[PATCH] D104602: [InstCombine] Use poison constant to represent the result of unreachable instrs

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 20 02:28:39 PDT 2021


nikic accepted this revision.
nikic added a comment.
This revision is now accepted and ready to land.

LGTM, but please drop the "use poison instead of undef" comments -- I don't think using poison instead of undef for dead code requires any explicit justification.



================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp:1445
   if (canSimplifyNullStoreOrGEP(SI)) {
     if (!isa<UndefValue>(Val))
+      return replaceOperand(SI, 0, PoisonValue::get(Val->getType()));
----------------
Might want to check for PoisonValue here, to canonicalize a pre-existing undef operand.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D104602



More information about the llvm-commits mailing list