[llvm] f925fd3 - [DAGCombiner] give magic number a name in getStoreMergeCandidates; NFC

Sanjay Patel via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 17 12:45:28 PDT 2020


Author: Sanjay Patel
Date: 2020-08-17T15:37:55-04:00
New Revision: f925fd3304ea18e177a305a9b4f7f9c9df497122

URL: https://github.com/llvm/llvm-project/commit/f925fd3304ea18e177a305a9b4f7f9c9df497122
DIFF: https://github.com/llvm/llvm-project/commit/f925fd3304ea18e177a305a9b4f7f9c9df497122.diff

LOG: [DAGCombiner] give magic number a name in getStoreMergeCandidates; NFC

Added: 
    

Modified: 
    llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index e4b9d6b8c4a5..172c5933de24 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -16232,10 +16232,11 @@ void DAGCombiner::getStoreMergeCandidates(
   RootNode = St->getChain().getNode();
 
   unsigned NumNodesExplored = 0;
+  const unsigned MaxSearchNodes = 1024;
   if (auto *Ldn = dyn_cast<LoadSDNode>(RootNode)) {
     RootNode = Ldn->getChain().getNode();
     for (auto I = RootNode->use_begin(), E = RootNode->use_end();
-         I != E && NumNodesExplored < 1024; ++I, ++NumNodesExplored) {
+         I != E && NumNodesExplored < MaxSearchNodes; ++I, ++NumNodesExplored) {
       if (I.getOperandNo() == 0 && isa<LoadSDNode>(*I)) { // walk down chain
         for (auto I2 = (*I)->use_begin(), E2 = (*I)->use_end(); I2 != E2; ++I2)
           TryToAddCandidate(I2);
@@ -16243,7 +16244,7 @@ void DAGCombiner::getStoreMergeCandidates(
     }
   } else {
     for (auto I = RootNode->use_begin(), E = RootNode->use_end();
-         I != E && NumNodesExplored < 1024; ++I, ++NumNodesExplored)
+         I != E && NumNodesExplored < MaxSearchNodes; ++I, ++NumNodesExplored)
       TryToAddCandidate(I);
   }
 }


        


More information about the llvm-commits mailing list