[llvm] [InstCombine] Fix non-convergence with freeze/phi folding (PR #182647)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Sat Feb 21 00:43:13 PST 2026


================
@@ -5214,6 +5220,11 @@ InstCombinerImpl::pushFreezeToPreventPoisonFromPropagating(FreezeInst &OrigFI) {
     if (!isa<Instruction>(V) || isa<PHINode>(V))
       return false;
 
+    // Don't push through an existing freeze. Otherwise we can repeatedly
+    // create redundant freeze instructions during instcombine iterations.
+    if (isa<FreezeInst>(V))
----------------
nikic wrote:

Can this actually happen? I'd expect this case to be folded by the preceding simplifyFreezeInst() call

https://github.com/llvm/llvm-project/pull/182647


More information about the llvm-commits mailing list