1 //===-------------- VVPInstrInfo.td - VVP_* SDNode patterns ---------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // This file defines the VE Vector Predicated SDNodes (VVP SDNodes). VVP
10 // SDNodes are an intermediate isel layer between the vector SDNodes emitted by
11 // LLVM and the actual VE vector instructions. For example:
13 // ADD(x,y) --> VVP_ADD(x,y,mask,evl) --> VADDSWSXrvml(x,y,mask,evl)
15 // The standard The VVP layer SDNode. The VE vector instruction.
18 // TODO explain how VVP nodes relate to VP SDNodes once VP ISel is uptream.
19 //===----------------------------------------------------------------------===//
23 // BinaryOp(x,y,mask,vl)
24 def SDTIntBinOpVVP : SDTypeProfile<1, 4, [ // vp_add, vp_and, etc.
28 SDTCisSameNumEltsAs<0, 3>,
32 // Binary operator commutative pattern.
33 class vvp_commutative<SDNode RootOp> :
35 (ops node:$lhs, node:$rhs, node:$mask, node:$vlen),
36 [(RootOp node:$lhs, node:$rhs, node:$mask, node:$vlen),
37 (RootOp node:$rhs, node:$lhs, node:$mask, node:$vlen)]>;
39 // VVP node definitions.
40 def vvp_add : SDNode<"VEISD::VVP_ADD", SDTIntBinOpVVP>;
41 def c_vvp_add : vvp_commutative<vvp_add>;
43 def vvp_and : SDNode<"VEISD::VVP_AND", SDTIntBinOpVVP>;
44 def c_vvp_and : vvp_commutative<vvp_and>;