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

Hyeongyu Kim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 8 21:12:43 PDT 2021


hyeongyukim added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstructionCombining.cpp:3563-3564
+
+  // We already folded "freeze (phi const, x)" to "phi const, (freeze x)"
+  assert(!isa<PHINode>(OrigOp));
+
----------------
lebedev.ri wrote:
> I do not expect that this assertion will hold, `foldOpIntoPhi()` has a number of bailouts.
> 
Do you mean `OrigOp` can be `PHINode` even if we already tried `foldOpIntoPhi()`?
Then, is it correct to change the assertion to the below code?
```
if (is<PHINode>(OrigOp))
  return nullptr;
```



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