summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG
diff options
context:
space:
mode:
authorNirav Dave <niravd@google.com>2017-08-01 16:00:47 +0000
committerNirav Dave <niravd@google.com>2017-08-01 16:00:47 +0000
commitb5a0af6b6eee77ecccb52d5a3efcc16f2baac70b (patch)
tree40bb06e2bed678440027295edadcbc5d23822107 /llvm/lib/CodeGen/SelectionDAG
parent4bf1d7ad81df8795c0323d258147b18affee3301 (diff)
downloadbcm5719-llvm-b5a0af6b6eee77ecccb52d5a3efcc16f2baac70b.tar.gz
bcm5719-llvm-b5a0af6b6eee77ecccb52d5a3efcc16f2baac70b.zip
[DAG] Move extload check in store merge. NFC.
Move candidate check from later check to initial candidate check. llvm-svn: 309698
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index 5c9db976a42..6dd9e9271b4 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -12569,7 +12569,6 @@ void DAGCombiner::getStoreMergeCandidates(
if (IsLoadSrc)
LBasePtr = BaseIndexOffset::match(
cast<LoadSDNode>(St->getValue())->getBasePtr(), DAG);
-
auto CandidateMatch = [&](StoreSDNode *Other, BaseIndexOffset &Ptr,
int64_t &Offset) -> bool {
if (Other->isVolatile() || Other->isIndexed())
@@ -12583,6 +12582,9 @@ void DAGCombiner::getStoreMergeCandidates(
// The Load's Base Ptr must also match
if (LoadSDNode *OtherLd = dyn_cast<LoadSDNode>(Other->getValue())) {
auto LPtr = BaseIndexOffset::match(OtherLd->getBasePtr(), DAG);
+ // We do not handle extended loads
+ if (OtherLd->getExtensionType() != ISD::NON_EXTLOAD)
+ return false;
if (!(LBasePtr.equalBaseIndex(LPtr, DAG)))
return false;
} else
@@ -12938,10 +12940,6 @@ bool DAGCombiner::MergeConsecutiveStores(StoreSDNode *St) {
if (Ld->isVolatile() || Ld->isIndexed())
break;
- // We do not accept ext loads.
- if (Ld->getExtensionType() != ISD::NON_EXTLOAD)
- break;
-
// The stored memory type must be the same.
if (Ld->getMemoryVT() != MemVT)
break;
OpenPOWER on IntegriCloud