[PATCH] D105392: [InstCombine] Add optimization to prevent poison from being propagated.

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 5 00:16:01 PDT 2021


nikic added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstructionCombining.cpp:3581
   // freeze (phi const, x) --> phi const, (freeze x)
   if (auto *PN = dyn_cast<PHINode>(Op0)) {
     if (Instruction *NV = foldOpIntoPhi(I, PN))
----------------
@hyeongyukim Looks like phi nodes are not a problem because they're handled separately here. I'd suggest to add a `assert(!isa<PHINode>(...))` check in your transform to make it obvious that it can't occur there.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D105392



More information about the llvm-commits mailing list