aboutsummaryrefslogtreecommitdiffstats
path: root/test/Transforms/GVN/rle.ll
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-09-21 06:48:08 +0000
committerChris Lattner <sabre@nondot.org>2009-09-21 06:48:08 +0000
commit4fbd14e80e11ec3ec9f240919e4a4a0186620c0c (patch)
treecb603bade09819edee54e763fcb053ed76c3e6d9 /test/Transforms/GVN/rle.ll
parent879135145f8c1efc09dceee54e6fa87cae63565c (diff)
downloadexternal_llvm-4fbd14e80e11ec3ec9f240919e4a4a0186620c0c.zip
external_llvm-4fbd14e80e11ec3ec9f240919e4a4a0186620c0c.tar.gz
external_llvm-4fbd14e80e11ec3ec9f240919e4a4a0186620c0c.tar.bz2
enable non-local analysis and PRE of large store -> little load.
This doesn't kick in too much because of phi translation issues, but this can be resolved in the future. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82447 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/GVN/rle.ll')
-rw-r--r--test/Transforms/GVN/rle.ll52
1 files changed, 51 insertions, 1 deletions
diff --git a/test/Transforms/GVN/rle.ll b/test/Transforms/GVN/rle.ll
index 04b38e4..afdcd5d 100644
--- a/test/Transforms/GVN/rle.ll
+++ b/test/Transforms/GVN/rle.ll
@@ -199,7 +199,7 @@ Cont:
;; types, and the reload is an offset from the store pointer.
;;===----------------------------------------------------------------------===;;
-;; i32 -> f32 forwarding.
+;; i32 -> i8 forwarding.
;; PR4216
define i8 @coerce_offset0(i32 %V, i32* %P) {
store i32 %V, i32* %P
@@ -214,5 +214,55 @@ define i8 @coerce_offset0(i32 %V, i32* %P) {
; CHECK: ret i8
}
+;; non-local i32/float -> i8 load forwarding.
+define i8 @coerce_offset_nonlocal0(i32* %P, i1 %cond) {
+ %P2 = bitcast i32* %P to float*
+ %P3 = bitcast i32* %P to i8*
+ %P4 = getelementptr i8* %P3, i32 2
+ 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:
+ %A = load i8* %P4
+ ret i8 %A
+
+; CHECK: @coerce_offset_nonlocal0
+; CHECK: Cont:
+; CHECK: %A = phi i8 [
+; CHECK-NOT: load
+; CHECK: ret i8 %A
+}
+
+
+;; non-local i32 -> i8 partial redundancy load forwarding.
+define i8 @coerce_offset_pre0(i32* %P, i1 %cond) {
+ %P3 = bitcast i32* %P to i8*
+ %P4 = getelementptr i8* %P3, i32 2
+ br i1 %cond, label %T, label %F
+T:
+ store i32 42, i32* %P
+ br label %Cont
+
+F:
+ br label %Cont
+
+Cont:
+ %A = load i8* %P4
+ ret i8 %A
+
+; CHECK: @coerce_offset_pre0
+; CHECK: F:
+; CHECK: load i8* %P4
+; CHECK: Cont:
+; CHECK: %A = phi i8 [
+; CHECK-NOT: load
+; CHECK: ret i8 %A
+}