[llvm] [InstCombine] Push freeze through non-recurrence PHIs (PR #157678)
David Sherwood via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 23 08:56:38 PDT 2025
================
@@ -5070,7 +5093,10 @@ InstCombinerImpl::pushFreezeToPreventPoisonFromPropagating(FreezeInst &OrigFI) {
return nullptr;
auto *UserI = cast<Instruction>(U->getUser());
- Builder.SetInsertPoint(UserI);
+ if (auto *PN = dyn_cast<PHINode>(UserI))
+ Builder.SetInsertPoint(PN->getIncomingBlock(*U)->getTerminator());
----------------
david-arm wrote:
Ah ok I think I understand now. So basically if CanPushFreeze returns true for a PHI node we fall through to code below that adds the operands of the PHI to the worklist. Then if CanPushFreeze returns false for one of those operands we'll end up asking for the user, which will be the PHI.
https://github.com/llvm/llvm-project/pull/157678
More information about the llvm-commits
mailing list