diff options
author | Sanjay Patel <spatel@rotateright.com> | 2017-08-10 15:07:37 +0000 |
---|---|---|
committer | Sanjay Patel <spatel@rotateright.com> | 2017-08-10 15:07:37 +0000 |
commit | 6470011e9ca0c9a8989331f06ff2a3ba4d66a1ee (patch) | |
tree | 4bcca968b4e6a18f3496428745bd2b7cdf3bce65 | |
parent | 35c908f20caba895dd10f09c8d7ec5829845e3c5 (diff) | |
download | bcm5719-llvm-6470011e9ca0c9a8989331f06ff2a3ba4d66a1ee.tar.gz bcm5719-llvm-6470011e9ca0c9a8989331f06ff2a3ba4d66a1ee.zip |
[InstCombine] regenerate test checks; NFC
llvm-svn: 310603
-rw-r--r-- | llvm/test/Transforms/InstCombine/memcpy-1.ll | 6 | ||||
-rw-r--r-- | llvm/test/Transforms/InstCombine/memcpy-2.ll | 7 | ||||
-rw-r--r-- | llvm/test/Transforms/InstCombine/memcpy-to-load.ll | 21 |
3 files changed, 20 insertions, 14 deletions
diff --git a/llvm/test/Transforms/InstCombine/memcpy-1.ll b/llvm/test/Transforms/InstCombine/memcpy-1.ll index 9efbcc8283d..76dce279b89 100644 --- a/llvm/test/Transforms/InstCombine/memcpy-1.ll +++ b/llvm/test/Transforms/InstCombine/memcpy-1.ll @@ -10,8 +10,10 @@ declare i8* @memcpy(i8*, i8*, i32) define i8* @test_simplify1(i8* %mem1, i8* %mem2, i32 %size) { ; CHECK-LABEL: @test_simplify1( +; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* %mem1, i8* %mem2, i32 %size, i32 1, i1 false) +; CHECK-NEXT: ret i8* %mem1 +; %ret = call i8* @memcpy(i8* %mem1, i8* %mem2, i32 %size) -; CHECK: call void @llvm.memcpy ret i8* %ret -; CHECK: ret i8* %mem1 } + diff --git a/llvm/test/Transforms/InstCombine/memcpy-2.ll b/llvm/test/Transforms/InstCombine/memcpy-2.ll index a31854c0175..12c68965b35 100644 --- a/llvm/test/Transforms/InstCombine/memcpy-2.ll +++ b/llvm/test/Transforms/InstCombine/memcpy-2.ll @@ -6,12 +6,13 @@ target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f3 declare i8 @memcpy(i8*, i8*, i32) -; Check that memcpy functions with the wrong prototype aren't simplified. +; Check that memcpy functions with the wrong prototype (doesn't return a pointer) aren't simplified. define i8 @test_no_simplify1(i8* %mem1, i8* %mem2, i32 %size) { ; CHECK-LABEL: @test_no_simplify1( +; CHECK-NEXT: [[RET:%.*]] = call i8 @memcpy(i8* %mem1, i8* %mem2, i32 %size) +; CHECK-NEXT: ret i8 [[RET]] +; %ret = call i8 @memcpy(i8* %mem1, i8* %mem2, i32 %size) -; CHECK: call i8 @memcpy ret i8 %ret -; CHECK: ret i8 %ret } diff --git a/llvm/test/Transforms/InstCombine/memcpy-to-load.ll b/llvm/test/Transforms/InstCombine/memcpy-to-load.ll index fe5f0ac657f..7638df68b90 100644 --- a/llvm/test/Transforms/InstCombine/memcpy-to-load.ll +++ b/llvm/test/Transforms/InstCombine/memcpy-to-load.ll @@ -1,17 +1,20 @@ ; RUN: opt < %s -instcombine -S | FileCheck %s + target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128" target triple = "i686-apple-darwin8" -define void @foo(double* %X, double* %Y) { -entry: - %tmp2 = bitcast double* %X to i8* - %tmp13 = bitcast double* %Y to i8* - call void @llvm.memcpy.p0i8.p0i8.i32(i8* %tmp2, i8* %tmp13, i32 8, i32 1, i1 false) +; Make sure that the memcpy has been replaced with a load/store of i64. + +define void @foo(i8* %d, i8* %s) { +; CHECK-LABEL: @foo( +; CHECK-NEXT: [[TMP1:%.*]] = bitcast i8* %s to i64* +; CHECK-NEXT: [[TMP2:%.*]] = bitcast i8* %d to i64* +; CHECK-NEXT: [[TMP3:%.*]] = load i64, i64* [[TMP1]], align 1 +; CHECK-NEXT: store i64 [[TMP3]], i64* [[TMP2]], align 1 +; CHECK-NEXT: ret void +; + call void @llvm.memcpy.p0i8.p0i8.i32(i8* %d, i8* %s, i32 8, i32 1, i1 false) ret void } -; Make sure that the memcpy has been replace with a load/store of i64 -; CHECK: [[TMP:%[0-9]+]] = load i64 -; CHECK: store i64 [[TMP]] - declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i32, i1) nounwind |