diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2009-10-13 07:48:38 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2009-10-13 07:48:38 +0000 |
commit | fc461aee7449bb8010b6f4946d88afd8e2b05e3e (patch) | |
tree | 71cc8d429e4db5afd033db00609120b5f546001d /test/Analysis | |
parent | c888d3594875d75fc81e4cd3b6630b4b88f8054e (diff) | |
download | external_llvm-fc461aee7449bb8010b6f4946d88afd8e2b05e3e.zip external_llvm-fc461aee7449bb8010b6f4946d88afd8e2b05e3e.tar.gz external_llvm-fc461aee7449bb8010b6f4946d88afd8e2b05e3e.tar.bz2 |
Teach BasicAA a little something about the atomic intrinsics: they can only
modify through the pointer they're given.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83959 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Analysis')
-rw-r--r-- | test/Analysis/BasicAA/2009-10-13-AtomicModRef.ll | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/Analysis/BasicAA/2009-10-13-AtomicModRef.ll b/test/Analysis/BasicAA/2009-10-13-AtomicModRef.ll new file mode 100644 index 0000000..3ccbc2f --- /dev/null +++ b/test/Analysis/BasicAA/2009-10-13-AtomicModRef.ll @@ -0,0 +1,16 @@ +; RUN: opt -gvn -S < %s | FileCheck %s + +declare i8 @llvm.atomic.load.add.i8.p0i8(i8*, i8) + +define void @foo(i8* %ptr) { + %P = getelementptr i8* %ptr, i32 0 + %Q = getelementptr i8* %ptr, i32 1 +; CHECK: getelementptr + %X = load i8* %P +; CHECK: = load + %Y = call i8 @llvm.atomic.load.add.i8.p0i8(i8* %Q, i8 1) + %Z = load i8* %P +; CHECK-NOT: = load + ret void +; CHECK: ret void +} |