[llvm] 64de3cd - [SCCP] Regenerate test checks (NFC)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 1 09:00:40 PDT 2022
Author: Nikita Popov
Date: 2022-11-01T17:00:32+01:00
New Revision: 64de3cdd71632f39c31ceb04603e7089bda4ed77
URL: https://github.com/llvm/llvm-project/commit/64de3cdd71632f39c31ceb04603e7089bda4ed77
DIFF: https://github.com/llvm/llvm-project/commit/64de3cdd71632f39c31ceb04603e7089bda4ed77.diff
LOG: [SCCP] Regenerate test checks (NFC)
Added:
Modified:
llvm/test/Transforms/SCCP/2009-09-24-byval-ptr.ll
llvm/test/Transforms/SCCP/arg-count-mismatch.ll
llvm/test/Transforms/SCCP/arg-type-mismatch.ll
Removed:
################################################################################
diff --git a/llvm/test/Transforms/SCCP/2009-09-24-byval-ptr.ll b/llvm/test/Transforms/SCCP/2009-09-24-byval-ptr.ll
index 750ebe234d119..7995dfaf6dd0f 100644
--- a/llvm/test/Transforms/SCCP/2009-09-24-byval-ptr.ll
+++ b/llvm/test/Transforms/SCCP/2009-09-24-byval-ptr.ll
@@ -1,16 +1,27 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt < %s -passes=ipsccp -S | FileCheck %s
+
; Don't constant-propagate byval pointers, since they are not pointers!
; PR5038
+
%struct.MYstr = type { i8, i32 }
@mystr = internal global %struct.MYstr zeroinitializer ; <%struct.MYstr*> [#uses=3]
define internal void @vfu1(%struct.MYstr* byval(%struct.MYstr) align 4 %u) nounwind {
+; CHECK-LABEL: @vfu1(
+; CHECK-NEXT: entry:
+; CHECK-NEXT: [[TMP0:%.*]] = getelementptr [[STRUCT_MYSTR:%.*]], %struct.MYstr* [[U:%.*]], i32 0, i32 1
+; CHECK-NEXT: store i32 99, i32* [[TMP0]], align 4
+; CHECK-NEXT: [[TMP1:%.*]] = getelementptr [[STRUCT_MYSTR]], %struct.MYstr* [[U]], i32 0, i32 0
+; CHECK-NEXT: store i8 97, i8* [[TMP1]], align 4
+; CHECK-NEXT: br label [[RETURN:%.*]]
+; CHECK: return:
+; CHECK-NEXT: ret void
+;
entry:
%0 = getelementptr %struct.MYstr, %struct.MYstr* %u, i32 0, i32 1 ; <i32*> [#uses=1]
store i32 99, i32* %0, align 4
-; CHECK: %struct.MYstr* %u
%1 = getelementptr %struct.MYstr, %struct.MYstr* %u, i32 0, i32 0 ; <i8*> [#uses=1]
store i8 97, i8* %1, align 4
-; CHECK: %struct.MYstr* %u
br label %return
return: ; preds = %entry
@@ -18,23 +29,34 @@ return: ; preds = %entry
}
define internal i32 @vfu2(%struct.MYstr* byval(%struct.MYstr) align 4 %u) nounwind readonly {
+; CHECK-LABEL: @vfu2(
+; CHECK-NEXT: entry:
+; CHECK-NEXT: [[TMP0:%.*]] = load i32, i32* getelementptr inbounds ([[STRUCT_MYSTR:%.*]], %struct.MYstr* @mystr, i32 0, i32 1), align 4
+; CHECK-NEXT: [[TMP1:%.*]] = load i8, i8* getelementptr inbounds ([[STRUCT_MYSTR]], %struct.MYstr* @mystr, i32 0, i32 0), align 1
+; CHECK-NEXT: [[TMP2:%.*]] = zext i8 [[TMP1]] to i32
+; CHECK-NEXT: [[TMP3:%.*]] = add i32 [[TMP2]], [[TMP0]]
+; CHECK-NEXT: ret i32 [[TMP3]]
+;
entry:
%0 = getelementptr %struct.MYstr, %struct.MYstr* %u, i32 0, i32 1 ; <i32*> [#uses=1]
%1 = load i32, i32* %0
-; CHECK: %struct.MYstr* @mystr, i{{..}} 0, i32 1
%2 = getelementptr %struct.MYstr, %struct.MYstr* %u, i32 0, i32 0 ; <i8*> [#uses=1]
%3 = load i8, i8* %2
-; CHECK: %struct.MYstr* @mystr, i{{..}} 0, i32 0
%4 = zext i8 %3 to i32
%5 = add i32 %4, %1
ret i32 %5
}
define i32 @unions() nounwind {
+; CHECK-LABEL: @unions(
+; CHECK-NEXT: entry:
+; CHECK-NEXT: call void @vfu1(%struct.MYstr* byval([[STRUCT_MYSTR:%.*]]) align 4 @mystr) #[[ATTR0:[0-9]+]]
+; CHECK-NEXT: [[RESULT:%.*]] = call i32 @vfu2(%struct.MYstr* byval([[STRUCT_MYSTR]]) align 4 @mystr) #[[ATTR0]]
+; CHECK-NEXT: ret i32 [[RESULT]]
+;
entry:
call void @vfu1(%struct.MYstr* byval(%struct.MYstr) align 4 @mystr) nounwind
%result = call i32 @vfu2(%struct.MYstr* byval(%struct.MYstr) align 4 @mystr) nounwind
-; CHECK: ret i32 %result
ret i32 %result
}
diff --git a/llvm/test/Transforms/SCCP/arg-count-mismatch.ll b/llvm/test/Transforms/SCCP/arg-count-mismatch.ll
index c51fd01c77287..46f6dead526e6 100644
--- a/llvm/test/Transforms/SCCP/arg-count-mismatch.ll
+++ b/llvm/test/Transforms/SCCP/arg-count-mismatch.ll
@@ -1,4 +1,4 @@
-; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature
; RUN: opt < %s -passes=ipsccp -S -o - | FileCheck %s
; The original C source looked like this:
@@ -31,8 +31,9 @@
; argument count between the caller and callee.
define dso_local void @foo(i16 %a) {
-; CHECK-LABEL: @foo(
-; CHECK-NEXT: [[CALL:%.*]] = call i16 bitcast (i16 (i16, i16)* @bar to i16 (i16)*)(i16 [[A:%.*]])
+; CHECK-LABEL: define {{[^@]+}}@foo
+; CHECK-SAME: (i16 [[A:%.*]]) {
+; CHECK-NEXT: [[CALL:%.*]] = call i16 bitcast (i16 (i16, i16)* @bar to i16 (i16)*)(i16 [[A]])
; CHECK-NEXT: ret void
;
%call = call i16 bitcast (i16 (i16, i16) * @bar to i16 (i16) *)(i16 %a)
@@ -40,7 +41,8 @@ define dso_local void @foo(i16 %a) {
}
define internal i16 @bar(i16 %p1, i16 %p2) {
-; CHECK-LABEL: @bar(
+; CHECK-LABEL: define {{[^@]+}}@bar
+; CHECK-SAME: (i16 [[P1:%.*]], i16 [[P2:%.*]]) {
; CHECK-NEXT: ret i16 0
;
ret i16 0
@@ -52,15 +54,17 @@ define internal i16 @bar(i16 %p1, i16 %p2) {
; been provided),
define internal i16 @vararg_prop(i16 %p1, ...) {
-; CHECK-LABEL: @vararg_prop(
+; CHECK-LABEL: define {{[^@]+}}@vararg_prop
+; CHECK-SAME: (i16 [[P1:%.*]], ...) {
; CHECK-NEXT: ret i16 undef
;
ret i16 %p1
}
define dso_local i16 @vararg_tests(i16 %a) {
-; CHECK-LABEL: @vararg_tests(
-; CHECK-NEXT: [[CALL1:%.*]] = call i16 (i16, ...) @vararg_prop(i16 7, i16 8, i16 [[A:%.*]])
+; CHECK-LABEL: define {{[^@]+}}@vararg_tests
+; CHECK-SAME: (i16 [[A:%.*]]) {
+; CHECK-NEXT: [[CALL1:%.*]] = call i16 (i16, ...) @vararg_prop(i16 7, i16 8, i16 [[A]])
; CHECK-NEXT: [[CALL2:%.*]] = call i16 bitcast (i16 (i16, i16, ...)* @vararg_no_prop to i16 (i16)*)(i16 7)
; CHECK-NEXT: [[ADD:%.*]] = add i16 7, [[CALL2]]
; CHECK-NEXT: ret i16 [[ADD]]
@@ -72,8 +76,9 @@ define dso_local i16 @vararg_tests(i16 %a) {
}
define internal i16 @vararg_no_prop(i16 %p1, i16 %p2, ...) {
-; CHECK-LABEL: @vararg_no_prop(
-; CHECK-NEXT: ret i16 [[P1:%.*]]
+; CHECK-LABEL: define {{[^@]+}}@vararg_no_prop
+; CHECK-SAME: (i16 [[P1:%.*]], i16 [[P2:%.*]], ...) {
+; CHECK-NEXT: ret i16 [[P1]]
;
ret i16 %p1
}
diff --git a/llvm/test/Transforms/SCCP/arg-type-mismatch.ll b/llvm/test/Transforms/SCCP/arg-type-mismatch.ll
index dac64daa4f7cc..52dfdfea924c0 100644
--- a/llvm/test/Transforms/SCCP/arg-type-mismatch.ll
+++ b/llvm/test/Transforms/SCCP/arg-type-mismatch.ll
@@ -1,12 +1,13 @@
-; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature
; RUN: opt < %s -passes=ipsccp -S -o - | FileCheck %s
; This test is just to verify that we do not crash/assert due to mismatch in
; argument type between the caller and callee.
define dso_local void @foo(i16 %a) {
-; CHECK-LABEL: @foo(
-; CHECK-NEXT: [[CALL:%.*]] = call i16 bitcast (i16 (i16, i16)* @bar to i16 (i16, i32)*)(i16 [[A:%.*]], i32 7)
+; CHECK-LABEL: define {{[^@]+}}@foo
+; CHECK-SAME: (i16 [[A:%.*]]) {
+; CHECK-NEXT: [[CALL:%.*]] = call i16 bitcast (i16 (i16, i16)* @bar to i16 (i16, i32)*)(i16 [[A]], i32 7)
; CHECK-NEXT: ret void
;
%call = call i16 bitcast (i16 (i16, i16) * @bar to i16 (i16, i32) *)(i16 %a, i32 7)
@@ -14,8 +15,9 @@ define dso_local void @foo(i16 %a) {
}
define internal i16 @bar(i16 %p1, i16 %p2) {
-; CHECK-LABEL: @bar(
-; CHECK-NEXT: ret i16 [[P2:%.*]]
+; CHECK-LABEL: define {{[^@]+}}@bar
+; CHECK-SAME: (i16 [[P1:%.*]], i16 [[P2:%.*]]) {
+; CHECK-NEXT: ret i16 [[P2]]
;
ret i16 %p2
}
More information about the llvm-commits
mailing list