[llvm] 49623fa - [ValueTracking] computeKnownBitsFromShiftOperator use KnownBits direct for constant shift amounts.
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 13 02:57:29 PST 2020
Author: Simon Pilgrim
Date: 2020-11-13T10:54:35Z
New Revision: 49623fa77a35de343e89ea2d8159ce719473ce71
URL: https://github.com/llvm/llvm-project/commit/49623fa77a35de343e89ea2d8159ce719473ce71
DIFF: https://github.com/llvm/llvm-project/commit/49623fa77a35de343e89ea2d8159ce719473ce71.diff
LOG: [ValueTracking] computeKnownBitsFromShiftOperator use KnownBits direct for constant shift amounts.
Let KnownBits shift handlers deal with out-of-range shift amounts.
Added:
Modified:
llvm/lib/Analysis/ValueTracking.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp
index b369f2697e5c..0a18718fd9b5 100644
--- a/llvm/lib/Analysis/ValueTracking.cpp
+++ b/llvm/lib/Analysis/ValueTracking.cpp
@@ -993,8 +993,7 @@ static void computeKnownBitsFromShiftOperator(
computeKnownBits(I->getOperand(1), DemandedElts, Known, Depth + 1, Q);
if (Known.isConstant()) {
- unsigned ShiftAmt = Known.getConstant().getLimitedValue(BitWidth - 1);
- Known = KF(Known2, KnownBits::makeConstant(APInt(32, ShiftAmt)));
+ Known = KF(Known2, Known);
// If the known bits conflict, this must be an overflowing left shift, so
// the shift result is poison. We can return anything we want. Choose 0 for
More information about the llvm-commits
mailing list