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

Juneyoung Lee via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 22 07:26:55 PDT 2021


aqjune 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());
----------------
nikic wrote:
> 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).
That is correct. I was concerned about whether independently dealing with it might confuse people or not.
Anyway, since it allows more optimization, I'll update this patch to do so.


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