Skip to content

Commit

Permalink
[DAG] BaseIndexOffset::computeAliasing - early out on failed matches.…
Browse files Browse the repository at this point in the history
… NFCI.

Don't wait to test that all base ptr matches have succeeded
  • Loading branch information
RKSimon committed Jan 4, 2024
1 parent 6bb8d69 commit 43e0723
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions llvm/lib/CodeGen/SelectionDAG/SelectionDAGAddressAnalysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,13 @@ bool BaseIndexOffset::computeAliasing(const SDNode *Op0,
const SelectionDAG &DAG, bool &IsAlias) {

BaseIndexOffset BasePtr0 = match(Op0, DAG);
BaseIndexOffset BasePtr1 = match(Op1, DAG);
if (!BasePtr0.getBase().getNode())
return false;

if (!(BasePtr0.getBase().getNode() && BasePtr1.getBase().getNode()))
BaseIndexOffset BasePtr1 = match(Op1, DAG);
if (!BasePtr1.getBase().getNode())
return false;

int64_t PtrDiff;
if (NumBytes0 && NumBytes1 &&
BasePtr0.equalBaseIndex(BasePtr1, DAG, PtrDiff)) {
Expand Down

0 comments on commit 43e0723

Please sign in to comment.