[PATCH] D105298: [InstSimplify] do not propagate poison from select arm to icmp user

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 1 12:11:17 PDT 2021


nikic added inline comments.


================
Comment at: llvm/lib/Analysis/InstructionSimplify.cpp:505
+  if (isa<PoisonValue>(TCmp) || isa<PoisonValue>(FCmp))
+    return nullptr;
+
----------------
I think the right place to address this is in handleOtherCmpSelSimplifications. It basically performs the `select i1 %a, i1 %b, i1 false -> and i1 %a, %b` fold that we have recently disabled in InstCombine. We should guard it by the same impliesPoison() check.


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

https://reviews.llvm.org/D105298



More information about the llvm-commits mailing list