From: Evan Cheng Date: Mon, 6 Nov 2006 08:14:30 +0000 (+0000) Subject: Add comment. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=3ef554d2b12af4ed0a25161fa02222d8f14026e5;p=oota-llvm.git Add comment. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31473 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index 03abac24503..eee7a8fe8b4 100644 --- a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -174,7 +174,13 @@ namespace { return true; } - bool CombineToIndexedLoadStore(SDNode *N) { + /// CombineToPreIndexedLoadStore - Try turning a load / store into a + /// pre-indexed load store when the base pointer is a add or subtract + /// and it has other uses besides the load / store. When the + /// transformation is done, the new indexed load / store effectively + /// folded the add / subtract in and all of its other uses are redirected + /// to the new load / store. + bool CombineToPreIndexedLoadStore(SDNode *N) { bool isLoad = true; SDOperand Ptr; if (LoadSDNode *LD = dyn_cast(N)) { @@ -811,7 +817,7 @@ SDOperand DAGCombiner::visitADD(SDNode *N) { return DAG.getNode(ISD::OR, VT, N0, N1); } } - + return SDOperand(); } @@ -2871,7 +2877,7 @@ SDOperand DAGCombiner::visitLOAD(SDNode *N) { } // Try transforming N to an indexed load. - if (CombineToIndexedLoadStore(N)) + if (CombineToPreIndexedLoadStore(N)) return SDOperand(N, 0); return SDOperand(); @@ -2917,7 +2923,7 @@ SDOperand DAGCombiner::visitSTORE(SDNode *N) { } // Try transforming N to an indexed store. - if (CombineToIndexedLoadStore(N)) + if (CombineToPreIndexedLoadStore(N)) return SDOperand(N, 0); return SDOperand();