[llvm] 43e0723 - [DAG] BaseIndexOffset::computeAliasing - early out on failed matches. NFCI.
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 4 02:51:24 PST 2024
Author: Simon Pilgrim
Date: 2024-01-04T10:50:42Z
New Revision: 43e0723899e909cb2502b34da2003a5774ffb394
URL: https://github.com/llvm/llvm-project/commit/43e0723899e909cb2502b34da2003a5774ffb394
DIFF: https://github.com/llvm/llvm-project/commit/43e0723899e909cb2502b34da2003a5774ffb394.diff
LOG: [DAG] BaseIndexOffset::computeAliasing - early out on failed matches. NFCI.
Don't wait to test that all base ptr matches have succeeded
Added:
Modified:
llvm/lib/CodeGen/SelectionDAG/SelectionDAGAddressAnalysis.cpp
Removed:
################################################################################
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGAddressAnalysis.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGAddressAnalysis.cpp
index 39a1e09e83c594..558706d3d3c562 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGAddressAnalysis.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGAddressAnalysis.cpp
@@ -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)) {
More information about the llvm-commits
mailing list