Skip to content

Commit d2cfb75

Browse files
author
git apple-llvm automerger
committed
Merge commit '5b38ecff6e9d' from llvm.org/main into next
2 parents bce5491 + 5b38ecf commit d2cfb75

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

llvm/lib/CodeGen/SelectionDAG/SelectionDAGAddressAnalysis.cpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,18 @@ bool BaseIndexOffset::equalBaseIndex(const BaseIndexOffset &Other,
3838
return true;
3939

4040
// Match GlobalAddresses
41-
if (auto *A = dyn_cast<GlobalAddressSDNode>(Base))
41+
if (auto *A = dyn_cast<GlobalAddressSDNode>(Base)) {
4242
if (auto *B = dyn_cast<GlobalAddressSDNode>(Other.Base))
4343
if (A->getGlobal() == B->getGlobal()) {
4444
Off += B->getOffset() - A->getOffset();
4545
return true;
4646
}
4747

48+
return false;
49+
}
50+
4851
// Match Constants
49-
if (auto *A = dyn_cast<ConstantPoolSDNode>(Base))
52+
if (auto *A = dyn_cast<ConstantPoolSDNode>(Base)) {
5053
if (auto *B = dyn_cast<ConstantPoolSDNode>(Other.Base)) {
5154
bool IsMatch =
5255
A->isMachineConstantPoolEntry() == B->isMachineConstantPoolEntry();
@@ -62,7 +65,8 @@ bool BaseIndexOffset::equalBaseIndex(const BaseIndexOffset &Other,
6265
}
6366
}
6467

65-
const MachineFrameInfo &MFI = DAG.getMachineFunction().getFrameInfo();
68+
return false;
69+
}
6670

6771
// Match FrameIndexes.
6872
if (auto *A = dyn_cast<FrameIndexSDNode>(Base))
@@ -73,6 +77,7 @@ bool BaseIndexOffset::equalBaseIndex(const BaseIndexOffset &Other,
7377
// Non-equal FrameIndexes - If both frame indices are fixed
7478
// we know their relative offsets and can compare them. Otherwise
7579
// we must be conservative.
80+
const MachineFrameInfo &MFI = DAG.getMachineFunction().getFrameInfo();
7681
if (MFI.isFixedObjectIndex(A->getIndex()) &&
7782
MFI.isFixedObjectIndex(B->getIndex())) {
7883
Off += MFI.getObjectOffset(B->getIndex()) -
@@ -81,6 +86,7 @@ bool BaseIndexOffset::equalBaseIndex(const BaseIndexOffset &Other,
8186
}
8287
}
8388
}
89+
8490
return false;
8591
}
8692

0 commit comments

Comments
 (0)