diff options
author | Nirav Dave <niravd@google.com> | 2017-07-04 02:20:17 +0000 |
---|---|---|
committer | Nirav Dave <niravd@google.com> | 2017-07-04 02:20:17 +0000 |
commit | a2810e677b35a6fcea2f86657549cf30faefb061 (patch) | |
tree | f83b8a6634dcf32a06adc564898defe7d3b6b1da | |
parent | e4a741376bebf902e94f27e7be1636c0510b0f46 (diff) | |
download | bcm5719-llvm-a2810e677b35a6fcea2f86657549cf30faefb061.tar.gz bcm5719-llvm-a2810e677b35a6fcea2f86657549cf30faefb061.zip |
[DAG] Fixed predicate for determining when two frame indices
addresses are comparable. NFCI.
llvm-svn: 307055
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAGAddressAnalysis.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGAddressAnalysis.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGAddressAnalysis.cpp index 4e899ae6668..14b804eef22 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGAddressAnalysis.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGAddressAnalysis.cpp @@ -37,13 +37,13 @@ bool BaseIndexOffset::equalBaseIndex(BaseIndexOffset &Other, const MachineFrameInfo &MFI = DAG.getMachineFunction().getFrameInfo(); - // Match non-equal FrameIndexes - a FrameIndex stemming from an - // alloca will not have it's ObjectOffset set until post-DAG and - // as such we must assume the two framesIndices are incomparable. + // Match non-equal FrameIndexes - If both frame indices are fixed + // we know their relative offsets and can compare them. Otherwise + // we must be conservative. if (auto *A = dyn_cast<FrameIndexSDNode>(Base)) if (auto *B = dyn_cast<FrameIndexSDNode>(Other.Base)) - if (!MFI.getObjectAllocation(A->getIndex()) && - !MFI.getObjectAllocation(B->getIndex())) { + if (MFI.isFixedObjectIndex(A->getIndex()) && + MFI.isFixedObjectIndex(B->getIndex())) { Off += MFI.getObjectOffset(B->getIndex()) - MFI.getObjectOffset(A->getIndex()); return true; |