Index: lib/Analysis/DependenceAnalysis.cpp =================================================================== --- lib/Analysis/DependenceAnalysis.cpp +++ lib/Analysis/DependenceAnalysis.cpp @@ -627,8 +627,7 @@ const Value *B) { const Value *AObj = GetUnderlyingObject(A, DL); const Value *BObj = GetUnderlyingObject(B, DL); - return AA->alias(AObj, DL.getTypeStoreSize(AObj->getType()), - BObj, DL.getTypeStoreSize(BObj->getType())); + return AA->alias(AObj, BObj); } Index: test/Analysis/DependenceAnalysis/AASize.ll =================================================================== --- /dev/null +++ test/Analysis/DependenceAnalysis/AASize.ll @@ -0,0 +1,46 @@ +; RUN: opt < %s -analyze -basicaa -da | FileCheck %s + +; CHECK-LABEL: test +; CHECK: da analyze - none! +; CHECK: da analyze - none! +; CHECK: da analyze - confused! +; CHECK: da analyze - consistent output [|<]! +; CHECK: da analyze - none! +; CHECK: da analyze - confused! +; CHECK: da analyze - none! +; CHECK: da analyze - consistent input [S]! +; load @d6 and store @d6 +; CHECK: da analyze - confused! +; CHECK: da analyze - consistent output [S]! + +; There is a dependency in here, between @d and %0 (=@f) +@d6 = hidden global i16 5, align 2 +@f6 = hidden local_unnamed_addr global i16* @d6, align 4 + +define i32 @test() local_unnamed_addr #1 { +entry: + store i16 1, i16* @d6, align 2 + %0 = load i16*, i16** @f6, align 4 + br label %for.body.i + +for.body.i: + %inc8.sink14.i = phi i16 [ 1, %entry ], [ %inc8.i, %for.cond.cleanup.i ] + %1 = load i16, i16* %0, align 2 + br label %for.body6.i + +for.cond.cleanup.i: + %inc8.i = add nuw nsw i16 %inc8.sink14.i, 1 + store i16 %inc8.i, i16* @d6, align 2 + %cmp.i = icmp ult i16 %inc8.i, 6 + br i1 %cmp.i, label %for.body.i, label %test.exit + +for.body6.i: + %c.013.i = phi i32 [ 0, %for.body.i ], [ %inc.i, %for.body6.i ] + %inc.i = add nuw nsw i32 %c.013.i, 1 + %exitcond.i = icmp eq i32 %inc.i, 7 + br i1 %exitcond.i, label %for.cond.cleanup.i, label %for.body6.i + +test.exit: + %conv2.i = sext i16 %1 to i32 + ret i32 0 +} \ No newline at end of file