[llvm] [GlobalISel] Add `G_FSHL` and `G_FSHR` to computeKnownBits (PR #191260)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 10 02:52:25 PDT 2026


================
@@ -603,6 +603,24 @@ KnownBits KnownBits::ashr(const KnownBits &LHS, const KnownBits &RHS,
   return Known;
 }
 
+KnownBits KnownBits::fshl(KnownBits LHS, KnownBits RHS, unsigned Amt) {
+  // fshl: (X << (Z % BW)) | (Y >> (BW - (Z % BW)))
+  if (Amt == 0)
----------------
jayfoad wrote:

These are general purpose utility functions so you need to do the `Amt %= BitWidth` here. Also please add some unit testing in unittests/Support/KnownBitsTest.cpp.

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


More information about the llvm-commits mailing list