@@ -38,15 +38,18 @@ bool BaseIndexOffset::equalBaseIndex(const BaseIndexOffset &Other,
38
38
return true ;
39
39
40
40
// Match GlobalAddresses
41
- if (auto *A = dyn_cast<GlobalAddressSDNode>(Base))
41
+ if (auto *A = dyn_cast<GlobalAddressSDNode>(Base)) {
42
42
if (auto *B = dyn_cast<GlobalAddressSDNode>(Other.Base ))
43
43
if (A->getGlobal () == B->getGlobal ()) {
44
44
Off += B->getOffset () - A->getOffset ();
45
45
return true ;
46
46
}
47
47
48
+ return false ;
49
+ }
50
+
48
51
// Match Constants
49
- if (auto *A = dyn_cast<ConstantPoolSDNode>(Base))
52
+ if (auto *A = dyn_cast<ConstantPoolSDNode>(Base)) {
50
53
if (auto *B = dyn_cast<ConstantPoolSDNode>(Other.Base )) {
51
54
bool IsMatch =
52
55
A->isMachineConstantPoolEntry () == B->isMachineConstantPoolEntry ();
@@ -62,7 +65,8 @@ bool BaseIndexOffset::equalBaseIndex(const BaseIndexOffset &Other,
62
65
}
63
66
}
64
67
65
- const MachineFrameInfo &MFI = DAG.getMachineFunction ().getFrameInfo ();
68
+ return false ;
69
+ }
66
70
67
71
// Match FrameIndexes.
68
72
if (auto *A = dyn_cast<FrameIndexSDNode>(Base))
@@ -73,6 +77,7 @@ bool BaseIndexOffset::equalBaseIndex(const BaseIndexOffset &Other,
73
77
// Non-equal FrameIndexes - If both frame indices are fixed
74
78
// we know their relative offsets and can compare them. Otherwise
75
79
// we must be conservative.
80
+ const MachineFrameInfo &MFI = DAG.getMachineFunction ().getFrameInfo ();
76
81
if (MFI.isFixedObjectIndex (A->getIndex ()) &&
77
82
MFI.isFixedObjectIndex (B->getIndex ())) {
78
83
Off += MFI.getObjectOffset (B->getIndex ()) -
@@ -81,6 +86,7 @@ bool BaseIndexOffset::equalBaseIndex(const BaseIndexOffset &Other,
81
86
}
82
87
}
83
88
}
89
+
84
90
return false ;
85
91
}
86
92
0 commit comments