[PATCH] D154953: [InstSimplify] Remove the remainder loop if we know the mask is always true

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 17 06:03:20 PDT 2023


nikic added a comment.

Please add an alive2 proof to the patch description.



================
Comment at: llvm/lib/Analysis/InstructionSimplify.cpp:1286
+      unsigned MaxActiveBits = Known.countMaxActiveBits();
+      if (MaxActiveBits <= RemC->logBase2())
+        return ConstantInt::getNullValue(Op0->getType());
----------------
This check looks a bit roundabout. I think what you actually want to check is that `Known.getMaxValue().ule(*RemC)`?


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

https://reviews.llvm.org/D154953



More information about the llvm-commits mailing list