summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/SelectionDAGAddressAnalysis.cpp
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@intel.com>2018-11-26 20:16:33 +0000
committerCraig Topper <craig.topper@intel.com>2018-11-26 20:16:33 +0000
commit923f463ef23cc3552845bb48398258073f3bc637 (patch)
tree6349712de61fc4c16f8b80059ac71d8c03b74377 /llvm/lib/CodeGen/SelectionDAG/SelectionDAGAddressAnalysis.cpp
parent2754d1dca47b596d922d9cb64c7c04d744604e5b (diff)
downloadbcm5719-llvm-923f463ef23cc3552845bb48398258073f3bc637.tar.gz
bcm5719-llvm-923f463ef23cc3552845bb48398258073f3bc637.zip
[SelectionDAG] Teach BaseIndexOffset::match to unwrap the base after looking through an add/or
We might find a target specific node that needs to be unwrapped after we look through an add/or. Otherwise we get inconsistent results if one pointer is just X86WrapperRIP and the other is (add X86WrapperRIP, C) Differential Revision: https://reviews.llvm.org/D54818 llvm-svn: 347591
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAGAddressAnalysis.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAGAddressAnalysis.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGAddressAnalysis.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGAddressAnalysis.cpp
index 8c57f18183e..488bac1a9a8 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGAddressAnalysis.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGAddressAnalysis.cpp
@@ -107,14 +107,14 @@ BaseIndexOffset BaseIndexOffset::match(const LSBaseSDNode *N,
if (auto *C = dyn_cast<ConstantSDNode>(Base->getOperand(1)))
if (DAG.MaskedValueIsZero(Base->getOperand(0), C->getAPIntValue())) {
Offset += C->getSExtValue();
- Base = Base->getOperand(0);
+ Base = DAG.getTargetLoweringInfo().unwrapAddress(Base->getOperand(0));
continue;
}
break;
case ISD::ADD:
if (auto *C = dyn_cast<ConstantSDNode>(Base->getOperand(1))) {
Offset += C->getSExtValue();
- Base = Base->getOperand(0);
+ Base = DAG.getTargetLoweringInfo().unwrapAddress(Base->getOperand(0));
continue;
}
break;
@@ -130,7 +130,7 @@ BaseIndexOffset BaseIndexOffset::match(const LSBaseSDNode *N,
Offset -= Off;
else
Offset += Off;
- Base = LSBase->getBasePtr();
+ Base = DAG.getTargetLoweringInfo().unwrapAddress(LSBase->getBasePtr());
continue;
}
break;
OpenPOWER on IntegriCloud