[llvm] 5b56b55 - [InstCombine] Regenerate test checks (NFC)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 8 01:24:38 PST 2022
Author: Nikita Popov
Date: 2022-12-08T10:24:10+01:00
New Revision: 5b56b5524454883973de7e28547c76e71b95f972
URL: https://github.com/llvm/llvm-project/commit/5b56b5524454883973de7e28547c76e71b95f972
DIFF: https://github.com/llvm/llvm-project/commit/5b56b5524454883973de7e28547c76e71b95f972.diff
LOG: [InstCombine] Regenerate test checks (NFC)
Use generated check with --check-globals to verify that the TBAA
metadata is correct.
Added:
Modified:
llvm/test/Transforms/InstCombine/struct-assign-tbaa-new.ll
llvm/test/Transforms/InstCombine/struct-assign-tbaa.ll
Removed:
################################################################################
diff --git a/llvm/test/Transforms/InstCombine/struct-assign-tbaa-new.ll b/llvm/test/Transforms/InstCombine/struct-assign-tbaa-new.ll
index f95529a3c1c2..04eb601fc683 100644
--- a/llvm/test/Transforms/InstCombine/struct-assign-tbaa-new.ll
+++ b/llvm/test/Transforms/InstCombine/struct-assign-tbaa-new.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-globals
; RUN: opt -passes=instcombine -S < %s | FileCheck %s
;
; Verify that instcombine preserves TBAA tags when converting a memcpy into
@@ -10,11 +11,13 @@ declare void @llvm.memcpy.p0.p0.i64(ptr nocapture, ptr nocapture, i64, i1) nounw
%A = type { float }
define void @test1(ptr %a1, ptr %a2) {
+; CHECK-LABEL: @test1(
+; CHECK-NEXT: entry:
+; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A2:%.*]], align 4, !tbaa [[TBAA0:![0-9]+]]
+; CHECK-NEXT: store i32 [[TMP0]], ptr [[A1:%.*]], align 4, !tbaa [[TBAA0]]
+; CHECK-NEXT: ret void
+;
entry:
-; CHECK-LABEL: @test1
-; CHECK: %[[LOAD:.*]] = load i32, {{.*}}, !tbaa [[TAG_A:!.*]]
-; CHECK: store i32 %[[LOAD]], {{.*}}, !tbaa [[TAG_A]]
-; CHECK: ret
tail call void @llvm.memcpy.p0.p0.i64(ptr align 4 %a1, ptr align 4 %a2, i64 4, i1 false), !tbaa !4 ; TAG_A
ret void
}
@@ -22,9 +25,11 @@ entry:
%B = type { ptr }
define ptr @test2() {
-; CHECK-LABEL: @test2
-; CHECK-NOT: memcpy
-; CHECK: ret
+; CHECK-LABEL: @test2(
+; CHECK-NEXT: [[TMP:%.*]] = alloca [[B:%.*]], align 8
+; CHECK-NEXT: store i64 poison, ptr null, align 4294967296
+; CHECK-NEXT: ret ptr [[TMP]]
+;
%tmp = alloca %B, align 8
call void @llvm.memcpy.p0.p0.i64(ptr align 8 %tmp, ptr align 8 undef, i64 8, i1 false), !tbaa !7 ; TAG_B
%tmp3 = load ptr, ptr %tmp
@@ -40,10 +45,15 @@ define ptr @test2() {
!6 = !{!1, i64 8, !"B", !5, i64 0, i64 8}
!7 = !{!6, !6, i64 0, i64 8}
-; CHECK-DAG: [[ROOT:!.*]] = !{!"root"}
-; CHECK-DAG: [[TYPE_char:!.*]] = !{[[ROOT]], !"char"}
-; CHECK-DAG: [[TYPE_float:!.*]] = !{[[TYPE_char]], !"float"}
-; CHECK-DAG: [[TYPE_A:!.*]] = !{[[TYPE_char]], i64 4, !"A", [[TYPE_float]], i64 0, i64 4}
-; CHECK-DAG: [[TAG_A]] = !{[[TYPE_A]], [[TYPE_A]], i64 0, i64 4}
; Note that the memcpy() call in test2() transforms into an
; undecorated 'store undef', so TAG_B is not present in the output.
+
+;.
+; CHECK: attributes #[[ATTR0:[0-9]+]] = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
+;.
+; CHECK: [[TBAA0]] = !{!1, !1, i64 0, i64 4}
+; CHECK: [[META1:![0-9]+]] = !{!2, i64 4, !"A", !4, i64 0, i64 4}
+; CHECK: [[META2:![0-9]+]] = !{!3, !"char"}
+; CHECK: [[META3:![0-9]+]] = !{!"root"}
+; CHECK: [[META4:![0-9]+]] = !{!2, !"float"}
+;.
diff --git a/llvm/test/Transforms/InstCombine/struct-assign-tbaa.ll b/llvm/test/Transforms/InstCombine/struct-assign-tbaa.ll
index 741e3746e46e..d59bff25f5dd 100644
--- a/llvm/test/Transforms/InstCombine/struct-assign-tbaa.ll
+++ b/llvm/test/Transforms/InstCombine/struct-assign-tbaa.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-globals
; RUN: opt -passes=instcombine -S < %s | FileCheck %s
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
@@ -9,11 +10,13 @@ declare void @llvm.memcpy.p0.p0.i64(ptr nocapture, ptr nocapture, i64, i1) nounw
%struct.test1 = type { float }
-; CHECK: @test
-; CHECK: %[[LOAD:.*]] = load i32, ptr %{{.*}}, align 4, !tbaa !0
-; CHECK: store i32 %[[LOAD:.*]], ptr %{{.*}}, align 4, !tbaa !0
-; CHECK: ret
define void @test1(ptr nocapture %a, ptr nocapture %b) {
+; CHECK-LABEL: @test1(
+; CHECK-NEXT: entry:
+; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[B:%.*]], align 4, !tbaa [[TBAA0:![0-9]+]]
+; CHECK-NEXT: store i32 [[TMP0]], ptr [[A:%.*]], align 4, !tbaa [[TBAA0]]
+; CHECK-NEXT: ret void
+;
entry:
tail call void @llvm.memcpy.p0.p0.i64(ptr align 4 %a, ptr align 4 %b, i64 4, i1 false), !tbaa.struct !3
ret void
@@ -23,20 +26,27 @@ entry:
define ptr @test2() {
; CHECK-LABEL: @test2(
-; CHECK-NOT: memcpy
-; CHECK: ret
+; CHECK-NEXT: [[TMP:%.*]] = alloca [[STRUCT_TEST2:%.*]], align 8
+; CHECK-NEXT: store i64 poison, ptr null, align 4294967296
+; CHECK-NEXT: ret ptr [[TMP]]
+;
%tmp = alloca %struct.test2, align 8
call void @llvm.memcpy.p0.p0.i64(ptr align 8 %tmp, ptr align 8 undef, i64 8, i1 false), !tbaa.struct !4
%tmp3 = load ptr, ptr %tmp
ret ptr %tmp
}
-; CHECK: !0 = !{!1, !1, i64 0}
-; CHECK: !1 = !{!"float", !2}
-
!0 = !{!"Simple C/C++ TBAA"}
!1 = !{!"omnipotent char", !0}
!2 = !{!5, !5, i64 0}
!3 = !{i64 0, i64 4, !2}
!4 = !{i64 0, i64 8, null}
!5 = !{!"float", !0}
+
+;.
+; CHECK: attributes #[[ATTR0:[0-9]+]] = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
+;.
+; CHECK: [[TBAA0]] = !{!1, !1, i64 0}
+; CHECK: [[META1:![0-9]+]] = !{!"float", !2}
+; CHECK: [[META2:![0-9]+]] = !{!"Simple C/C++ TBAA"}
+;.
More information about the llvm-commits
mailing list