summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2006-11-08 20:27:27 +0000
committerEvan Cheng <evan.cheng@apple.com>2006-11-08 20:27:27 +0000
commit85e54223cde9bb77b9127282c9f72608617ccbe3 (patch)
tree03dd302af4ceca1e610afe08311c5efb20f896e8 /llvm/lib/CodeGen
parentfd6e54439a21e2768b3eacd01e5e974bf4305911 (diff)
downloadbcm5719-llvm-85e54223cde9bb77b9127282c9f72608617ccbe3.tar.gz
bcm5719-llvm-85e54223cde9bb77b9127282c9f72608617ccbe3.zip
Match more post-indexed ops.
llvm-svn: 31569
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index bdb2d5e2f17..430cf5c6f56 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -301,8 +301,12 @@ namespace {
SDOperand BasePtr;
SDOperand Offset;
ISD::MemOpAddrMode AM = ISD::UNINDEXED;
- if (TLI.getPostIndexedAddressParts(Op, VT, BasePtr, Offset, AM,DAG) &&
- BasePtr == Ptr) {
+ if (TLI.getPostIndexedAddressParts(Op, VT, BasePtr, Offset, AM,DAG)) {
+ if (Ptr == Offset)
+ std::swap(BasePtr, Offset);
+ if (Ptr != BasePtr)
+ continue;
+
// Try turning it into a post-indexed load / store except when
// 1) Op must be independent of N, i.e. Op is neither a predecessor
// nor a successor of N. Otherwise, if Op is folded that would
OpenPOWER on IntegriCloud