[llvm] [InstCombine] Push freeze through non-recurrence PHIs (PR #157678)
David Sherwood via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 23 07:50:13 PDT 2025
================
@@ -5042,10 +5042,33 @@ InstCombinerImpl::pushFreezeToPreventPoisonFromPropagating(FreezeInst &OrigFI) {
// Op1.fr = Freeze(Op1)
// ... = Inst(Op1.fr, NonPoisonOps...)
- auto CanPushFreeze = [](Value *V) {
- if (!isa<Instruction>(V) || isa<PHINode>(V))
+ auto CanPushFreeze = [this](Value *V) {
+ if (!isa<Instruction>(V))
return false;
+ if (auto *PN = dyn_cast<PHINode>(V)) {
+ BasicBlock *BB = PN->getParent();
+ SmallPtrSet<BasicBlock *, 8> VisitedBBs;
+ for (Use &U : PN->incoming_values()) {
----------------
david-arm wrote:
Ah yes you're right. Sorry I was thinking about getIncomingValueForBlock.
https://github.com/llvm/llvm-project/pull/157678
More information about the llvm-commits
mailing list