Skip to content

Commit 43e0723

Browse files
committed
[DAG] BaseIndexOffset::computeAliasing - early out on failed matches. NFCI.
Don't wait to test that all base ptr matches have succeeded
1 parent 6bb8d69 commit 43e0723

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

llvm/lib/CodeGen/SelectionDAG/SelectionDAGAddressAnalysis.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,13 @@ bool BaseIndexOffset::computeAliasing(const SDNode *Op0,
9191
const SelectionDAG &DAG, bool &IsAlias) {
9292

9393
BaseIndexOffset BasePtr0 = match(Op0, DAG);
94-
BaseIndexOffset BasePtr1 = match(Op1, DAG);
94+
if (!BasePtr0.getBase().getNode())
95+
return false;
9596

96-
if (!(BasePtr0.getBase().getNode() && BasePtr1.getBase().getNode()))
97+
BaseIndexOffset BasePtr1 = match(Op1, DAG);
98+
if (!BasePtr1.getBase().getNode())
9799
return false;
100+
98101
int64_t PtrDiff;
99102
if (NumBytes0 && NumBytes1 &&
100103
BasePtr0.equalBaseIndex(BasePtr1, DAG, PtrDiff)) {

0 commit comments

Comments
 (0)