diff options
author | Chris Lattner <sabre@nondot.org> | 2009-09-20 21:00:18 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-09-20 21:00:18 +0000 |
commit | 386251341fb6d7e08b9cd8e87e90dee5512ea9bf (patch) | |
tree | dce761c2c5e4c5f5adc460a9ecbd2a2035e95de6 /test/Transforms/GVN/rle.ll | |
parent | 771a5422e167200f8a750449f688215f9abe925a (diff) | |
download | external_llvm-386251341fb6d7e08b9cd8e87e90dee5512ea9bf.zip external_llvm-386251341fb6d7e08b9cd8e87e90dee5512ea9bf.tar.gz external_llvm-386251341fb6d7e08b9cd8e87e90dee5512ea9bf.tar.bz2 |
improve memdep to eliminate bitcasts (and aliases, and noop geps)
early for the stated reasons: this allows it to find more
equivalences and depend less on code layout.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82404 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/GVN/rle.ll')
-rw-r--r-- | test/Transforms/GVN/rle.ll | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/test/Transforms/GVN/rle.ll b/test/Transforms/GVN/rle.ll index 503a5bb..1c5ab67 100644 --- a/test/Transforms/GVN/rle.ll +++ b/test/Transforms/GVN/rle.ll @@ -141,6 +141,32 @@ Cont: ; CHECK: ret i8 %A } +;; non-local i32/float -> i8 load forwarding. This also tests that the "P3" +;; bitcast equivalence can be properly phi translated. +define i8 @coerce_mustalias_nonlocal1(i32* %P, i1 %cond) { + %P2 = bitcast i32* %P to float* + br i1 %cond, label %T, label %F +T: + store i32 42, i32* %P + br label %Cont + +F: + store float 1.0, float* %P2 + br label %Cont + +Cont: + %P3 = bitcast i32* %P to i8* + %A = load i8* %P3 + ret i8 %A + +; CHECK: @coerce_mustalias_nonlocal1 +; CHECK: Cont: +; CHECK: %A = phi i8 [ +; CHECK-NOT: load +; CHECK: ret i8 %A +} + + ;; non-local i32 -> i8 partial redundancy load forwarding. define i8 @coerce_mustalias_pre0(i32* %P, i1 %cond) { %P3 = bitcast i32* %P to i8* |