[llvm] [NewGVN] Improve SelfLookup optimization to ensure termination (PR #82162)

Nuno Lopes via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 18 08:32:06 PST 2024


================
@@ -1033,8 +1036,23 @@ PHIExpression *NewGVN::createPHIExpression(ArrayRef<ValPair> PHIOperands,
       return false;
     OriginalOpsConstant = OriginalOpsConstant && isa<Constant>(P.first);
     HasBackedge = HasBackedge || isBackedge(BB, PHIBlock);
-    return lookupOperandLeader(P.first) != I;
+
+    // Ignore phi arguments that are known to be equivalent to the phi. Only
+    // done for real PHIs (PHIOfOps may not converge).
----------------
nunoplopes wrote:

so what about phi-of-ops?
maybe open a new bug report with a trigger for phi-of-ops if possible

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


More information about the llvm-commits mailing list