[llvm] 3b175e1 - [InstCombine] Regenerate test checks (NFC)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 9 01:37:33 PDT 2024
Author: Nikita Popov
Date: 2024-08-09T10:37:25+02:00
New Revision: 3b175e13d4bce751b9a8b0feb70fa6eebc8eca20
URL: https://github.com/llvm/llvm-project/commit/3b175e13d4bce751b9a8b0feb70fa6eebc8eca20
DIFF: https://github.com/llvm/llvm-project/commit/3b175e13d4bce751b9a8b0feb70fa6eebc8eca20.diff
LOG: [InstCombine] Regenerate test checks (NFC)
And merge two test files.
Added:
Modified:
llvm/test/Transforms/InstCombine/call-cast-target.ll
Removed:
llvm/test/Transforms/InstCombine/cast-callee-deopt-bundles.ll
################################################################################
diff --git a/llvm/test/Transforms/InstCombine/call-cast-target.ll b/llvm/test/Transforms/InstCombine/call-cast-target.ll
index 26c0fc8d2cb4c7..b9f57dbbd1c303 100644
--- a/llvm/test/Transforms/InstCombine/call-cast-target.ll
+++ b/llvm/test/Transforms/InstCombine/call-cast-target.ll
@@ -1,13 +1,16 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; RUN: opt < %s -passes=instcombine -S | FileCheck %s
target datalayout = "e-p:32:32"
target triple = "i686-pc-linux-gnu"
define i32 @main() {
-; CHECK-LABEL: @main
-; CHECK: %[[call:.*]] = call ptr @ctime(ptr null)
-; CHECK: %[[cast:.*]] = ptrtoint ptr %[[call]] to i32
-; CHECK: ret i32 %[[cast]]
+; CHECK-LABEL: define i32 @main() {
+; CHECK-NEXT: [[ENTRY:.*:]]
+; CHECK-NEXT: [[TMP:%.*]] = call ptr @ctime(ptr null)
+; CHECK-NEXT: [[TMP0:%.*]] = ptrtoint ptr [[TMP]] to i32
+; CHECK-NEXT: ret i32 [[TMP0]]
+;
entry:
%tmp = call i32 @ctime( ptr null ) ; <i32> [#uses=1]
ret i32 %tmp
@@ -16,13 +19,21 @@ entry:
declare ptr @ctime(ptr)
define internal { i8 } @foo(ptr) {
+; CHECK-LABEL: define internal { i8 } @foo(
+; CHECK-SAME: ptr [[TMP0:%.*]]) {
+; CHECK-NEXT: [[ENTRY:.*:]]
+; CHECK-NEXT: ret { i8 } zeroinitializer
+;
entry:
ret { i8 } { i8 0 }
}
define void @test_struct_ret() {
-; CHECK-LABEL: @test_struct_ret
-; CHECK-NOT: bitcast
+; CHECK-LABEL: define void @test_struct_ret() {
+; CHECK-NEXT: [[ENTRY:.*:]]
+; CHECK-NEXT: [[TMP0:%.*]] = call { i8 } @foo(ptr null)
+; CHECK-NEXT: ret void
+;
entry:
%0 = call { i8 } @foo(ptr null)
ret void
@@ -31,10 +42,13 @@ entry:
declare i32 @fn1(i32)
define i32 @test1(ptr %a) {
-; CHECK-LABEL: @test1
-; CHECK: %[[cast:.*]] = ptrtoint ptr %a to i32
-; CHECK-NEXT: %[[call:.*]] = tail call i32 @fn1(i32 %[[cast]])
-; CHECK-NEXT: ret i32 %[[call]]
+; CHECK-LABEL: define i32 @test1(
+; CHECK-SAME: ptr [[A:%.*]]) {
+; CHECK-NEXT: [[ENTRY:.*:]]
+; CHECK-NEXT: [[TMP0:%.*]] = ptrtoint ptr [[A]] to i32
+; CHECK-NEXT: [[CALL:%.*]] = tail call i32 @fn1(i32 [[TMP0]])
+; CHECK-NEXT: ret i32 [[CALL]]
+;
entry:
%call = tail call i32 @fn1(ptr %a)
ret i32 %call
@@ -43,9 +57,12 @@ entry:
declare i32 @fn2(i16)
define i32 @test2(ptr %a) {
-; CHECK-LABEL: @test2
-; CHECK: %[[call:.*]] = tail call i32 @fn2(ptr %a)
-; CHECK-NEXT: ret i32 %[[call]]
+; CHECK-LABEL: define i32 @test2(
+; CHECK-SAME: ptr [[A:%.*]]) {
+; CHECK-NEXT: [[ENTRY:.*:]]
+; CHECK-NEXT: [[CALL:%.*]] = tail call i32 @fn2(ptr [[A]])
+; CHECK-NEXT: ret i32 [[CALL]]
+;
entry:
%call = tail call i32 @fn2(ptr %a)
ret i32 %call
@@ -54,9 +71,12 @@ entry:
declare i32 @fn3(i64)
define i32 @test3(ptr %a) {
-; CHECK-LABEL: @test3
-; CHECK: %[[call:.*]] = tail call i32 @fn3(ptr %a)
-; CHECK-NEXT: ret i32 %[[call]]
+; CHECK-LABEL: define i32 @test3(
+; CHECK-SAME: ptr [[A:%.*]]) {
+; CHECK-NEXT: [[ENTRY:.*:]]
+; CHECK-NEXT: [[CALL:%.*]] = tail call i32 @fn3(ptr [[A]])
+; CHECK-NEXT: ret i32 [[CALL]]
+;
entry:
%call = tail call i32 @fn3(ptr %a)
ret i32 %call
@@ -65,9 +85,12 @@ entry:
declare i32 @fn4(i32) "thunk"
define i32 @test4(ptr %a) {
-; CHECK-LABEL: @test4
-; CHECK: %[[call:.*]] = tail call i32 @fn4(ptr %a)
-; CHECK-NEXT: ret i32 %[[call]]
+; CHECK-LABEL: define i32 @test4(
+; CHECK-SAME: ptr [[A:%.*]]) {
+; CHECK-NEXT: [[ENTRY:.*:]]
+; CHECK-NEXT: [[CALL:%.*]] = tail call i32 @fn4(ptr [[A]])
+; CHECK-NEXT: ret i32 [[CALL]]
+;
entry:
%call = tail call i32 @fn4(ptr %a)
ret i32 %call
@@ -76,9 +99,14 @@ entry:
declare i1 @fn5(ptr byval({ i32, i32 }) align 4 %r)
define i1 @test5() {
-; CHECK-LABEL: @test5
-; CHECK: %[[call:.*]] = call i1 @fn5(i32 {{.*}}, i32 {{.*}})
-; CHECK-NEXT: ret i1 %[[call]]
+; CHECK-LABEL: define i1 @test5() {
+; CHECK-NEXT: [[TMP1:%.*]] = alloca { i32, i32 }, align 4
+; CHECK-NEXT: [[TMP2:%.*]] = load i32, ptr [[TMP1]], align 4
+; CHECK-NEXT: [[TMP3:%.*]] = getelementptr inbounds i8, ptr [[TMP1]], i32 4
+; CHECK-NEXT: [[TMP4:%.*]] = load i32, ptr [[TMP3]], align 4
+; CHECK-NEXT: [[TMP5:%.*]] = call i1 @fn5(i32 [[TMP2]], i32 [[TMP4]])
+; CHECK-NEXT: ret i1 [[TMP5]]
+;
%1 = alloca { i32, i32 }, align 4
%2 = getelementptr inbounds { i32, i32 }, ptr %1, i32 0, i32 0
%3 = load i32, ptr %2, align 4
@@ -87,3 +115,16 @@ define i1 @test5() {
%6 = call i1 @fn5(i32 %3, i32 %5)
ret i1 %6
}
+
+declare void @bundles_callee(i32)
+
+define void @bundles() {
+; CHECK-LABEL: define void @bundles() {
+; CHECK-NEXT: [[ENTRY:.*:]]
+; CHECK-NEXT: call void @bundles_callee(i32 0) [ "deopt"() ]
+; CHECK-NEXT: ret void
+;
+entry:
+ call void @bundles_callee() [ "deopt"() ]
+ ret void
+}
diff --git a/llvm/test/Transforms/InstCombine/cast-callee-deopt-bundles.ll b/llvm/test/Transforms/InstCombine/cast-callee-deopt-bundles.ll
deleted file mode 100644
index 14ff3ee71094f4..00000000000000
--- a/llvm/test/Transforms/InstCombine/cast-callee-deopt-bundles.ll
+++ /dev/null
@@ -1,11 +0,0 @@
-; RUN: opt -passes=instcombine -S < %s | FileCheck %s
-
-declare void @foo(i32)
-
-define void @g() {
-; CHECK-LABEL: @g(
- entry:
-; CHECK: call void @foo(i32 0) [ "deopt"() ]
- call void @foo () [ "deopt"() ]
- ret void
-}
More information about the llvm-commits
mailing list