[llvm-commits] [llvm] r140666 - in /llvm/trunk: lib/Analysis/BasicAliasAnalysis.cpp test/Analysis/BasicAA/modref.ll
Eli Friedman
eli.friedman at gmail.com
Tue Sep 27 17:34:28 PDT 2011
Author: efriedma
Date: Tue Sep 27 19:34:27 2011
New Revision: 140666
URL: http://llvm.org/viewvc/llvm-project?rev=140666&view=rev
Log:
PR10628: Fix getModRefInfo so it queries the underlying alias() implementation correctly while checking nocapture calls.
Modified:
llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp
llvm/trunk/test/Analysis/BasicAA/modref.ll
Modified: llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp?rev=140666&r1=140665&r2=140666&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp (original)
+++ llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp Tue Sep 27 19:34:27 2011
@@ -714,7 +714,7 @@
// is impossible to alias the pointer we're checking. If not, we have to
// assume that the call could touch the pointer, even though it doesn't
// escape.
- if (!isNoAlias(Location(cast<Value>(CI)), Loc)) {
+ if (!isNoAlias(Location(*CI), Location(Object))) {
PassedAsArg = true;
break;
}
Modified: llvm/trunk/test/Analysis/BasicAA/modref.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/modref.ll?rev=140666&r1=140665&r2=140666&view=diff
==============================================================================
--- llvm/trunk/test/Analysis/BasicAA/modref.ll (original)
+++ llvm/trunk/test/Analysis/BasicAA/modref.ll Tue Sep 27 19:34:27 2011
@@ -129,8 +129,23 @@
; CHECK: ret
}
+; PR10628
+declare void @test7decl(i32* nocapture %x)
+define i32 @test7() nounwind uwtable ssp {
+entry:
+ %x = alloca i32, align 4
+ store i32 0, i32* %x, align 4
+ %add.ptr = getelementptr inbounds i32* %x, i64 1
+ call void @test7decl(i32* %add.ptr)
+ %tmp = load i32* %x, align 4
+ ret i32 %tmp
+; CHECK: @test7(
+; CHECK: store i32 0
+; CHECK: call void @test7decl
+; CHECK: load i32*
+}
+
declare void @llvm.memset.p0i8.i32(i8* nocapture, i8, i32, i32, i1) nounwind
declare void @llvm.memset.p0i8.i8(i8* nocapture, i8, i8, i32, i1) nounwind
declare void @llvm.memcpy.p0i8.p0i8.i8(i8* nocapture, i8* nocapture, i8, i32, i1) nounwind
declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i32, i1) nounwind
-
More information about the llvm-commits
mailing list