[SelectionDAG] ComputeNumSignBits - add support for rotate uniform vector amounts

This commit is contained in:
Simon Pilgrim 2020-01-25 18:55:47 +00:00
parent 435a60a5af
commit e3c26a9d1b
2 changed files with 1 additions and 3 deletions

View File

@ -3749,7 +3749,7 @@ unsigned SelectionDAG::ComputeNumSignBits(SDValue Op, const APInt &DemandedElts,
if (Tmp == VTBits)
return VTBits;
if (ConstantSDNode *C = dyn_cast<ConstantSDNode>(Op.getOperand(1))) {
if (ConstantSDNode *C = isConstOrConstSplat(Op.getOperand(1))) {
unsigned RotAmt = C->getAPIntValue().urem(VTBits);
// Handle rotate right by N like a rotate left by 32-N.

View File

@ -101,7 +101,6 @@ define <4 x i32> @rot_v4i32_mask_ashr0(<4 x i32> %a0) {
; XOP: # %bb.0:
; XOP-NEXT: vpsravd {{.*}}(%rip), %xmm0, %xmm0
; XOP-NEXT: vprotd $1, %xmm0, %xmm0
; XOP-NEXT: vpsravd {{.*}}(%rip), %xmm0, %xmm0
; XOP-NEXT: vpand {{.*}}(%rip), %xmm0, %xmm0
; XOP-NEXT: retq
;
@ -109,7 +108,6 @@ define <4 x i32> @rot_v4i32_mask_ashr0(<4 x i32> %a0) {
; AVX512: # %bb.0:
; AVX512-NEXT: vpsravd {{.*}}(%rip), %xmm0, %xmm0
; AVX512-NEXT: vprold $1, %xmm0, %xmm0
; AVX512-NEXT: vpsravd {{.*}}(%rip), %xmm0, %xmm0
; AVX512-NEXT: vpand {{.*}}(%rip), %xmm0, %xmm0
; AVX512-NEXT: retq
%1 = ashr <4 x i32> %a0, <i32 25, i32 26, i32 27, i32 28>