From 7775b33a3238f25c41dfcc1c1012108668575e4f Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Sat, 16 Dec 2006 06:25:23 +0000 Subject: [PATCH] Cannot combine an indexed load / store any further. llvm-svn: 32629 --- lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index 04f21b9557c..3e53130ba50 100644 --- a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -2727,12 +2727,17 @@ bool DAGCombiner::CombineToPreIndexedLoadStore(SDNode *N) { SDOperand Ptr; MVT::ValueType VT; if (LoadSDNode *LD = dyn_cast(N)) { + if (LD->getAddressingMode() != ISD::UNINDEXED) + return false; VT = LD->getLoadedVT(); - if (!TLI.isIndexedLoadLegal(ISD::PRE_INC, VT) && + if (LD->getAddressingMode() != ISD::UNINDEXED && + !TLI.isIndexedLoadLegal(ISD::PRE_INC, VT) && !TLI.isIndexedLoadLegal(ISD::PRE_DEC, VT)) return false; Ptr = LD->getBasePtr(); } else if (StoreSDNode *ST = dyn_cast(N)) { + if (ST->getAddressingMode() != ISD::UNINDEXED) + return false; VT = ST->getStoredVT(); if (!TLI.isIndexedStoreLegal(ISD::PRE_INC, VT) && !TLI.isIndexedStoreLegal(ISD::PRE_DEC, VT)) @@ -2846,12 +2851,16 @@ bool DAGCombiner::CombineToPostIndexedLoadStore(SDNode *N) { SDOperand Ptr; MVT::ValueType VT; if (LoadSDNode *LD = dyn_cast(N)) { + if (LD->getAddressingMode() != ISD::UNINDEXED) + return false; VT = LD->getLoadedVT(); if (!TLI.isIndexedLoadLegal(ISD::POST_INC, VT) && !TLI.isIndexedLoadLegal(ISD::POST_DEC, VT)) return false; Ptr = LD->getBasePtr(); } else if (StoreSDNode *ST = dyn_cast(N)) { + if (ST->getAddressingMode() != ISD::UNINDEXED) + return false; VT = ST->getStoredVT(); if (!TLI.isIndexedStoreLegal(ISD::POST_INC, VT) && !TLI.isIndexedStoreLegal(ISD::POST_DEC, VT))