summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorQuentin Colombet <qcolombet@apple.com>2015-04-24 21:28:00 +0000
committerQuentin Colombet <qcolombet@apple.com>2015-04-24 21:28:00 +0000
commit82291459611118ae441179945b472ad68e86a7d4 (patch)
tree94e8dd90d7edfa2c1e2b3bfc80d3b2621d4b3729 /llvm/lib
parentaac51934cfc61420bf621e20af1e7bae29e013c5 (diff)
downloadbcm5719-llvm-82291459611118ae441179945b472ad68e86a7d4.tar.gz
bcm5719-llvm-82291459611118ae441179945b472ad68e86a7d4.zip
[DAGCombiner] Fix the type used in canFoldInAddressingMode to account for the
right scaling. In the function canFoldInAddressingMode, VT is computed as the type of the destination/source of a LOAD/STORE operations, instead of the memory type of the operation. On targets with a scaling factor on the offset of the LOAD/STORE operations, the function may return false for actually valid cases. This may then prevent the selection of profitable pre or post indexed load/store operations, and instead select pre or post indexed load/store for unprofitable cases. Patch by Francois de Ferriere <francois.de-ferriere@st.com>! Differential Revision: http://reviews.llvm.org/D9146 llvm-svn: 235780
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index 97043e1c0cd..df721e2d3b5 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -8804,11 +8804,11 @@ static bool canFoldInAddressingMode(SDNode *N, SDNode *Use,
if (LoadSDNode *LD = dyn_cast<LoadSDNode>(Use)) {
if (LD->isIndexed() || LD->getBasePtr().getNode() != N)
return false;
- VT = Use->getValueType(0);
+ VT = LD->getMemoryVT();
} else if (StoreSDNode *ST = dyn_cast<StoreSDNode>(Use)) {
if (ST->isIndexed() || ST->getBasePtr().getNode() != N)
return false;
- VT = ST->getValue().getValueType();
+ VT = ST->getMemoryVT();
} else
return false;
OpenPOWER on IntegriCloud