[PATCH] D150670: [WebAssembly] Disable generation of fshl/fshr for rotates

Nikita Popov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon May 29 12:37:24 PDT 2023


nikic added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp:927-933
+        if (I->getOperand(0) != I->getOperand(1)) {
+          APInt DemandedMaskLHS(DemandedMask.lshr(ShiftAmt));
+          APInt DemandedMaskRHS(DemandedMask.shl(BitWidth - ShiftAmt));
+          if (SimplifyDemandedBits(I, 0, DemandedMaskLHS, LHSKnown, Depth + 1) ||
+              SimplifyDemandedBits(I, 1, DemandedMaskRHS, RHSKnown, Depth + 1))
+            return I;
+        }
----------------
You should be able to do something along these lines.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D150670/new/

https://reviews.llvm.org/D150670



More information about the cfe-commits mailing list