Skip to content

Commit 1481ae3

Browse files
committed
[X86] Use getAllOnesConstant instead of getConstant(-1). NFCI
A while back I had tried to cleanup cases where getConstant was implicitly truncating constants. Initially by manual audit and later with an assert. I only committed patches from the assert testing. This code path isn't executed in lit tests so I only found it with the manual audit. I found this patch still setting in my stash so thought I go ahead and post it.
1 parent 0167a92 commit 1481ae3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/Target/X86/X86ISelLowering.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49321,7 +49321,7 @@ static SDValue combineVectorShiftImm(SDNode *N, SelectionDAG &DAG,
4932149321
if (!LogicalShift && ISD::isBuildVectorAllOnes(N0.getNode()))
4932249322
// N0 is all ones or undef. We guarantee that the bits shifted into the
4932349323
// result are all ones, not undef.
49324-
return DAG.getConstant(-1, SDLoc(N), VT);
49324+
return DAG.getAllOnesConstant(SDLoc(N), VT);
4932549325

4932649326
auto MergeShifts = [&](SDValue X, uint64_t Amt0, uint64_t Amt1) {
4932749327
unsigned NewShiftVal = Amt0 + Amt1;

0 commit comments

Comments
 (0)