diff options
author | Evan Cheng <evan.cheng@apple.com> | 2006-11-06 08:14:30 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2006-11-06 08:14:30 +0000 |
commit | eb99bd736a5ef12be2cda98faafa4736553f9dc7 (patch) | |
tree | 8d8fedac5ed44fd0707bfaf0a6dcfa09226047b6 /llvm/lib/CodeGen | |
parent | 698c900b0c8789e49c1bf520913490ef2ecddedd (diff) | |
download | bcm5719-llvm-eb99bd736a5ef12be2cda98faafa4736553f9dc7.tar.gz bcm5719-llvm-eb99bd736a5ef12be2cda98faafa4736553f9dc7.zip |
Add comment.
llvm-svn: 31473
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index 03abac24503..eee7a8fe8b4 100644 --- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/llvm/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<LoadSDNode>(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(); |