[llvm] 19e5579 - [Util] Regenerate test checks (NFC)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 22 07:21:11 PST 2022
Author: Nikita Popov
Date: 2022-12-22T16:20:55+01:00
New Revision: 19e55791c4fa484401d0b4a4e5d66dd313251ade
URL: https://github.com/llvm/llvm-project/commit/19e55791c4fa484401d0b4a4e5d66dd313251ade
DIFF: https://github.com/llvm/llvm-project/commit/19e55791c4fa484401d0b4a4e5d66dd313251ade.diff
LOG: [Util] Regenerate test checks (NFC)
Added:
Modified:
llvm/test/Transforms/Util/strip-gc-relocates.ll
Removed:
################################################################################
diff --git a/llvm/test/Transforms/Util/strip-gc-relocates.ll b/llvm/test/Transforms/Util/strip-gc-relocates.ll
index 04782158ad69c..552e3b49dd493 100644
--- a/llvm/test/Transforms/Util/strip-gc-relocates.ll
+++ b/llvm/test/Transforms/Util/strip-gc-relocates.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -S -passes=strip-gc-relocates,instcombine < %s | FileCheck %s
; test utility/debugging pass which removes gc.relocates, inserted by -rewrite-statepoints-for-gc
declare void @use_obj32(ptr addrspace(1)) "gc-leaf-function"
@@ -12,11 +13,12 @@ declare ptr addrspace(1) @new_instance() #1
; Simple case: remove gc.relocate
define ptr addrspace(1) @test1(ptr addrspace(1) %arg) gc "statepoint-example" {
+; CHECK-LABEL: @test1(
+; CHECK-NEXT: entry:
+; CHECK-NEXT: [[STATEPOINT_TOKEN:%.*]] = call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 2882400000, i32 0, ptr nonnull elementtype(void ()) @g, i32 0, i32 0, i32 0, i32 0) [ "deopt"(i32 100), "gc-live"() ]
+; CHECK-NEXT: ret ptr addrspace(1) [[ARG:%.*]]
+;
entry:
-; CHECK-LABEL: test1
-; CHECK: gc.statepoint
-; CHECK-NOT: gc.relocate
-; CHECK: ret ptr addrspace(1) %arg
%statepoint_token = call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 2882400000, i32 0, ptr elementtype(void ()) @g, i32 0, i32 0, i32 0, i32 0) ["gc-live"(ptr addrspace(1) %arg), "deopt" (i32 100)]
%arg.relocated = call coldcc ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token %statepoint_token, i32 0, i32 0) ; (%arg, %arg)
ret ptr addrspace(1) %arg.relocated
@@ -24,12 +26,16 @@ entry:
; Remove gc.relocates in presence of nested relocates.
define void @test2(ptr addrspace(1) %base) gc "statepoint-example" {
+; CHECK-LABEL: @test2(
+; CHECK-NEXT: entry:
+; CHECK-NEXT: [[PTR_GEP1:%.*]] = getelementptr i32, ptr addrspace(1) [[BASE:%.*]], i64 30
+; CHECK-NEXT: [[STATEPOINT_TOKEN:%.*]] = call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 2882400000, i32 0, ptr nonnull elementtype(void ()) @do_safepoint, i32 0, i32 0, i32 0, i32 0) [ "gc-live"() ]
+; CHECK-NEXT: call void @use_obj32(ptr addrspace(1) [[PTR_GEP1]])
+; CHECK-NEXT: [[STATEPOINT_TOKEN1:%.*]] = call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 2882400000, i32 0, ptr nonnull elementtype(void ()) @do_safepoint, i32 0, i32 0, i32 0, i32 0) [ "gc-live"() ]
+; CHECK-NEXT: call void @use_obj32(ptr addrspace(1) [[PTR_GEP1]])
+; CHECK-NEXT: ret void
+;
entry:
-; CHECK-LABEL: test2
-; CHECK: statepoint
-; CHECK-NOT: gc.relocate
-; CHECK: call void @use_obj32(ptr addrspace(1) %ptr.gep1)
-; CHECK: call void @use_obj32(ptr addrspace(1) %ptr.gep1)
%ptr.gep = getelementptr i32, ptr addrspace(1) %base, i32 15
%ptr.gep1 = getelementptr i32, ptr addrspace(1) %ptr.gep, i32 15
%statepoint_token = call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 2882400000, i32 0, ptr elementtype(void ()) @do_safepoint, i32 0, i32 0, i32 0, i32 0) ["gc-live"(ptr addrspace(1) %ptr.gep1, ptr addrspace(1) %base)]
@@ -45,16 +51,20 @@ entry:
; landing pad gc.relocates removed by instcombine since it has no uses.
define ptr addrspace(1) @test3(ptr addrspace(1) %arg) gc "statepoint-example" personality i32 8 {
-; CHECK-LABEL: test3(
-; CHECK: gc.statepoint
-; CHECK-LABEL: normal_dest:
-; CHECK-NOT: gc.relocate
-; CHECK: ret ptr addrspace(1) %arg
-; CHECK-LABEL: unwind_dest:
-; CHECK-NOT: gc.relocate
+; CHECK-LABEL: @test3(
+; CHECK-NEXT: entry:
+; CHECK-NEXT: [[STATEPOINT_TOKEN:%.*]] = invoke token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 2882400000, i32 0, ptr nonnull elementtype(void ()) @g, i32 0, i32 0, i32 0, i32 0) [ "deopt"(i32 100), "gc-live"() ]
+; CHECK-NEXT: to label [[NORMAL_DEST:%.*]] unwind label [[UNWIND_DEST:%.*]]
+; CHECK: normal_dest:
+; CHECK-NEXT: ret ptr addrspace(1) [[ARG:%.*]]
+; CHECK: unwind_dest:
+; CHECK-NEXT: [[LPAD:%.*]] = landingpad token
+; CHECK-NEXT: cleanup
+; CHECK-NEXT: resume token undef
+;
entry:
%statepoint_token = invoke token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 2882400000, i32 0, ptr elementtype(void ()) @g, i32 0, i32 0, i32 0, i32 0) ["gc-live"(ptr addrspace(1) %arg), "deopt" (i32 100)]
- to label %normal_dest unwind label %unwind_dest
+ to label %normal_dest unwind label %unwind_dest
normal_dest: ; preds = %entry
%arg.relocated1 = call coldcc ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token %statepoint_token, i32 0, i32 0) ; (%arg, %arg)
@@ -62,14 +72,29 @@ normal_dest: ; preds = %entry
unwind_dest: ; preds = %entry
%lpad = landingpad token
- cleanup
+ cleanup
%arg.relocated = call coldcc ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token %lpad, i32 0, i32 0) ; (%arg, %arg)
resume token undef
}
; in presence of phi
define void @test4(i1 %cond) gc "statepoint-example" {
-; CHECK-LABEL: test4
+; CHECK-LABEL: @test4(
+; CHECK-NEXT: entry:
+; CHECK-NEXT: [[BASE1:%.*]] = call ptr addrspace(1) @new_instance()
+; CHECK-NEXT: [[BASE2:%.*]] = call ptr addrspace(1) @new_instance()
+; CHECK-NEXT: br i1 [[COND:%.*]], label [[HERE:%.*]], label [[THERE:%.*]]
+; CHECK: here:
+; CHECK-NEXT: br label [[MERGE:%.*]]
+; CHECK: there:
+; CHECK-NEXT: br label [[MERGE]]
+; CHECK: merge:
+; CHECK-NEXT: [[BASEPHI_BASE:%.*]] = phi ptr addrspace(1) [ [[BASE1]], [[HERE]] ], [ [[BASE2]], [[THERE]] ], !is_base_value !0
+; CHECK-NEXT: [[STATEPOINT_TOKEN:%.*]] = call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 2882400000, i32 0, ptr nonnull elementtype(void ()) @do_safepoint, i32 0, i32 0, i32 0, i32 0) [ "gc-live"() ]
+; CHECK-NEXT: [[PTR_GEP_REMAT:%.*]] = getelementptr i32, ptr addrspace(1) [[BASEPHI_BASE]], i64 15
+; CHECK-NEXT: call void @use_obj32(ptr addrspace(1) [[PTR_GEP_REMAT]])
+; CHECK-NEXT: ret void
+;
entry:
%base1 = call ptr addrspace(1) @new_instance()
%base2 = call ptr addrspace(1) @new_instance()
@@ -82,9 +107,6 @@ there: ; preds = %entry
br label %merge
merge: ; preds = %there, %here
-; CHECK-LABEL: merge:
-; CHECK-NOT: gc.relocate
-; CHECK: %ptr.gep.remat = getelementptr i32, ptr addrspace(1) %basephi.base
%basephi.base = phi ptr addrspace(1) [ %base1, %here ], [ %base2, %there ], !is_base_value !0
%basephi = phi ptr addrspace(1) [ %base1, %here ], [ %base2, %there ]
%ptr.gep = getelementptr i32, ptr addrspace(1) %basephi, i32 15
@@ -98,10 +120,12 @@ merge: ; preds = %there, %here
; The gc.relocate type is
diff erent from %arg, but removing the gc.relocate,
; needs a bitcast to be added from ptr addrspace(1) to ptr addrspace(1)
define ptr addrspace(1) @test5(ptr addrspace(1) %arg) gc "statepoint-example" {
+; CHECK-LABEL: @test5(
+; CHECK-NEXT: entry:
+; CHECK-NEXT: [[STATEPOINT_TOKEN:%.*]] = call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 2882400000, i32 0, ptr nonnull elementtype(void ()) @g, i32 0, i32 0, i32 0, i32 0) [ "deopt"(i32 100), "gc-live"() ]
+; CHECK-NEXT: ret ptr addrspace(1) [[ARG:%.*]]
+;
entry:
-; CHECK-LABEL: test5
-; CHECK: gc.statepoint
-; CHECK-NOT: gc.relocate
%statepoint_token = call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 2882400000, i32 0, ptr elementtype(void ()) @g, i32 0, i32 0, i32 0, i32 0) ["gc-live"(ptr addrspace(1) %arg), "deopt" (i32 100)]
%arg.relocated = call coldcc ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token %statepoint_token, i32 0, i32 0) ; (%arg, %arg)
ret ptr addrspace(1) %arg.relocated
More information about the llvm-commits
mailing list