Skip to content

Commit 5af5cd1

Browse files
committed
[DAG] getValidShiftAmountRange - fix upper bound of ConstantRange
I forgot to account for ConstantRange expecting the upper bound to be non-inclusive
1 parent 5cbd598 commit 5af5cd1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3045,7 +3045,7 @@ SelectionDAG::getValidShiftAmountRange(SDValue V, const APInt &DemandedElts,
30453045
assert(((!MinAmt && !MaxAmt) || (MinAmt && MaxAmt)) &&
30463046
"Failed to find matching min/max shift amounts");
30473047
if (MinAmt && MaxAmt)
3048-
return ConstantRange(*MinAmt, *MaxAmt);
3048+
return ConstantRange(*MinAmt, *MaxAmt + 1);
30493049
}
30503050

30513051
// Use computeKnownBits to find a hidden constant/knownbits (usually type

0 commit comments

Comments
 (0)