[llvm] [DemandedBits] Support non-constant shift amounts (PR #148880)

Panagiotis Karouzakis via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 29 02:12:32 PDT 2025


================
@@ -76,6 +76,19 @@ void DemandedBits::determineLiveOperandBits(
           computeKnownBits(V2, Known2, DL, &AC, UserI, &DT);
         }
       };
+  auto GetShiftedRange = [&](unsigned Min, unsigned Max, bool ShiftLeft) {
+    using ShiftFn = APInt (APInt::*)(unsigned) const;
----------------
karouzakisp wrote:

Yes, but I think we need either std::mem_fn or lambda functions for the binding. 

I think this is the simplest way to express it

https://github.com/llvm/llvm-project/pull/148880


More information about the llvm-commits mailing list