[llvm] [DAGCombiner] Limit steps in shouldCombineToPostInc (PR #116030)

Jonathan Cohen via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 13 23:39:12 PST 2024


================
@@ -19089,7 +19089,8 @@ static bool shouldCombineToPostInc(SDNode *N, SDValue Ptr, SDNode *PtrUse,
                                    IsMasked, OtherPtr, TLI)) {
         SmallVector<const SDNode *, 2> Worklist;
         Worklist.push_back(Use);
-        if (SDNode::hasPredecessorHelper(N, Visited, Worklist))
+        constexpr unsigned int MaxSteps = 8192;
----------------
jcohen-apple wrote:

I changed it to be a hidden cl option in case someone would like to play with it later, and defaulted to 8192. WDYT?

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


More information about the llvm-commits mailing list