Skip to content

Commit aeb611a

Browse files
committed
AMDGPU: Don't avoid clamp of bit shift in BFE pattern
Use "countMaxTrailingOnes() <= 5" instead of "countMinLeadingZeros() >= 27" in uint5Bits PatLeaf definition.
1 parent 0c29f88 commit aeb611a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/Target/AMDGPU/SIInstructions.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3554,7 +3554,7 @@ def : AMDGPUPat <
35543554
>;
35553555

35563556
def uint5Bits : PatLeaf<(i32 VGPR_32:$width), [{
3557-
return CurDAG->computeKnownBits(SDValue(N, 0)).countMinLeadingZeros() >= 27;
3557+
return CurDAG->computeKnownBits(SDValue(N, 0)).countMaxTrailingOnes() <= 5;
35583558
}]>;
35593559

35603560
// x << (bitwidth - y) >> (bitwidth - y)

0 commit comments

Comments
 (0)