diff options
author | Chris Lattner <sabre@nondot.org> | 2009-05-25 21:28:56 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-05-25 21:28:56 +0000 |
commit | ab9cf1282baf559771183304ffc9959882e17ebb (patch) | |
tree | c7b762f1037e2fe2aa6e9013a856e17a132af08b /test | |
parent | d67a1666ec70001ee9ce4c80ea5b0ab8e4f7a77b (diff) | |
download | external_llvm-ab9cf1282baf559771183304ffc9959882e17ebb.zip external_llvm-ab9cf1282baf559771183304ffc9959882e17ebb.tar.gz external_llvm-ab9cf1282baf559771183304ffc9959882e17ebb.tar.bz2 |
make memdep use the getModRefInfo method for stores instead of the
low-level alias() method, allowing it to reason more aggressively
about pointers into constant memory. PR4189
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72403 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/Transforms/GVN/load-constant-mem.ll | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/Transforms/GVN/load-constant-mem.ll b/test/Transforms/GVN/load-constant-mem.ll new file mode 100644 index 0000000..83b9d38 --- /dev/null +++ b/test/Transforms/GVN/load-constant-mem.ll @@ -0,0 +1,13 @@ +; RUN: llvm-as < %s | opt -gvn -instcombine | llvm-dis | grep {ret i32 0} +; PR4189 +@G = external constant [4 x i32] + +define i32 @test(i8* %p, i32 %i) nounwind { +entry: + %P = getelementptr [4 x i32]* @G, i32 0, i32 %i + %A = load i32* %P + store i8 4, i8* %p + %B = load i32* %P + %C = sub i32 %A, %B + ret i32 %C +} |