[llvm] [GVN] Track visited nodes in equality propagation to avoid OOM (PR #212265)

Antonio Frighetto via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 3 05:22:29 PDT 2026


================
@@ -3118,6 +3119,9 @@ bool GVNPass::propagateEquality(
     if (isa<Constant>(LHS) && isa<Constant>(RHS))
       continue;
 
+    if (!Visited.insert({LHS, RHS}).second)
----------------
antoniofrighetto wrote:

Nit: I don't think it should matter much in practice, but should we have this check after canonicalizing the pair (immediately after the swap below)?

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


More information about the llvm-commits mailing list