[llvm] [KnownBits] Implement knownbits lshr/ashr with exact flag (PR #84254)
Thorsten Schütt via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 6 23:22:58 PST 2024
================
@@ -565,7 +565,9 @@ void GISelKnownBits::computeKnownBitsImpl(Register R, KnownBits &Known,
KnownBits ExtKnown = KnownBits::makeConstant(APInt(BitWidth, BitWidth));
KnownBits ShiftKnown = KnownBits::computeForAddSub(
/*Add=*/false, /*NSW=*/false, /* NUW=*/false, ExtKnown, WidthKnown);
- Known = KnownBits::ashr(KnownBits::shl(Known, ShiftKnown), ShiftKnown);
+ Known = KnownBits::ashr(KnownBits::shl(Known, ShiftKnown), ShiftKnown,
+ /*ShAmtNonZero=*/false,
+ /*Exact*/ true);
----------------
tschuett wrote:
Could you read the `Exact` flag from the llvm::MachineInstr? Same for NSW and NUW above. Maybe I am missing something.
https://github.com/llvm/llvm-project/pull/84254
More information about the llvm-commits
mailing list