[PATCH] D149001: [InstSimplify] sdiv a (1 srem b) --> a

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 24 02:20:02 PDT 2023


nikic requested changes to this revision.
nikic added a comment.
This revision now requires changes to proceed.

This looks good to me, but it looks like you need to regenerate some clang OpenMP tests as well. Not sure why/where those run InstSimplify, but the failures look legitimate.



================
Comment at: llvm/lib/Analysis/InstructionSimplify.cpp:1059
+  KnownBits Known = computeKnownBits(Op1, Q.DL, 0, Q.AC, Q.CxtI, Q.DT);
+  if (Known.countMinLeadingZeros() >= Known.getBitWidth() - 1)
     return IsDiv ? Op0 : Constant::getNullValue(Ty);
----------------
I'd feel better about a `==` here.


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

https://reviews.llvm.org/D149001



More information about the llvm-commits mailing list