[PATCH] D104661: [InstSimplify] Add more poison folding optimizations

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 21 12:30:33 PDT 2021


nikic added inline comments.


================
Comment at: llvm/lib/Analysis/InstructionSimplify.cpp:742
+  if (Q.isUndefValue(Op0) || Q.isUndefValue(Op1)) {
+    if (isa<PoisonValue>(Op0) || isa<PoisonValue>(Op1))
+      return PoisonValue::get(Op0->getType());
----------------
I'd prefer the PoisonValue checks to happen independently of the isUndefValue checks, because these are valid even if undef value folding is disabled (folding poison does not create an assumption for a specific undef value).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D104661



More information about the llvm-commits mailing list