diff options
author | Chris Lattner <sabre@nondot.org> | 2009-12-06 04:54:31 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-12-06 04:54:31 +0000 |
commit | cb9cbc494975dc827465af32d806e7b9ae17090c (patch) | |
tree | 6e4b4f2191ac1ebf04aabd0a87e51a5c4573da82 /test | |
parent | 0fce29b9d1b85416492a205dd81fe3b3e95b9650 (diff) | |
download | external_llvm-cb9cbc494975dc827465af32d806e7b9ae17090c.zip external_llvm-cb9cbc494975dc827465af32d806e7b9ae17090c.tar.gz external_llvm-cb9cbc494975dc827465af32d806e7b9ae17090c.tar.bz2 |
add support for forwarding mem intrinsic values to non-local loads.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90697 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-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 01d1ebc..af02557 100644 --- a/test/Transforms/GVN/rle.ll +++ b/test/Transforms/GVN/rle.ll @@ -163,6 +163,31 @@ entry: ; CHECK-NEXT: ret float } +;; non-local memset -> i16 load forwarding. +define i16 @memset_to_i16_nonlocal0(i16* %P, i1 %cond) { + %P3 = bitcast i16* %P to i8* + br i1 %cond, label %T, label %F +T: + tail call void @llvm.memset.i64(i8* %P3, i8 1, i64 400, i32 1) + br label %Cont + +F: + tail call void @llvm.memset.i64(i8* %P3, i8 2, i64 400, i32 1) + br label %Cont + +Cont: + %P2 = getelementptr i16* %P, i32 4 + %A = load i16* %P2 + ret i16 %A + +; CHECK: @memset_to_i16_nonlocal0 +; CHECK: Cont: +; CHECK-NEXT: %A = phi i16 [ 514, %F ], [ 257, %T ] +; CHECK-NOT: load +; CHECK: ret i16 %A +} + + declare void @llvm.memset.i64(i8* nocapture, i8, i64, i32) nounwind @@ -192,6 +217,7 @@ 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) { |