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

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jul 10 04:50:54 PDT 2021


lebedev.ri added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstructionCombining.cpp:3536
+
+  // Optimization may not be performed if %a is changed to %a.frozen, we only
+  // consider when OrigOp is single-use.
----------------
```
While we could change the other users of OrigOp to use freeze(OrigOp), that potentially reduces their optimization potential, so let's only do this iff the OrigOp is only used by the freeze.
```


================
Comment at: llvm/lib/Transforms/InstCombine/InstructionCombining.cpp:3538
+  // consider when OrigOp is single-use.
+  if (!OrigOpInst || !OrigOpInst->hasOneUse() ||
+      canCreateUndefOrPoison(dyn_cast<Operator>(OrigOp)))
----------------
The PHI bailout should go here. 
Otherwise we will be wasting compile time.


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