[llvm] 85ccdca - [BasicAA] Remove assert in AA evaluator
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 18 11:04:51 PST 2020
Author: Nikita Popov
Date: 2020-11-18T20:04:38+01:00
New Revision: 85ccdcaa502ee2c478f2d0ba2b1e217117b69032
URL: https://github.com/llvm/llvm-project/commit/85ccdcaa502ee2c478f2d0ba2b1e217117b69032
DIFF: https://github.com/llvm/llvm-project/commit/85ccdcaa502ee2c478f2d0ba2b1e217117b69032.diff
LOG: [BasicAA] Remove assert in AA evaluator
As reported in https://reviews.llvm.org/D91383#2401825, this
assert breaks external -aa-eval tests. We'll have to fix this
case before re-enabling it.
Added:
Modified:
llvm/lib/Analysis/AliasAnalysisEvaluator.cpp
llvm/test/Analysis/BasicAA/recphi.ll
Removed:
################################################################################
diff --git a/llvm/lib/Analysis/AliasAnalysisEvaluator.cpp b/llvm/lib/Analysis/AliasAnalysisEvaluator.cpp
index 4c88ca8bc833..b1433c579af8 100644
--- a/llvm/lib/Analysis/AliasAnalysisEvaluator.cpp
+++ b/llvm/lib/Analysis/AliasAnalysisEvaluator.cpp
@@ -170,14 +170,6 @@ void AAEvaluator::runInternal(Function &F, AAResults &AA) {
++MustAliasCount;
break;
}
-
- // We assume that alias(I1, I2) == alias(I2, I1) and only print one
- // order. Make sure this assumption actually holds.
- // TODO: We should probably assert this in AA itself under
- // EXPENSIVE_CHECKS. This would need some more thorough verification that
- // all AA queries are symmetric first.
- assert(AR == AA.alias(*I2, I2Size, *I1, I1Size) &&
- "AA query not symmetric");
}
}
diff --git a/llvm/test/Analysis/BasicAA/recphi.ll b/llvm/test/Analysis/BasicAA/recphi.ll
index a6157f22a4f9..f0ddb8c94751 100644
--- a/llvm/test/Analysis/BasicAA/recphi.ll
+++ b/llvm/test/Analysis/BasicAA/recphi.ll
@@ -188,4 +188,27 @@ bb5: ; preds = %bb3, %bb4
ret i16 0
}
+; TODO: Currently yields an asymmetric result.
+; CHECK-LABEL: Function: symmetry
+; CHECK: MayAlias: i32* %p, i32* %p.base
+; CHECK: MayAlias: i32* %p.base, i32* %p.next
+; CHECK: NoAlias: i32* %p, i32* %p.next
+; CHECK: MayAlias: i32* %p.base, i32* %result
+; CHECK: NoAlias: i32* %p, i32* %result
+; CHECK: MustAlias: i32* %p.next, i32* %result
+define i32* @symmetry(i32* %p.base, i1 %c) {
+entry:
+ br label %loop
+
+loop:
+ %p = phi i32* [ %p.base, %entry ], [ %p.next, %loop ]
+ %p.next = getelementptr inbounds i32, i32* %p, i32 1
+ br i1 %c, label %loop, label %exit
+
+exit:
+ %result = phi i32* [ %p.next, %loop ]
+ ret i32* %result
+}
+
+
declare i16 @call(i32)
More information about the llvm-commits
mailing list