summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/SelectionDAGAddressAnalysis.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAGAddressAnalysis.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAGAddressAnalysis.cpp17
1 files changed, 4 insertions, 13 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGAddressAnalysis.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGAddressAnalysis.cpp
index f954a52d671..d2e0dbbf88e 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGAddressAnalysis.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGAddressAnalysis.cpp
@@ -11,7 +11,6 @@
#include "llvm/CodeGen/SelectionDAGAddressAnalysis.h"
#include "llvm/CodeGen/ISDOpcodes.h"
-#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/SelectionDAG.h"
#include "llvm/CodeGen/SelectionDAGNodes.h"
@@ -27,28 +26,20 @@ bool BaseIndexOffset::equalBaseIndex(BaseIndexOffset &Other,
// Match GlobalAddresses
if (Index == Other.Index)
- if (auto *A = dyn_cast<GlobalAddressSDNode>(Base))
- if (auto *B = dyn_cast<GlobalAddressSDNode>(Other.Base))
+ if (GlobalAddressSDNode *A = dyn_cast<GlobalAddressSDNode>(Base))
+ if (GlobalAddressSDNode *B = dyn_cast<GlobalAddressSDNode>(Other.Base))
if (A->getGlobal() == B->getGlobal()) {
Off += B->getOffset() - A->getOffset();
return true;
}
- // Match FrameIndexes
- if (Index == Other.Index)
- if (auto *A = dyn_cast<FrameIndexSDNode>(Base))
- if (auto *B = dyn_cast<FrameIndexSDNode>(Other.Base)) {
- const MachineFrameInfo &MFI = DAG.getMachineFunction().getFrameInfo();
- Off += MFI.getObjectOffset(B->getIndex()) -
- MFI.getObjectOffset(A->getIndex());
- return true;
- }
+ // TODO: we should be able to add FrameIndex analysis improvements here.
return false;
}
/// Parses tree in Ptr for base, index, offset addresses.
-BaseIndexOffset BaseIndexOffset::match(SDValue Ptr, const SelectionDAG &DAG) {
+BaseIndexOffset BaseIndexOffset::match(SDValue Ptr) {
// (((B + I*M) + c)) + c ...
SDValue Base = Ptr;
SDValue Index = SDValue();
OpenPOWER on IntegriCloud