diff --git a/lib/Analysis/AliasAnalysisEvaluator.cpp b/lib/Analysis/AliasAnalysisEvaluator.cpp index 4c88ca8bc83..b1433c579af 100644 --- a/lib/Analysis/AliasAnalysisEvaluator.cpp +++ b/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/test/Analysis/BasicAA/recphi.ll b/test/Analysis/BasicAA/recphi.ll index a6157f22a4f..f0ddb8c9475 100644 --- a/test/Analysis/BasicAA/recphi.ll +++ b/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)