[llvm] 5e3a5d1 - HotColdSplit: Convert tests to opaque pointers
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Sun Nov 27 18:56:29 PST 2022
Author: Matt Arsenault
Date: 2022-11-27T21:42:00-05:00
New Revision: 5e3a5d163d63d8389cba3e7aa69f5067328f7647
URL: https://github.com/llvm/llvm-project/commit/5e3a5d163d63d8389cba3e7aa69f5067328f7647
DIFF: https://github.com/llvm/llvm-project/commit/5e3a5d163d63d8389cba3e7aa69f5067328f7647.diff
LOG: HotColdSplit: Convert tests to opaque pointers
For some reason the script was deleting the assume declaration in
assumption-cache-invalidation.ll, so fixed that manually.
Added:
Modified:
llvm/test/Transforms/HotColdSplit/addr-taken.ll
llvm/test/Transforms/HotColdSplit/apply-penalty-for-inputs.ll
llvm/test/Transforms/HotColdSplit/apply-penalty-for-outputs.ll
llvm/test/Transforms/HotColdSplit/assumption-cache-invalidation.ll
llvm/test/Transforms/HotColdSplit/duplicate-phi-preds-crash.ll
llvm/test/Transforms/HotColdSplit/eh-typeid-for.ll
llvm/test/Transforms/HotColdSplit/lifetime-markers-on-inputs-1.ll
llvm/test/Transforms/HotColdSplit/lifetime-markers-on-inputs-2.ll
llvm/test/Transforms/HotColdSplit/lifetime-markers-on-inputs-3.ll
llvm/test/Transforms/HotColdSplit/mark-the-whole-func-cold.ll
llvm/test/Transforms/HotColdSplit/noreturn.ll
llvm/test/Transforms/HotColdSplit/outline-if-then-else.ll
llvm/test/Transforms/HotColdSplit/outline-multiple-entry-region.ll
llvm/test/Transforms/HotColdSplit/region-overlap.ll
llvm/test/Transforms/HotColdSplit/swifterror.ll
llvm/test/Transforms/HotColdSplit/update-split-loop-metadata.ll
Removed:
################################################################################
diff --git a/llvm/test/Transforms/HotColdSplit/addr-taken.ll b/llvm/test/Transforms/HotColdSplit/addr-taken.ll
index 19f1d4f1974b1..e682214e80808 100644
--- a/llvm/test/Transforms/HotColdSplit/addr-taken.ll
+++ b/llvm/test/Transforms/HotColdSplit/addr-taken.ll
@@ -19,8 +19,8 @@ exit:
ret void
}
- at take_addr_of_foo = global void ()* @foo
- at take_addr_of_bar = global void ()* @bar
+ at take_addr_of_foo = global ptr @foo
+ at take_addr_of_bar = global ptr @bar
; CHECK: attributes #[[outlined_func_attr]] = {
; CHECK-SAME: cold
diff --git a/llvm/test/Transforms/HotColdSplit/apply-penalty-for-inputs.ll b/llvm/test/Transforms/HotColdSplit/apply-penalty-for-inputs.ll
index 4906316816e97..ade8c57d58edd 100644
--- a/llvm/test/Transforms/HotColdSplit/apply-penalty-for-inputs.ll
+++ b/llvm/test/Transforms/HotColdSplit/apply-penalty-for-inputs.ll
@@ -1,12 +1,12 @@
; REQUIRES: asserts
; RUN: opt -hotcoldsplit -debug-only=hotcoldsplit -hotcoldsplit-threshold=2 -hotcoldsplit-max-params=2 -S < %s -o /dev/null 2>&1 | FileCheck %s
-declare void @sink(i32*, i32, i32) cold
+declare void @sink(ptr, i32, i32) cold
@g = global i32 0
define void @foo(i32 %arg) {
- %local = load i32, i32* @g
+ %local = load i32, ptr @g
br i1 undef, label %cold, label %exit
cold:
@@ -14,21 +14,21 @@ cold:
; CHECK-NEXT: Applying penalty for: 2 params
; CHECK-NEXT: Applying penalty for: 0 outputs/split phis
; CHECK-NEXT: penalty = 6
- call void @sink(i32* @g, i32 %arg, i32 %local)
+ call void @sink(ptr @g, i32 %arg, i32 %local)
ret void
exit:
ret void
}
-define void @bar(i32* %p1, i32 %p2, i32 %p3) {
+define void @bar(ptr %p1, i32 %p2, i32 %p3) {
br i1 undef, label %cold, label %exit
cold:
; CHECK: Applying penalty for splitting: 2
; CHECK-NEXT: 3 inputs and 0 outputs exceeds parameter limit (2)
; CHECK-NEXT: penalty = 2147483647
- call void @sink(i32* %p1, i32 %p2, i32 %p3)
+ call void @sink(ptr %p1, i32 %p2, i32 %p3)
ret void
exit:
diff --git a/llvm/test/Transforms/HotColdSplit/apply-penalty-for-outputs.ll b/llvm/test/Transforms/HotColdSplit/apply-penalty-for-outputs.ll
index b7bf760b90c4b..633614a72186b 100644
--- a/llvm/test/Transforms/HotColdSplit/apply-penalty-for-outputs.ll
+++ b/llvm/test/Transforms/HotColdSplit/apply-penalty-for-outputs.ll
@@ -14,7 +14,7 @@ cold:
; CHECK-NEXT: Applying penalty for: 1 params
; CHECK-NEXT: Applying penalty for: 1 outputs/split phis
; CHECK-NEXT: penalty = 7
- %local = load i32, i32* @g
+ %local = load i32, ptr @g
call void @sink()
br label %exit
diff --git a/llvm/test/Transforms/HotColdSplit/assumption-cache-invalidation.ll b/llvm/test/Transforms/HotColdSplit/assumption-cache-invalidation.ll
index 315307fbcc17e..46a94cb955453 100644
--- a/llvm/test/Transforms/HotColdSplit/assumption-cache-invalidation.ll
+++ b/llvm/test/Transforms/HotColdSplit/assumption-cache-invalidation.ll
@@ -23,14 +23,13 @@ target triple = "aarch64"
define void @f() {
entry:
- %i = getelementptr inbounds %a, %a* null, i64 0, i32 1
+ %i = getelementptr inbounds %a, ptr null, i64 0, i32 1
br label %label
label: ; preds = %entry
- %i1 = bitcast i64* %i to %b**
- %load0 = load %b*, %b** %i1, align 8
- %i3 = getelementptr inbounds %b, %b* %load0, i64 undef, i32 0
- %load1 = load i64, i64* %i3, align 8
+ %load0 = load ptr, ptr %i, align 8
+ %i3 = getelementptr inbounds %b, ptr %load0, i64 undef, i32 0
+ %load1 = load i64, ptr %i3, align 8
%cmp0 = icmp ugt i64 %load1, 1
br i1 %cmp0, label %if.then, label %if.else
@@ -38,16 +37,16 @@ if.then: ; preds = %label
unreachable
if.else: ; preds = %label
- call void @g(i8* undef)
- %load2 = load i64, i64* undef, align 8
+ call void @g(ptr undef)
+ %load2 = load i64, ptr undef, align 8
%i7 = and i64 %load2, -16
- %i8 = inttoptr i64 %i7 to i8*
+ %i8 = inttoptr i64 %i7 to ptr
%cmp1 = icmp eq i64 %load1, 0
call void @llvm.assume(i1 %cmp1)
unreachable
}
-declare void @g(i8*)
+declare void @g(ptr)
declare void @llvm.assume(i1 noundef) #0
diff --git a/llvm/test/Transforms/HotColdSplit/duplicate-phi-preds-crash.ll b/llvm/test/Transforms/HotColdSplit/duplicate-phi-preds-crash.ll
index fa68300b0d86b..441d376637358 100644
--- a/llvm/test/Transforms/HotColdSplit/duplicate-phi-preds-crash.ll
+++ b/llvm/test/Transforms/HotColdSplit/duplicate-phi-preds-crash.ll
@@ -5,9 +5,9 @@ target triple = "x86_64-apple-macosx10.14.0"
declare void @sideeffect(i64)
-declare i8* @realloc(i8* %ptr, i64 %size)
+declare ptr @realloc(ptr %ptr, i64 %size)
-declare void @free(i8* %ptr)
+declare void @free(ptr %ptr)
declare void @sink() cold
@@ -15,10 +15,10 @@ declare void @sink() cold
; CHECK: call {{.*}}@sideeffect(
; CHECK: call {{.*}}@realloc(
; CHECK-LABEL: codeRepl:
-; CHECK: call {{.*}}@realloc2.cold.1(i64 %size, i8* %ptr, i8** %retval.0.ce.loc)
+; CHECK: call {{.*}}@realloc2.cold.1(i64 %size, ptr %ptr, ptr %retval.0.ce.loc)
; CHECK-LABEL: cleanup:
-; CHECK-NEXT: phi i8* [ null, %if.then ], [ %call, %if.end ], [ %retval.0.ce.reload, %codeRepl ]
-define i8* @realloc2(i8* %ptr, i64 %size) {
+; CHECK-NEXT: phi ptr [ null, %if.then ], [ %call, %if.end ], [ %retval.0.ce.reload, %codeRepl ]
+define ptr @realloc2(ptr %ptr, i64 %size) {
entry:
%0 = add i64 %size, -1
%1 = icmp ugt i64 %0, 184549375
@@ -29,23 +29,23 @@ if.then: ; preds = %entry
br label %cleanup
if.end: ; preds = %entry
- %call = call i8* @realloc(i8* %ptr, i64 %size)
- %tobool1 = icmp eq i8* %call, null
+ %call = call ptr @realloc(ptr %ptr, i64 %size)
+ %tobool1 = icmp eq ptr %call, null
br i1 %tobool1, label %if.then2, label %cleanup
if.then2: ; preds = %if.end
call void @sideeffect(i64 %size)
call void @sink()
- %tobool3 = icmp eq i8* %ptr, null
+ %tobool3 = icmp eq ptr %ptr, null
br i1 %tobool3, label %cleanup, label %if.then4
if.then4: ; preds = %if.then2
- call void @free(i8* %ptr)
+ call void @free(ptr %ptr)
br label %cleanup
cleanup: ; preds = %if.end, %if.then4, %if.then2, %if.then
- %retval.0 = phi i8* [ null, %if.then ], [ null, %if.then2 ], [ null, %if.then4 ], [ %call, %if.end ]
- ret i8* %retval.0
+ %retval.0 = phi ptr [ null, %if.then ], [ null, %if.then2 ], [ null, %if.then4 ], [ %call, %if.end ]
+ ret ptr %retval.0
}
; CHECK-LABEL: define {{.*}}@realloc2.cold.1(
diff --git a/llvm/test/Transforms/HotColdSplit/eh-typeid-for.ll b/llvm/test/Transforms/HotColdSplit/eh-typeid-for.ll
index 87a5bcc9131ea..a8c5b669f99e2 100644
--- a/llvm/test/Transforms/HotColdSplit/eh-typeid-for.ll
+++ b/llvm/test/Transforms/HotColdSplit/eh-typeid-for.ll
@@ -2,7 +2,7 @@
; Do not outline calls to @llvm.eh.typeid.for. See llvm.org/PR39545.
- at _ZTIi = external constant i8*
+ at _ZTIi = external constant ptr
; CHECK-LABEL: @fun
; CHECK-NOT: call {{.*}}@fun.cold.1
@@ -14,11 +14,11 @@ if.then:
ret void
if.else:
- %t = call i32 @llvm.eh.typeid.for(i8* bitcast (i8** @_ZTIi to i8*))
+ %t = call i32 @llvm.eh.typeid.for(ptr @_ZTIi)
call void @sink()
ret void
}
declare void @sink() cold
-declare i32 @llvm.eh.typeid.for(i8*)
+declare i32 @llvm.eh.typeid.for(ptr)
diff --git a/llvm/test/Transforms/HotColdSplit/lifetime-markers-on-inputs-1.ll b/llvm/test/Transforms/HotColdSplit/lifetime-markers-on-inputs-1.ll
index 6d9214482c8ce..b787bb4022d72 100644
--- a/llvm/test/Transforms/HotColdSplit/lifetime-markers-on-inputs-1.ll
+++ b/llvm/test/Transforms/HotColdSplit/lifetime-markers-on-inputs-1.ll
@@ -1,59 +1,55 @@
; RUN: opt -S -hotcoldsplit -hotcoldsplit-threshold=0 < %s 2>&1 | FileCheck %s
-declare void @llvm.lifetime.start.p0i8(i64, i8* nocapture)
+declare void @llvm.lifetime.start.p0(i64, ptr nocapture)
-declare void @llvm.lifetime.end.p0i8(i64, i8* nocapture)
+declare void @llvm.lifetime.end.p0(i64, ptr nocapture)
-declare void @use(i8*)
+declare void @use(ptr)
-declare void @cold_use2(i8*, i8*) cold
+declare void @cold_use2(ptr, ptr) cold
; CHECK-LABEL: define {{.*}}@foo(
define void @foo() {
entry:
%local1 = alloca i256
%local2 = alloca i256
- %local1_cast = bitcast i256* %local1 to i8*
- %local2_cast = bitcast i256* %local2 to i8*
br i1 undef, label %normalPath, label %outlinedPath
normalPath:
; These two uses of stack slots are non-overlapping. Based on this alone,
; the stack slots could be merged.
- call void @llvm.lifetime.start.p0i8(i64 1, i8* %local1_cast)
- call void @use(i8* %local1_cast)
- call void @llvm.lifetime.end.p0i8(i64 1, i8* %local1_cast)
- call void @llvm.lifetime.start.p0i8(i64 1, i8* %local2_cast)
- call void @use(i8* %local2_cast)
- call void @llvm.lifetime.end.p0i8(i64 1, i8* %local2_cast)
+ call void @llvm.lifetime.start.p0(i64 1, ptr %local1)
+ call void @use(ptr %local1)
+ call void @llvm.lifetime.end.p0(i64 1, ptr %local1)
+ call void @llvm.lifetime.start.p0(i64 1, ptr %local2)
+ call void @use(ptr %local2)
+ call void @llvm.lifetime.end.p0(i64 1, ptr %local2)
ret void
; CHECK-LABEL: codeRepl:
-; CHECK: [[local1_cast:%.*]] = bitcast i256* %local1 to i8*
-; CHECK-NEXT: call void @llvm.lifetime.start.p0i8(i64 -1, i8* [[local1_cast]])
-; CHECK-NEXT: [[local2_cast:%.*]] = bitcast i256* %local2 to i8*
-; CHECK-NEXT: call void @llvm.lifetime.start.p0i8(i64 -1, i8* [[local2_cast]])
-; CHECK-NEXT: call i1 @foo.cold.1(i8* %local1_cast, i8* %local2_cast)
+; CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 -1, ptr %local1)
+; CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 -1, ptr %local2)
+; CHECK-NEXT: call i1 @foo.cold.1(ptr %local1, ptr %local2)
; CHECK-NEXT: br i1
outlinedPath:
; These two uses of stack slots are overlapping. This should prevent
; merging of stack slots. CodeExtractor must replicate the effects of
; these markers in the caller to inhibit stack coloring.
- %gep1 = getelementptr inbounds i8, i8* %local1_cast, i64 1
- call void @llvm.lifetime.start.p0i8(i64 1, i8* %gep1)
- call void @llvm.lifetime.start.p0i8(i64 1, i8* %local2_cast)
- call void @cold_use2(i8* %local1_cast, i8* %local2_cast)
- call void @llvm.lifetime.end.p0i8(i64 1, i8* %gep1)
- call void @llvm.lifetime.end.p0i8(i64 1, i8* %local2_cast)
+ %gep1 = getelementptr inbounds i8, ptr %local1, i64 1
+ call void @llvm.lifetime.start.p0(i64 1, ptr %gep1)
+ call void @llvm.lifetime.start.p0(i64 1, ptr %local2)
+ call void @cold_use2(ptr %local1, ptr %local2)
+ call void @llvm.lifetime.end.p0(i64 1, ptr %gep1)
+ call void @llvm.lifetime.end.p0(i64 1, ptr %local2)
br i1 undef, label %outlinedPath2, label %outlinedPathExit
outlinedPath2:
; These extra lifetime markers are used to test that we emit only one
; pair of guard markers in the caller per memory object.
- call void @llvm.lifetime.start.p0i8(i64 1, i8* %local2_cast)
- call void @use(i8* %local2_cast)
- call void @llvm.lifetime.end.p0i8(i64 1, i8* %local2_cast)
+ call void @llvm.lifetime.start.p0(i64 1, ptr %local2)
+ call void @use(ptr %local2)
+ call void @llvm.lifetime.end.p0(i64 1, ptr %local2)
ret void
outlinedPathExit:
diff --git a/llvm/test/Transforms/HotColdSplit/lifetime-markers-on-inputs-2.ll b/llvm/test/Transforms/HotColdSplit/lifetime-markers-on-inputs-2.ll
index e0df965632abf..dc78c2883e7df 100644
--- a/llvm/test/Transforms/HotColdSplit/lifetime-markers-on-inputs-2.ll
+++ b/llvm/test/Transforms/HotColdSplit/lifetime-markers-on-inputs-2.ll
@@ -1,13 +1,13 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -S -hotcoldsplit -hotcoldsplit-threshold=0 < %s 2>&1 | FileCheck %s
-declare void @llvm.lifetime.start.p0i8(i64, i8* nocapture)
+declare void @llvm.lifetime.start.p0(i64, ptr nocapture)
-declare void @llvm.lifetime.end.p0i8(i64, i8* nocapture)
+declare void @llvm.lifetime.end.p0(i64, ptr nocapture)
-declare void @cold_use(i8*) cold
+declare void @cold_use(ptr) cold
-declare void @use(i8*)
+declare void @use(ptr)
; In this CFG, splitting will extract the blocks extract{1,2}. I.e., it will
; extract a lifetime.start marker, but not the corresponding lifetime.end
@@ -38,28 +38,25 @@ define void @only_lifetime_start_is_cold() {
; CHECK-LABEL: @only_lifetime_start_is_cold(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[LOCAL1:%.*]] = alloca i256
-; CHECK-NEXT: [[LOCAL1_CAST:%.*]] = bitcast i256* [[LOCAL1]] to i8*
; CHECK-NEXT: br i1 undef, label [[CODEREPL:%.*]], label [[NO_EXTRACT1:%.*]]
; CHECK: codeRepl:
-; CHECK-NEXT: [[LT_CAST:%.*]] = bitcast i256* [[LOCAL1]] to i8*
-; CHECK-NEXT: call void @llvm.lifetime.start.p0i8(i64 -1, i8* [[LT_CAST]])
-; CHECK-NEXT: [[TARGETBLOCK:%.*]] = call i1 @only_lifetime_start_is_cold.cold.1(i8* [[LOCAL1_CAST]]) #3
+; CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 -1, ptr [[LOCAL1]])
+; CHECK-NEXT: [[TARGETBLOCK:%.*]] = call i1 @only_lifetime_start_is_cold.cold.1(ptr [[LOCAL1]]) #3
; CHECK-NEXT: br i1 [[TARGETBLOCK]], label [[NO_EXTRACT1]], label [[EXIT:%.*]]
; CHECK: no-extract1:
; CHECK-NEXT: br label [[EXIT]]
; CHECK: exit:
-; CHECK-NEXT: call void @llvm.lifetime.end.p0i8(i64 1, i8* [[LOCAL1_CAST]])
+; CHECK-NEXT: call void @llvm.lifetime.end.p0(i64 1, ptr [[LOCAL1]])
; CHECK-NEXT: ret void
;
entry:
%local1 = alloca i256
- %local1_cast = bitcast i256* %local1 to i8*
br i1 undef, label %extract1, label %no-extract1
extract1:
; lt.start
- call void @llvm.lifetime.start.p0i8(i64 1, i8* %local1_cast)
- call void @cold_use(i8* %local1_cast)
+ call void @llvm.lifetime.start.p0(i64 1, ptr %local1)
+ call void @cold_use(ptr %local1)
br i1 undef, label %extract2, label %no-extract1
extract2:
@@ -70,7 +67,7 @@ no-extract1:
exit:
; lt.end
- call void @llvm.lifetime.end.p0i8(i64 1, i8* %local1_cast)
+ call void @llvm.lifetime.end.p0(i64 1, ptr %local1)
ret void
}
@@ -99,14 +96,13 @@ define void @only_lifetime_end_is_cold() {
; CHECK-LABEL: @only_lifetime_end_is_cold(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[LOCAL1:%.*]] = alloca i256
-; CHECK-NEXT: [[LOCAL1_CAST:%.*]] = bitcast i256* [[LOCAL1]] to i8*
-; CHECK-NEXT: call void @llvm.lifetime.start.p0i8(i64 1, i8* [[LOCAL1_CAST]])
+; CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 1, ptr [[LOCAL1]])
; CHECK-NEXT: br i1 undef, label [[NO_EXTRACT1:%.*]], label [[CODEREPL:%.*]]
; CHECK: no-extract1:
-; CHECK-NEXT: call void @llvm.lifetime.end.p0i8(i64 1, i8* [[LOCAL1_CAST]])
+; CHECK-NEXT: call void @llvm.lifetime.end.p0(i64 1, ptr [[LOCAL1]])
; CHECK-NEXT: br label [[EXIT:%.*]]
; CHECK: codeRepl:
-; CHECK-NEXT: call void @only_lifetime_end_is_cold.cold.1(i8* [[LOCAL1_CAST]]) #3
+; CHECK-NEXT: call void @only_lifetime_end_is_cold.cold.1(ptr [[LOCAL1]]) #3
; CHECK-NEXT: br label [[EXIT]]
; CHECK: exit:
; CHECK-NEXT: ret void
@@ -114,19 +110,18 @@ define void @only_lifetime_end_is_cold() {
entry:
; lt.start
%local1 = alloca i256
- %local1_cast = bitcast i256* %local1 to i8*
- call void @llvm.lifetime.start.p0i8(i64 1, i8* %local1_cast)
+ call void @llvm.lifetime.start.p0(i64 1, ptr %local1)
br i1 undef, label %no-extract1, label %extract1
no-extract1:
; lt.end
- call void @llvm.lifetime.end.p0i8(i64 1, i8* %local1_cast)
+ call void @llvm.lifetime.end.p0(i64 1, ptr %local1)
br label %exit
extract1:
; lt.end
- call void @cold_use(i8* %local1_cast)
- call void @llvm.lifetime.end.p0i8(i64 1, i8* %local1_cast)
+ call void @cold_use(ptr %local1)
+ call void @llvm.lifetime.end.p0(i64 1, ptr %local1)
br label %exit
exit:
@@ -139,14 +134,13 @@ define void @do_not_lift_lifetime_end() {
; CHECK-LABEL: @do_not_lift_lifetime_end(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[LOCAL1:%.*]] = alloca i256
-; CHECK-NEXT: [[LOCAL1_CAST:%.*]] = bitcast i256* [[LOCAL1]] to i8*
-; CHECK-NEXT: call void @llvm.lifetime.start.p0i8(i64 1, i8* [[LOCAL1_CAST]])
+; CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 1, ptr [[LOCAL1]])
; CHECK-NEXT: br label [[HEADER:%.*]]
; CHECK: header:
-; CHECK-NEXT: call void @use(i8* [[LOCAL1_CAST]])
+; CHECK-NEXT: call void @use(ptr [[LOCAL1]])
; CHECK-NEXT: br i1 undef, label [[EXIT:%.*]], label [[CODEREPL:%.*]]
; CHECK: codeRepl:
-; CHECK-NEXT: [[TARGETBLOCK:%.*]] = call i1 @do_not_lift_lifetime_end.cold.1(i8* [[LOCAL1_CAST]]) #3
+; CHECK-NEXT: [[TARGETBLOCK:%.*]] = call i1 @do_not_lift_lifetime_end.cold.1(ptr [[LOCAL1]]) #3
; CHECK-NEXT: br i1 [[TARGETBLOCK]], label [[HEADER]], label [[EXIT]]
; CHECK: exit:
; CHECK-NEXT: ret void
@@ -154,18 +148,17 @@ define void @do_not_lift_lifetime_end() {
entry:
; lt.start
%local1 = alloca i256
- %local1_cast = bitcast i256* %local1 to i8*
- call void @llvm.lifetime.start.p0i8(i64 1, i8* %local1_cast)
+ call void @llvm.lifetime.start.p0(i64 1, ptr %local1)
br label %header
header:
; If the lifetime.end marker is lifted, this use becomes dead the second time
; the header block is executed.
- call void @use(i8* %local1_cast)
+ call void @use(ptr %local1)
br i1 undef, label %exit, label %extract1
extract1:
- call void @cold_use(i8* %local1_cast)
+ call void @cold_use(ptr %local1)
br i1 undef, label %extract2, label %extract3
extract2:
@@ -174,7 +167,7 @@ extract2:
extract3:
; lt.end
- call void @llvm.lifetime.end.p0i8(i64 1, i8* %local1_cast)
+ call void @llvm.lifetime.end.p0(i64 1, ptr %local1)
br label %exit
exit:
diff --git a/llvm/test/Transforms/HotColdSplit/lifetime-markers-on-inputs-3.ll b/llvm/test/Transforms/HotColdSplit/lifetime-markers-on-inputs-3.ll
index 6da31fbccf384..1987a7fd16b28 100644
--- a/llvm/test/Transforms/HotColdSplit/lifetime-markers-on-inputs-3.ll
+++ b/llvm/test/Transforms/HotColdSplit/lifetime-markers-on-inputs-3.ll
@@ -3,40 +3,36 @@
%type1 = type opaque
%type2 = type opaque
-declare void @llvm.lifetime.start.p0i8(i64, i8* nocapture)
+declare void @llvm.lifetime.start.p0(i64, ptr nocapture)
-declare void @llvm.lifetime.end.p0i8(i64, i8* nocapture)
+declare void @llvm.lifetime.end.p0(i64, ptr nocapture)
-declare void @use(%type1**, %type2**)
+declare void @use(ptr, ptr)
-declare void @use2(%type1**, %type2**) cold
+declare void @use2(ptr, ptr) cold
; CHECK-LABEL: define {{.*}}@foo(
define void @foo() {
entry:
- %local1 = alloca %type1*
- %local2 = alloca %type2*
- %local1_cast = bitcast %type1** %local1 to i8*
- %local2_cast = bitcast %type2** %local2 to i8*
+ %local1 = alloca ptr
+ %local2 = alloca ptr
br i1 undef, label %normalPath, label %outlinedPath
normalPath:
- call void @use(%type1** %local1, %type2** %local2)
+ call void @use(ptr %local1, ptr %local2)
ret void
; CHECK-LABEL: codeRepl:
-; CHECK: [[local1_cast:%.*]] = bitcast %type1** %local1 to i8*
-; CHECK-NEXT: call void @llvm.lifetime.start.p0i8(i64 -1, i8* [[local1_cast]])
-; CHECK-NEXT: [[local2_cast:%.*]] = bitcast %type2** %local2 to i8*
-; CHECK-NEXT: call void @llvm.lifetime.start.p0i8(i64 -1, i8* [[local2_cast]])
-; CHECK-NEXT: call void @foo.cold.1(i8* %local1_cast, i8* %local2_cast
+; CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 -1, ptr %local1)
+; CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 -1, ptr %local2)
+; CHECK-NEXT: call void @foo.cold.1(ptr %local1, ptr %local2
outlinedPath:
- call void @llvm.lifetime.start.p0i8(i64 1, i8* %local1_cast)
- call void @llvm.lifetime.start.p0i8(i64 1, i8* %local2_cast)
- call void @use2(%type1** %local1, %type2** %local2)
- call void @llvm.lifetime.end.p0i8(i64 1, i8* %local1_cast)
- call void @llvm.lifetime.end.p0i8(i64 1, i8* %local2_cast)
+ call void @llvm.lifetime.start.p0(i64 1, ptr %local1)
+ call void @llvm.lifetime.start.p0(i64 1, ptr %local2)
+ call void @use2(ptr %local1, ptr %local2)
+ call void @llvm.lifetime.end.p0(i64 1, ptr %local1)
+ call void @llvm.lifetime.end.p0(i64 1, ptr %local2)
br label %outlinedPathExit
outlinedPathExit:
diff --git a/llvm/test/Transforms/HotColdSplit/mark-the-whole-func-cold.ll b/llvm/test/Transforms/HotColdSplit/mark-the-whole-func-cold.ll
index cc87f617b4f4d..34465a1459eac 100644
--- a/llvm/test/Transforms/HotColdSplit/mark-the-whole-func-cold.ll
+++ b/llvm/test/Transforms/HotColdSplit/mark-the-whole-func-cold.ll
@@ -27,14 +27,14 @@ target triple = "x86_64-apple-macosx10.14.0"
define void @_Z3fooii(i32, i32) {
%3 = alloca i32, align 4
%4 = alloca i32, align 4
- store i32 %0, i32* %3, align 4
- store i32 %1, i32* %4, align 4
- %5 = load i32, i32* %3, align 4
+ store i32 %0, ptr %3, align 4
+ store i32 %1, ptr %4, align 4
+ %5 = load i32, ptr %3, align 4
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %13
; <label>:7: ; preds = %2
- %8 = load i32, i32* %4, align 4
+ %8 = load i32, ptr %4, align 4
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %11
diff --git a/llvm/test/Transforms/HotColdSplit/noreturn.ll b/llvm/test/Transforms/HotColdSplit/noreturn.ll
index 74f4cb18c7fb6..fa7222ded94ad 100644
--- a/llvm/test/Transforms/HotColdSplit/noreturn.ll
+++ b/llvm/test/Transforms/HotColdSplit/noreturn.ll
@@ -10,13 +10,13 @@ target triple = "x86_64-apple-macosx10.14.0"
; CHECK-LABEL: define {{.*}}@foo(
; CHECK-NOT: foo.cold.1
-define void @foo(i32, %struct.__jmp_buf_tag*) {
+define void @foo(i32, ptr) {
%3 = icmp eq i32 %0, 0
tail call void @_Z10sideeffectv()
br i1 %3, label %5, label %4
; <label>:4: ; preds = %2
- tail call void @longjmp(%struct.__jmp_buf_tag* %1, i32 0)
+ tail call void @longjmp(ptr %1, i32 0)
unreachable
; <label>:5: ; preds = %2
@@ -63,14 +63,14 @@ exit:
; CHECK-LABEL: define {{.*}}@baz(
; CHECK: call {{.*}}@baz.cold.1(
-define void @baz(i32, %struct.__jmp_buf_tag*) {
+define void @baz(i32, ptr) {
%3 = icmp eq i32 %0, 0
tail call void @_Z10sideeffectv()
br i1 %3, label %5, label %4
; <label>:4: ; preds = %2
call void @sink()
- tail call void @longjmp(%struct.__jmp_buf_tag* %1, i32 0)
+ tail call void @longjmp(ptr %1, i32 0)
unreachable
; <label>:5: ; preds = %2
@@ -88,4 +88,4 @@ declare void @llvm.trap() noreturn cold
declare void @_Z10sideeffectv()
-declare void @longjmp(%struct.__jmp_buf_tag*, i32) noreturn nounwind
+declare void @longjmp(ptr, i32) noreturn nounwind
diff --git a/llvm/test/Transforms/HotColdSplit/outline-if-then-else.ll b/llvm/test/Transforms/HotColdSplit/outline-if-then-else.ll
index faf663c71c54c..e91fa48e43100 100644
--- a/llvm/test/Transforms/HotColdSplit/outline-if-then-else.ll
+++ b/llvm/test/Transforms/HotColdSplit/outline-if-then-else.ll
@@ -27,13 +27,13 @@ target triple = "x86_64-apple-macosx10.14.0"
define void @foo(i32 %cond) {
entry:
%cond.addr = alloca i32
- store i32 %cond, i32* %cond.addr
- %0 = load i32, i32* %cond.addr
+ store i32 %cond, ptr %cond.addr
+ %0 = load i32, ptr %cond.addr
%tobool = icmp ne i32 %0, 0
br i1 %tobool, label %if.then, label %if.end2
if.then: ; preds = %entry
- %1 = load i32, i32* %cond.addr
+ %1 = load i32, ptr %cond.addr
%cmp = icmp sgt i32 %1, 10
br i1 %cmp, label %if.then1, label %if.else
diff --git a/llvm/test/Transforms/HotColdSplit/outline-multiple-entry-region.ll b/llvm/test/Transforms/HotColdSplit/outline-multiple-entry-region.ll
index 0275715fc0a10..0cbc35e60f3b1 100644
--- a/llvm/test/Transforms/HotColdSplit/outline-multiple-entry-region.ll
+++ b/llvm/test/Transforms/HotColdSplit/outline-multiple-entry-region.ll
@@ -37,12 +37,12 @@ target triple = "x86_64-apple-macosx10.14.0"
define void @_Z3fooii(i32, i32) {
%3 = alloca i32, align 4
%4 = alloca i32, align 4
- store i32 %0, i32* %3, align 4
- store i32 %1, i32* %4, align 4
+ store i32 %0, ptr %3, align 4
+ store i32 %1, ptr %4, align 4
br label %5
; <label>:5: ; preds = %2
- %6 = load i32, i32* %3, align 4
+ %6 = load i32, ptr %3, align 4
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %9
@@ -51,7 +51,7 @@ define void @_Z3fooii(i32, i32) {
br label %14
; <label>:9: ; preds = %5
- %10 = load i32, i32* %4, align 4
+ %10 = load i32, ptr %4, align 4
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %13
diff --git a/llvm/test/Transforms/HotColdSplit/region-overlap.ll b/llvm/test/Transforms/HotColdSplit/region-overlap.ll
index 6ab65c069ec91..17f81775ad0a2 100644
--- a/llvm/test/Transforms/HotColdSplit/region-overlap.ll
+++ b/llvm/test/Transforms/HotColdSplit/region-overlap.ll
@@ -27,14 +27,14 @@ target triple = "x86_64-apple-macosx10.14.0"
define void @_Z3fooii(i32, i32) {
%3 = alloca i32, align 4
%4 = alloca i32, align 4
- store i32 %0, i32* %3, align 4
- store i32 %1, i32* %4, align 4
- %5 = load i32, i32* %3, align 4
+ store i32 %0, ptr %3, align 4
+ store i32 %1, ptr %4, align 4
+ %5 = load i32, ptr %3, align 4
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %12
; <label>:7: ; preds = %2
- %8 = load i32, i32* %4, align 4
+ %8 = load i32, ptr %4, align 4
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %11
diff --git a/llvm/test/Transforms/HotColdSplit/swifterror.ll b/llvm/test/Transforms/HotColdSplit/swifterror.ll
index b97b0fa005e71..71a0f7d0d4ab4 100644
--- a/llvm/test/Transforms/HotColdSplit/swifterror.ll
+++ b/llvm/test/Transforms/HotColdSplit/swifterror.ll
@@ -8,12 +8,12 @@ target triple = "x86_64-apple-macosx10.14.0"
declare void @sink() cold
; CHECK-LABEL: define {{.*}}@in_arg(
-; CHECK: call void @in_arg.cold.1(%swift_error** swifterror
-define void @in_arg(%swift_error** swifterror %error_ptr_ref) {
+; CHECK: call void @in_arg.cold.1(ptr swifterror
+define void @in_arg(ptr swifterror %error_ptr_ref) {
br i1 undef, label %cold, label %exit
cold:
- store %swift_error* undef, %swift_error** %error_ptr_ref
+ store ptr undef, ptr %error_ptr_ref
call void @sink()
br label %exit
@@ -22,13 +22,13 @@ exit:
}
; CHECK-LABEL: define {{.*}}@in_alloca(
-; CHECK: call void @in_alloca.cold.1(%swift_error** swifterror
+; CHECK: call void @in_alloca.cold.1(ptr swifterror
define void @in_alloca() {
- %err = alloca swifterror %swift_error*
+ %err = alloca swifterror ptr
br i1 undef, label %cold, label %exit
cold:
- store %swift_error* undef, %swift_error** %err
+ store ptr undef, ptr %err
call void @sink()
br label %exit
diff --git a/llvm/test/Transforms/HotColdSplit/update-split-loop-metadata.ll b/llvm/test/Transforms/HotColdSplit/update-split-loop-metadata.ll
index ccfe84fe79793..bd1e024d4c62c 100644
--- a/llvm/test/Transforms/HotColdSplit/update-split-loop-metadata.ll
+++ b/llvm/test/Transforms/HotColdSplit/update-split-loop-metadata.ll
@@ -14,7 +14,7 @@ target triple = "x86_64-apple-macosx10.14.0"
; CHECK: [[LOOP_MD]] = distinct !{[[LOOP_MD]], [[LINE:![0-9]+]], [[LINE]]}
; CHECK: [[LINE]] = !DILocation(line: 1, column: 1, scope: [[SCOPE]])
-define void @basic(i32* %p, i32 %k) !dbg !6 {
+define void @basic(ptr %p, i32 %k) !dbg !6 {
entry:
%cmp3 = icmp slt i32 0, %k
br i1 %cmp3, label %for.body.lr.ph, label %for.end
@@ -24,9 +24,9 @@ for.body.lr.ph: ; preds = %entry
for.body: ; preds = %for.body.lr.ph, %for.body
%i.05 = phi i32 [ 0, %for.body.lr.ph ], [ %inc, %for.body ]
- %p.addr.04 = phi i32* [ %p, %for.body.lr.ph ], [ %incdec.ptr, %for.body ]
- %incdec.ptr = getelementptr inbounds i32, i32* %p.addr.04, i32 1
- store i32 %i.05, i32* %p.addr.04, align 4
+ %p.addr.04 = phi ptr [ %p, %for.body.lr.ph ], [ %incdec.ptr, %for.body ]
+ %incdec.ptr = getelementptr inbounds i32, ptr %p.addr.04, i32 1
+ store i32 %i.05, ptr %p.addr.04, align 4
%inc = add nsw i32 %i.05, 1
call void @sink()
%cmp = icmp slt i32 %inc, %k
More information about the llvm-commits
mailing list