Skip to content

Commit be9e747

Browse files
authored
[SelectionDAG] Add SDTCisSameNumEltsAs to SDTIntShiftOp. (#162756)
The shift amount may have a different scalar size than the result, but they should have the same number of elements or they should both be scalar.
1 parent c8205d6 commit be9e747

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/include/llvm/Target/TargetSelectionDAG.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def SDTIntBinOp : SDTypeProfile<1, 2, [ // add, and, or, xor, udiv, etc.
116116
SDTCisSameAs<0, 1>, SDTCisSameAs<0, 2>, SDTCisInt<0>
117117
]>;
118118
def SDTIntShiftOp : SDTypeProfile<1, 2, [ // shl, sra, srl
119-
SDTCisSameAs<0, 1>, SDTCisInt<0>, SDTCisInt<2>
119+
SDTCisSameAs<0, 1>, SDTCisInt<0>, SDTCisInt<2>, SDTCisSameNumEltsAs<0, 2>
120120
]>;
121121
def SDTIntShiftPairOp : SDTypeProfile<2, 3, [ // shl_parts, sra_parts, srl_parts
122122
SDTCisInt<0>, SDTCisSameAs<1, 0>,

0 commit comments

Comments
 (0)