[PATCH] D105392: [InstCombine] Add optimization to prevent poison from being propagated.
Hyeongyu Kim via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Jul 4 15:22:16 PDT 2021
hyeongyukim marked 2 inline comments as done.
hyeongyukim added inline comments.
================
Comment at: llvm/lib/Transforms/InstCombine/InstructionCombining.cpp:3537
- auto *MaybePoisonUse = MaybePoisonOperand.getValue();
- auto *FrozenMaybePoisonOperand = new FreezeInst(MaybePoisonUse->get(), MaybePoisonUse->getUser()->getName() + ".fr");
+ if (!OrigOpInst->hasOneUse() ||
+ canCreateUndefOrPoison(dyn_cast<Operator>(OrigOp)))
----------------
lebedev.ri wrote:
> I think it would be good to have a comment explaining why we don't do this iff the `OrigOpInst` has other uses.
> We could just change them all to use `OrigFI` first. Why do we want to not do this?
I add an example of a problem that occurs when there is more than one use of OrigOpInst.
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