OSDN Git Service

[InstCombine] regenerate test checks; NFC
authorSanjay Patel <spatel@rotateright.com>
Thu, 10 Aug 2017 15:07:37 +0000 (15:07 +0000)
committerSanjay Patel <spatel@rotateright.com>
Thu, 10 Aug 2017 15:07:37 +0000 (15:07 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310603 91177308-0d34-0410-b5e6-96231b3b80d8

test/Transforms/InstCombine/memcpy-1.ll
test/Transforms/InstCombine/memcpy-2.ll
test/Transforms/InstCombine/memcpy-to-load.ll

index 9efbcc8..76dce27 100644 (file)
@@ -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
 }
+
index a31854c..12c6896 100644 (file)
@@ -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
 }
index fe5f0ac..7638df6 100644 (file)
@@ -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