[llvm] 0271ae6 - [test] Change test/SampleProfile to use opaque pointers
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Sun Jul 17 17:38:40 PDT 2022
Author: Fangrui Song
Date: 2022-07-17T17:38:35-07:00
New Revision: 0271ae65a66367d802fa6866599d11e35f68450f
URL: https://github.com/llvm/llvm-project/commit/0271ae65a66367d802fa6866599d11e35f68450f
DIFF: https://github.com/llvm/llvm-project/commit/0271ae65a66367d802fa6866599d11e35f68450f.diff
LOG: [test] Change test/SampleProfile to use opaque pointers
Added:
Modified:
llvm/test/Transforms/SampleProfile/Inputs/profile-symbol-list.ll
llvm/test/Transforms/SampleProfile/branch.ll
llvm/test/Transforms/SampleProfile/calls.ll
llvm/test/Transforms/SampleProfile/cold-indirect-call.ll
llvm/test/Transforms/SampleProfile/cov-zero-samples.ll
llvm/test/Transforms/SampleProfile/coverage-warning.ll
llvm/test/Transforms/SampleProfile/csspgo-inline-debug.ll
llvm/test/Transforms/SampleProfile/csspgo-inline-icall.ll
llvm/test/Transforms/SampleProfile/csspgo-inline.ll
llvm/test/Transforms/SampleProfile/csspgo-summary.ll
llvm/test/Transforms/SampleProfile/csspgo-use-preinliner.ll
llvm/test/Transforms/SampleProfile/discriminator.ll
llvm/test/Transforms/SampleProfile/early-inline.ll
llvm/test/Transforms/SampleProfile/entry_counts_cold.ll
llvm/test/Transforms/SampleProfile/entry_counts_missing_dbginfo.ll
llvm/test/Transforms/SampleProfile/fnptr.ll
llvm/test/Transforms/SampleProfile/function_metadata.ll
llvm/test/Transforms/SampleProfile/gcc-simple.ll
llvm/test/Transforms/SampleProfile/indirect-call-gcc.ll
llvm/test/Transforms/SampleProfile/indirect-call.ll
llvm/test/Transforms/SampleProfile/inline-act.ll
llvm/test/Transforms/SampleProfile/inline-callee-update.ll
llvm/test/Transforms/SampleProfile/inline-cold.ll
llvm/test/Transforms/SampleProfile/inline-combine.ll
llvm/test/Transforms/SampleProfile/inline-coverage.ll
llvm/test/Transforms/SampleProfile/inline-mergeprof-dup.ll
llvm/test/Transforms/SampleProfile/inline-mergeprof.ll
llvm/test/Transforms/SampleProfile/inline-noduplicate.ll
llvm/test/Transforms/SampleProfile/inline-replay.ll
llvm/test/Transforms/SampleProfile/inline-stats.ll
llvm/test/Transforms/SampleProfile/inline-topdown.ll
llvm/test/Transforms/SampleProfile/inline.ll
llvm/test/Transforms/SampleProfile/nodebug-error.ll
llvm/test/Transforms/SampleProfile/nolocinfo.ll
llvm/test/Transforms/SampleProfile/norepeated-icp-2.ll
llvm/test/Transforms/SampleProfile/norepeated-icp-3.ll
llvm/test/Transforms/SampleProfile/norepeated-icp-4.ll
llvm/test/Transforms/SampleProfile/norepeated-icp.ll
llvm/test/Transforms/SampleProfile/offset.ll
llvm/test/Transforms/SampleProfile/profile-context-order.ll
llvm/test/Transforms/SampleProfile/profile-context-tracker-debug.ll
llvm/test/Transforms/SampleProfile/profile-context-tracker.ll
llvm/test/Transforms/SampleProfile/profile-correlation-irreducible-loops.ll
llvm/test/Transforms/SampleProfile/profile-format-compress.ll
llvm/test/Transforms/SampleProfile/profile-format.ll
llvm/test/Transforms/SampleProfile/profile-inference-noprobes.ll
llvm/test/Transforms/SampleProfile/profile-inference.ll
llvm/test/Transforms/SampleProfile/profile-sample-accurate.ll
llvm/test/Transforms/SampleProfile/profile-topdown-order.ll
llvm/test/Transforms/SampleProfile/propagate.ll
llvm/test/Transforms/SampleProfile/pseudo-probe-dangle2.ll
llvm/test/Transforms/SampleProfile/pseudo-probe-discriminator.ll
llvm/test/Transforms/SampleProfile/pseudo-probe-emit.ll
llvm/test/Transforms/SampleProfile/pseudo-probe-inline.ll
llvm/test/Transforms/SampleProfile/pseudo-probe-instcombine.ll
llvm/test/Transforms/SampleProfile/pseudo-probe-loop-deletion.ll
llvm/test/Transforms/SampleProfile/pseudo-probe-memset.ll
llvm/test/Transforms/SampleProfile/pseudo-probe-peep.ll
llvm/test/Transforms/SampleProfile/pseudo-probe-profile-metadata-2.ll
llvm/test/Transforms/SampleProfile/pseudo-probe-profile-metadata.ll
llvm/test/Transforms/SampleProfile/pseudo-probe-profile.ll
llvm/test/Transforms/SampleProfile/pseudo-probe-selectionDAG.ll
llvm/test/Transforms/SampleProfile/pseudo-probe-slotindex.ll
llvm/test/Transforms/SampleProfile/pseudo-probe-twoaddr.ll
llvm/test/Transforms/SampleProfile/pseudo-probe-verify.ll
llvm/test/Transforms/SampleProfile/remap-2.ll
llvm/test/Transforms/SampleProfile/remarks.ll
llvm/test/Transforms/SampleProfile/uniqname.ll
llvm/test/Transforms/SampleProfile/use-sample-profile-attr.ll
llvm/test/Transforms/SampleProfile/warm-inline-instance.ll
Removed:
################################################################################
diff --git a/llvm/test/Transforms/SampleProfile/Inputs/profile-symbol-list.ll b/llvm/test/Transforms/SampleProfile/Inputs/profile-symbol-list.ll
index f30df4e6ba4f..b8e64e82b971 100644
--- a/llvm/test/Transforms/SampleProfile/Inputs/profile-symbol-list.ll
+++ b/llvm/test/Transforms/SampleProfile/Inputs/profile-symbol-list.ll
@@ -83,12 +83,12 @@ while.body: ; preds = %while.body, %entry
br i1 %exitcond.4, label %while.end, label %while.body, !dbg !27, !llvm.loop !28
while.end: ; preds = %while.body
- %call2 = tail call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %spec.select.4), !dbg !31
+ %call2 = tail call i32 (ptr, ...) @printf(ptr @.str, i32 %spec.select.4), !dbg !31
ret i32 0, !dbg !32
}
; Function Attrs: nofree nounwind
-declare dso_local i32 @printf(i8* nocapture readonly, ...) local_unnamed_addr #3
+declare dso_local i32 @printf(ptr nocapture readonly, ...) local_unnamed_addr #3
attributes #0 = { noinline norecurse nounwind readnone uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="none" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" "use-sample-profile" }
attributes #1 = { norecurse nounwind readnone uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="none" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" "use-sample-profile" }
diff --git a/llvm/test/Transforms/SampleProfile/branch.ll b/llvm/test/Transforms/SampleProfile/branch.ll
index a65e3bb04ab5..96bd2b1971d4 100644
--- a/llvm/test/Transforms/SampleProfile/branch.ll
+++ b/llvm/test/Transforms/SampleProfile/branch.ll
@@ -29,63 +29,63 @@
@.str = private unnamed_addr constant [15 x i8] c"result is %lf\0A\00", align 1
; Function Attrs: uwtable
-define i32 @main(i32 %argc, i8** %argv) #0 !dbg !6 {
+define i32 @main(i32 %argc, ptr %argv) #0 !dbg !6 {
; CHECK: Printing analysis {{.*}} for function 'main':
entry:
%retval = alloca i32, align 4
%argc.addr = alloca i32, align 4
- %argv.addr = alloca i8**, align 8
+ %argv.addr = alloca ptr, align 8
%result = alloca double, align 8
%limit = alloca i32, align 4
%s = alloca double, align 8
%u = alloca i32, align 4
%x = alloca double, align 8
- store i32 0, i32* %retval, align 4
- store i32 %argc, i32* %argc.addr, align 4
- call void @llvm.dbg.declare(metadata i32* %argc.addr, metadata !16, metadata !17), !dbg !18
- store i8** %argv, i8*** %argv.addr, align 8
- call void @llvm.dbg.declare(metadata i8*** %argv.addr, metadata !19, metadata !17), !dbg !20
- %0 = load i32, i32* %argc.addr, align 4, !dbg !21
+ store i32 0, ptr %retval, align 4
+ store i32 %argc, ptr %argc.addr, align 4
+ call void @llvm.dbg.declare(metadata ptr %argc.addr, metadata !16, metadata !17), !dbg !18
+ store ptr %argv, ptr %argv.addr, align 8
+ call void @llvm.dbg.declare(metadata ptr %argv.addr, metadata !19, metadata !17), !dbg !20
+ %0 = load i32, ptr %argc.addr, align 4, !dbg !21
%cmp = icmp slt i32 %0, 2, !dbg !23
br i1 %cmp, label %if.then, label %if.end, !dbg !24
; CHECK: edge entry -> if.then probability is 0x4ccf6b16 / 0x80000000 = 60.01%
; CHECK: edge entry -> if.end probability is 0x333094ea / 0x80000000 = 39.99%
if.then: ; preds = %entry
- store i32 1, i32* %retval, align 4, !dbg !25
+ store i32 1, ptr %retval, align 4, !dbg !25
br label %return, !dbg !25
if.end: ; preds = %entry
- call void @llvm.dbg.declare(metadata double* %result, metadata !26, metadata !17), !dbg !27
- call void @llvm.dbg.declare(metadata i32* %limit, metadata !28, metadata !17), !dbg !29
- %1 = load i8**, i8*** %argv.addr, align 8, !dbg !30
- %arrayidx = getelementptr inbounds i8*, i8** %1, i64 1, !dbg !30
- %2 = load i8*, i8** %arrayidx, align 8, !dbg !30
- %call = call i32 @atoi(i8* %2) #4, !dbg !31
- store i32 %call, i32* %limit, align 4, !dbg !29
- %3 = load i32, i32* %limit, align 4, !dbg !32
+ call void @llvm.dbg.declare(metadata ptr %result, metadata !26, metadata !17), !dbg !27
+ call void @llvm.dbg.declare(metadata ptr %limit, metadata !28, metadata !17), !dbg !29
+ %1 = load ptr, ptr %argv.addr, align 8, !dbg !30
+ %arrayidx = getelementptr inbounds ptr, ptr %1, i64 1, !dbg !30
+ %2 = load ptr, ptr %arrayidx, align 8, !dbg !30
+ %call = call i32 @atoi(ptr %2) #4, !dbg !31
+ store i32 %call, ptr %limit, align 4, !dbg !29
+ %3 = load i32, ptr %limit, align 4, !dbg !32
%cmp1 = icmp sgt i32 %3, 100, !dbg !34
br i1 %cmp1, label %if.then.2, label %if.else, !dbg !35
; CHECK: edge if.end -> if.then.2 probability is 0x6652c748 / 0x80000000 = 79.94%
; CHECK: edge if.end -> if.else probability is 0x19ad38b8 / 0x80000000 = 20.06%
if.then.2: ; preds = %if.end
- call void @llvm.dbg.declare(metadata double* %s, metadata !36, metadata !17), !dbg !38
- %4 = load i8**, i8*** %argv.addr, align 8, !dbg !39
- %arrayidx3 = getelementptr inbounds i8*, i8** %4, i64 2, !dbg !39
- %5 = load i8*, i8** %arrayidx3, align 8, !dbg !39
- %call4 = call i32 @atoi(i8* %5) #4, !dbg !40
+ call void @llvm.dbg.declare(metadata ptr %s, metadata !36, metadata !17), !dbg !38
+ %4 = load ptr, ptr %argv.addr, align 8, !dbg !39
+ %arrayidx3 = getelementptr inbounds ptr, ptr %4, i64 2, !dbg !39
+ %5 = load ptr, ptr %arrayidx3, align 8, !dbg !39
+ %call4 = call i32 @atoi(ptr %5) #4, !dbg !40
%conv = sitofp i32 %call4 to double, !dbg !40
%mul = fmul double 0x40370ABE6A337A81, %conv, !dbg !41
- store double %mul, double* %s, align 8, !dbg !38
- call void @llvm.dbg.declare(metadata i32* %u, metadata !42, metadata !17), !dbg !44
- store i32 0, i32* %u, align 4, !dbg !44
+ store double %mul, ptr %s, align 8, !dbg !38
+ call void @llvm.dbg.declare(metadata ptr %u, metadata !42, metadata !17), !dbg !44
+ store i32 0, ptr %u, align 4, !dbg !44
br label %for.cond, !dbg !45
for.cond: ; preds = %for.inc, %if.then.2
- %6 = load i32, i32* %u, align 4, !dbg !46
- %7 = load i32, i32* %limit, align 4, !dbg !48
+ %6 = load i32, ptr %u, align 4, !dbg !46
+ %7 = load i32, ptr %limit, align 4, !dbg !48
%cmp5 = icmp slt i32 %6, %7, !dbg !49
br i1 %cmp5, label %for.body, label %for.end, !dbg !50, !prof !80
; CHECK: edge for.cond -> for.body probability is 0x73333333 / 0x80000000 = 90.00%
@@ -94,53 +94,53 @@ for.cond: ; preds = %for.inc, %if.then.2
; OVW: edge for.cond -> for.end probability is 0x094c0c42 / 0x80000000 = 7.26%
for.body: ; preds = %for.cond
- call void @llvm.dbg.declare(metadata double* %x, metadata !51, metadata !17), !dbg !53
- %8 = load double, double* %s, align 8, !dbg !54
- store double %8, double* %x, align 8, !dbg !53
- %9 = load double, double* %x, align 8, !dbg !55
+ call void @llvm.dbg.declare(metadata ptr %x, metadata !51, metadata !17), !dbg !53
+ %8 = load double, ptr %s, align 8, !dbg !54
+ store double %8, ptr %x, align 8, !dbg !53
+ %9 = load double, ptr %x, align 8, !dbg !55
%add = fadd double %9, 3.049000e+00, !dbg !56
- %10 = load i32, i32* %u, align 4, !dbg !57
+ %10 = load i32, ptr %u, align 4, !dbg !57
%conv6 = sitofp i32 %10 to double, !dbg !57
%add7 = fadd double %add, %conv6, !dbg !58
- store double %add7, double* %s, align 8, !dbg !59
- %11 = load double, double* %s, align 8, !dbg !60
- %12 = load double, double* %x, align 8, !dbg !61
+ store double %add7, ptr %s, align 8, !dbg !59
+ %11 = load double, ptr %s, align 8, !dbg !60
+ %12 = load double, ptr %x, align 8, !dbg !61
%div = fdiv double 3.940000e+00, %12, !dbg !62
%mul8 = fmul double %div, 3.200000e-01, !dbg !63
%add9 = fadd double %11, %mul8, !dbg !64
- %13 = load double, double* %s, align 8, !dbg !65
+ %13 = load double, ptr %s, align 8, !dbg !65
%sub = fsub double %13, %add9, !dbg !65
- store double %sub, double* %s, align 8, !dbg !65
+ store double %sub, ptr %s, align 8, !dbg !65
br label %for.inc, !dbg !66
for.inc: ; preds = %for.body
- %14 = load i32, i32* %u, align 4, !dbg !67
+ %14 = load i32, ptr %u, align 4, !dbg !67
%inc = add nsw i32 %14, 1, !dbg !67
- store i32 %inc, i32* %u, align 4, !dbg !67
+ store i32 %inc, ptr %u, align 4, !dbg !67
br label %for.cond, !dbg !68
for.end: ; preds = %for.cond
- %15 = load double, double* %s, align 8, !dbg !69
- store double %15, double* %result, align 8, !dbg !70
+ %15 = load double, ptr %s, align 8, !dbg !69
+ store double %15, ptr %result, align 8, !dbg !70
br label %if.end.13, !dbg !71
if.else: ; preds = %if.end
- %16 = load i8**, i8*** %argv.addr, align 8, !dbg !72
- %arrayidx10 = getelementptr inbounds i8*, i8** %16, i64 2, !dbg !72
- %17 = load i8*, i8** %arrayidx10, align 8, !dbg !72
- %call11 = call i32 @atoi(i8* %17) #4, !dbg !74
+ %16 = load ptr, ptr %argv.addr, align 8, !dbg !72
+ %arrayidx10 = getelementptr inbounds ptr, ptr %16, i64 2, !dbg !72
+ %17 = load ptr, ptr %arrayidx10, align 8, !dbg !72
+ %call11 = call i32 @atoi(ptr %17) #4, !dbg !74
%conv12 = sitofp i32 %call11 to double, !dbg !74
- store double %conv12, double* %result, align 8, !dbg !75
+ store double %conv12, ptr %result, align 8, !dbg !75
br label %if.end.13
if.end.13: ; preds = %if.else, %for.end
- %18 = load double, double* %result, align 8, !dbg !76
- %call14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i32 0, i32 0), double %18), !dbg !77
- store i32 0, i32* %retval, align 4, !dbg !78
+ %18 = load double, ptr %result, align 8, !dbg !76
+ %call14 = call i32 (ptr, ...) @printf(ptr @.str, double %18), !dbg !77
+ store i32 0, ptr %retval, align 4, !dbg !78
br label %return, !dbg !78
return: ; preds = %if.end.13, %if.then
- %19 = load i32, i32* %retval, align 4, !dbg !79
+ %19 = load i32, ptr %retval, align 4, !dbg !79
ret i32 %19, !dbg !79
}
@@ -148,9 +148,9 @@ return: ; preds = %if.end.13, %if.then
declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
; Function Attrs: nounwind readonly
-declare i32 @atoi(i8*) #2
+declare i32 @atoi(ptr) #2
-declare i32 @printf(i8*, ...) #3
+declare i32 @printf(ptr, ...) #3
attributes #0 = { uwtable "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="all" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+sse,+sse2" "unsafe-fp-math"="false" "use-soft-float"="false" "use-sample-profile" }
attributes #1 = { nounwind readnone }
diff --git a/llvm/test/Transforms/SampleProfile/calls.ll b/llvm/test/Transforms/SampleProfile/calls.ll
index db61b72c1d2b..e540a5bbea64 100644
--- a/llvm/test/Transforms/SampleProfile/calls.ll
+++ b/llvm/test/Transforms/SampleProfile/calls.ll
@@ -23,10 +23,10 @@ define i32 @_Z3sumii(i32 %x, i32 %y) #0 !dbg !4 {
entry:
%x.addr = alloca i32, align 4
%y.addr = alloca i32, align 4
- store i32 %x, i32* %x.addr, align 4
- store i32 %y, i32* %y.addr, align 4
- %0 = load i32, i32* %x.addr, align 4, !dbg !11
- %1 = load i32, i32* %y.addr, align 4, !dbg !11
+ store i32 %x, ptr %x.addr, align 4
+ store i32 %y, ptr %y.addr, align 4
+ %0 = load i32, ptr %x.addr, align 4, !dbg !11
+ %1 = load i32, ptr %y.addr, align 4, !dbg !11
%add = add nsw i32 %0, %1, !dbg !11
ret i32 %add, !dbg !11
}
@@ -37,21 +37,21 @@ entry:
%retval = alloca i32, align 4
%s = alloca i32, align 4
%i = alloca i32, align 4
- store i32 0, i32* %retval
- store i32 0, i32* %i, align 4, !dbg !12
+ store i32 0, ptr %retval
+ store i32 0, ptr %i, align 4, !dbg !12
br label %while.cond, !dbg !13
while.cond: ; preds = %if.end, %entry
- %0 = load i32, i32* %i, align 4, !dbg !14
+ %0 = load i32, ptr %i, align 4, !dbg !14
%inc = add nsw i32 %0, 1, !dbg !14
- store i32 %inc, i32* %i, align 4, !dbg !14
+ store i32 %inc, ptr %i, align 4, !dbg !14
%cmp = icmp slt i32 %0, 400000000, !dbg !14
br i1 %cmp, label %while.body, label %while.end, !dbg !14
; CHECK: edge while.cond -> while.body probability is 0x77f2798d / 0x80000000 = 93.71% [HOT edge]
; CHECK: edge while.cond -> while.end probability is 0x080d8673 / 0x80000000 = 6.29%
while.body: ; preds = %while.cond
- %1 = load i32, i32* %i, align 4, !dbg !16
+ %1 = load i32, ptr %i, align 4, !dbg !16
%cmp1 = icmp ne i32 %1, 100, !dbg !16
br i1 %cmp1, label %if.then, label %if.else, !dbg !16
; Without discriminator information, the profiler used to think that
@@ -63,26 +63,26 @@ while.body: ; preds = %while.cond
if.then: ; preds = %while.body
- %2 = load i32, i32* %i, align 4, !dbg !18
- %3 = load i32, i32* %s, align 4, !dbg !18
+ %2 = load i32, ptr %i, align 4, !dbg !18
+ %3 = load i32, ptr %s, align 4, !dbg !18
%call = call i32 @_Z3sumii(i32 %2, i32 %3), !dbg !18
- store i32 %call, i32* %s, align 4, !dbg !18
+ store i32 %call, ptr %s, align 4, !dbg !18
br label %if.end, !dbg !18
if.else: ; preds = %while.body
- store i32 30, i32* %s, align 4, !dbg !20
+ store i32 30, ptr %s, align 4, !dbg !20
br label %if.end
if.end: ; preds = %if.else, %if.then
br label %while.cond, !dbg !22
while.end: ; preds = %while.cond
- %4 = load i32, i32* %s, align 4, !dbg !24
- %call2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i32 0, i32 0), i32 %4), !dbg !24
+ %4 = load i32, ptr %s, align 4, !dbg !24
+ %call2 = call i32 (ptr, ...) @printf(ptr @.str, i32 %4), !dbg !24
ret i32 0, !dbg !25
}
-declare i32 @printf(i8*, ...) #2
+declare i32 @printf(ptr, ...) #2
attributes #0 = {"use-sample-profile"}
diff --git a/llvm/test/Transforms/SampleProfile/cold-indirect-call.ll b/llvm/test/Transforms/SampleProfile/cold-indirect-call.ll
index 3c8914239b6e..bffc775b6439 100644
--- a/llvm/test/Transforms/SampleProfile/cold-indirect-call.ll
+++ b/llvm/test/Transforms/SampleProfile/cold-indirect-call.ll
@@ -1,6 +1,6 @@
; RUN: opt < %s -passes=sample-profile -sample-profile-file=%S/Inputs/cold-indirect-call.prof -S | FileCheck %s
-define i32 @foo(i32 ()* %func) #0 !dbg !3 {
+define i32 @foo(ptr %func) #0 !dbg !3 {
; CHECK: icmp {{.*}} @bar
; CHECK-NOT: icmp {{.*}} @baz
%call = call i32 %func(), !dbg !4
diff --git a/llvm/test/Transforms/SampleProfile/cov-zero-samples.ll b/llvm/test/Transforms/SampleProfile/cov-zero-samples.ll
index 43ba65b9c8f8..d59fc8fedc91 100644
--- a/llvm/test/Transforms/SampleProfile/cov-zero-samples.ll
+++ b/llvm/test/Transforms/SampleProfile/cov-zero-samples.ll
@@ -31,58 +31,58 @@ entry:
%retval = alloca i32, align 4
%sum = alloca i32, align 4
%i = alloca i64, align 8
- store i32 0, i32* %retval, align 4
- call void @llvm.dbg.declare(metadata i32* %sum, metadata !20, metadata !21), !dbg !22
- store i32 0, i32* %sum, align 4, !dbg !22
- call void @llvm.dbg.declare(metadata i64* %i, metadata !23, metadata !21), !dbg !25
- store i64 0, i64* %i, align 8, !dbg !25
+ store i32 0, ptr %retval, align 4
+ call void @llvm.dbg.declare(metadata ptr %sum, metadata !20, metadata !21), !dbg !22
+ store i32 0, ptr %sum, align 4, !dbg !22
+ call void @llvm.dbg.declare(metadata ptr %i, metadata !23, metadata !21), !dbg !25
+ store i64 0, ptr %i, align 8, !dbg !25
br label %for.cond, !dbg !26
for.cond: ; preds = %for.inc, %entry
- %0 = load i64, i64* %i, align 8, !dbg !27
- %1 = load volatile i64, i64* @N, align 8, !dbg !30
+ %0 = load i64, ptr %i, align 8, !dbg !27
+ %1 = load volatile i64, ptr @N, align 8, !dbg !30
%cmp = icmp slt i64 %0, %1, !dbg !31
br i1 %cmp, label %for.body, label %for.end, !dbg !32
for.body: ; preds = %for.cond
- %2 = load i64, i64* %i, align 8, !dbg !33
- %3 = load volatile i64, i64* @N, align 8, !dbg !36
+ %2 = load i64, ptr %i, align 8, !dbg !33
+ %3 = load volatile i64, ptr @N, align 8, !dbg !36
%cmp1 = icmp sgt i64 %2, %3, !dbg !37
br i1 %cmp1, label %if.then, label %if.end, !dbg !38
if.then: ; preds = %for.body
- %4 = load i64, i64* %i, align 8, !dbg !39
+ %4 = load i64, ptr %i, align 8, !dbg !39
%conv = trunc i64 %4 to i32, !dbg !39
%call = call i32 @_Z12never_calledi(i32 %conv), !dbg !41
- %5 = load i32, i32* %sum, align 4, !dbg !42
+ %5 = load i32, ptr %sum, align 4, !dbg !42
%add = add nsw i32 %5, %call, !dbg !42
- store i32 %add, i32* %sum, align 4, !dbg !42
+ store i32 %add, ptr %sum, align 4, !dbg !42
br label %if.end, !dbg !43
if.end: ; preds = %if.then, %for.body
- %6 = load i64, i64* %i, align 8, !dbg !44
+ %6 = load i64, ptr %i, align 8, !dbg !44
%div = sdiv i64 %6, 239, !dbg !45
- %7 = load i32, i32* %sum, align 4, !dbg !46
+ %7 = load i32, ptr %sum, align 4, !dbg !46
%conv2 = sext i32 %7 to i64, !dbg !46
%mul = mul nsw i64 %conv2, %div, !dbg !46
%conv3 = trunc i64 %mul to i32, !dbg !46
- store i32 %conv3, i32* %sum, align 4, !dbg !46
+ store i32 %conv3, ptr %sum, align 4, !dbg !46
br label %for.inc, !dbg !47
for.inc: ; preds = %if.end
- %8 = load i64, i64* %i, align 8, !dbg !48
+ %8 = load i64, ptr %i, align 8, !dbg !48
%inc = add nsw i64 %8, 1, !dbg !48
- store i64 %inc, i64* %i, align 8, !dbg !48
+ store i64 %inc, ptr %i, align 8, !dbg !48
br label %for.cond, !dbg !50
for.end: ; preds = %for.cond
- %9 = load i32, i32* %sum, align 4, !dbg !51
- %call4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i32 0, i32 0), i32 %9), !dbg !52
+ %9 = load i32, ptr %sum, align 4, !dbg !51
+ %call4 = call i32 (ptr, ...) @printf(ptr @.str, i32 %9), !dbg !52
ret i32 0, !dbg !53
}
-declare i32 @printf(i8*, ...)
+declare i32 @printf(ptr, ...)
attributes #0 = { nounwind readnone }
attributes #1 = {"use-sample-profile"}
diff --git a/llvm/test/Transforms/SampleProfile/coverage-warning.ll b/llvm/test/Transforms/SampleProfile/coverage-warning.ll
index 888d262e9d4c..fe54a05caac0 100644
--- a/llvm/test/Transforms/SampleProfile/coverage-warning.ll
+++ b/llvm/test/Transforms/SampleProfile/coverage-warning.ll
@@ -8,21 +8,21 @@ define i32 @foo(i32 %i) #0 !dbg !4 {
entry:
%retval = alloca i32, align 4
%i.addr = alloca i32, align 4
- store i32 %i, i32* %i.addr, align 4
- %0 = load i32, i32* %i.addr, align 4, !dbg !9
+ store i32 %i, ptr %i.addr, align 4
+ %0 = load i32, ptr %i.addr, align 4, !dbg !9
%cmp = icmp sgt i32 %0, 1000, !dbg !10
br i1 %cmp, label %if.then, label %if.end, !dbg !9
if.then: ; preds = %entry
- store i32 30, i32* %retval, align 4, !dbg !11
+ store i32 30, ptr %retval, align 4, !dbg !11
br label %return, !dbg !11
if.end: ; preds = %entry
- store i32 3, i32* %retval, align 4, !dbg !12
+ store i32 3, ptr %retval, align 4, !dbg !12
br label %return, !dbg !12
return: ; preds = %if.end, %if.then
- %1 = load i32, i32* %retval, align 4, !dbg !13
+ %1 = load i32, ptr %retval, align 4, !dbg !13
ret i32 %1, !dbg !13
}
diff --git a/llvm/test/Transforms/SampleProfile/csspgo-inline-debug.ll b/llvm/test/Transforms/SampleProfile/csspgo-inline-debug.ll
index e5f2f7571eaf..fe3102355dcc 100644
--- a/llvm/test/Transforms/SampleProfile/csspgo-inline-debug.ll
+++ b/llvm/test/Transforms/SampleProfile/csspgo-inline-debug.ll
@@ -60,7 +60,7 @@ while.cond2.preheader: ; preds = %entry
while.body: ; preds = %while.body, %entry
%x.addr.016 = phi i32 [ %sub, %while.body ], [ %x, %entry ]
- %tmp = load volatile i32, i32* @factor, align 4, !dbg !64
+ %tmp = load volatile i32, ptr @factor, align 4, !dbg !64
%call = tail call i32 @_Z3fibi(i32 %tmp), !dbg !67
%sub = sub nsw i32 %x.addr.016, %call, !dbg !68
%cmp1 = icmp sgt i32 %sub, 0, !dbg !69
@@ -68,7 +68,7 @@ while.body: ; preds = %while.body, %entry
while.body4: ; preds = %while.body4, %while.cond2.preheader
%x.addr.114 = phi i32 [ %add, %while.body4 ], [ %x, %while.cond2.preheader ]
- %tmp1 = load volatile i32, i32* @factor, align 4, !dbg !72
+ %tmp1 = load volatile i32, ptr @factor, align 4, !dbg !72
%call5 = tail call i32 @_Z3fibi(i32 %tmp1), !dbg !74
%add = add nsw i32 %call5, %x.addr.114, !dbg !75
%cmp3 = icmp slt i32 %add, 0, !dbg !60
diff --git a/llvm/test/Transforms/SampleProfile/csspgo-inline-icall.ll b/llvm/test/Transforms/SampleProfile/csspgo-inline-icall.ll
index 6e42ee15c39b..32b47bcfc6d8 100644
--- a/llvm/test/Transforms/SampleProfile/csspgo-inline-icall.ll
+++ b/llvm/test/Transforms/SampleProfile/csspgo-inline-icall.ll
@@ -4,18 +4,18 @@
; RUN: opt < %s -passes=sample-profile -sample-profile-file=%t.md5 -sample-profile-icp-relative-hotness=1 -pass-remarks=sample-profile -sample-profile-inline-size=0 -S -o /dev/null 2>&1 | FileCheck -check-prefix=ICP-HOT %s
-define void @test(void ()*) #0 !dbg !3 {
+define void @test(ptr) #0 !dbg !3 {
;; Add two direct call to force top-down order for sample profile loader
call void @_Z3foov(), !dbg !7
call void @_Z3barv(), !dbg !7
call void @_Z3bazv(), !dbg !7
- %2 = alloca void ()*
- store void ()* %0, void ()** %2
- %3 = load void ()*, void ()** %2
+ %2 = alloca ptr
+ store ptr %0, ptr %2
+ %3 = load ptr, ptr %2
call void %3(), !dbg !4
- %4 = alloca void ()*
- store void ()* %0, void ()** %4
- %5 = load void ()*, void ()** %4
+ %4 = alloca ptr
+ store ptr %0, ptr %4
+ %5 = load ptr, ptr %4
call void %5(), !dbg !5
ret void
}
diff --git a/llvm/test/Transforms/SampleProfile/csspgo-inline.ll b/llvm/test/Transforms/SampleProfile/csspgo-inline.ll
index 1894ec6e3ce9..c88de5f56c74 100644
--- a/llvm/test/Transforms/SampleProfile/csspgo-inline.ll
+++ b/llvm/test/Transforms/SampleProfile/csspgo-inline.ll
@@ -81,7 +81,7 @@ while.cond2.preheader: ; preds = %entry
while.body: ; preds = %while.body, %entry
%x.addr.016 = phi i32 [ %sub, %while.body ], [ %x, %entry ]
- %tmp = load volatile i32, i32* @factor, align 4, !dbg !64
+ %tmp = load volatile i32, ptr @factor, align 4, !dbg !64
%call = tail call i32 @_Z3fibi(i32 %tmp), !dbg !67
%sub = sub nsw i32 %x.addr.016, %call, !dbg !68
%cmp1 = icmp sgt i32 %sub, 0, !dbg !69
@@ -89,7 +89,7 @@ while.body: ; preds = %while.body, %entry
while.body4: ; preds = %while.body4, %while.cond2.preheader
%x.addr.114 = phi i32 [ %add, %while.body4 ], [ %x, %while.cond2.preheader ]
- %tmp1 = load volatile i32, i32* @factor, align 4, !dbg !72
+ %tmp1 = load volatile i32, ptr @factor, align 4, !dbg !72
%call5 = tail call i32 @_Z3fibi(i32 %tmp1), !dbg !74
%add = add nsw i32 %call5, %x.addr.114, !dbg !75
%cmp3 = icmp slt i32 %add, 0, !dbg !60
diff --git a/llvm/test/Transforms/SampleProfile/csspgo-summary.ll b/llvm/test/Transforms/SampleProfile/csspgo-summary.ll
index 411bb4d5e362..f18425ed3a90 100644
--- a/llvm/test/Transforms/SampleProfile/csspgo-summary.ll
+++ b/llvm/test/Transforms/SampleProfile/csspgo-summary.ll
@@ -47,7 +47,7 @@ while.cond2.preheader: ; preds = %entry
while.body: ; preds = %while.body, %entry
%x.addr.016 = phi i32 [ %sub, %while.body ], [ %x, %entry ]
- %tmp = load volatile i32, i32* @factor, align 4, !dbg !64
+ %tmp = load volatile i32, ptr @factor, align 4, !dbg !64
%call = tail call i32 @_Z3fibi(i32 %tmp), !dbg !67
%sub = sub nsw i32 %x.addr.016, %call, !dbg !68
%cmp1 = icmp sgt i32 %sub, 0, !dbg !69
@@ -55,7 +55,7 @@ while.body: ; preds = %while.body, %entry
while.body4: ; preds = %while.body4, %while.cond2.preheader
%x.addr.114 = phi i32 [ %add, %while.body4 ], [ %x, %while.cond2.preheader ]
- %tmp1 = load volatile i32, i32* @factor, align 4, !dbg !72
+ %tmp1 = load volatile i32, ptr @factor, align 4, !dbg !72
%call5 = tail call i32 @_Z3fibi(i32 %tmp1), !dbg !74
%add = add nsw i32 %call5, %x.addr.114, !dbg !75
%cmp3 = icmp slt i32 %add, 0, !dbg !60
diff --git a/llvm/test/Transforms/SampleProfile/csspgo-use-preinliner.ll b/llvm/test/Transforms/SampleProfile/csspgo-use-preinliner.ll
index 4b6f57ac740b..da9c37937d2a 100644
--- a/llvm/test/Transforms/SampleProfile/csspgo-use-preinliner.ll
+++ b/llvm/test/Transforms/SampleProfile/csspgo-use-preinliner.ll
@@ -59,7 +59,7 @@ while.cond2.preheader: ; preds = %entry
while.body: ; preds = %while.body, %entry
%x.addr.016 = phi i32 [ %sub, %while.body ], [ %x, %entry ]
- %tmp = load volatile i32, i32* @factor, align 4, !dbg !64
+ %tmp = load volatile i32, ptr @factor, align 4, !dbg !64
%call = tail call i32 @_Z3fibi(i32 %tmp), !dbg !67
%sub = sub nsw i32 %x.addr.016, %call, !dbg !68
%cmp1 = icmp sgt i32 %sub, 0, !dbg !69
@@ -67,7 +67,7 @@ while.body: ; preds = %while.body, %entry
while.body4: ; preds = %while.body4, %while.cond2.preheader
%x.addr.114 = phi i32 [ %add, %while.body4 ], [ %x, %while.cond2.preheader ]
- %tmp1 = load volatile i32, i32* @factor, align 4, !dbg !72
+ %tmp1 = load volatile i32, ptr @factor, align 4, !dbg !72
%call5 = tail call i32 @_Z3fibi(i32 %tmp1), !dbg !74
%add = add nsw i32 %call5, %x.addr.114, !dbg !75
%cmp3 = icmp slt i32 %add, 0, !dbg !60
diff --git a/llvm/test/Transforms/SampleProfile/discriminator.ll b/llvm/test/Transforms/SampleProfile/discriminator.ll
index b644d9ae45da..4dd66cb6e98e 100644
--- a/llvm/test/Transforms/SampleProfile/discriminator.ll
+++ b/llvm/test/Transforms/SampleProfile/discriminator.ll
@@ -26,38 +26,38 @@ define i32 @foo(i32 %i) #0 !dbg !4 {
entry:
%i.addr = alloca i32, align 4
%x = alloca i32, align 4
- store i32 %i, i32* %i.addr, align 4
- store i32 0, i32* %x, align 4, !dbg !10
+ store i32 %i, ptr %i.addr, align 4
+ store i32 0, ptr %x, align 4, !dbg !10
br label %while.cond, !dbg !11
while.cond: ; preds = %if.end, %entry
- %0 = load i32, i32* %i.addr, align 4, !dbg !12
+ %0 = load i32, ptr %i.addr, align 4, !dbg !12
%cmp = icmp slt i32 %0, 100, !dbg !12
br i1 %cmp, label %while.body, label %while.end, !dbg !12
; CHECK: edge while.cond -> while.body probability is 0x7d83ba68 / 0x80000000 = 98.06% [HOT edge]
; CHECK: edge while.cond -> while.end probability is 0x027c4598 / 0x80000000 = 1.94%
while.body: ; preds = %while.cond
- %1 = load i32, i32* %i.addr, align 4, !dbg !14
+ %1 = load i32, ptr %i.addr, align 4, !dbg !14
%cmp1 = icmp slt i32 %1, 50, !dbg !14
br i1 %cmp1, label %if.then, label %if.end, !dbg !14
; CHECK: edge while.body -> if.then probability is 0x07878788 / 0x80000000 = 5.88%
; CHECK: edge while.body -> if.end probability is 0x78787878 / 0x80000000 = 94.12% [HOT edge]
if.then: ; preds = %while.body
- %2 = load i32, i32* %x, align 4, !dbg !17
+ %2 = load i32, ptr %x, align 4, !dbg !17
%dec = add nsw i32 %2, -1, !dbg !17
- store i32 %dec, i32* %x, align 4, !dbg !17
+ store i32 %dec, ptr %x, align 4, !dbg !17
br label %if.end, !dbg !17
if.end: ; preds = %if.then, %while.body
- %3 = load i32, i32* %i.addr, align 4, !dbg !19
+ %3 = load i32, ptr %i.addr, align 4, !dbg !19
%inc = add nsw i32 %3, 1, !dbg !19
- store i32 %inc, i32* %i.addr, align 4, !dbg !19
+ store i32 %inc, ptr %i.addr, align 4, !dbg !19
br label %while.cond, !dbg !20
while.end: ; preds = %while.cond
- %4 = load i32, i32* %x, align 4, !dbg !21
+ %4 = load i32, ptr %x, align 4, !dbg !21
ret i32 %4, !dbg !21
}
diff --git a/llvm/test/Transforms/SampleProfile/early-inline.ll b/llvm/test/Transforms/SampleProfile/early-inline.ll
index 204e0bb2951e..884353ae76cd 100644
--- a/llvm/test/Transforms/SampleProfile/early-inline.ll
+++ b/llvm/test/Transforms/SampleProfile/early-inline.ll
@@ -5,11 +5,11 @@
target triple = "x86_64-unknown-linux-gnu"
- at _ZTIi = external constant i8*
+ at _ZTIi = external constant ptr
; Function Attrs: uwtable
-define void @_Z3foov() #0 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) !dbg !6 {
- %1 = alloca i8*
+define void @_Z3foov() #0 personality ptr @__gxx_personality_v0 !dbg !6 {
+ %1 = alloca ptr
%2 = alloca i32
%3 = alloca i32, align 4
; CHECK: call void @no_inline
@@ -24,8 +24,8 @@ define void @_Z3foov() #0 personality i8* bitcast (i32 (...)* @__gxx_personality
ret void
; <label>:5:
- %6 = landingpad { i8*, i32 }
- catch i8* bitcast (i8** @_ZTIi to i8*)
+ %6 = landingpad { ptr, i32 }
+ catch ptr @_ZTIi
ret void
}
diff --git a/llvm/test/Transforms/SampleProfile/entry_counts_cold.ll b/llvm/test/Transforms/SampleProfile/entry_counts_cold.ll
index e3a9132ae710..5fe80dbf6445 100644
--- a/llvm/test/Transforms/SampleProfile/entry_counts_cold.ll
+++ b/llvm/test/Transforms/SampleProfile/entry_counts_cold.ll
@@ -6,26 +6,26 @@ target triple = "x86_64-apple-macosx10.14.0"
; Function Attrs: nounwind ssp uwtable
; CHECK: define i32 @top({{.*}} !prof [[TOP:![0-9]+]]
-define i32 @top(i32* %p) #0 !dbg !8 {
+define i32 @top(ptr %p) #0 !dbg !8 {
entry:
- %p.addr = alloca i32*, align 8
- store i32* %p, i32** %p.addr, align 8, !tbaa !15
- call void @llvm.dbg.declare(metadata i32** %p.addr, metadata !14, metadata !DIExpression()), !dbg !19
- %0 = load i32*, i32** %p.addr, align 8, !dbg !20, !tbaa !15
- %call = call i32 @foo(i32* %0), !dbg !21
+ %p.addr = alloca ptr, align 8
+ store ptr %p, ptr %p.addr, align 8, !tbaa !15
+ call void @llvm.dbg.declare(metadata ptr %p.addr, metadata !14, metadata !DIExpression()), !dbg !19
+ %0 = load ptr, ptr %p.addr, align 8, !dbg !20, !tbaa !15
+ %call = call i32 @foo(ptr %0), !dbg !21
; foo is inlined
; CHECK-NOT: call i32 @foo
; CHECK: call i32 @bar
- %1 = load i32*, i32** %p.addr, align 8, !dbg !22, !tbaa !15
- %2 = load i32, i32* %1, align 4, !dbg !24, !tbaa !25
+ %1 = load ptr, ptr %p.addr, align 8, !dbg !22, !tbaa !15
+ %2 = load i32, ptr %1, align 4, !dbg !24, !tbaa !25
%tobool = icmp ne i32 %2, 0, !dbg !24
br i1 %tobool, label %if.then, label %if.end, !dbg !27
if.then: ; preds = %entry
- %3 = load i32*, i32** %p.addr, align 8, !dbg !28, !tbaa !15
+ %3 = load ptr, ptr %p.addr, align 8, !dbg !28, !tbaa !15
; bar is not inlined
; CHECK: call i32 @bar
- %call1 = call i32 @bar(i32* %3), !dbg !29
+ %call1 = call i32 @bar(ptr %3), !dbg !29
br label %if.end, !dbg !29
if.end: ; preds = %if.then, %entry
@@ -37,61 +37,59 @@ declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
; Function Attrs: nounwind ssp uwtable
; CHECK: define i32 @foo({{.*}} !prof [[FOO:![0-9]+]]
-define i32 @foo(i32* %p) #0 !dbg !31 {
+define i32 @foo(ptr %p) #0 !dbg !31 {
entry:
- %p.addr = alloca i32*, align 8
+ %p.addr = alloca ptr, align 8
%a = alloca i32, align 4
- store i32* %p, i32** %p.addr, align 8, !tbaa !15
- call void @llvm.dbg.declare(metadata i32** %p.addr, metadata !33, metadata !DIExpression()), !dbg !35
- %0 = bitcast i32* %a to i8*, !dbg !36
- call void @llvm.lifetime.start.p0i8(i64 4, i8* %0) #4, !dbg !36
- call void @llvm.dbg.declare(metadata i32* %a, metadata !34, metadata !DIExpression()), !dbg !37
- %1 = load i32*, i32** %p.addr, align 8, !dbg !38, !tbaa !15
- %arrayidx = getelementptr inbounds i32, i32* %1, i64 3, !dbg !38
- %2 = load i32, i32* %arrayidx, align 4, !dbg !38, !tbaa !25
- %3 = load i32*, i32** %p.addr, align 8, !dbg !39, !tbaa !15
- %arrayidx1 = getelementptr inbounds i32, i32* %3, i64 2, !dbg !39
- %4 = load i32, i32* %arrayidx1, align 4, !dbg !40, !tbaa !25
- %add = add nsw i32 %4, %2, !dbg !40
- store i32 %add, i32* %arrayidx1, align 4, !dbg !40, !tbaa !25
- %5 = load i32*, i32** %p.addr, align 8, !dbg !41, !tbaa !15
- %call = call i32 @bar(i32* %5), !dbg !42
- store i32 %call, i32* %a, align 4, !dbg !43, !tbaa !25
- %6 = load i32, i32* %a, align 4, !dbg !44, !tbaa !25
- %add2 = add nsw i32 %6, 1, !dbg !45
- %7 = bitcast i32* %a to i8*, !dbg !46
- call void @llvm.lifetime.end.p0i8(i64 4, i8* %7) #4, !dbg !46
+ store ptr %p, ptr %p.addr, align 8, !tbaa !15
+ call void @llvm.dbg.declare(metadata ptr %p.addr, metadata !33, metadata !DIExpression()), !dbg !35
+ call void @llvm.lifetime.start.p0(i64 4, ptr %a) #4, !dbg !36
+ call void @llvm.dbg.declare(metadata ptr %a, metadata !34, metadata !DIExpression()), !dbg !37
+ %0 = load ptr, ptr %p.addr, align 8, !dbg !38, !tbaa !15
+ %arrayidx = getelementptr inbounds i32, ptr %0, i64 3, !dbg !38
+ %1 = load i32, ptr %arrayidx, align 4, !dbg !38, !tbaa !25
+ %2 = load ptr, ptr %p.addr, align 8, !dbg !39, !tbaa !15
+ %arrayidx1 = getelementptr inbounds i32, ptr %2, i64 2, !dbg !39
+ %3 = load i32, ptr %arrayidx1, align 4, !dbg !40, !tbaa !25
+ %add = add nsw i32 %3, %1, !dbg !40
+ store i32 %add, ptr %arrayidx1, align 4, !dbg !40, !tbaa !25
+ %4 = load ptr, ptr %p.addr, align 8, !dbg !41, !tbaa !15
+ %call = call i32 @bar(ptr %4), !dbg !42
+ store i32 %call, ptr %a, align 4, !dbg !43, !tbaa !25
+ %5 = load i32, ptr %a, align 4, !dbg !44, !tbaa !25
+ %add2 = add nsw i32 %5, 1, !dbg !45
+ call void @llvm.lifetime.end.p0(i64 4, ptr %a) #4, !dbg !46
ret i32 %add2, !dbg !47
}
; Function Attrs: nounwind ssp uwtable
; CHECK: define i32 @bar({{.*}} !prof [[BAR:![0-9]+]]
-define i32 @bar(i32* %p) #0 !dbg !48 {
+define i32 @bar(ptr %p) #0 !dbg !48 {
entry:
- %p.addr = alloca i32*, align 8
- store i32* %p, i32** %p.addr, align 8, !tbaa !15
- call void @llvm.dbg.declare(metadata i32** %p.addr, metadata !50, metadata !DIExpression()), !dbg !51
+ %p.addr = alloca ptr, align 8
+ store ptr %p, ptr %p.addr, align 8, !tbaa !15
+ call void @llvm.dbg.declare(metadata ptr %p.addr, metadata !50, metadata !DIExpression()), !dbg !51
; CHECK: call void (...) @baz{{.*}} !prof [[BAZ:![0-9]+]]
call void (...) @baz(), !dbg !52
- %0 = load i32*, i32** %p.addr, align 8, !dbg !53, !tbaa !15
- %arrayidx = getelementptr inbounds i32, i32* %0, i64 2, !dbg !53
- %1 = load i32, i32* %arrayidx, align 4, !dbg !53, !tbaa !25
- %2 = load i32*, i32** %p.addr, align 8, !dbg !54, !tbaa !15
- %arrayidx1 = getelementptr inbounds i32, i32* %2, i64 1, !dbg !54
- %3 = load i32, i32* %arrayidx1, align 4, !dbg !55, !tbaa !25
+ %0 = load ptr, ptr %p.addr, align 8, !dbg !53, !tbaa !15
+ %arrayidx = getelementptr inbounds i32, ptr %0, i64 2, !dbg !53
+ %1 = load i32, ptr %arrayidx, align 4, !dbg !53, !tbaa !25
+ %2 = load ptr, ptr %p.addr, align 8, !dbg !54, !tbaa !15
+ %arrayidx1 = getelementptr inbounds i32, ptr %2, i64 1, !dbg !54
+ %3 = load i32, ptr %arrayidx1, align 4, !dbg !55, !tbaa !25
%add = add nsw i32 %3, %1, !dbg !55
- store i32 %add, i32* %arrayidx1, align 4, !dbg !55, !tbaa !25
- %4 = load i32*, i32** %p.addr, align 8, !dbg !56, !tbaa !15
- %arrayidx2 = getelementptr inbounds i32, i32* %4, i64 3, !dbg !56
- %5 = load i32, i32* %arrayidx2, align 4, !dbg !56, !tbaa !25
+ store i32 %add, ptr %arrayidx1, align 4, !dbg !55, !tbaa !25
+ %4 = load ptr, ptr %p.addr, align 8, !dbg !56, !tbaa !15
+ %arrayidx2 = getelementptr inbounds i32, ptr %4, i64 3, !dbg !56
+ %5 = load i32, ptr %arrayidx2, align 4, !dbg !56, !tbaa !25
ret i32 %5, !dbg !57
}
; Function Attrs: argmemonly nounwind
-declare void @llvm.lifetime.start.p0i8(i64, i8* nocapture) #2
+declare void @llvm.lifetime.start.p0(i64, ptr nocapture) #2
; Function Attrs: argmemonly nounwind
-declare void @llvm.lifetime.end.p0i8(i64, i8* nocapture) #2
+declare void @llvm.lifetime.end.p0(i64, ptr nocapture) #2
declare void @baz(...) #3
diff --git a/llvm/test/Transforms/SampleProfile/entry_counts_missing_dbginfo.ll b/llvm/test/Transforms/SampleProfile/entry_counts_missing_dbginfo.ll
index 52ed936d90de..b8e106418343 100644
--- a/llvm/test/Transforms/SampleProfile/entry_counts_missing_dbginfo.ll
+++ b/llvm/test/Transforms/SampleProfile/entry_counts_missing_dbginfo.ll
@@ -16,26 +16,26 @@ target triple = "x86_64-apple-macosx10.14.0"
; Function Attrs: nounwind ssp uwtable
; CHECK: define i32 @top({{.*}} !prof [[TOP:![0-9]+]]
-define i32 @top(i32* %p) #0 !dbg !8 {
+define i32 @top(ptr %p) #0 !dbg !8 {
entry:
- %p.addr = alloca i32*, align 8
- store i32* %p, i32** %p.addr, align 8, !tbaa !15
- call void @llvm.dbg.declare(metadata i32** %p.addr, metadata !14, metadata !DIExpression()), !dbg !19
- %0 = load i32*, i32** %p.addr, align 8, !dbg !20, !tbaa !15
- %call = call i32 @foo(i32* %0), !dbg !21
+ %p.addr = alloca ptr, align 8
+ store ptr %p, ptr %p.addr, align 8, !tbaa !15
+ call void @llvm.dbg.declare(metadata ptr %p.addr, metadata !14, metadata !DIExpression()), !dbg !19
+ %0 = load ptr, ptr %p.addr, align 8, !dbg !20, !tbaa !15
+ %call = call i32 @foo(ptr %0), !dbg !21
; foo is inlined
; CHECK-NOT: call i32 @foo
; CHECK: call i32 @bar
- %1 = load i32*, i32** %p.addr, align 8, !dbg !22, !tbaa !15
- %2 = load i32, i32* %1, align 4, !dbg !24, !tbaa !25
+ %1 = load ptr, ptr %p.addr, align 8, !dbg !22, !tbaa !15
+ %2 = load i32, ptr %1, align 4, !dbg !24, !tbaa !25
%tobool = icmp ne i32 %2, 0, !dbg !24
br i1 %tobool, label %if.then, label %if.end, !dbg !27
if.then: ; preds = %entry
- %3 = load i32*, i32** %p.addr, align 8, !dbg !28, !tbaa !15
+ %3 = load ptr, ptr %p.addr, align 8, !dbg !28, !tbaa !15
; bar is not inlined
; CHECK: call i32 @bar
- %call1 = call i32 @bar(i32* %3), !dbg !29
+ %call1 = call i32 @bar(ptr %3), !dbg !29
br label %if.end, !dbg !29
if.end: ; preds = %if.then, %entry
@@ -47,61 +47,59 @@ declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
; Function Attrs: nounwind ssp uwtable
; CHECK: define i32 @foo({{.*}} !prof [[FOO:![0-9]+]]
-define i32 @foo(i32* %p) #0 !dbg !31 {
+define i32 @foo(ptr %p) #0 !dbg !31 {
entry:
- %p.addr = alloca i32*, align 8
+ %p.addr = alloca ptr, align 8
%a = alloca i32, align 4
- store i32* %p, i32** %p.addr, align 8, !tbaa !15
- call void @llvm.dbg.declare(metadata i32** %p.addr, metadata !33, metadata !DIExpression()), !dbg !35
- %0 = bitcast i32* %a to i8*, !dbg !36
- call void @llvm.lifetime.start.p0i8(i64 4, i8* %0) #4, !dbg !36
- call void @llvm.dbg.declare(metadata i32* %a, metadata !34, metadata !DIExpression()), !dbg !37
- %1 = load i32*, i32** %p.addr, align 8, !dbg !38, !tbaa !15
- %arrayidx = getelementptr inbounds i32, i32* %1, i64 3, !dbg !38
- %2 = load i32, i32* %arrayidx, align 4, !dbg !38, !tbaa !25
- %3 = load i32*, i32** %p.addr, align 8, !dbg !39, !tbaa !15
- %arrayidx1 = getelementptr inbounds i32, i32* %3, i64 2, !dbg !39
- %4 = load i32, i32* %arrayidx1, align 4, !dbg !40, !tbaa !25
- %add = add nsw i32 %4, %2, !dbg !40
- store i32 %add, i32* %arrayidx1, align 4, !dbg !40, !tbaa !25
- %5 = load i32*, i32** %p.addr, align 8, !dbg !41, !tbaa !15
- %call = call i32 @bar(i32* %5), !dbg !42
- store i32 %call, i32* %a, align 4, !dbg !43, !tbaa !25
- %6 = load i32, i32* %a, align 4, !dbg !44, !tbaa !25
- %add2 = add nsw i32 %6, 1, !dbg !45
- %7 = bitcast i32* %a to i8*, !dbg !46
- call void @llvm.lifetime.end.p0i8(i64 4, i8* %7) #4, !dbg !46
+ store ptr %p, ptr %p.addr, align 8, !tbaa !15
+ call void @llvm.dbg.declare(metadata ptr %p.addr, metadata !33, metadata !DIExpression()), !dbg !35
+ call void @llvm.lifetime.start.p0(i64 4, ptr %a) #4, !dbg !36
+ call void @llvm.dbg.declare(metadata ptr %a, metadata !34, metadata !DIExpression()), !dbg !37
+ %0 = load ptr, ptr %p.addr, align 8, !dbg !38, !tbaa !15
+ %arrayidx = getelementptr inbounds i32, ptr %0, i64 3, !dbg !38
+ %1 = load i32, ptr %arrayidx, align 4, !dbg !38, !tbaa !25
+ %2 = load ptr, ptr %p.addr, align 8, !dbg !39, !tbaa !15
+ %arrayidx1 = getelementptr inbounds i32, ptr %2, i64 2, !dbg !39
+ %3 = load i32, ptr %arrayidx1, align 4, !dbg !40, !tbaa !25
+ %add = add nsw i32 %3, %1, !dbg !40
+ store i32 %add, ptr %arrayidx1, align 4, !dbg !40, !tbaa !25
+ %4 = load ptr, ptr %p.addr, align 8, !dbg !41, !tbaa !15
+ %call = call i32 @bar(ptr %4), !dbg !42
+ store i32 %call, ptr %a, align 4, !dbg !43, !tbaa !25
+ %5 = load i32, ptr %a, align 4, !dbg !44, !tbaa !25
+ %add2 = add nsw i32 %5, 1, !dbg !45
+ call void @llvm.lifetime.end.p0(i64 4, ptr %a) #4, !dbg !46
ret i32 %add2, !dbg !47
}
; Function Attrs: nounwind ssp uwtable
-; CHECK: define i32 @bar(i32* %p) #0 !prof [[BAR:![0-9]+]] {
-define i32 @bar(i32* %p) #0 {
+; CHECK: define i32 @bar(ptr %p) #0 !prof [[BAR:![0-9]+]] {
+define i32 @bar(ptr %p) #0 {
entry:
- %p.addr = alloca i32*, align 8
- store i32* %p, i32** %p.addr, align 8, !tbaa !15
- call void @llvm.dbg.declare(metadata i32** %p.addr, metadata !50, metadata !DIExpression()), !dbg !51
+ %p.addr = alloca ptr, align 8
+ store ptr %p, ptr %p.addr, align 8, !tbaa !15
+ call void @llvm.dbg.declare(metadata ptr %p.addr, metadata !50, metadata !DIExpression()), !dbg !51
; CHECK: call void (...) @baz(), !dbg !{{[0-9]+}}
call void (...) @baz(), !dbg !52, !prof !100
- %0 = load i32*, i32** %p.addr, align 8, !dbg !53, !tbaa !15
- %arrayidx = getelementptr inbounds i32, i32* %0, i64 2, !dbg !53
- %1 = load i32, i32* %arrayidx, align 4, !dbg !53, !tbaa !25
- %2 = load i32*, i32** %p.addr, align 8, !dbg !54, !tbaa !15
- %arrayidx1 = getelementptr inbounds i32, i32* %2, i64 1, !dbg !54
- %3 = load i32, i32* %arrayidx1, align 4, !dbg !55, !tbaa !25
+ %0 = load ptr, ptr %p.addr, align 8, !dbg !53, !tbaa !15
+ %arrayidx = getelementptr inbounds i32, ptr %0, i64 2, !dbg !53
+ %1 = load i32, ptr %arrayidx, align 4, !dbg !53, !tbaa !25
+ %2 = load ptr, ptr %p.addr, align 8, !dbg !54, !tbaa !15
+ %arrayidx1 = getelementptr inbounds i32, ptr %2, i64 1, !dbg !54
+ %3 = load i32, ptr %arrayidx1, align 4, !dbg !55, !tbaa !25
%add = add nsw i32 %3, %1, !dbg !55
- store i32 %add, i32* %arrayidx1, align 4, !dbg !55, !tbaa !25
- %4 = load i32*, i32** %p.addr, align 8, !dbg !56, !tbaa !15
- %arrayidx2 = getelementptr inbounds i32, i32* %4, i64 3, !dbg !56
- %5 = load i32, i32* %arrayidx2, align 4, !dbg !56, !tbaa !25
+ store i32 %add, ptr %arrayidx1, align 4, !dbg !55, !tbaa !25
+ %4 = load ptr, ptr %p.addr, align 8, !dbg !56, !tbaa !15
+ %arrayidx2 = getelementptr inbounds i32, ptr %4, i64 3, !dbg !56
+ %5 = load i32, ptr %arrayidx2, align 4, !dbg !56, !tbaa !25
ret i32 %5, !dbg !57
}
; Function Attrs: argmemonly nounwind
-declare void @llvm.lifetime.start.p0i8(i64, i8* nocapture) #2
+declare void @llvm.lifetime.start.p0(i64, ptr nocapture) #2
; Function Attrs: argmemonly nounwind
-declare void @llvm.lifetime.end.p0i8(i64, i8* nocapture) #2
+declare void @llvm.lifetime.end.p0(i64, ptr nocapture) #2
declare void @baz(...) #3
diff --git a/llvm/test/Transforms/SampleProfile/fnptr.ll b/llvm/test/Transforms/SampleProfile/fnptr.ll
index 1b3a8527c1eb..c19337d2c420 100644
--- a/llvm/test/Transforms/SampleProfile/fnptr.ll
+++ b/llvm/test/Transforms/SampleProfile/fnptr.ll
@@ -81,7 +81,7 @@ for.body3: ; preds = %for.inc, %for.cond1
%call = tail call i32 @rand() #3, !dbg !15
%rem = srem i32 %call, 100, !dbg !15
%cmp4 = icmp slt i32 %rem, 30, !dbg !15
- %_Z3fooi._Z3bari = select i1 %cmp4, double (i32)* @_Z3fooi, double (i32)* @_Z3bari, !dbg !15
+ %_Z3fooi._Z3bari = select i1 %cmp4, ptr @_Z3fooi, ptr @_Z3bari, !dbg !15
%call5 = tail call i32 @rand() #3, !dbg !16
%rem6 = srem i32 %call5, 100, !dbg !16
%cmp7 = icmp slt i32 %rem6, 10, !dbg !16
@@ -114,7 +114,7 @@ for.inc12: ; preds = %for.inc
for.end14: ; preds = %for.inc12
%S.2.lcssa.lcssa = phi double [ %S.2.lcssa, %for.inc12 ]
- %call15 = tail call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), double %S.2.lcssa.lcssa), !dbg !24
+ %call15 = tail call i32 (ptr, ...) @printf(ptr @.str, double %S.2.lcssa.lcssa), !dbg !24
ret i32 0, !dbg !25
}
@@ -122,7 +122,7 @@ for.end14: ; preds = %for.inc12
declare i32 @rand() #1
; Function Attrs: nounwind
-declare i32 @printf(i8* nocapture readonly, ...) #1
+declare i32 @printf(ptr nocapture readonly, ...) #1
attributes #0 = {"use-sample-profile"}
attributes #2 = {"use-sample-profile"}
diff --git a/llvm/test/Transforms/SampleProfile/function_metadata.ll b/llvm/test/Transforms/SampleProfile/function_metadata.ll
index 12274d90c3d3..00f61e9f4ed5 100644
--- a/llvm/test/Transforms/SampleProfile/function_metadata.ll
+++ b/llvm/test/Transforms/SampleProfile/function_metadata.ll
@@ -25,10 +25,10 @@ define void @bar_available() #0 !dbg !14 {
; CHECK: define void @test({{.*}} !prof ![[ENTRY_TEST:[0-9]+]]
; THRESHOLD: define void @test({{.*}} !prof ![[ENTRY_THRESHOLD:[0-9]+]]
; THRESHOLD-REPLAY: define void @test({{.*}} !prof ![[ENTRY_REPLAY_TEST:[0-9]+]]
-define void @test(void ()*) #0 !dbg !7 {
- %2 = alloca void ()*
- store void ()* %0, void ()** %2
- %3 = load void ()*, void ()** %2
+define void @test(ptr) #0 !dbg !7 {
+ %2 = alloca ptr
+ store ptr %0, ptr %2
+ %3 = load ptr, ptr %2
; CHECK: call {{.*}}, !prof ![[PROF:[0-9]+]]
call void @foo(), !dbg !18
call void %3(), !dbg !19
diff --git a/llvm/test/Transforms/SampleProfile/gcc-simple.ll b/llvm/test/Transforms/SampleProfile/gcc-simple.ll
index 5f0e1905eb6d..315ac5afb9e2 100644
--- a/llvm/test/Transforms/SampleProfile/gcc-simple.ll
+++ b/llvm/test/Transforms/SampleProfile/gcc-simple.ll
@@ -29,8 +29,8 @@ define i64 @_Z3fool(i64 %i) #0 !dbg !4 {
entry:
%retval = alloca i64, align 8
%i.addr = alloca i64, align 8
- store i64 %i, i64* %i.addr, align 8
- call void @llvm.dbg.declare(metadata i64* %i.addr, metadata !16, metadata !17), !dbg !18
+ store i64 %i, ptr %i.addr, align 8
+ call void @llvm.dbg.declare(metadata ptr %i.addr, metadata !16, metadata !17), !dbg !18
%call = call i32 @rand() #3, !dbg !19
; CHECK: !prof ![[PROF1:[0-9]+]]
%cmp = icmp slt i32 %call, 500, !dbg !21
@@ -38,7 +38,7 @@ entry:
; CHECK: !prof ![[PROF2:[0-9]+]]
if.then: ; preds = %entry
- store i64 2, i64* %retval, align 8, !dbg !23
+ store i64 2, ptr %retval, align 8, !dbg !23
br label %return, !dbg !23
if.else: ; preds = %entry
@@ -49,15 +49,15 @@ if.else: ; preds = %entry
; CHECK: !prof ![[PROF4:[0-9]+]]
if.then.3: ; preds = %if.else
- store i64 10, i64* %retval, align 8, !dbg !30
+ store i64 10, ptr %retval, align 8, !dbg !30
br label %return, !dbg !30
if.else.4: ; preds = %if.else
- store i64 90, i64* %retval, align 8, !dbg !32
+ store i64 90, ptr %retval, align 8, !dbg !32
br label %return, !dbg !32
return: ; preds = %if.else.4, %if.then.3, %if.then
- %0 = load i64, i64* %retval, align 8, !dbg !34
+ %0 = load i64, ptr %retval, align 8, !dbg !34
ret i64 %0, !dbg !34
}
@@ -75,57 +75,57 @@ entry:
%sum = alloca i64, align 8
%k = alloca i32, align 4
%i = alloca i32, align 4
- store i32 0, i32* %retval, align 4
- call void @llvm.dbg.declare(metadata i64* %sum, metadata !35, metadata !17), !dbg !36
- store i64 0, i64* %sum, align 8, !dbg !36
- call void @llvm.dbg.declare(metadata i32* %k, metadata !37, metadata !17), !dbg !39
- store i32 0, i32* %k, align 4, !dbg !39
+ store i32 0, ptr %retval, align 4
+ call void @llvm.dbg.declare(metadata ptr %sum, metadata !35, metadata !17), !dbg !36
+ store i64 0, ptr %sum, align 8, !dbg !36
+ call void @llvm.dbg.declare(metadata ptr %k, metadata !37, metadata !17), !dbg !39
+ store i32 0, ptr %k, align 4, !dbg !39
br label %for.cond, !dbg !40
for.cond: ; preds = %for.inc.4, %entry
- %0 = load i32, i32* %k, align 4, !dbg !41
+ %0 = load i32, ptr %k, align 4, !dbg !41
%cmp = icmp slt i32 %0, 3000, !dbg !45
br i1 %cmp, label %for.body, label %for.end.6, !dbg !46
; CHECK: !prof ![[PROF6:[0-9]+]]
for.body: ; preds = %for.cond
- call void @llvm.dbg.declare(metadata i32* %i, metadata !47, metadata !17), !dbg !49
- store i32 0, i32* %i, align 4, !dbg !49
+ call void @llvm.dbg.declare(metadata ptr %i, metadata !47, metadata !17), !dbg !49
+ store i32 0, ptr %i, align 4, !dbg !49
br label %for.cond.1, !dbg !50
for.cond.1: ; preds = %for.inc, %for.body
- %1 = load i32, i32* %i, align 4, !dbg !51
+ %1 = load i32, ptr %i, align 4, !dbg !51
%cmp2 = icmp slt i32 %1, 200000, !dbg !55
br i1 %cmp2, label %for.body.3, label %for.end, !dbg !56
; CHECK: !prof ![[PROF7:[0-9]+]]
for.body.3: ; preds = %for.cond.1
- %2 = load i32, i32* %i, align 4, !dbg !57
+ %2 = load i32, ptr %i, align 4, !dbg !57
%conv = sext i32 %2 to i64, !dbg !57
%call = call i64 @_Z3fool(i64 %conv), !dbg !59
; CHECK: !prof ![[PROF8:[0-9]+]]
- %3 = load i64, i64* %sum, align 8, !dbg !60
+ %3 = load i64, ptr %sum, align 8, !dbg !60
%add = add nsw i64 %3, %call, !dbg !60
- store i64 %add, i64* %sum, align 8, !dbg !60
+ store i64 %add, ptr %sum, align 8, !dbg !60
br label %for.inc, !dbg !61
for.inc: ; preds = %for.body.3
- %4 = load i32, i32* %i, align 4, !dbg !62
+ %4 = load i32, ptr %i, align 4, !dbg !62
%inc = add nsw i32 %4, 1, !dbg !62
- store i32 %inc, i32* %i, align 4, !dbg !62
+ store i32 %inc, ptr %i, align 4, !dbg !62
br label %for.cond.1, !dbg !64
for.end: ; preds = %for.cond.1
br label %for.inc.4, !dbg !65
for.inc.4: ; preds = %for.end
- %5 = load i32, i32* %k, align 4, !dbg !67
+ %5 = load i32, ptr %k, align 4, !dbg !67
%inc5 = add nsw i32 %5, 1, !dbg !67
- store i32 %inc5, i32* %k, align 4, !dbg !67
+ store i32 %inc5, ptr %k, align 4, !dbg !67
br label %for.cond, !dbg !68
for.end.6: ; preds = %for.cond
- %6 = load i64, i64* %sum, align 8, !dbg !69
+ %6 = load i64, ptr %sum, align 8, !dbg !69
%cmp7 = icmp sgt i64 %6, 0, !dbg !70
%cond = select i1 %cmp7, i32 0, i32 1, !dbg !69
ret i32 %cond, !dbg !71
diff --git a/llvm/test/Transforms/SampleProfile/indirect-call-gcc.ll b/llvm/test/Transforms/SampleProfile/indirect-call-gcc.ll
index 61b320d86d73..5aabd82c3306 100644
--- a/llvm/test/Transforms/SampleProfile/indirect-call-gcc.ll
+++ b/llvm/test/Transforms/SampleProfile/indirect-call-gcc.ll
@@ -5,10 +5,10 @@
; It is expected to fail on certain architectures as gcc profile reader does
; not work.
-define void @test(void ()*) #0 !dbg !3 {
- %2 = alloca void ()*
- store void ()* %0, void ()** %2
- %3 = load void ()*, void ()** %2
+define void @test(ptr) #0 !dbg !3 {
+ %2 = alloca ptr
+ store ptr %0, ptr %2
+ %3 = load ptr, ptr %2
; CHECK: call {{.*}}, !prof ![[PROF:[0-9]+]]
call void %3(), !dbg !4
ret void
diff --git a/llvm/test/Transforms/SampleProfile/indirect-call.ll b/llvm/test/Transforms/SampleProfile/indirect-call.ll
index 90566a639cc7..53aaa977c180 100644
--- a/llvm/test/Transforms/SampleProfile/indirect-call.ll
+++ b/llvm/test/Transforms/SampleProfile/indirect-call.ll
@@ -2,10 +2,10 @@
; RUN: opt -S %s -passes=sample-profile -sample-profile-file=%S/Inputs/indirect-call.compact.afdo | FileCheck %s
; CHECK-LABEL: @test
-define void @test(void ()*) #0 !dbg !3 {
- %2 = alloca void ()*
- store void ()* %0, void ()** %2
- %3 = load void ()*, void ()** %2
+define void @test(ptr) #0 !dbg !3 {
+ %2 = alloca ptr
+ store ptr %0, ptr %2
+ %3 = load ptr, ptr %2
; CHECK: call {{.*}}, !prof ![[PROF:[0-9]+]]
call void %3(), !dbg !4
ret void
@@ -13,10 +13,10 @@ define void @test(void ()*) #0 !dbg !3 {
; CHECK-LABEL: @test_inline
; If the indirect call is promoted and inlined in profile, we should promote and inline it.
-define void @test_inline(i64* (i32*)*, i32* %x) #0 !dbg !6 {
- %2 = alloca i64* (i32*)*
- store i64* (i32*)* %0, i64* (i32*)** %2
- %3 = load i64* (i32*)*, i64* (i32*)** %2
+define void @test_inline(ptr, ptr %x) #0 !dbg !6 {
+ %2 = alloca ptr
+ store ptr %0, ptr %2
+ %3 = load ptr, ptr %2
; CHECK: icmp {{.*}} @foo_inline2
; CHECK: br {{.*}} !prof ![[BR1:[0-9]+]]
; CHECK: if.true.direct_targ:
@@ -28,44 +28,44 @@ define void @test_inline(i64* (i32*)*, i32* %x) #0 !dbg !6 {
; CHECK-NOT: call
; CHECK: if.false.orig_indirect2:
; CHECK: call {{.*}} !prof ![[VP:[0-9]+]]
- call i64* %3(i32* %x), !dbg !7
+ call ptr %3(ptr %x), !dbg !7
ret void
}
; CHECK-LABEL: @test_inline_strip
; If the indirect call is promoted and inlined in profile, and the callee name
; is stripped we should promote and inline it.
-define void @test_inline_strip(i64* (i32*)*, i32* %x) #0 !dbg !8 {
- %2 = alloca i64* (i32*)*
- store i64* (i32*)* %0, i64* (i32*)** %2
- %3 = load i64* (i32*)*, i64* (i32*)** %2
+define void @test_inline_strip(ptr, ptr %x) #0 !dbg !8 {
+ %2 = alloca ptr
+ store ptr %0, ptr %2
+ %3 = load ptr, ptr %2
; CHECK: icmp {{.*}} @foo_inline_strip.suffix
; CHECK: if.true.direct_targ:
; CHECK-NOT: call
; CHECK: if.false.orig_indirect:
; CHECK: call
- call i64* %3(i32* %x), !dbg !9
+ call ptr %3(ptr %x), !dbg !9
ret void
}
; CHECK-LABEL: @test_inline_strip_conflict
; If the indirect call is promoted and inlined in profile, and the callee name
; is stripped, but have more than 1 potential match, we should not promote.
-define void @test_inline_strip_conflict(i64* (i32*)*, i32* %x) #0 !dbg !10 {
- %2 = alloca i64* (i32*)*
- store i64* (i32*)* %0, i64* (i32*)** %2
- %3 = load i64* (i32*)*, i64* (i32*)** %2
+define void @test_inline_strip_conflict(ptr, ptr %x) #0 !dbg !10 {
+ %2 = alloca ptr
+ store ptr %0, ptr %2
+ %3 = load ptr, ptr %2
; CHECK-NOT: if.true.direct_targ:
- call i64* %3(i32* %x), !dbg !11
+ call ptr %3(ptr %x), !dbg !11
ret void
}
; CHECK-LABEL: @test_noinline
; If the indirect call target is not available, we should not promote it.
-define void @test_noinline(void ()*) #0 !dbg !12 {
- %2 = alloca void ()*
- store void ()* %0, void ()** %2
- %3 = load void ()*, void ()** %2
+define void @test_noinline(ptr) #0 !dbg !12 {
+ %2 = alloca ptr
+ store ptr %0, ptr %2
+ %3 = load ptr, ptr %2
; CHECK-NOT: icmp
; CHECK: call
call void %3(), !dbg !13
@@ -75,12 +75,12 @@ define void @test_noinline(void ()*) #0 !dbg !12 {
; CHECK-LABEL: @test_noinline_bitcast
; If the indirect call has been promoted to a direct call with bitcast,
; do not inline it.
-define float @test_noinline_bitcast(float ()*) #0 !dbg !26 {
- %2 = alloca float ()*
- store float ()* %0, float ()** %2
+define float @test_noinline_bitcast(ptr) #0 !dbg !26 {
+ %2 = alloca ptr
+ store ptr %0, ptr %2
; CHECK: icmp
; CHECK: call
- %3 = load float ()*, float ()** %2
+ %3 = load ptr, ptr %2
%4 = call float %3(), !dbg !27
ret float %4
}
@@ -90,44 +90,44 @@ define float @test_noinline_bitcast(float ()*) #0 !dbg !26 {
define void @test_norecursive_inline() #0 !dbg !24 {
; CHECK-NOT: icmp
; CHECK: call
- %1 = load void ()*, void ()** @y, align 8
+ %1 = load ptr, ptr @y, align 8
call void %1(), !dbg !25
ret void
}
-define i32* @return_arg(i32* readnone returned) #0 !dbg !29{
- ret i32* %0
+define ptr @return_arg(ptr readnone returned) #0 !dbg !29{
+ ret ptr %0
}
; CHECK-LABEL: @return_arg_caller
; When the promoted indirect call returns a parameter that was defined by the
; return value of a previous direct call. Checks both direct call and promoted
; indirect call are inlined.
-define i32* @return_arg_caller(i32* (i32*)* nocapture) #0 !dbg !30{
-; CHECK-NOT: call i32* @foo_inline1
+define ptr @return_arg_caller(ptr nocapture) #0 !dbg !30{
+; CHECK-NOT: call ptr @foo_inline1
; CHECK: if.true.direct_targ:
; CHECK-NOT: call
; CHECK: if.false.orig_indirect:
; CHECK: call
- %2 = call i32* @foo_inline1(i32* null), !dbg !31
- %cmp = icmp ne i32* %2, null
+ %2 = call ptr @foo_inline1(ptr null), !dbg !31
+ %cmp = icmp ne ptr %2, null
br i1 %cmp, label %then, label %else
then:
- %3 = tail call i32* %0(i32* %2), !dbg !32
- ret i32* %3
+ %3 = tail call ptr %0(ptr %2), !dbg !32
+ ret ptr %3
else:
- ret i32* null
+ ret ptr null
}
; CHECK-LABEL: @branch_prof_valid
; Check the conditional branch generated by indirect call promotion won't
; have invalid profile like !{!"branch_weights", i32 0, i32 0}.
-define void @branch_prof_valid(void ()* %t0) #0 !dbg !33 {
- %t1 = alloca void ()*
- store void ()* %t0, void ()** %t1
- %t2 = load void ()*, void ()** %t1
+define void @branch_prof_valid(ptr %t0) #0 !dbg !33 {
+ %t1 = alloca ptr
+ store ptr %t0, ptr %t1
+ %t2 = load ptr, ptr %t1
; CHECK-NOT: call {{.*}}
; CHECK: br i1 {{.*}}, label %if.true.direct_targ, label %if.false.orig_indirect, {{.*}}, !prof ![[BR3:[0-9]+]]
call void %t2(), !dbg !34
@@ -135,30 +135,30 @@ define void @branch_prof_valid(void ()* %t0) #0 !dbg !33 {
}
@x = global i32 0, align 4
- at y = global void ()* null, align 8
+ at y = global ptr null, align 8
-define i32* @foo_inline1(i32* %x) #0 !dbg !14 {
- ret i32* %x
+define ptr @foo_inline1(ptr %x) #0 !dbg !14 {
+ ret ptr %x
}
-define i32* @foo_inline_strip.suffix(i32* %x) #0 !dbg !15 {
- ret i32* %x
+define ptr @foo_inline_strip.suffix(ptr %x) #0 !dbg !15 {
+ ret ptr %x
}
-define i32* @foo_inline_strip_conflict.suffix1(i32* %x) #0 !dbg !16 {
- ret i32* %x
+define ptr @foo_inline_strip_conflict.suffix1(ptr %x) #0 !dbg !16 {
+ ret ptr %x
}
-define i32* @foo_inline_strip_conflict.suffix2(i32* %x) #0 !dbg !17 {
- ret i32* %x
+define ptr @foo_inline_strip_conflict.suffix2(ptr %x) #0 !dbg !17 {
+ ret ptr %x
}
-define i32* @foo_inline_strip_conflict.suffix3(i32* %x) #0 !dbg !18 {
- ret i32* %x
+define ptr @foo_inline_strip_conflict.suffix3(ptr %x) #0 !dbg !18 {
+ ret ptr %x
}
-define i32* @foo_inline2(i32* %x) #0 !dbg !19 {
- ret i32* %x
+define ptr @foo_inline2(ptr %x) #0 !dbg !19 {
+ ret ptr %x
}
define void @foo_inline3() #0 !dbg !35 {
@@ -186,7 +186,7 @@ define void @test_direct() #0 !dbg !22 {
ret void
}
- at foo_alias = alias void (), void ()* @foo_direct
+ at foo_alias = alias void (), ptr @foo_direct
attributes #0 = {"use-sample-profile"}
diff --git a/llvm/test/Transforms/SampleProfile/inline-act.ll b/llvm/test/Transforms/SampleProfile/inline-act.ll
index e4c580488453..3ab3efd9d1c3 100644
--- a/llvm/test/Transforms/SampleProfile/inline-act.ll
+++ b/llvm/test/Transforms/SampleProfile/inline-act.ll
@@ -46,9 +46,9 @@ define void @_Z3bari(i32) #0 !dbg !9 {
br i1 %2, label %3, label %6, !dbg !10
; <label>:3: ; preds = %1
- %4 = load i32, i32* @t, align 4
+ %4 = load i32, ptr @t, align 4
%5 = shl nsw i32 %4, 1
- store i32 %5, i32* @t, align 4
+ store i32 %5, ptr @t, align 4
br label %6
; <label>:6: ; preds = %3, %1
diff --git a/llvm/test/Transforms/SampleProfile/inline-callee-update.ll b/llvm/test/Transforms/SampleProfile/inline-callee-update.ll
index 65b8d358cbdb..2f4734cb8c03 100644
--- a/llvm/test/Transforms/SampleProfile/inline-callee-update.ll
+++ b/llvm/test/Transforms/SampleProfile/inline-callee-update.ll
@@ -2,54 +2,54 @@
; RUN: opt < %s -passes='thinlto-pre-link<O2>' -pgo-kind=pgo-sample-use-pipeline -sample-profile-file=%S/Inputs/inline-callee-update.prof -S | FileCheck %s
- at y = global i32* ()* null, align 8
- at z = global i32* ()* null, align 8
+ at y = global ptr null, align 8
+ at z = global ptr null, align 8
-; CHECK: define i32* @sample_loader_inlinee() {{.*}} !prof ![[ENTRY:[0-9]+]]
-define i32* @sample_loader_inlinee() #0 !dbg !3 {
+; CHECK: define ptr @sample_loader_inlinee() {{.*}} !prof ![[ENTRY:[0-9]+]]
+define ptr @sample_loader_inlinee() #0 !dbg !3 {
bb:
- %tmp = call i32* @direct_leaf_func(i32* null), !dbg !4
- %cmp = icmp ne i32* %tmp, null
+ %tmp = call ptr @direct_leaf_func(ptr null), !dbg !4
+ %cmp = icmp ne ptr %tmp, null
br i1 %cmp, label %then, label %else
then: ; preds = %bb
- %tmp1 = load i32* ()*, i32* ()** @z, align 8, !dbg !5
- %tmp2 = call i32* %tmp1(), !dbg !5
- ret i32* %tmp2
+ %tmp1 = load ptr, ptr @z, align 8, !dbg !5
+ %tmp2 = call ptr %tmp1(), !dbg !5
+ ret ptr %tmp2
else: ; preds = %bb
- ret i32* null
+ ret ptr null
}
-; CHECK: define i32* @cgscc_inlinee() {{.*}} !prof ![[ENTRY:[0-9]+]]
-define i32* @cgscc_inlinee() #0 !dbg !6 {
+; CHECK: define ptr @cgscc_inlinee() {{.*}} !prof ![[ENTRY:[0-9]+]]
+define ptr @cgscc_inlinee() #0 !dbg !6 {
bb:
- %tmp = call i32* @direct_leaf_func(i32* null), !dbg !7
- %cmp = icmp ne i32* %tmp, null
+ %tmp = call ptr @direct_leaf_func(ptr null), !dbg !7
+ %cmp = icmp ne ptr %tmp, null
br i1 %cmp, label %then, label %else
then: ; preds = %bb
- %tmp1 = load i32* ()*, i32* ()** @y, align 8, !dbg !8
- %tmp2 = call i32* %tmp1(), !dbg !8
- ret i32* %tmp2
+ %tmp1 = load ptr, ptr @y, align 8, !dbg !8
+ %tmp2 = call ptr %tmp1(), !dbg !8
+ ret ptr %tmp2
else: ; preds = %bb
- ret i32* null
+ ret ptr null
}
-define i32* @test_sample_loader_inline(void ()* %arg) #0 !dbg !9 {
+define ptr @test_sample_loader_inline(ptr %arg) #0 !dbg !9 {
bb:
- %tmp = call i32* @sample_loader_inlinee(), !dbg !10
- ret i32* %tmp
+ %tmp = call ptr @sample_loader_inlinee(), !dbg !10
+ ret ptr %tmp
}
-define i32* @test_cgscc_inline(void ()* %arg) #0 !dbg !11 {
+define ptr @test_cgscc_inline(ptr %arg) #0 !dbg !11 {
bb:
- %tmp = call i32* @cgscc_inlinee(), !dbg !12
- ret i32* %tmp
+ %tmp = call ptr @cgscc_inlinee(), !dbg !12
+ ret ptr %tmp
}
-declare i32* @direct_leaf_func(i32*)
+declare ptr @direct_leaf_func(ptr)
attributes #0 = {"use-sample-profile"}
diff --git a/llvm/test/Transforms/SampleProfile/inline-cold.ll b/llvm/test/Transforms/SampleProfile/inline-cold.ll
index f71dbdf3991a..ebd64dd4504b 100644
--- a/llvm/test/Transforms/SampleProfile/inline-cold.ll
+++ b/llvm/test/Transforms/SampleProfile/inline-cold.ll
@@ -17,10 +17,10 @@ define i32 @_Z3sumii(i32 %x, i32 %y) #0 !dbg !6 {
entry:
%x.addr = alloca i32, align 4
%y.addr = alloca i32, align 4
- store i32 %x, i32* %x.addr, align 4
- store i32 %y, i32* %y.addr, align 4
- %tmp = load i32, i32* %x.addr, align 4, !dbg !8
- %tmp1 = load i32, i32* %y.addr, align 4, !dbg !8
+ store i32 %x, ptr %x.addr, align 4
+ store i32 %y, ptr %y.addr, align 4
+ %tmp = load i32, ptr %x.addr, align 4, !dbg !8
+ %tmp1 = load i32, ptr %y.addr, align 4, !dbg !8
%add = add nsw i32 %tmp, %tmp1, !dbg !8
ret i32 %add, !dbg !8
}
@@ -30,47 +30,47 @@ entry:
%retval = alloca i32, align 4
%s = alloca i32, align 4
%i = alloca i32, align 4
- store i32 0, i32* %retval
- store i32 0, i32* %i, align 4, !dbg !10
+ store i32 0, ptr %retval
+ store i32 0, ptr %i, align 4, !dbg !10
br label %while.cond, !dbg !11
while.cond: ; preds = %if.end, %entry
- %tmp = load i32, i32* %i, align 4, !dbg !12
+ %tmp = load i32, ptr %i, align 4, !dbg !12
%inc = add nsw i32 %tmp, 1, !dbg !12
- store i32 %inc, i32* %i, align 4, !dbg !12
+ store i32 %inc, ptr %i, align 4, !dbg !12
%cmp = icmp slt i32 %tmp, 400000000, !dbg !12
br i1 %cmp, label %while.body, label %while.end, !dbg !12
while.body: ; preds = %while.cond
- %tmp1 = load i32, i32* %i, align 4, !dbg !14
+ %tmp1 = load i32, ptr %i, align 4, !dbg !14
%cmp1 = icmp ne i32 %tmp1, 100, !dbg !14
br i1 %cmp1, label %if.then, label %if.else, !dbg !14
if.then: ; preds = %while.body
- %tmp2 = load i32, i32* %i, align 4, !dbg !16
- %tmp3 = load i32, i32* %s, align 4, !dbg !16
+ %tmp2 = load i32, ptr %i, align 4, !dbg !16
+ %tmp3 = load i32, ptr %s, align 4, !dbg !16
%call = call i32 @_Z3sumii(i32 %tmp2, i32 %tmp3), !dbg !16
; INLINE-NOT: call i32 @_Z3sumii
; NOTINLINE: call i32 @_Z3sumii
- store i32 %call, i32* %s, align 4, !dbg !16
+ store i32 %call, ptr %s, align 4, !dbg !16
br label %if.end, !dbg !16
if.else: ; preds = %while.body
- store i32 30, i32* %s, align 4, !dbg !18
+ store i32 30, ptr %s, align 4, !dbg !18
br label %if.end
if.end: ; preds = %if.else, %if.then
br label %while.cond, !dbg !20
while.end: ; preds = %while.cond
- %tmp4 = load i32, i32* %s, align 4, !dbg !22
- %call2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i32 0, i32 0), i32 %tmp4), !dbg !22
+ %tmp4 = load i32, ptr %s, align 4, !dbg !22
+ %call2 = call i32 (ptr, ...) @printf(ptr @.str, i32 %tmp4), !dbg !22
ret i32 0, !dbg !23
}
attributes #0 = { "use-sample-profile" }
-declare i32 @printf(i8*, ...)
+declare i32 @printf(ptr, ...)
!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!3, !4}
diff --git a/llvm/test/Transforms/SampleProfile/inline-combine.ll b/llvm/test/Transforms/SampleProfile/inline-combine.ll
index 780235d7eba6..aa26e5d08792 100644
--- a/llvm/test/Transforms/SampleProfile/inline-combine.ll
+++ b/llvm/test/Transforms/SampleProfile/inline-combine.ll
@@ -6,7 +6,7 @@
%"class.llvm::SmallVectorImpl.base" = type { %"class.llvm::SmallVectorTemplateBase.base" }
%"class.llvm::SmallVectorTemplateBase.base" = type { %"class.llvm::SmallVectorTemplateCommon.base" }
%"class.llvm::SmallVectorTemplateCommon.base" = type <{ %"class.llvm::SmallVectorBase", %"struct.llvm::AlignedCharArrayUnion" }>
-%"class.llvm::SmallVectorBase" = type { i8*, i8*, i8* }
+%"class.llvm::SmallVectorBase" = type { ptr, ptr, ptr }
%"struct.llvm::AlignedCharArrayUnion" = type { %"struct.llvm::AlignedCharArray" }
%"struct.llvm::AlignedCharArray" = type { [4 x i8] }
%"struct.llvm::SmallVectorStorage" = type { [31 x %"struct.llvm::AlignedCharArrayUnion"] }
@@ -16,18 +16,17 @@ $foo = comdat any
$bar = comdat any
-define void @foo(%"class.llvm::FoldingSetNodeID"* %this) #0 align 2 !dbg !3 {
- %1 = alloca %"class.llvm::FoldingSetNodeID"*, align 8
- store %"class.llvm::FoldingSetNodeID"* %this, %"class.llvm::FoldingSetNodeID"** %1, align 8
- %2 = load %"class.llvm::FoldingSetNodeID"*, %"class.llvm::FoldingSetNodeID"** %1, align 8
- %3 = getelementptr inbounds %"class.llvm::FoldingSetNodeID", %"class.llvm::FoldingSetNodeID"* %2, i32 0, i32 0
+define void @foo(ptr %this) #0 align 2 !dbg !3 {
+ %1 = alloca ptr, align 8
+ store ptr %this, ptr %1, align 8
+ %2 = load ptr, ptr %1, align 8
; the call should have been inlined after sample-profile pass
; CHECK-NOT: call
- call void bitcast (void (%"class.llvm::SmallVectorImpl"*)* @bar to void (%"class.llvm::SmallVector"*)*)(%"class.llvm::SmallVector"* %3), !dbg !7
+ call void @bar(ptr %2), !dbg !7
ret void
}
-define void @bar(%"class.llvm::SmallVectorImpl"* %this) #0 align 2 !dbg !8 {
+define void @bar(ptr %this) #0 align 2 !dbg !8 {
ret void
}
diff --git a/llvm/test/Transforms/SampleProfile/inline-coverage.ll b/llvm/test/Transforms/SampleProfile/inline-coverage.ll
index 74525cd0cb48..6b0c3e9ddbf2 100644
--- a/llvm/test/Transforms/SampleProfile/inline-coverage.ll
+++ b/llvm/test/Transforms/SampleProfile/inline-coverage.ll
@@ -35,11 +35,11 @@
define i64 @_Z3fool(i64 %i) #0 !dbg !4 {
entry:
%i.addr = alloca i64, align 8
- store i64 %i, i64* %i.addr, align 8
- call void @llvm.dbg.declare(metadata i64* %i.addr, metadata !16, metadata !17), !dbg !18
+ store i64 %i, ptr %i.addr, align 8
+ call void @llvm.dbg.declare(metadata ptr %i.addr, metadata !16, metadata !17), !dbg !18
%call = call i32 @rand(), !dbg !19
%conv = sext i32 %call to i64, !dbg !19
- %0 = load i64, i64* %i.addr, align 8, !dbg !20
+ %0 = load i64, ptr %i.addr, align 8, !dbg !20
%mul = mul nsw i64 %conv, %0, !dbg !21
ret i64 %mul, !dbg !22
}
@@ -53,35 +53,35 @@ entry:
%retval = alloca i32, align 4
%sum = alloca i64, align 8
%i = alloca i32, align 4
- store i32 0, i32* %retval, align 4
- call void @llvm.dbg.declare(metadata i64* %sum, metadata !23, metadata !17), !dbg !24
- store i64 0, i64* %sum, align 8, !dbg !24
- call void @llvm.dbg.declare(metadata i32* %i, metadata !25, metadata !17), !dbg !27
- store i32 0, i32* %i, align 4, !dbg !27
+ store i32 0, ptr %retval, align 4
+ call void @llvm.dbg.declare(metadata ptr %sum, metadata !23, metadata !17), !dbg !24
+ store i64 0, ptr %sum, align 8, !dbg !24
+ call void @llvm.dbg.declare(metadata ptr %i, metadata !25, metadata !17), !dbg !27
+ store i32 0, ptr %i, align 4, !dbg !27
br label %for.cond, !dbg !28
for.cond: ; preds = %for.inc, %entry
- %0 = load i32, i32* %i, align 4, !dbg !29
+ %0 = load i32, ptr %i, align 4, !dbg !29
%cmp = icmp slt i32 %0, 600000000, !dbg !32
br i1 %cmp, label %for.body, label %for.end, !dbg !33
for.body: ; preds = %for.cond
- %1 = load i32, i32* %i, align 4, !dbg !34
+ %1 = load i32, ptr %i, align 4, !dbg !34
%conv = sext i32 %1 to i64, !dbg !34
%call = call i64 @_Z3fool(i64 %conv), !dbg !35
- %2 = load i64, i64* %sum, align 8, !dbg !36
+ %2 = load i64, ptr %sum, align 8, !dbg !36
%add = add nsw i64 %2, %call, !dbg !36
- store i64 %add, i64* %sum, align 8, !dbg !36
+ store i64 %add, ptr %sum, align 8, !dbg !36
br label %for.inc, !dbg !37
for.inc: ; preds = %for.body
- %3 = load i32, i32* %i, align 4, !dbg !38
+ %3 = load i32, ptr %i, align 4, !dbg !38
%inc = add nsw i32 %3, 1, !dbg !38
- store i32 %inc, i32* %i, align 4, !dbg !38
+ store i32 %inc, ptr %i, align 4, !dbg !38
br label %for.cond, !dbg !39
for.end: ; preds = %for.cond
- %4 = load i64, i64* %sum, align 8, !dbg !40
+ %4 = load i64, ptr %sum, align 8, !dbg !40
%cmp1 = icmp sgt i64 %4, 0, !dbg !41
%cond = select i1 %cmp1, i32 0, i32 1, !dbg !40
ret i32 %cond, !dbg !42
diff --git a/llvm/test/Transforms/SampleProfile/inline-mergeprof-dup.ll b/llvm/test/Transforms/SampleProfile/inline-mergeprof-dup.ll
index 8d1379a58229..c345d1017a45 100644
--- a/llvm/test/Transforms/SampleProfile/inline-mergeprof-dup.ll
+++ b/llvm/test/Transforms/SampleProfile/inline-mergeprof-dup.ll
@@ -1,42 +1,42 @@
;; Test we merge non-inlined profile only once with '-sample-profile-merge-inlinee'
; RUN: opt < %s -passes='function(callsite-splitting),sample-profile' -sample-profile-file=%S/Inputs/inline-mergeprof.prof -sample-profile-merge-inlinee=true -S | FileCheck %s
-%struct.bitmap = type { i32, %struct.bitmap* }
+%struct.bitmap = type { i32, ptr }
; CHECK-LABEL: @main
-define void @main(i1 %c, %struct.bitmap* %a_elt, %struct.bitmap* %b_elt) #0 !dbg !6 {
+define void @main(i1 %c, ptr %a_elt, ptr %b_elt) #0 !dbg !6 {
entry:
br label %Top
Top:
- %tobool1 = icmp eq %struct.bitmap* %a_elt, null
+ %tobool1 = icmp eq ptr %a_elt, null
br i1 %tobool1, label %CallSiteBB, label %NextCond
NextCond:
- %cmp = icmp ne %struct.bitmap* %b_elt, null
+ %cmp = icmp ne ptr %b_elt, null
br i1 %cmp, label %CallSiteBB, label %End
CallSiteBB:
%p = phi i1 [0, %Top], [%c, %NextCond]
;; The call site is replicated by callsite-splitting pass and they end up share the same sample profile
-; CHECK: call void @_Z3sumii(%struct.bitmap* null, %struct.bitmap* null, %struct.bitmap* %b_elt, i1 false)
-; CHECK: call void @_Z3sumii(%struct.bitmap* nonnull %a_elt, %struct.bitmap* nonnull %a_elt, %struct.bitmap* nonnull %b_elt, i1 %c)
- call void @_Z3sumii(%struct.bitmap* %a_elt, %struct.bitmap* %a_elt, %struct.bitmap* %b_elt, i1 %p), !dbg !8
+; CHECK: call void @_Z3sumii(ptr null, ptr null, ptr %b_elt, i1 false)
+; CHECK: call void @_Z3sumii(ptr nonnull %a_elt, ptr nonnull %a_elt, ptr nonnull %b_elt, i1 %c)
+ call void @_Z3sumii(ptr %a_elt, ptr %a_elt, ptr %b_elt, i1 %p), !dbg !8
br label %End
End:
ret void
}
-define void @_Z3sumii(%struct.bitmap* %dst_elt, %struct.bitmap* %a_elt, %struct.bitmap* %b_elt, i1 %c) #0 !dbg !12 {
+define void @_Z3sumii(ptr %dst_elt, ptr %a_elt, ptr %b_elt, i1 %c) #0 !dbg !12 {
entry:
- %tobool = icmp ne %struct.bitmap* %a_elt, null
- %tobool1 = icmp ne %struct.bitmap* %b_elt, null
+ %tobool = icmp ne ptr %a_elt, null
+ %tobool1 = icmp ne ptr %b_elt, null
%or.cond = and i1 %tobool, %tobool1, !dbg !13
br i1 %or.cond, label %Cond, label %Big
Cond:
- %cmp = icmp eq %struct.bitmap* %dst_elt, %a_elt, !dbg !14
+ %cmp = icmp eq ptr %dst_elt, %a_elt, !dbg !14
br i1 %cmp, label %Small, label %Big, !dbg !15
Small:
diff --git a/llvm/test/Transforms/SampleProfile/inline-mergeprof.ll b/llvm/test/Transforms/SampleProfile/inline-mergeprof.ll
index 1ad40168d0ac..3094b2523602 100644
--- a/llvm/test/Transforms/SampleProfile/inline-mergeprof.ll
+++ b/llvm/test/Transforms/SampleProfile/inline-mergeprof.ll
@@ -19,12 +19,12 @@ entry:
%retval = alloca i32, align 4
%s = alloca i32, align 4
%i = alloca i32, align 4
- %tmp = load i32, i32* %i, align 4, !dbg !8
- %tmp1 = load i32, i32* %s, align 4, !dbg !8
+ %tmp = load i32, ptr %i, align 4, !dbg !8
+ %tmp1 = load i32, ptr %s, align 4, !dbg !8
%call = call i32 @_Z3sumii(i32 %tmp, i32 %tmp1), !dbg !8
; SCALE: call i32 @_Z3sumii
; MERGE: call i32 @_Z3sumii
- store i32 %call, i32* %s, align 4, !dbg !8
+ store i32 %call, ptr %s, align 4, !dbg !8
ret i32 0, !dbg !11
}
@@ -32,13 +32,13 @@ define i32 @_Z3sumii(i32 %x, i32 %y) #0 !dbg !12 {
entry:
%x.addr = alloca i32, align 4
%y.addr = alloca i32, align 4
- store i32 %x, i32* %x.addr, align 4
- store i32 %y, i32* %y.addr, align 4
- %tmp = load i32, i32* %x.addr, align 4, !dbg !13
- %tmp1 = load i32, i32* %y.addr, align 4, !dbg !13
+ store i32 %x, ptr %x.addr, align 4
+ store i32 %y, ptr %y.addr, align 4
+ %tmp = load i32, ptr %x.addr, align 4, !dbg !13
+ %tmp1 = load i32, ptr %y.addr, align 4, !dbg !13
%add = add nsw i32 %tmp, %tmp1, !dbg !13
- %tmp2 = load i32, i32* %x.addr, align 4, !dbg !13
- %tmp3 = load i32, i32* %y.addr, align 4, !dbg !13
+ %tmp2 = load i32, ptr %x.addr, align 4, !dbg !13
+ %tmp3 = load i32, ptr %y.addr, align 4, !dbg !13
%cmp1 = icmp ne i32 %tmp3, 100, !dbg !13
br i1 %cmp1, label %if.then, label %if.else, !dbg !13
@@ -54,17 +54,17 @@ define i32 @_Z3subii(i32 %x, i32 %y) #0 !dbg !16 {
entry:
%x.addr = alloca i32, align 4
%y.addr = alloca i32, align 4
- store i32 %x, i32* %x.addr, align 4
- store i32 %y, i32* %y.addr, align 4
- %tmp = load i32, i32* %x.addr, align 4, !dbg !17
- %tmp1 = load i32, i32* %y.addr, align 4, !dbg !17
+ store i32 %x, ptr %x.addr, align 4
+ store i32 %y, ptr %y.addr, align 4
+ %tmp = load i32, ptr %x.addr, align 4, !dbg !17
+ %tmp1 = load i32, ptr %y.addr, align 4, !dbg !17
%add = sub nsw i32 %tmp, %tmp1, !dbg !17
ret i32 %add, !dbg !18
}
attributes #0 = { "use-sample-profile" }
-declare i32 @printf(i8*, ...)
+declare i32 @printf(ptr, ...)
!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!3, !4}
diff --git a/llvm/test/Transforms/SampleProfile/inline-noduplicate.ll b/llvm/test/Transforms/SampleProfile/inline-noduplicate.ll
index 16e447726233..b3aaf4b57de8 100644
--- a/llvm/test/Transforms/SampleProfile/inline-noduplicate.ll
+++ b/llvm/test/Transforms/SampleProfile/inline-noduplicate.ll
@@ -15,10 +15,10 @@ entry:
call void @bar() "call-inline-cost"="1000"
%x.addr = alloca i32, align 4
%y.addr = alloca i32, align 4
- store i32 %x, i32* %x.addr, align 4
- store i32 %y, i32* %y.addr, align 4
- %0 = load i32, i32* %x.addr, align 4, !dbg !11
- %1 = load i32, i32* %y.addr, align 4, !dbg !11
+ store i32 %x, ptr %x.addr, align 4
+ store i32 %y, ptr %y.addr, align 4
+ %0 = load i32, ptr %x.addr, align 4, !dbg !11
+ %1 = load i32, ptr %y.addr, align 4, !dbg !11
%add = add nsw i32 %0, %1, !dbg !11
ret i32 %add, !dbg !11
}
@@ -29,47 +29,47 @@ entry:
%retval = alloca i32, align 4
%s = alloca i32, align 4
%i = alloca i32, align 4
- store i32 0, i32* %retval
- store i32 0, i32* %i, align 4, !dbg !12
+ store i32 0, ptr %retval
+ store i32 0, ptr %i, align 4, !dbg !12
br label %while.cond, !dbg !13
while.cond: ; preds = %if.end, %entry
- %0 = load i32, i32* %i, align 4, !dbg !14
+ %0 = load i32, ptr %i, align 4, !dbg !14
%inc = add nsw i32 %0, 1, !dbg !14
- store i32 %inc, i32* %i, align 4, !dbg !14
+ store i32 %inc, ptr %i, align 4, !dbg !14
%cmp = icmp slt i32 %0, 400000000, !dbg !14
br i1 %cmp, label %while.body, label %while.end, !dbg !14
while.body: ; preds = %while.cond
- %1 = load i32, i32* %i, align 4, !dbg !16
+ %1 = load i32, ptr %i, align 4, !dbg !16
%cmp1 = icmp ne i32 %1, 100, !dbg !16
br i1 %cmp1, label %if.then, label %if.else, !dbg !16
if.then: ; preds = %while.body
- %2 = load i32, i32* %i, align 4, !dbg !18
- %3 = load i32, i32* %s, align 4, !dbg !18
+ %2 = load i32, ptr %i, align 4, !dbg !18
+ %3 = load i32, ptr %s, align 4, !dbg !18
%call = call i32 @_Z3sumii(i32 %2, i32 %3), !dbg !18
; _Z3sumii should not be inlined because of the noduplicate call to foo.
; CHECK: call i32 @_Z3sumii
; CHECK-NOT: call void @foo
- store i32 %call, i32* %s, align 4, !dbg !18
+ store i32 %call, ptr %s, align 4, !dbg !18
br label %if.end, !dbg !18
if.else: ; preds = %while.body
- store i32 30, i32* %s, align 4, !dbg !20
+ store i32 30, ptr %s, align 4, !dbg !20
br label %if.end
if.end: ; preds = %if.else, %if.then
br label %while.cond, !dbg !22
while.end: ; preds = %while.cond
- %4 = load i32, i32* %s, align 4, !dbg !24
- %call2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i32 0, i32 0), i32 %4), !dbg !24
+ %4 = load i32, ptr %s, align 4, !dbg !24
+ %call2 = call i32 (ptr, ...) @printf(ptr @.str, i32 %4), !dbg !24
ret i32 0, !dbg !25
}
-declare i32 @printf(i8*, ...) #2
+declare i32 @printf(ptr, ...) #2
attributes #0 = { "use-sample-profile" }
diff --git a/llvm/test/Transforms/SampleProfile/inline-replay.ll b/llvm/test/Transforms/SampleProfile/inline-replay.ll
index 77e142f2d03b..56a3e6fe7eb8 100644
--- a/llvm/test/Transforms/SampleProfile/inline-replay.ll
+++ b/llvm/test/Transforms/SampleProfile/inline-replay.ll
@@ -109,13 +109,13 @@ define i32 @_Z3sumii(i32 %x, i32 %y) #0 !dbg !6 {
entry:
%x.addr = alloca i32, align 4
%y.addr = alloca i32, align 4
- store i32 %x, i32* %x.addr, align 4
- store i32 %y, i32* %y.addr, align 4
- %tmp = load i32, i32* %x.addr, align 4, !dbg !8
- %tmp1 = load i32, i32* %y.addr, align 4, !dbg !8
+ store i32 %x, ptr %x.addr, align 4
+ store i32 %y, ptr %y.addr, align 4
+ %tmp = load i32, ptr %x.addr, align 4, !dbg !8
+ %tmp1 = load i32, ptr %y.addr, align 4, !dbg !8
%add = add nsw i32 %tmp, %tmp1, !dbg !8
- %tmp2 = load i32, i32* %x.addr, align 4, !dbg !8
- %tmp3 = load i32, i32* %y.addr, align 4, !dbg !8
+ %tmp2 = load i32, ptr %x.addr, align 4, !dbg !8
+ %tmp3 = load i32, ptr %y.addr, align 4, !dbg !8
%call = call i32 @_Z3subii(i32 %tmp2, i32 %tmp3), !dbg !8
ret i32 %add, !dbg !8
}
@@ -124,10 +124,10 @@ define i32 @_Z3subii(i32 %x, i32 %y) #0 !dbg !9 {
entry:
%x.addr = alloca i32, align 4
%y.addr = alloca i32, align 4
- store i32 %x, i32* %x.addr, align 4
- store i32 %y, i32* %y.addr, align 4
- %tmp = load i32, i32* %x.addr, align 4, !dbg !10
- %tmp1 = load i32, i32* %y.addr, align 4, !dbg !10
+ store i32 %x, ptr %x.addr, align 4
+ store i32 %y, ptr %y.addr, align 4
+ %tmp = load i32, ptr %x.addr, align 4, !dbg !10
+ %tmp1 = load i32, ptr %y.addr, align 4, !dbg !10
%add = sub nsw i32 %tmp, %tmp1, !dbg !10
ret i32 %add, !dbg !11
}
@@ -137,43 +137,43 @@ entry:
%retval = alloca i32, align 4
%s = alloca i32, align 4
%i = alloca i32, align 4
- store i32 0, i32* %retval
- store i32 0, i32* %i, align 4, !dbg !13
+ store i32 0, ptr %retval
+ store i32 0, ptr %i, align 4, !dbg !13
br label %while.cond, !dbg !14
while.cond: ; preds = %if.end, %entry
- %tmp = load i32, i32* %i, align 4, !dbg !15
+ %tmp = load i32, ptr %i, align 4, !dbg !15
%inc = add nsw i32 %tmp, 1, !dbg !15
- store i32 %inc, i32* %i, align 4, !dbg !15
+ store i32 %inc, ptr %i, align 4, !dbg !15
%cmp = icmp slt i32 %tmp, 400000000, !dbg !15
br i1 %cmp, label %while.body, label %while.end, !dbg !15
while.body: ; preds = %while.cond
- %tmp1 = load i32, i32* %i, align 4, !dbg !17
+ %tmp1 = load i32, ptr %i, align 4, !dbg !17
%cmp1 = icmp ne i32 %tmp1, 100, !dbg !17
br i1 %cmp1, label %if.then, label %if.else, !dbg !17
if.then: ; preds = %while.body
- %tmp2 = load i32, i32* %i, align 4, !dbg !19
- %tmp3 = load i32, i32* %s, align 4, !dbg !19
+ %tmp2 = load i32, ptr %i, align 4, !dbg !19
+ %tmp3 = load i32, ptr %s, align 4, !dbg !19
%call = call i32 @_Z3sumii(i32 %tmp2, i32 %tmp3), !dbg !19
- store i32 %call, i32* %s, align 4, !dbg !19
+ store i32 %call, ptr %s, align 4, !dbg !19
br label %if.end, !dbg !19
if.else: ; preds = %while.body
- store i32 30, i32* %s, align 4, !dbg !21
+ store i32 30, ptr %s, align 4, !dbg !21
br label %if.end
if.end: ; preds = %if.else, %if.then
br label %while.cond, !dbg !23
while.end: ; preds = %while.cond
- %tmp4 = load i32, i32* %s, align 4, !dbg !25
- %call2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i32 0, i32 0), i32 %tmp4), !dbg !25
+ %tmp4 = load i32, ptr %s, align 4, !dbg !25
+ %call2 = call i32 (ptr, ...) @printf(ptr @.str, i32 %tmp4), !dbg !25
ret i32 0, !dbg !26
}
-declare i32 @printf(i8*, ...)
+declare i32 @printf(ptr, ...)
attributes #0 = { "use-sample-profile" }
diff --git a/llvm/test/Transforms/SampleProfile/inline-stats.ll b/llvm/test/Transforms/SampleProfile/inline-stats.ll
index a676b5385854..4e3d49e09270 100644
--- a/llvm/test/Transforms/SampleProfile/inline-stats.ll
+++ b/llvm/test/Transforms/SampleProfile/inline-stats.ll
@@ -22,10 +22,10 @@ define i32 @_Z3sumii(i32 %x, i32 %y) #0 !dbg !6 {
entry:
%x.addr = alloca i32, align 4
%y.addr = alloca i32, align 4
- store i32 %x, i32* %x.addr, align 4
- store i32 %y, i32* %y.addr, align 4
- %tmp = load i32, i32* %x.addr, align 4, !dbg !8
- %tmp1 = load i32, i32* %y.addr, align 4, !dbg !8
+ store i32 %x, ptr %x.addr, align 4
+ store i32 %y, ptr %y.addr, align 4
+ %tmp = load i32, ptr %x.addr, align 4, !dbg !8
+ %tmp1 = load i32, ptr %y.addr, align 4, !dbg !8
%add = add nsw i32 %tmp, %tmp1, !dbg !8
ret i32 %add, !dbg !8
}
@@ -34,42 +34,42 @@ entry:
%retval = alloca i32, align 4
%s = alloca i32, align 4
%i = alloca i32, align 4
- store i32 0, i32* %retval
- store i32 0, i32* %i, align 4, !dbg !10
+ store i32 0, ptr %retval
+ store i32 0, ptr %i, align 4, !dbg !10
br label %while.cond, !dbg !11
while.cond: ; preds = %if.end, %entry
- %tmp = load i32, i32* %i, align 4, !dbg !12
+ %tmp = load i32, ptr %i, align 4, !dbg !12
%inc = add nsw i32 %tmp, 1, !dbg !12
- store i32 %inc, i32* %i, align 4, !dbg !12
+ store i32 %inc, ptr %i, align 4, !dbg !12
%cmp = icmp slt i32 %tmp, 400000000, !dbg !12
br i1 %cmp, label %while.body, label %while.end, !dbg !12
while.body: ; preds = %while.cond
- %tmp1 = load i32, i32* %i, align 4, !dbg !14
+ %tmp1 = load i32, ptr %i, align 4, !dbg !14
%cmp1 = icmp ne i32 %tmp1, 100, !dbg !14
br i1 %cmp1, label %if.then, label %if.else, !dbg !14
if.then: ; preds = %while.body
- %tmp2 = load i32, i32* %i, align 4, !dbg !16
- %tmp3 = load i32, i32* %s, align 4, !dbg !16
+ %tmp2 = load i32, ptr %i, align 4, !dbg !16
+ %tmp3 = load i32, ptr %s, align 4, !dbg !16
%call = call i32 @_Z3sumii(i32 %tmp2, i32 %tmp3), !dbg !16
- store i32 %call, i32* %s, align 4, !dbg !16
+ store i32 %call, ptr %s, align 4, !dbg !16
br label %if.end, !dbg !16
if.else: ; preds = %while.body
- store i32 30, i32* %s, align 4, !dbg !18
+ store i32 30, ptr %s, align 4, !dbg !18
br label %if.end
if.end: ; preds = %if.else, %if.then
br label %while.cond, !dbg !20
while.end: ; preds = %while.cond
- %tmp4 = load i32, i32* %s, align 4, !dbg !22
- %call2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i32 0, i32 0), i32 %tmp4), !dbg !22
+ %tmp4 = load i32, ptr %s, align 4, !dbg !22
+ %call2 = call i32 (ptr, ...) @printf(ptr @.str, i32 %tmp4), !dbg !22
ret i32 0, !dbg !23
}
-declare i32 @printf(i8*, ...)
+declare i32 @printf(ptr, ...)
attributes #0 = { "use-sample-profile" }
diff --git a/llvm/test/Transforms/SampleProfile/inline-topdown.ll b/llvm/test/Transforms/SampleProfile/inline-topdown.ll
index 8e8e07696030..60b73bb95e86 100644
--- a/llvm/test/Transforms/SampleProfile/inline-topdown.ll
+++ b/llvm/test/Transforms/SampleProfile/inline-topdown.ll
@@ -13,13 +13,13 @@ define i32 @_Z3sumii(i32 %x, i32 %y) #0 !dbg !6 {
entry:
%x.addr = alloca i32, align 4
%y.addr = alloca i32, align 4
- store i32 %x, i32* %x.addr, align 4
- store i32 %y, i32* %y.addr, align 4
- %tmp = load i32, i32* %x.addr, align 4, !dbg !8
- %tmp1 = load i32, i32* %y.addr, align 4, !dbg !8
+ store i32 %x, ptr %x.addr, align 4
+ store i32 %y, ptr %y.addr, align 4
+ %tmp = load i32, ptr %x.addr, align 4, !dbg !8
+ %tmp1 = load i32, ptr %y.addr, align 4, !dbg !8
%add = add nsw i32 %tmp, %tmp1, !dbg !8
- %tmp2 = load i32, i32* %x.addr, align 4, !dbg !8
- %tmp3 = load i32, i32* %y.addr, align 4, !dbg !8
+ %tmp2 = load i32, ptr %x.addr, align 4, !dbg !8
+ %tmp3 = load i32, ptr %y.addr, align 4, !dbg !8
%call = call i32 @_Z3subii(i32 %tmp2, i32 %tmp3), !dbg !8
ret i32 %add, !dbg !8
}
@@ -28,10 +28,10 @@ define i32 @_Z3subii(i32 %x, i32 %y) #0 !dbg !9 {
entry:
%x.addr = alloca i32, align 4
%y.addr = alloca i32, align 4
- store i32 %x, i32* %x.addr, align 4
- store i32 %y, i32* %y.addr, align 4
- %tmp = load i32, i32* %x.addr, align 4, !dbg !10
- %tmp1 = load i32, i32* %y.addr, align 4, !dbg !10
+ store i32 %x, ptr %x.addr, align 4
+ store i32 %y, ptr %y.addr, align 4
+ %tmp = load i32, ptr %x.addr, align 4, !dbg !10
+ %tmp1 = load i32, ptr %y.addr, align 4, !dbg !10
%add = sub nsw i32 %tmp, %tmp1, !dbg !10
ret i32 %add, !dbg !11
}
@@ -41,43 +41,43 @@ entry:
%retval = alloca i32, align 4
%s = alloca i32, align 4
%i = alloca i32, align 4
- store i32 0, i32* %retval
- store i32 0, i32* %i, align 4, !dbg !13
+ store i32 0, ptr %retval
+ store i32 0, ptr %i, align 4, !dbg !13
br label %while.cond, !dbg !14
while.cond: ; preds = %if.end, %entry
- %tmp = load i32, i32* %i, align 4, !dbg !15
+ %tmp = load i32, ptr %i, align 4, !dbg !15
%inc = add nsw i32 %tmp, 1, !dbg !15
- store i32 %inc, i32* %i, align 4, !dbg !15
+ store i32 %inc, ptr %i, align 4, !dbg !15
%cmp = icmp slt i32 %tmp, 400000000, !dbg !15
br i1 %cmp, label %while.body, label %while.end, !dbg !15
while.body: ; preds = %while.cond
- %tmp1 = load i32, i32* %i, align 4, !dbg !17
+ %tmp1 = load i32, ptr %i, align 4, !dbg !17
%cmp1 = icmp ne i32 %tmp1, 100, !dbg !17
br i1 %cmp1, label %if.then, label %if.else, !dbg !17
if.then: ; preds = %while.body
- %tmp2 = load i32, i32* %i, align 4, !dbg !19
- %tmp3 = load i32, i32* %s, align 4, !dbg !19
+ %tmp2 = load i32, ptr %i, align 4, !dbg !19
+ %tmp3 = load i32, ptr %s, align 4, !dbg !19
%call = call i32 @_Z3sumii(i32 %tmp2, i32 %tmp3), !dbg !19
- store i32 %call, i32* %s, align 4, !dbg !19
+ store i32 %call, ptr %s, align 4, !dbg !19
br label %if.end, !dbg !19
if.else: ; preds = %while.body
- store i32 30, i32* %s, align 4, !dbg !21
+ store i32 30, ptr %s, align 4, !dbg !21
br label %if.end
if.end: ; preds = %if.else, %if.then
br label %while.cond, !dbg !23
while.end: ; preds = %while.cond
- %tmp4 = load i32, i32* %s, align 4, !dbg !25
- %call2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i32 0, i32 0), i32 %tmp4), !dbg !25
+ %tmp4 = load i32, ptr %s, align 4, !dbg !25
+ %call2 = call i32 (ptr, ...) @printf(ptr @.str, i32 %tmp4), !dbg !25
ret i32 0, !dbg !26
}
-declare i32 @printf(i8*, ...)
+declare i32 @printf(ptr, ...)
attributes #0 = { "use-sample-profile" }
diff --git a/llvm/test/Transforms/SampleProfile/inline.ll b/llvm/test/Transforms/SampleProfile/inline.ll
index 0098e102baca..0a3a58b697f9 100644
--- a/llvm/test/Transforms/SampleProfile/inline.ll
+++ b/llvm/test/Transforms/SampleProfile/inline.ll
@@ -24,10 +24,10 @@ define i32 @_Z3sumii(i32 %x, i32 %y) #0 !dbg !4 {
entry:
%x.addr = alloca i32, align 4
%y.addr = alloca i32, align 4
- store i32 %x, i32* %x.addr, align 4
- store i32 %y, i32* %y.addr, align 4
- %0 = load i32, i32* %x.addr, align 4, !dbg !11
- %1 = load i32, i32* %y.addr, align 4, !dbg !11
+ store i32 %x, ptr %x.addr, align 4
+ store i32 %y, ptr %y.addr, align 4
+ %0 = load i32, ptr %x.addr, align 4, !dbg !11
+ %1 = load i32, ptr %y.addr, align 4, !dbg !11
%add = add nsw i32 %0, %1, !dbg !11
ret i32 %add, !dbg !11
}
@@ -38,45 +38,45 @@ entry:
%retval = alloca i32, align 4
%s = alloca i32, align 4
%i = alloca i32, align 4
- store i32 0, i32* %retval
- store i32 0, i32* %i, align 4, !dbg !12
+ store i32 0, ptr %retval
+ store i32 0, ptr %i, align 4, !dbg !12
br label %while.cond, !dbg !13
while.cond: ; preds = %if.end, %entry
- %0 = load i32, i32* %i, align 4, !dbg !14
+ %0 = load i32, ptr %i, align 4, !dbg !14
%inc = add nsw i32 %0, 1, !dbg !14
- store i32 %inc, i32* %i, align 4, !dbg !14
+ store i32 %inc, ptr %i, align 4, !dbg !14
%cmp = icmp slt i32 %0, 400000000, !dbg !14
br i1 %cmp, label %while.body, label %while.end, !dbg !14
while.body: ; preds = %while.cond
- %1 = load i32, i32* %i, align 4, !dbg !16
+ %1 = load i32, ptr %i, align 4, !dbg !16
%cmp1 = icmp ne i32 %1, 100, !dbg !16
br i1 %cmp1, label %if.then, label %if.else, !dbg !16
if.then: ; preds = %while.body
- %2 = load i32, i32* %i, align 4, !dbg !18
- %3 = load i32, i32* %s, align 4, !dbg !18
+ %2 = load i32, ptr %i, align 4, !dbg !18
+ %3 = load i32, ptr %s, align 4, !dbg !18
%call = call i32 @_Z3sumii(i32 %2, i32 %3), !dbg !18
; CHECK-NOT: call i32 @_Z3sumii
- store i32 %call, i32* %s, align 4, !dbg !18
+ store i32 %call, ptr %s, align 4, !dbg !18
br label %if.end, !dbg !18
if.else: ; preds = %while.body
- store i32 30, i32* %s, align 4, !dbg !20
+ store i32 30, ptr %s, align 4, !dbg !20
br label %if.end
if.end: ; preds = %if.else, %if.then
br label %while.cond, !dbg !22
while.end: ; preds = %while.cond
- %4 = load i32, i32* %s, align 4, !dbg !24
- %call2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i32 0, i32 0), i32 %4), !dbg !24
+ %4 = load i32, ptr %s, align 4, !dbg !24
+ %call2 = call i32 (ptr, ...) @printf(ptr @.str, i32 %4), !dbg !24
ret i32 0, !dbg !25
}
-declare i32 @printf(i8*, ...) #2
+declare i32 @printf(ptr, ...) #2
attributes #0 = { "use-sample-profile" }
diff --git a/llvm/test/Transforms/SampleProfile/nodebug-error.ll b/llvm/test/Transforms/SampleProfile/nodebug-error.ll
index 746846572aee..6aa7732d5d9f 100644
--- a/llvm/test/Transforms/SampleProfile/nodebug-error.ll
+++ b/llvm/test/Transforms/SampleProfile/nodebug-error.ll
@@ -6,29 +6,29 @@
; RUN: -sample-profile-merge-inlinee=true -S 2>&1| FileCheck %s
@.str = private unnamed_addr constant [11 x i8] c"sum is %d\0A\00", align 1
-declare void @__cxa_call_unexpected(i8*)
+declare void @__cxa_call_unexpected(ptr)
declare i32 @__gxx_personality_v0(...)
declare i32 @_Z3subii(i32 %x, i32 %y)
-define i32 @main() "use-sample-profile" nounwind uwtable ssp personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) !dbg !6 {
+define i32 @main() "use-sample-profile" nounwind uwtable ssp personality ptr @__gxx_personality_v0 !dbg !6 {
entry:
%retval = alloca i32, align 4
%s = alloca i32, align 4
%i = alloca i32, align 4
- %tmp = load i32, i32* %i, align 4, !dbg !8
- %tmp1 = load i32, i32* %s, align 4, !dbg !8
+ %tmp = load i32, ptr %i, align 4, !dbg !8
+ %tmp1 = load i32, ptr %s, align 4, !dbg !8
%call = invoke i32 @foo(i32 %tmp, i32 %tmp1)
to label %cont unwind label %lpad, !dbg !8
; CHECK-NOT: warning: No debug information found in function foo
; CHECK: invoke i32 @foo
cont:
- store i32 %call, i32* %s, align 4, !dbg !8
+ store i32 %call, ptr %s, align 4, !dbg !8
ret i32 0, !dbg !11
lpad:
- %lptmp0 = landingpad { i8*, i32 }
- filter [0 x i8*] zeroinitializer
- %lptmp1 = extractvalue { i8*, i32 } %lptmp0, 0
- tail call void @__cxa_call_unexpected(i8* %lptmp1) noreturn nounwind
+ %lptmp0 = landingpad { ptr, i32 }
+ filter [0 x ptr] zeroinitializer
+ %lptmp1 = extractvalue { ptr, i32 } %lptmp0, 0
+ tail call void @__cxa_call_unexpected(ptr %lptmp1) noreturn nounwind
unreachable
}
@@ -40,7 +40,7 @@ entry:
attributes #0 = { "use-sample-profile" }
-declare i32 @printf(i8*, ...)
+declare i32 @printf(ptr, ...)
!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!3, !4}
diff --git a/llvm/test/Transforms/SampleProfile/nolocinfo.ll b/llvm/test/Transforms/SampleProfile/nolocinfo.ll
index c078bc3ade4b..3c501f3efb78 100644
--- a/llvm/test/Transforms/SampleProfile/nolocinfo.ll
+++ b/llvm/test/Transforms/SampleProfile/nolocinfo.ll
@@ -3,7 +3,7 @@
define i32 @foo(i32 %i) #0 !dbg !4 {
entry:
%i.addr = alloca i32, align 4
- %0 = load i32, i32* %i.addr, align 4
+ %0 = load i32, ptr %i.addr, align 4
%cmp = icmp sgt i32 %0, 1000
; Remarks for conditional branches need debug location information for the
diff --git a/llvm/test/Transforms/SampleProfile/norepeated-icp-2.ll b/llvm/test/Transforms/SampleProfile/norepeated-icp-2.ll
index e99c5db125b6..30a51989c946 100644
--- a/llvm/test/Transforms/SampleProfile/norepeated-icp-2.ll
+++ b/llvm/test/Transforms/SampleProfile/norepeated-icp-2.ll
@@ -5,24 +5,24 @@ target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16
target triple = "x86_64-unknown-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"moo\0A\00", align 1
- at p = dso_local global void ()* null, align 8
+ at p = dso_local global ptr null, align 8
@cond = dso_local global i8 0, align 1
@str = private unnamed_addr constant [4 x i8] c"moo\00", align 1
; Function Attrs: uwtable mustprogress
define dso_local void @_Z3moov() #0 !dbg !7 {
entry:
- %puts = call i32 @puts(i8* nonnull dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0)), !dbg !9
+ %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str), !dbg !9
ret void, !dbg !10
}
; Function Attrs: nofree nounwind
-declare dso_local noundef i32 @printf(i8* nocapture noundef readonly, ...) #1
+declare dso_local noundef i32 @printf(ptr nocapture noundef readonly, ...) #1
; Function Attrs: uwtable mustprogress
define dso_local void @_Z3hoov() #0 !dbg !11 {
entry:
- %0 = load volatile i8, i8* @cond, align 1, !dbg !12, !range !17
+ %0 = load volatile i8, ptr @cond, align 1, !dbg !12, !range !17
%tobool.not = icmp eq i8 %0, 0, !dbg !12
br i1 %tobool.not, label %if.end, label %if.then, !dbg !12
@@ -31,42 +31,42 @@ if.then: ; preds = %entry
br label %if.end, !dbg !18
if.end: ; preds = %if.then, %entry
- store void ()* @_Z3moov, void ()** @p, align 8, !dbg !19
+ store ptr @_Z3moov, ptr @p, align 8, !dbg !19
ret void, !dbg !22
}
declare !dbg !23 dso_local void @_Z10hoo_calleev() #2
; MAX2-LABEL: @_Z3goov(
-; MAX2: icmp eq void ()* {{.*}} @_Z3hoov
+; MAX2: icmp eq ptr {{.*}} @_Z3hoov
; MAX2: call void %t0(), {{.*}} !prof ![[PROF_ID1:[0-9]+]]
-; MAX2-NOT: icmp eq void ()* {{.*}} @_Z3hoov
-; MAX2-NOT: icmp eq void ()* {{.*}} @_Z3moov
+; MAX2-NOT: icmp eq ptr {{.*}} @_Z3hoov
+; MAX2-NOT: icmp eq ptr {{.*}} @_Z3moov
; MAX2: call void %t1(), {{.*}} !prof ![[PROF_ID2:[0-9]+]]
-; MAX2-NOT: icmp eq void ()* {{.*}} @_Z3hoov
-; MAX2-NOT: icmp eq void ()* {{.*}} @_Z3moov
+; MAX2-NOT: icmp eq ptr {{.*}} @_Z3hoov
+; MAX2-NOT: icmp eq ptr {{.*}} @_Z3moov
; MAX2: call void %t2(), {{.*}} !prof ![[PROF_ID2:[0-9]+]]
; MAX2: ret void
; MAX4-LABEL: @_Z3goov(
-; MAX4: icmp eq void ()* {{.*}} @_Z3hoov
-; MAX4: icmp eq void ()* {{.*}} @_Z3moov
+; MAX4: icmp eq ptr {{.*}} @_Z3hoov
+; MAX4: icmp eq ptr {{.*}} @_Z3moov
; MAX4: call void %t0(), {{.*}} !prof ![[PROF_ID3:[0-9]+]]
-; MAX4: icmp eq void ()* {{.*}} @_Z3hoov
-; MAX4: icmp eq void ()* {{.*}} @_Z3moov
+; MAX4: icmp eq ptr {{.*}} @_Z3hoov
+; MAX4: icmp eq ptr {{.*}} @_Z3moov
; MAX4: call void %t1(), {{.*}} !prof ![[PROF_ID4:[0-9]+]]
-; MAX4-NOT: icmp eq void ()* {{.*}} @_Z3hoov
-; MAX4-NOT: icmp eq void ()* {{.*}} @_Z3moov
+; MAX4-NOT: icmp eq ptr {{.*}} @_Z3hoov
+; MAX4-NOT: icmp eq ptr {{.*}} @_Z3moov
; MAX4: call void %t2(), {{.*}} !prof ![[PROF_ID5:[0-9]+]]
; MAX4: ret void
; Function Attrs: uwtable mustprogress
define dso_local void @_Z3goov() #0 !dbg !24 {
entry:
- %t0 = load void ()*, void ()** @p, align 8, !dbg !25
+ %t0 = load ptr, ptr @p, align 8, !dbg !25
call void %t0(), !dbg !26, !prof !30
- %t1 = load void ()*, void ()** @p, align 8, !dbg !25
+ %t1 = load ptr, ptr @p, align 8, !dbg !25
call void %t1(), !dbg !28, !prof !31
- %t2 = load void ()*, void ()** @p, align 8, !dbg !25
+ %t2 = load ptr, ptr @p, align 8, !dbg !25
call void %t2(), !dbg !29, !prof !32
ret void, !dbg !27
}
@@ -78,7 +78,7 @@ entry:
; MAX4: ![[PROF_ID5]] = !{!"VP", i32 0, i64 13000, i64 4128940972712279918, i64 -1, i64 3137940972712279918, i64 -1, i64 2132940972712279918, i64 -1, i64 1850239051784516332, i64 -1}
; Function Attrs: nofree nounwind
-declare noundef i32 @puts(i8* nocapture noundef readonly) #3
+declare noundef i32 @puts(ptr nocapture noundef readonly) #3
attributes #0 = { uwtable mustprogress "disable-tail-calls"="false" "frame-pointer"="none" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" "unsafe-fp-math"="false" "use-sample-profile" "use-soft-float"="false" }
attributes #1 = { nofree nounwind "disable-tail-calls"="false" "frame-pointer"="none" "less-precise-fpmad"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" "unsafe-fp-math"="false" "use-soft-float"="false" }
diff --git a/llvm/test/Transforms/SampleProfile/norepeated-icp-3.ll b/llvm/test/Transforms/SampleProfile/norepeated-icp-3.ll
index 140a15f58747..9b9bbca48c90 100644
--- a/llvm/test/Transforms/SampleProfile/norepeated-icp-3.ll
+++ b/llvm/test/Transforms/SampleProfile/norepeated-icp-3.ll
@@ -4,16 +4,16 @@ target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16
target triple = "x86_64-unknown-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"hoo\0A\00", align 1
- at p = dso_local global void ()* null, align 8
+ at p = dso_local global ptr null, align 8
@str = private unnamed_addr constant [4 x i8] c"hoo\00", align 1
; Function Attrs: nofree nounwind
-declare dso_local noundef i32 @printf(i8* nocapture noundef readonly, ...) #1
+declare dso_local noundef i32 @printf(ptr nocapture noundef readonly, ...) #1
; Function Attrs: uwtable mustprogress
define dso_local void @_Z3goov() #0 !dbg !11 {
entry:
- %0 = load void ()*, void ()** @p, align 8, !dbg !12, !tbaa !13
+ %0 = load ptr, ptr @p, align 8, !dbg !12, !tbaa !13
call void %0(), !dbg !17, !prof !22
ret void, !dbg !18
}
@@ -34,7 +34,7 @@ entry:
}
; Function Attrs: nofree nounwind
-declare noundef i32 @puts(i8* nocapture noundef readonly) #2
+declare noundef i32 @puts(ptr nocapture noundef readonly) #2
attributes #0 = { uwtable mustprogress "disable-tail-calls"="false" "frame-pointer"="none" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" "unsafe-fp-math"="false" "use-sample-profile" "use-soft-float"="false" }
attributes #1 = { nofree nounwind "disable-tail-calls"="false" "frame-pointer"="none" "less-precise-fpmad"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" "unsafe-fp-math"="false" "use-soft-float"="false" }
diff --git a/llvm/test/Transforms/SampleProfile/norepeated-icp-4.ll b/llvm/test/Transforms/SampleProfile/norepeated-icp-4.ll
index 5bfcce7d6e7d..57a2386951db 100644
--- a/llvm/test/Transforms/SampleProfile/norepeated-icp-4.ll
+++ b/llvm/test/Transforms/SampleProfile/norepeated-icp-4.ll
@@ -3,7 +3,7 @@
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
- at p = dso_local global void ()* null, align 8
+ at p = dso_local global ptr null, align 8
; After _Z3goov is inlined into _Z3foov, the value profile of the indirect
; call in _Z3goov and _Z3foov need to be scaled. The test is to make sure
@@ -21,7 +21,7 @@ target triple = "x86_64-unknown-linux-gnu"
; Function Attrs: uwtable mustprogress
define dso_local void @_Z3goov() #0 !dbg !11 !prof !23 {
entry:
- %t0 = load void ()*, void ()** @p, align 8, !dbg !12, !tbaa !13
+ %t0 = load ptr, ptr @p, align 8, !dbg !12, !tbaa !13
call void %t0(), !dbg !17, !prof !22
ret void, !dbg !18
}
diff --git a/llvm/test/Transforms/SampleProfile/norepeated-icp.ll b/llvm/test/Transforms/SampleProfile/norepeated-icp.ll
index ce6998138a35..f3340ba1a587 100644
--- a/llvm/test/Transforms/SampleProfile/norepeated-icp.ll
+++ b/llvm/test/Transforms/SampleProfile/norepeated-icp.ll
@@ -4,23 +4,23 @@ target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16
target triple = "x86_64-unknown-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"hoo\0A\00", align 1
- at p = dso_local global void ()* null, align 8
+ at p = dso_local global ptr null, align 8
@str = private unnamed_addr constant [4 x i8] c"hoo\00", align 1
; Function Attrs: uwtable mustprogress
define dso_local void @_Z3hoov() #0 !dbg !7 {
entry:
- %puts = call i32 @puts(i8* nonnull dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0)), !dbg !9
+ %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str), !dbg !9
ret void, !dbg !10
}
; Function Attrs: nofree nounwind
-declare dso_local noundef i32 @printf(i8* nocapture noundef readonly, ...) #1
+declare dso_local noundef i32 @printf(ptr nocapture noundef readonly, ...) #1
; Function Attrs: uwtable mustprogress
define dso_local void @_Z3goov() #0 !dbg !11 {
entry:
- %0 = load void ()*, void ()** @p, align 8, !dbg !12, !tbaa !13
+ %0 = load ptr, ptr @p, align 8, !dbg !12, !tbaa !13
call void %0(), !dbg !17
ret void, !dbg !18
}
@@ -28,8 +28,8 @@ entry:
; Check the indirect call in _Z3goov inlined into _Z3foov won't be indirect
; call promoted for _Z3hoov twice in _Z3foov.
; CHECK-LABEL: @_Z3foov(
-; CHECK: icmp eq void ()* {{.*}} @_Z3hoov
-; CHECK-NOT: icmp eq void ()* {{.*}} @_Z3hoov
+; CHECK: icmp eq ptr {{.*}} @_Z3hoov
+; CHECK-NOT: icmp eq ptr {{.*}} @_Z3hoov
; CHECK: ret void
; Function Attrs: uwtable mustprogress
@@ -40,7 +40,7 @@ entry:
}
; Function Attrs: nofree nounwind
-declare noundef i32 @puts(i8* nocapture noundef readonly) #2
+declare noundef i32 @puts(ptr nocapture noundef readonly) #2
attributes #0 = { uwtable mustprogress "disable-tail-calls"="false" "frame-pointer"="none" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" "unsafe-fp-math"="false" "use-sample-profile" "use-soft-float"="false" }
attributes #1 = { nofree nounwind "disable-tail-calls"="false" "frame-pointer"="none" "less-precise-fpmad"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" "unsafe-fp-math"="false" "use-soft-float"="false" }
diff --git a/llvm/test/Transforms/SampleProfile/offset.ll b/llvm/test/Transforms/SampleProfile/offset.ll
index 1a8b8973ecf1..bd1cbbe8c58a 100644
--- a/llvm/test/Transforms/SampleProfile/offset.ll
+++ b/llvm/test/Transforms/SampleProfile/offset.ll
@@ -23,24 +23,24 @@ define i32 @_Z3fooi(i32 %a) #0 !dbg !4 {
entry:
%retval = alloca i32, align 4
%a.addr = alloca i32, align 4
- store i32 %a, i32* %a.addr, align 4
- call void @llvm.dbg.declare(metadata i32* %a.addr, metadata !11, metadata !12), !dbg !13
- %0 = load i32, i32* %a.addr, align 4, !dbg !14
+ store i32 %a, ptr %a.addr, align 4
+ call void @llvm.dbg.declare(metadata ptr %a.addr, metadata !11, metadata !12), !dbg !13
+ %0 = load i32, ptr %a.addr, align 4, !dbg !14
%cmp = icmp sgt i32 %0, 0, !dbg !18
br i1 %cmp, label %if.then, label %if.else, !dbg !19
; CHECK: edge entry -> if.then probability is 0x0167ba82 / 0x80000000 = 1.10%
; CHECK: edge entry -> if.else probability is 0x7e98457e / 0x80000000 = 98.90% [HOT edge]
if.then: ; preds = %entry
- store i32 10, i32* %retval, align 4, !dbg !20
+ store i32 10, ptr %retval, align 4, !dbg !20
br label %return, !dbg !20
if.else: ; preds = %entry
- store i32 20, i32* %retval, align 4, !dbg !22
+ store i32 20, ptr %retval, align 4, !dbg !22
br label %return, !dbg !22
return: ; preds = %if.else, %if.then
- %1 = load i32, i32* %retval, align 4, !dbg !24
+ %1 = load i32, ptr %retval, align 4, !dbg !24
ret i32 %1, !dbg !24
}
diff --git a/llvm/test/Transforms/SampleProfile/profile-context-order.ll b/llvm/test/Transforms/SampleProfile/profile-context-order.ll
index ff707280c4da..0771345b4c36 100644
--- a/llvm/test/Transforms/SampleProfile/profile-context-order.ll
+++ b/llvm/test/Transforms/SampleProfile/profile-context-order.ll
@@ -26,11 +26,11 @@
@factor = dso_local global i32 3, align 4, !dbg !0
- at fp = dso_local global i32 (i32)* null, align 8
+ at fp = dso_local global ptr null, align 8
define dso_local i32 @main() local_unnamed_addr #0 !dbg !18 {
entry:
- store i32 (i32)* @_Z3fibi, i32 (i32)** @fp, align 8, !dbg !25
+ store ptr @_Z3fibi, ptr @fp, align 8, !dbg !25
br label %for.body, !dbg !25
for.cond.cleanup: ; preds = %for.body
@@ -62,7 +62,7 @@ for.body: ; preds = %for.body, %entry
define dso_local i32 @_Z5funcAi(i32 %x) local_unnamed_addr #0 !dbg !40 {
entry:
%add = add nsw i32 %x, 100000, !dbg !44
- %0 = load i32 (i32)*, i32 (i32)** @fp, align 8
+ %0 = load ptr, ptr @fp, align 8
%call = call i32 %0(i32 8), !dbg !45
%call1 = tail call i32 @_Z8funcLeafi(i32 %add), !dbg !46
ret i32 %call, !dbg !46
@@ -83,7 +83,7 @@ while.cond2.preheader: ; preds = %entry
while.body: ; preds = %while.body, %entry
%x.addr.016 = phi i32 [ %sub, %while.body ], [ %x, %entry ]
- %tmp = load volatile i32, i32* @factor, align 4, !dbg !64
+ %tmp = load volatile i32, ptr @factor, align 4, !dbg !64
%call = tail call i32 @_Z5funcAi(i32 %tmp), !dbg !67
%sub = sub nsw i32 %x.addr.016, %call, !dbg !68
%cmp1 = icmp sgt i32 %sub, 0, !dbg !69
@@ -91,7 +91,7 @@ while.body: ; preds = %while.body, %entry
while.body4: ; preds = %while.body4, %while.cond2.preheader
%x.addr.114 = phi i32 [ %add, %while.body4 ], [ %x, %while.cond2.preheader ]
- %tmp1 = load volatile i32, i32* @factor, align 4, !dbg !72
+ %tmp1 = load volatile i32, ptr @factor, align 4, !dbg !72
%call5 = tail call i32 @_Z5funcBi(i32 %tmp1), !dbg !74
%add = add nsw i32 %call5, %x.addr.114, !dbg !75
%cmp3 = icmp slt i32 %add, 0, !dbg !60
diff --git a/llvm/test/Transforms/SampleProfile/profile-context-tracker-debug.ll b/llvm/test/Transforms/SampleProfile/profile-context-tracker-debug.ll
index 4fc972937420..bd670a1d683e 100644
--- a/llvm/test/Transforms/SampleProfile/profile-context-tracker-debug.ll
+++ b/llvm/test/Transforms/SampleProfile/profile-context-tracker-debug.ll
@@ -127,7 +127,7 @@ while.cond2.preheader: ; preds = %entry
while.body: ; preds = %while.body, %entry
%x.addr.016 = phi i32 [ %sub, %while.body ], [ %x, %entry ]
- %tmp = load volatile i32, i32* @factor, align 4, !dbg !64
+ %tmp = load volatile i32, ptr @factor, align 4, !dbg !64
%call = tail call i32 @_Z3fibi(i32 %tmp), !dbg !67
%sub = sub nsw i32 %x.addr.016, %call, !dbg !68
%cmp1 = icmp sgt i32 %sub, 0, !dbg !69
@@ -135,7 +135,7 @@ while.body: ; preds = %while.body, %entry
while.body4: ; preds = %while.body4, %while.cond2.preheader
%x.addr.114 = phi i32 [ %add, %while.body4 ], [ %x, %while.cond2.preheader ]
- %tmp1 = load volatile i32, i32* @factor, align 4, !dbg !72
+ %tmp1 = load volatile i32, ptr @factor, align 4, !dbg !72
%call5 = tail call i32 @_Z3fibi(i32 %tmp1), !dbg !74
%add = add nsw i32 %call5, %x.addr.114, !dbg !75
%cmp3 = icmp slt i32 %add, 0, !dbg !60
diff --git a/llvm/test/Transforms/SampleProfile/profile-context-tracker.ll b/llvm/test/Transforms/SampleProfile/profile-context-tracker.ll
index d49e2dc9b5f0..0acb4d4d53ef 100644
--- a/llvm/test/Transforms/SampleProfile/profile-context-tracker.ll
+++ b/llvm/test/Transforms/SampleProfile/profile-context-tracker.ll
@@ -98,7 +98,7 @@ while.cond2.preheader: ; preds = %entry
while.body: ; preds = %while.body, %entry
%x.addr.016 = phi i32 [ %sub, %while.body ], [ %x, %entry ]
- %tmp = load volatile i32, i32* @factor, align 4, !dbg !64
+ %tmp = load volatile i32, ptr @factor, align 4, !dbg !64
%call = tail call i32 @_Z3fibi(i32 %tmp), !dbg !67
%sub = sub nsw i32 %x.addr.016, %call, !dbg !68
%cmp1 = icmp sgt i32 %sub, 0, !dbg !69
@@ -106,7 +106,7 @@ while.body: ; preds = %while.body, %entry
while.body4: ; preds = %while.body4, %while.cond2.preheader
%x.addr.114 = phi i32 [ %add, %while.body4 ], [ %x, %while.cond2.preheader ]
- %tmp1 = load volatile i32, i32* @factor, align 4, !dbg !72
+ %tmp1 = load volatile i32, ptr @factor, align 4, !dbg !72
%call5 = tail call i32 @_Z3fibi(i32 %tmp1), !dbg !74
%add = add nsw i32 %call5, %x.addr.114, !dbg !75
%cmp3 = icmp slt i32 %add, 0, !dbg !60
diff --git a/llvm/test/Transforms/SampleProfile/profile-correlation-irreducible-loops.ll b/llvm/test/Transforms/SampleProfile/profile-correlation-irreducible-loops.ll
index 700017ae8981..f5c3ca4aca47 100644
--- a/llvm/test/Transforms/SampleProfile/profile-correlation-irreducible-loops.ll
+++ b/llvm/test/Transforms/SampleProfile/profile-correlation-irreducible-loops.ll
@@ -50,7 +50,7 @@
define dso_local i32 @yyparse_1() #0 {
b1:
call void @llvm.pseudoprobe(i64 -7702751003264189226, i64 1, i32 0, i64 -1)
- %0 = load i32, i32* @yydebug, align 4
+ %0 = load i32, ptr @yydebug, align 4
%cmp = icmp ne i32 %0, 0
br label %b2
; CHECK: - b1: float = {{.*}}, int = {{.*}}, count = 1
@@ -96,7 +96,7 @@ b8:
b9:
call void @llvm.pseudoprobe(i64 -7702751003264189226, i64 9, i32 0, i64 -1)
- %1 = load i32, i32* @yydebug, align 4
+ %1 = load i32, ptr @yydebug, align 4
ret i32 %1
; CHECK: - b9: float = {{.*}}, int = {{.*}}, count = 1
@@ -138,14 +138,14 @@ b9:
define dso_local i32 @foo1() #0 !prof !132 {
b1:
call void @llvm.pseudoprobe(i64 7682762345278052905, i64 1, i32 0, i64 -1)
- %0 = load i32, i32* @yydebug, align 4
+ %0 = load i32, ptr @yydebug, align 4
%cmp = icmp ne i32 %0, 0
br label %b2
; CHECK3: - b1: float = {{.*}}, int = {{.*}}, count = 1
b2:
call void @llvm.pseudoprobe(i64 7682762345278052905, i64 2, i32 0, i64 -1)
- %1 = load i32, i32* @yydebug, align 4
+ %1 = load i32, ptr @yydebug, align 4
switch i32 %1, label %b4 [
i32 1, label %indirectgoto
i32 2, label %b3
@@ -159,14 +159,14 @@ b3:
b4:
call void @llvm.pseudoprobe(i64 7682762345278052905, i64 4, i32 0, i64 -1)
- %2 = load i32, i32* @yydebug, align 4
+ %2 = load i32, ptr @yydebug, align 4
ret i32 %2
; CHECK3: - b4: float = {{.*}}, int = {{.*}}, count = 1
indirectgoto:
%indirect.goto.dest = alloca i8, align 4
call void @llvm.pseudoprobe(i64 7682762345278052905, i64 5, i32 0, i64 -1)
- indirectbr i8* %indirect.goto.dest, [label %b2, label %indirectgoto, label %b4, label %b3], !prof !134
+ indirectbr ptr %indirect.goto.dest, [label %b2, label %indirectgoto, label %b4, label %b3], !prof !134
; CHECK3: - indirectgoto: float = {{.*}}, int = {{.*}}, count = 17747
}
diff --git a/llvm/test/Transforms/SampleProfile/profile-format-compress.ll b/llvm/test/Transforms/SampleProfile/profile-format-compress.ll
index fd72078d2415..112da585d90b 100644
--- a/llvm/test/Transforms/SampleProfile/profile-format-compress.ll
+++ b/llvm/test/Transforms/SampleProfile/profile-format-compress.ll
@@ -25,7 +25,7 @@
; will annotate the IR with exactly the same result as using text format.
; CHECK: br i1 %cmp, label %while.body, label %while.end{{.*}} !prof ![[IDX1:[0-9]*]]
; CHECK: br i1 %cmp1, label %if.then, label %if.else{{.*}} !prof ![[IDX2:[0-9]*]]
-; CHECK: call i32 (i8*, ...) @printf{{.*}} !prof ![[IDX3:[0-9]*]]
+; CHECK: call i32 (ptr, ...) @printf{{.*}} !prof ![[IDX3:[0-9]*]]
; CHECK: = !{!"TotalCount", i64 26781}
; CHECK: = !{!"MaxCount", i64 5553}
; CHECK: ![[IDX1]] = !{!"branch_weights", i32 5392, i32 163}
@@ -37,10 +37,10 @@ define i32 @_Z3sumii(i32 %x, i32 %y) #0 !dbg !4 {
entry:
%x.addr = alloca i32, align 4
%y.addr = alloca i32, align 4
- store i32 %x, i32* %x.addr, align 4
- store i32 %y, i32* %y.addr, align 4
- %0 = load i32, i32* %x.addr, align 4, !dbg !11
- %1 = load i32, i32* %y.addr, align 4, !dbg !11
+ store i32 %x, ptr %x.addr, align 4
+ store i32 %y, ptr %y.addr, align 4
+ %0 = load i32, ptr %x.addr, align 4, !dbg !11
+ %1 = load i32, ptr %y.addr, align 4, !dbg !11
%add = add nsw i32 %0, %1, !dbg !11
ret i32 %add, !dbg !11
}
@@ -51,44 +51,44 @@ entry:
%retval = alloca i32, align 4
%s = alloca i32, align 4
%i = alloca i32, align 4
- store i32 0, i32* %retval
- store i32 0, i32* %i, align 4, !dbg !12
+ store i32 0, ptr %retval
+ store i32 0, ptr %i, align 4, !dbg !12
br label %while.cond, !dbg !13
while.cond: ; preds = %if.end, %entry
- %0 = load i32, i32* %i, align 4, !dbg !14
+ %0 = load i32, ptr %i, align 4, !dbg !14
%inc = add nsw i32 %0, 1, !dbg !14
- store i32 %inc, i32* %i, align 4, !dbg !14
+ store i32 %inc, ptr %i, align 4, !dbg !14
%cmp = icmp slt i32 %0, 400000000, !dbg !14
br i1 %cmp, label %while.body, label %while.end, !dbg !14
while.body: ; preds = %while.cond
- %1 = load i32, i32* %i, align 4, !dbg !16
+ %1 = load i32, ptr %i, align 4, !dbg !16
%cmp1 = icmp ne i32 %1, 100, !dbg !16
br i1 %cmp1, label %if.then, label %if.else, !dbg !16
if.then: ; preds = %while.body
- %2 = load i32, i32* %i, align 4, !dbg !18
- %3 = load i32, i32* %s, align 4, !dbg !18
+ %2 = load i32, ptr %i, align 4, !dbg !18
+ %3 = load i32, ptr %s, align 4, !dbg !18
%call = call i32 @_Z3sumii(i32 %2, i32 %3), !dbg !18
- store i32 %call, i32* %s, align 4, !dbg !18
+ store i32 %call, ptr %s, align 4, !dbg !18
br label %if.end, !dbg !18
if.else: ; preds = %while.body
- store i32 30, i32* %s, align 4, !dbg !20
+ store i32 30, ptr %s, align 4, !dbg !20
br label %if.end
if.end: ; preds = %if.else, %if.then
br label %while.cond, !dbg !22
while.end: ; preds = %while.cond
- %4 = load i32, i32* %s, align 4, !dbg !24
- %call2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i32 0, i32 0), i32 %4), !dbg !24
+ %4 = load i32, ptr %s, align 4, !dbg !24
+ %call2 = call i32 (ptr, ...) @printf(ptr @.str, i32 %4), !dbg !24
ret i32 0, !dbg !25
}
-declare i32 @printf(i8*, ...) #2
+declare i32 @printf(ptr, ...) #2
attributes #0 = { "use-sample-profile" }
diff --git a/llvm/test/Transforms/SampleProfile/profile-format.ll b/llvm/test/Transforms/SampleProfile/profile-format.ll
index 392562f38063..be36267d8e3c 100644
--- a/llvm/test/Transforms/SampleProfile/profile-format.ll
+++ b/llvm/test/Transforms/SampleProfile/profile-format.ll
@@ -27,7 +27,7 @@
; will annotate the IR with exactly the same result as using text format.
; CHECK: br i1 %cmp, label %while.body, label %while.end{{.*}} !prof ![[IDX1:[0-9]*]]
; CHECK: br i1 %cmp1, label %if.then, label %if.else{{.*}} !prof ![[IDX2:[0-9]*]]
-; CHECK: call i32 (i8*, ...) @printf{{.*}} !prof ![[IDX3:[0-9]*]]
+; CHECK: call i32 (ptr, ...) @printf{{.*}} !prof ![[IDX3:[0-9]*]]
; CHECK: = !{!"TotalCount", i64 26781}
; CHECK: = !{!"MaxCount", i64 5553}
; CHECK: ![[IDX1]] = !{!"branch_weights", i32 5392, i32 163}
@@ -42,10 +42,10 @@ define i32 @_Z3sumii(i32 %x, i32 %y) #0 !dbg !4 {
entry:
%x.addr = alloca i32, align 4
%y.addr = alloca i32, align 4
- store i32 %x, i32* %x.addr, align 4
- store i32 %y, i32* %y.addr, align 4
- %0 = load i32, i32* %x.addr, align 4, !dbg !11
- %1 = load i32, i32* %y.addr, align 4, !dbg !11
+ store i32 %x, ptr %x.addr, align 4
+ store i32 %y, ptr %y.addr, align 4
+ %0 = load i32, ptr %x.addr, align 4, !dbg !11
+ %1 = load i32, ptr %y.addr, align 4, !dbg !11
%add = add nsw i32 %0, %1, !dbg !11
ret i32 %add, !dbg !11
}
@@ -56,44 +56,44 @@ entry:
%retval = alloca i32, align 4
%s = alloca i32, align 4
%i = alloca i32, align 4
- store i32 0, i32* %retval
- store i32 0, i32* %i, align 4, !dbg !12
+ store i32 0, ptr %retval
+ store i32 0, ptr %i, align 4, !dbg !12
br label %while.cond, !dbg !13
while.cond: ; preds = %if.end, %entry
- %0 = load i32, i32* %i, align 4, !dbg !14
+ %0 = load i32, ptr %i, align 4, !dbg !14
%inc = add nsw i32 %0, 1, !dbg !14
- store i32 %inc, i32* %i, align 4, !dbg !14
+ store i32 %inc, ptr %i, align 4, !dbg !14
%cmp = icmp slt i32 %0, 400000000, !dbg !14
br i1 %cmp, label %while.body, label %while.end, !dbg !14
while.body: ; preds = %while.cond
- %1 = load i32, i32* %i, align 4, !dbg !16
+ %1 = load i32, ptr %i, align 4, !dbg !16
%cmp1 = icmp ne i32 %1, 100, !dbg !16
br i1 %cmp1, label %if.then, label %if.else, !dbg !16
if.then: ; preds = %while.body
- %2 = load i32, i32* %i, align 4, !dbg !18
- %3 = load i32, i32* %s, align 4, !dbg !18
+ %2 = load i32, ptr %i, align 4, !dbg !18
+ %3 = load i32, ptr %s, align 4, !dbg !18
%call = call i32 @_Z3sumii(i32 %2, i32 %3), !dbg !18
- store i32 %call, i32* %s, align 4, !dbg !18
+ store i32 %call, ptr %s, align 4, !dbg !18
br label %if.end, !dbg !18
if.else: ; preds = %while.body
- store i32 30, i32* %s, align 4, !dbg !20
+ store i32 30, ptr %s, align 4, !dbg !20
br label %if.end
if.end: ; preds = %if.else, %if.then
br label %while.cond, !dbg !22
while.end: ; preds = %while.cond
- %4 = load i32, i32* %s, align 4, !dbg !24
- %call2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i32 0, i32 0), i32 %4), !dbg !24
+ %4 = load i32, ptr %s, align 4, !dbg !24
+ %call2 = call i32 (ptr, ...) @printf(ptr @.str, i32 %4), !dbg !24
ret i32 0, !dbg !25
}
-declare i32 @printf(i8*, ...) #2
+declare i32 @printf(ptr, ...) #2
attributes #0 = { "use-sample-profile" }
diff --git a/llvm/test/Transforms/SampleProfile/profile-inference-noprobes.ll b/llvm/test/Transforms/SampleProfile/profile-inference-noprobes.ll
index d1e62f4c850e..27a9915b6f2c 100644
--- a/llvm/test/Transforms/SampleProfile/profile-inference-noprobes.ll
+++ b/llvm/test/Transforms/SampleProfile/profile-inference-noprobes.ll
@@ -21,7 +21,7 @@ define void @test_4() #0 !dbg !4 {
;entry:
; ret void, !dbg !9
b1:
- %0 = load i32, i32* @yydebug, align 4
+ %0 = load i32, ptr @yydebug, align 4
%cmp = icmp ne i32 %0, 0, !dbg !9
br i1 %cmp, label %b2, label %b3, !dbg !9
; CHECK2: - b1: float = {{.*}}, int = {{.*}}, count = 100
diff --git a/llvm/test/Transforms/SampleProfile/profile-inference.ll b/llvm/test/Transforms/SampleProfile/profile-inference.ll
index 41af84a7f78e..2a62dfd2c707 100644
--- a/llvm/test/Transforms/SampleProfile/profile-inference.ll
+++ b/llvm/test/Transforms/SampleProfile/profile-inference.ll
@@ -20,7 +20,7 @@
define dso_local i32 @test_1() #0 {
b1:
call void @llvm.pseudoprobe(i64 7964825052912775246, i64 1, i32 0, i64 -1)
- %0 = load i32, i32* @yydebug, align 4
+ %0 = load i32, ptr @yydebug, align 4
%cmp = icmp ne i32 %0, 0
br i1 %cmp, label %b2, label %b3
; CHECK: edge b1 -> b2 probability is 0x4ccccccd / 0x80000000 = 60.00%
@@ -57,7 +57,7 @@ b3:
define dso_local i32 @test_2() #0 {
b1:
call void @llvm.pseudoprobe(i64 -6216829535442445639, i64 1, i32 0, i64 -1)
- %0 = load i32, i32* @yydebug, align 4
+ %0 = load i32, ptr @yydebug, align 4
%cmp = icmp ne i32 %0, 0
br i1 %cmp, label %b2, label %b3
; CHECK: edge b1 -> b2 probability is 0x73333333 / 0x80000000 = 90.00%
@@ -98,7 +98,7 @@ b3:
define dso_local i32 @test_3() #0 {
b1:
call void @llvm.pseudoprobe(i64 1649282507922421973, i64 1, i32 0, i64 -1)
- %0 = load i32, i32* @yydebug, align 4
+ %0 = load i32, ptr @yydebug, align 4
%cmp = icmp ne i32 %0, 0
br i1 %cmp, label %b2, label %b4
; CHECK: edge b1 -> b2 probability is 0x10505050 / 0x80000000 = 12.75%
@@ -176,7 +176,7 @@ b5:
define dso_local i32 @sum_of_squares() #0 {
b1:
call void @llvm.pseudoprobe(i64 -907520326213521421, i64 1, i32 0, i64 -1)
- %0 = load i32, i32* @yydebug, align 4
+ %0 = load i32, ptr @yydebug, align 4
%cmp = icmp ne i32 %0, 0
br label %b2
; CHECK: edge b1 -> b2 probability is 0x80000000 / 0x80000000 = 100.00%
diff --git a/llvm/test/Transforms/SampleProfile/profile-sample-accurate.ll b/llvm/test/Transforms/SampleProfile/profile-sample-accurate.ll
index 711d9bd08394..80394b3f60fb 100644
--- a/llvm/test/Transforms/SampleProfile/profile-sample-accurate.ll
+++ b/llvm/test/Transforms/SampleProfile/profile-sample-accurate.ll
@@ -49,10 +49,10 @@ define i32 @_Z3sumii(i32 %x, i32 %y) #0 !dbg !4 {
entry:
%x.addr = alloca i32, align 4
%y.addr = alloca i32, align 4
- store i32 %x, i32* %x.addr, align 4
- store i32 %y, i32* %y.addr, align 4
- %0 = load i32, i32* %x.addr, align 4, !dbg !11
- %1 = load i32, i32* %y.addr, align 4, !dbg !11
+ store i32 %x, ptr %x.addr, align 4
+ store i32 %y, ptr %y.addr, align 4
+ %0 = load i32, ptr %x.addr, align 4, !dbg !11
+ %1 = load i32, ptr %y.addr, align 4, !dbg !11
%add = add nsw i32 %0, %1, !dbg !11
ret i32 %add, !dbg !11
}
@@ -73,19 +73,19 @@ entry:
%retval = alloca i32, align 4
%s = alloca i32, align 4
%i = alloca i32, align 4
- store i32 0, i32* %retval
- store i32 0, i32* %i, align 4, !dbg !12
+ store i32 0, ptr %retval
+ store i32 0, ptr %i, align 4, !dbg !12
br label %while.cond, !dbg !13
while.cond: ; preds = %if.end, %entry
- %0 = load i32, i32* %i, align 4, !dbg !14
+ %0 = load i32, ptr %i, align 4, !dbg !14
%inc = add nsw i32 %0, 1, !dbg !14
- store i32 %inc, i32* %i, align 4, !dbg !14
+ store i32 %inc, ptr %i, align 4, !dbg !14
%cmp = icmp slt i32 %0, 400000000, !dbg !14
br i1 %cmp, label %while.body, label %while.end, !dbg !14
while.body: ; preds = %while.cond
- %1 = load i32, i32* %i, align 4, !dbg !16
+ %1 = load i32, ptr %i, align 4, !dbg !16
%cmp1 = icmp ne i32 %1, 100, !dbg !16
br i1 %cmp1, label %if.then, label %if.else, !dbg !16
@@ -109,26 +109,26 @@ while.body: ; preds = %while.cond
; PROFSYMLIST-NOT: call i32 @_Z3sumii
; PROFSYMLIST: if.else:
if.then: ; preds = %while.body
- %2 = load i32, i32* %i, align 4, !dbg !18
- %3 = load i32, i32* %s, align 4, !dbg !18
+ %2 = load i32, ptr %i, align 4, !dbg !18
+ %3 = load i32, ptr %s, align 4, !dbg !18
%call = call i32 @_Z3sumii(i32 %2, i32 %3), !dbg !18
- store i32 %call, i32* %s, align 4, !dbg !18
+ store i32 %call, ptr %s, align 4, !dbg !18
br label %if.end, !dbg !18
if.else: ; preds = %while.body
- store i32 30, i32* %s, align 4, !dbg !20
+ store i32 30, ptr %s, align 4, !dbg !20
br label %if.end
if.end: ; preds = %if.else, %if.then
br label %while.cond, !dbg !22
while.end: ; preds = %while.cond
- %4 = load i32, i32* %s, align 4, !dbg !24
- %call2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i32 0, i32 0), i32 %4), !dbg !24
+ %4 = load i32, ptr %s, align 4, !dbg !24
+ %call2 = call i32 (ptr, ...) @printf(ptr @.str, i32 %4), !dbg !24
ret i32 0, !dbg !25
}
-declare i32 @printf(i8*, ...) #2
+declare i32 @printf(ptr, ...) #2
attributes #0 = { "use-sample-profile" }
diff --git a/llvm/test/Transforms/SampleProfile/profile-topdown-order.ll b/llvm/test/Transforms/SampleProfile/profile-topdown-order.ll
index 4f437b222383..fa24937f5e28 100644
--- a/llvm/test/Transforms/SampleProfile/profile-topdown-order.ll
+++ b/llvm/test/Transforms/SampleProfile/profile-topdown-order.ll
@@ -17,11 +17,11 @@
; DYNAMIC: ![[#PROF]] = !{!"function_entry_count", i64 27}
@factor = dso_local global i32 3, align 4, !dbg !0
- at fp = dso_local global i32 (i32)* null, align 8
+ at fp = dso_local global ptr null, align 8
define dso_local i32 @main() local_unnamed_addr #0 !dbg !18 {
entry:
- store i32 (i32)* @_Z3fibi, i32 (i32)** @fp, align 8, !dbg !25
+ store ptr @_Z3fibi, ptr @fp, align 8, !dbg !25
br label %for.body, !dbg !25
for.cond.cleanup: ; preds = %for.body
@@ -43,7 +43,7 @@ for.body: ; preds = %for.body, %entry
define dso_local i32 @_Z5funcAi(i32 %x) local_unnamed_addr #0 !dbg !40 {
entry:
%add = add nsw i32 %x, 100000, !dbg !44
- %0 = load i32 (i32)*, i32 (i32)** @fp, align 8
+ %0 = load ptr, ptr @fp, align 8
%call = call i32 %0(i32 8), !dbg !45
%call1 = tail call i32 @_Z8funcLeafi(i32 %add), !dbg !46
ret i32 %call, !dbg !46
@@ -64,7 +64,7 @@ while.cond2.preheader: ; preds = %entry
while.body: ; preds = %while.body, %entry
%x.addr.016 = phi i32 [ %sub, %while.body ], [ %x, %entry ]
- %tmp = load volatile i32, i32* @factor, align 4, !dbg !64
+ %tmp = load volatile i32, ptr @factor, align 4, !dbg !64
%call = tail call i32 @_Z5funcAi(i32 %tmp), !dbg !67
%sub = sub nsw i32 %x.addr.016, %call, !dbg !68
%cmp1 = icmp sgt i32 %sub, 0, !dbg !69
@@ -72,7 +72,7 @@ while.body: ; preds = %while.body, %entry
while.body4: ; preds = %while.body4, %while.cond2.preheader
%x.addr.114 = phi i32 [ %add, %while.body4 ], [ %x, %while.cond2.preheader ]
- %tmp1 = load volatile i32, i32* @factor, align 4, !dbg !72
+ %tmp1 = load volatile i32, ptr @factor, align 4, !dbg !72
%call5 = tail call i32 @_Z5funcBi(i32 %tmp1), !dbg !74
%add = add nsw i32 %call5, %x.addr.114, !dbg !75
%cmp3 = icmp slt i32 %add, 0, !dbg !60
diff --git a/llvm/test/Transforms/SampleProfile/propagate.ll b/llvm/test/Transforms/SampleProfile/propagate.ll
index a24b9c106d6c..d419e717728d 100644
--- a/llvm/test/Transforms/SampleProfile/propagate.ll
+++ b/llvm/test/Transforms/SampleProfile/propagate.ll
@@ -48,39 +48,39 @@ entry:
%N.addr = alloca i64, align 8
%i = alloca i64, align 8
%j = alloca i64, align 8
- store i32 %x, i32* %x.addr, align 4
- call void @llvm.dbg.declare(metadata i32* %x.addr, metadata !11, metadata !12), !dbg !13
- store i32 %y, i32* %y.addr, align 4
- call void @llvm.dbg.declare(metadata i32* %y.addr, metadata !14, metadata !12), !dbg !15
- store i64 %N, i64* %N.addr, align 8
- call void @llvm.dbg.declare(metadata i64* %N.addr, metadata !16, metadata !12), !dbg !17
- %0 = load i32, i32* %x.addr, align 4, !dbg !18
- %1 = load i32, i32* %y.addr, align 4, !dbg !20
+ store i32 %x, ptr %x.addr, align 4
+ call void @llvm.dbg.declare(metadata ptr %x.addr, metadata !11, metadata !12), !dbg !13
+ store i32 %y, ptr %y.addr, align 4
+ call void @llvm.dbg.declare(metadata ptr %y.addr, metadata !14, metadata !12), !dbg !15
+ store i64 %N, ptr %N.addr, align 8
+ call void @llvm.dbg.declare(metadata ptr %N.addr, metadata !16, metadata !12), !dbg !17
+ %0 = load i32, ptr %x.addr, align 4, !dbg !18
+ %1 = load i32, ptr %y.addr, align 4, !dbg !20
%cmp = icmp slt i32 %0, %1, !dbg !21
br i1 %cmp, label %if.then, label %if.else, !dbg !22
if.then: ; preds = %entry
- %2 = load i32, i32* %y.addr, align 4, !dbg !23
- %3 = load i32, i32* %x.addr, align 4, !dbg !25
+ %2 = load i32, ptr %y.addr, align 4, !dbg !23
+ %3 = load i32, ptr %x.addr, align 4, !dbg !25
%sub = sub nsw i32 %2, %3, !dbg !26
%conv = sext i32 %sub to i64, !dbg !23
- store i64 %conv, i64* %retval, align 8, !dbg !27
+ store i64 %conv, ptr %retval, align 8, !dbg !27
br label %return, !dbg !27
if.else: ; preds = %entry
- call void @llvm.dbg.declare(metadata i64* %i, metadata !28, metadata !12), !dbg !31
- store i64 0, i64* %i, align 8, !dbg !31
+ call void @llvm.dbg.declare(metadata ptr %i, metadata !28, metadata !12), !dbg !31
+ store i64 0, ptr %i, align 8, !dbg !31
br label %for.cond, !dbg !32
for.cond: ; preds = %for.inc17, %if.else
- %4 = load i64, i64* %i, align 8, !dbg !33
- %5 = load i64, i64* %N.addr, align 8, !dbg !36
+ %4 = load i64, ptr %i, align 8, !dbg !33
+ %5 = load i64, ptr %N.addr, align 8, !dbg !36
%cmp1 = icmp slt i64 %4, %5, !dbg !37
br i1 %cmp1, label %for.body, label %for.end19, !dbg !38
for.body: ; preds = %for.cond
- %6 = load i64, i64* %i, align 8, !dbg !39
- %7 = load i64, i64* %N.addr, align 8, !dbg !42
+ %6 = load i64, ptr %i, align 8, !dbg !39
+ %7 = load i64, ptr %N.addr, align 8, !dbg !42
%div = sdiv i64 %7, 3, !dbg !43
%cmp2 = icmp sgt i64 %6, %div, !dbg !44
br i1 %cmp2, label %if.then3, label %if.end, !dbg !45
@@ -88,14 +88,14 @@ for.body: ; preds = %for.cond
; CHECK: edge for.body -> if.end probability is 0x2ed6d05a / 0x80000000 = 36.59%
if.then3: ; preds = %for.body
- %8 = load i32, i32* %x.addr, align 4, !dbg !46
+ %8 = load i32, ptr %x.addr, align 4, !dbg !46
%dec = add nsw i32 %8, -1, !dbg !46
- store i32 %dec, i32* %x.addr, align 4, !dbg !46
+ store i32 %dec, ptr %x.addr, align 4, !dbg !46
br label %if.end, !dbg !47
if.end: ; preds = %if.then3, %for.body
- %9 = load i64, i64* %i, align 8, !dbg !48
- %10 = load i64, i64* %N.addr, align 8, !dbg !50
+ %9 = load i64, ptr %i, align 8, !dbg !48
+ %10 = load i64, ptr %N.addr, align 8, !dbg !50
%div4 = sdiv i64 %10, 4, !dbg !51
%cmp5 = icmp sgt i64 %9, %div4, !dbg !52
br i1 %cmp5, label %if.then6, label %if.else7, !dbg !53
@@ -103,21 +103,21 @@ if.end: ; preds = %if.then3, %for.body
; CHECK: edge if.end -> if.else7 probability is 0x22762762 / 0x80000000 = 26.92%
if.then6: ; preds = %if.end
- %11 = load i32, i32* %y.addr, align 4, !dbg !54
+ %11 = load i32, ptr %y.addr, align 4, !dbg !54
%inc = add nsw i32 %11, 1, !dbg !54
- store i32 %inc, i32* %y.addr, align 4, !dbg !54
- %12 = load i32, i32* %x.addr, align 4, !dbg !56
+ store i32 %inc, ptr %y.addr, align 4, !dbg !54
+ %12 = load i32, ptr %x.addr, align 4, !dbg !56
%add = add nsw i32 %12, 3, !dbg !56
- store i32 %add, i32* %x.addr, align 4, !dbg !56
+ store i32 %add, ptr %x.addr, align 4, !dbg !56
br label %if.end16, !dbg !57
if.else7: ; preds = %if.end
- call void @llvm.dbg.declare(metadata i64* %j, metadata !58, metadata !12), !dbg !62
- store i64 0, i64* %j, align 8, !dbg !62
+ call void @llvm.dbg.declare(metadata ptr %j, metadata !58, metadata !12), !dbg !62
+ store i64 0, ptr %j, align 8, !dbg !62
br label %for.cond8, !dbg !63
for.cond8: ; preds = %for.inc, %if.else7
- %13 = load i64, i64* %j, align 8, !dbg !64
+ %13 = load i64, ptr %j, align 8, !dbg !64
%cmp9 = icmp slt i64 %13, 100, !dbg !67
br i1 %cmp9, label %for.body10, label %for.end, !dbg !68
; CHECK: edge for.cond8 -> for.body10 probability is 0x7e941a89 / 0x80000000 = 98.89% [HOT edge]
@@ -125,21 +125,21 @@ for.cond8: ; preds = %for.inc, %if.else7
for.body10: ; preds = %for.cond8
- %14 = load i64, i64* %j, align 8, !dbg !69
- %15 = load i32, i32* %x.addr, align 4, !dbg !71
+ %14 = load i64, ptr %j, align 8, !dbg !69
+ %15 = load i32, ptr %x.addr, align 4, !dbg !71
%conv11 = sext i32 %15 to i64, !dbg !71
%add12 = add nsw i64 %conv11, %14, !dbg !71
%conv13 = trunc i64 %add12 to i32, !dbg !71
- store i32 %conv13, i32* %x.addr, align 4, !dbg !71
- %16 = load i32, i32* %y.addr, align 4, !dbg !72
+ store i32 %conv13, ptr %x.addr, align 4, !dbg !71
+ %16 = load i32, ptr %y.addr, align 4, !dbg !72
%sub14 = sub nsw i32 %16, 3, !dbg !72
- store i32 %sub14, i32* %y.addr, align 4, !dbg !72
+ store i32 %sub14, ptr %y.addr, align 4, !dbg !72
br label %for.inc, !dbg !73
for.inc: ; preds = %for.body10
- %17 = load i64, i64* %j, align 8, !dbg !74
+ %17 = load i64, ptr %j, align 8, !dbg !74
%inc15 = add nsw i64 %17, 1, !dbg !74
- store i64 %inc15, i64* %j, align 8, !dbg !74
+ store i64 %inc15, ptr %j, align 8, !dbg !74
br label %for.cond8, !dbg !76
for.end: ; preds = %for.cond8
@@ -149,24 +149,24 @@ if.end16: ; preds = %for.end, %if.then6
br label %for.inc17, !dbg !77
for.inc17: ; preds = %if.end16
- %18 = load i64, i64* %i, align 8, !dbg !78
+ %18 = load i64, ptr %i, align 8, !dbg !78
%inc18 = add nsw i64 %18, 1, !dbg !78
- store i64 %inc18, i64* %i, align 8, !dbg !78
+ store i64 %inc18, ptr %i, align 8, !dbg !78
br label %for.cond, !dbg !80
for.end19: ; preds = %for.cond
br label %if.end20
if.end20: ; preds = %for.end19
- %19 = load i32, i32* %y.addr, align 4, !dbg !81
- %20 = load i32, i32* %x.addr, align 4, !dbg !82
+ %19 = load i32, ptr %y.addr, align 4, !dbg !81
+ %20 = load i32, ptr %x.addr, align 4, !dbg !82
%mul = mul nsw i32 %19, %20, !dbg !83
%conv21 = sext i32 %mul to i64, !dbg !81
- store i64 %conv21, i64* %retval, align 8, !dbg !84
+ store i64 %conv21, ptr %retval, align 8, !dbg !84
br label %return, !dbg !84
return: ; preds = %if.end20, %if.then
- %21 = load i64, i64* %retval, align 8, !dbg !85
+ %21 = load i64, ptr %retval, align 8, !dbg !85
ret i64 %21, !dbg !85
}
@@ -180,25 +180,25 @@ entry:
%x = alloca i32, align 4
%y = alloca i32, align 4
%N = alloca i64, align 8
- store i32 0, i32* %retval, align 4
- call void @llvm.dbg.declare(metadata i32* %x, metadata !89, metadata !12), !dbg !90
- store i32 5678, i32* %x, align 4, !dbg !90
- call void @llvm.dbg.declare(metadata i32* %y, metadata !91, metadata !12), !dbg !92
- store i32 1234, i32* %y, align 4, !dbg !92
- call void @llvm.dbg.declare(metadata i64* %N, metadata !93, metadata !12), !dbg !94
- store i64 9999999, i64* %N, align 8, !dbg !94
- %0 = load i32, i32* %x, align 4, !dbg !95
- %1 = load i32, i32* %y, align 4, !dbg !96
- %2 = load i64, i64* %N, align 8, !dbg !97
- %3 = load i32, i32* %x, align 4, !dbg !98
- %4 = load i32, i32* %y, align 4, !dbg !99
- %5 = load i64, i64* %N, align 8, !dbg !100
+ store i32 0, ptr %retval, align 4
+ call void @llvm.dbg.declare(metadata ptr %x, metadata !89, metadata !12), !dbg !90
+ store i32 5678, ptr %x, align 4, !dbg !90
+ call void @llvm.dbg.declare(metadata ptr %y, metadata !91, metadata !12), !dbg !92
+ store i32 1234, ptr %y, align 4, !dbg !92
+ call void @llvm.dbg.declare(metadata ptr %N, metadata !93, metadata !12), !dbg !94
+ store i64 9999999, ptr %N, align 8, !dbg !94
+ %0 = load i32, ptr %x, align 4, !dbg !95
+ %1 = load i32, ptr %y, align 4, !dbg !96
+ %2 = load i64, ptr %N, align 8, !dbg !97
+ %3 = load i32, ptr %x, align 4, !dbg !98
+ %4 = load i32, ptr %y, align 4, !dbg !99
+ %5 = load i64, ptr %N, align 8, !dbg !100
%call = call i64 @_Z3fooiil(i32 %3, i32 %4, i64 %5), !dbg !101
- %call1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i32 0, i32 0), i32 %0, i32 %1, i64 %2, i64 %call), !dbg !102
+ %call1 = call i32 (ptr, ...) @printf(ptr @.str, i32 %0, i32 %1, i64 %2, i64 %call), !dbg !102
ret i32 0, !dbg !104
}
-declare i32 @printf(i8*, ...) #3
+declare i32 @printf(ptr, ...) #3
attributes #0 = { nounwind uwtable "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="all" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" "use-sample-profile" }
attributes #1 = { nounwind readnone }
diff --git a/llvm/test/Transforms/SampleProfile/pseudo-probe-dangle2.ll b/llvm/test/Transforms/SampleProfile/pseudo-probe-dangle2.ll
index ef93afa0cfd8..21d7200a2c86 100644
--- a/llvm/test/Transforms/SampleProfile/pseudo-probe-dangle2.ll
+++ b/llvm/test/Transforms/SampleProfile/pseudo-probe-dangle2.ll
@@ -7,17 +7,17 @@
; CHECK-NOT: call void @llvm.pseudoprobe(i64 -4224472938262609671, i64 5
; Function Attrs: nounwind uwtable
-define dso_local i32 @foo(i32* nocapture %marker, i32* nocapture %move_ordering, i32* nocapture %moves, i32 %num_moves) local_unnamed_addr #0 !dbg !10 {
+define dso_local i32 @foo(ptr nocapture %marker, ptr nocapture %move_ordering, ptr nocapture %moves, i32 %num_moves) local_unnamed_addr #0 !dbg !10 {
entry:
- call void @llvm.dbg.value(metadata i32* %marker, metadata !19, metadata !DIExpression()), !dbg !28
- call void @llvm.dbg.value(metadata i32* %move_ordering, metadata !20, metadata !DIExpression()), !dbg !28
- call void @llvm.dbg.value(metadata i32* %moves, metadata !21, metadata !DIExpression()), !dbg !28
+ call void @llvm.dbg.value(metadata ptr %marker, metadata !19, metadata !DIExpression()), !dbg !28
+ call void @llvm.dbg.value(metadata ptr %move_ordering, metadata !20, metadata !DIExpression()), !dbg !28
+ call void @llvm.dbg.value(metadata ptr %moves, metadata !21, metadata !DIExpression()), !dbg !28
call void @llvm.dbg.value(metadata i32 %num_moves, metadata !22, metadata !DIExpression()), !dbg !28
call void @llvm.pseudoprobe(i64 -4224472938262609671, i64 1, i32 0, i64 -1), !dbg !29
call void @llvm.dbg.value(metadata i32 -1000000, metadata !25, metadata !DIExpression()), !dbg !28
- %0 = load i32, i32* %marker, align 4, !dbg !30, !tbaa !31
+ %0 = load i32, ptr %marker, align 4, !dbg !30, !tbaa !31
%inc = add nsw i32 %0, 1, !dbg !30
- store i32 %inc, i32* %marker, align 4, !dbg !30, !tbaa !31
+ store i32 %inc, ptr %marker, align 4, !dbg !30, !tbaa !31
call void @llvm.dbg.value(metadata i32 %inc, metadata !27, metadata !DIExpression()), !dbg !28
%cmp = icmp slt i32 %0, 9, !dbg !35
br i1 %cmp, label %for.cond, label %if.else, !dbg !37
@@ -37,8 +37,8 @@ for.cond: ; preds = %entry, %for.inc
for.body: ; preds = %for.cond
call void @llvm.pseudoprobe(i64 -4224472938262609671, i64 4, i32 0, i64 -1), !dbg !46
%idxprom = sext i32 %i.0 to i64, !dbg !46
- %arrayidx = getelementptr inbounds i32, i32* %move_ordering, i64 %idxprom, !dbg !46
- %1 = load i32, i32* %arrayidx, align 4, !dbg !46, !tbaa !31
+ %arrayidx = getelementptr inbounds i32, ptr %move_ordering, i64 %idxprom, !dbg !46
+ %1 = load i32, ptr %arrayidx, align 4, !dbg !46, !tbaa !31
%cmp2 = icmp sgt i32 %1, %best.0, !dbg !49
br i1 %cmp2, label %if.then3, label %for.inc, !dbg !50
diff --git a/llvm/test/Transforms/SampleProfile/pseudo-probe-discriminator.ll b/llvm/test/Transforms/SampleProfile/pseudo-probe-discriminator.ll
index c88db45ae355..e0d8d56899be 100644
--- a/llvm/test/Transforms/SampleProfile/pseudo-probe-discriminator.ll
+++ b/llvm/test/Transforms/SampleProfile/pseudo-probe-discriminator.ll
@@ -21,9 +21,9 @@ bb1:
ret void, !dbg !13
bb2:
-; DEBUG: store i32 8, i32* @a, align 4, !dbg ![[INST:[0-9]+]]
-; PROBE: store i32 8, i32* @a, align 4, !dbg ![[INST:[0-9]+]]
- store i32 8, i32* @a, align 4, !dbg !12
+; DEBUG: store i32 8, ptr @a, align 4, !dbg ![[INST:[0-9]+]]
+; PROBE: store i32 8, ptr @a, align 4, !dbg ![[INST:[0-9]+]]
+ store i32 8, ptr @a, align 4, !dbg !12
br label %bb3
bb3:
@@ -31,8 +31,8 @@ bb3:
}
declare void @_Z3barv() #1
-declare void @llvm.lifetime.start.p0i8(i64, i8* nocapture) nounwind argmemonly
-declare void @llvm.lifetime.end.p0i8(i64, i8* nocapture) nounwind argmemonly
+declare void @llvm.lifetime.start.p0(i64, ptr nocapture) nounwind argmemonly
+declare void @llvm.lifetime.end.p0(i64, ptr nocapture) nounwind argmemonly
attributes #0 = { uwtable "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="all" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #1 = { "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="all" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2" "unsafe-fp-math"="false" "use-soft-float"="false" }
diff --git a/llvm/test/Transforms/SampleProfile/pseudo-probe-emit.ll b/llvm/test/Transforms/SampleProfile/pseudo-probe-emit.ll
index fce26d3ea8b5..c8b9baf44a20 100644
--- a/llvm/test/Transforms/SampleProfile/pseudo-probe-emit.ll
+++ b/llvm/test/Transforms/SampleProfile/pseudo-probe-emit.ll
@@ -27,7 +27,7 @@ bb1:
; CHECK-MIR: PSEUDO_PROBE [[#GUID]], 4, 0, 0
; CHECK-ASM: .pseudoprobe [[#GUID]] 3 0 0
; CHECK-ASM: .pseudoprobe [[#GUID]] 4 0 0
- store i32 6, i32* @a, align 4
+ store i32 6, ptr @a, align 4
br label %bb3
bb2:
@@ -36,7 +36,7 @@ bb2:
; CHECK-MIR: PSEUDO_PROBE [[#GUID]], 4, 0, 0
; CHECK-ASM: .pseudoprobe [[#GUID]] 2 0 0
; CHECK-ASM: .pseudoprobe [[#GUID]] 4 0 0
- store i32 8, i32* @a, align 4
+ store i32 8, ptr @a, align 4
br label %bb3
bb3:
@@ -46,7 +46,7 @@ bb3:
declare void @bar(i32 %x)
-define internal void @foo2(void (i32)* %f) !dbg !4 {
+define internal void @foo2(ptr %f) !dbg !4 {
entry:
; CHECK-IL: call void @llvm.pseudoprobe(i64 [[#GUID2:]], i64 1, i32 0, i64 -1)
; CHECK-MIR: PSEUDO_PROBE [[#GUID2:]], 1, 0, 0
diff --git a/llvm/test/Transforms/SampleProfile/pseudo-probe-inline.ll b/llvm/test/Transforms/SampleProfile/pseudo-probe-inline.ll
index 3d186310ad0d..8157bebdc377 100644
--- a/llvm/test/Transforms/SampleProfile/pseudo-probe-inline.ll
+++ b/llvm/test/Transforms/SampleProfile/pseudo-probe-inline.ll
@@ -50,7 +50,7 @@ while.cond:
while.body:
; CHECK: call void @llvm.pseudoprobe(i64 [[#GUID2]], i64 3, i32 0, i64 -1)
- %0 = load volatile i32, i32* @factor, align 4, !dbg !32
+ %0 = load volatile i32, ptr @factor, align 4, !dbg !32
%sub = sub nsw i32 %x.addr.0, %0, !dbg !39
br label %while.cond, !dbg !31
@@ -62,7 +62,7 @@ while.cond2:
while.body4:
; CHECK: call void @llvm.pseudoprobe(i64 [[#GUID2]], i64 5, i32 0, i64 -1)
- %1 = load volatile i32, i32* @factor, align 4, !dbg !45
+ %1 = load volatile i32, ptr @factor, align 4, !dbg !45
%add = add nsw i32 %x.addr.1, %1, !dbg !48
br label %while.cond2, !dbg !44
diff --git a/llvm/test/Transforms/SampleProfile/pseudo-probe-instcombine.ll b/llvm/test/Transforms/SampleProfile/pseudo-probe-instcombine.ll
index bbc03971760a..ae38ee9b827b 100644
--- a/llvm/test/Transforms/SampleProfile/pseudo-probe-instcombine.ll
+++ b/llvm/test/Transforms/SampleProfile/pseudo-probe-instcombine.ll
@@ -1,28 +1,28 @@
; RUN: opt -passes=instcombine -available-load-scan-limit=2 -S < %s | FileCheck %s
-%struct.nonbonded = type { [2 x %struct.CompAtom*], [2 x %struct.CompAtomExt*], [2 x %struct.CompAtom*], [2 x %class.Vector*], [2 x %class.Vector*], [2 x i32], %class.Vector, double*, double*, %class.ComputeNonbondedWorkArrays*, %class.Pairlists*, i32, i32, double, double, i32, i32, i32, i32 }
+%struct.nonbonded = type { [2 x ptr], [2 x ptr], [2 x ptr], [2 x ptr], [2 x ptr], [2 x i32], %class.Vector, ptr, ptr, ptr, ptr, i32, i32, double, double, i32, i32, i32, i32 }
%struct.CompAtomExt = type { i32 }
%struct.CompAtom = type { %class.Vector, float, i16, i8, i8 }
%class.Vector = type { double, double, double }
%class.ComputeNonbondedWorkArrays = type { %class.ResizeArray, %class.ResizeArray.0, %class.ResizeArray, %class.ResizeArray, %class.ResizeArray, %class.ResizeArray, %class.ResizeArray, %class.ResizeArray, %class.ResizeArray, %class.ResizeArray, %class.ResizeArray, %class.ResizeArray, %class.ResizeArray, %class.ResizeArray, %class.ResizeArray, %class.ResizeArray, %class.ResizeArray, %class.ResizeArray.2, %class.ResizeArray.2 }
-%class.ResizeArray.0 = type { i32 (...)**, %class.ResizeArrayRaw.1* }
-%class.ResizeArrayRaw.1 = type <{ double*, i8*, i32, i32, i32, float, i32, [4 x i8] }>
-%class.ResizeArray = type { i32 (...)**, %class.ResizeArrayRaw* }
-%class.ResizeArrayRaw = type <{ i16*, i8*, i32, i32, i32, float, i32, [4 x i8] }>
-%class.ResizeArray.2 = type { i32 (...)**, %class.ResizeArrayRaw.3* }
-%class.ResizeArrayRaw.3 = type <{ %class.Vector*, i8*, i32, i32, i32, float, i32, [4 x i8] }>
-%class.Pairlists = type { i16*, i32, i32 }
+%class.ResizeArray.0 = type { ptr, ptr }
+%class.ResizeArrayRaw.1 = type <{ ptr, ptr, i32, i32, i32, float, i32, [4 x i8] }>
+%class.ResizeArray = type { ptr, ptr }
+%class.ResizeArrayRaw = type <{ ptr, ptr, i32, i32, i32, float, i32, [4 x i8] }>
+%class.ResizeArray.2 = type { ptr, ptr }
+%class.ResizeArrayRaw.3 = type <{ ptr, ptr, i32, i32, i32, float, i32, [4 x i8] }>
+%class.Pairlists = type { ptr, i32, i32 }
-define dso_local void @merge(%struct.nonbonded* nocapture readonly %params) local_unnamed_addr align 2 {
+define dso_local void @merge(ptr nocapture readonly %params) local_unnamed_addr align 2 {
;; Check the minPart4 and minPart assignments are merged.
; CHECK-LABEL: @merge(
-; CHECK-COUNT-1: getelementptr inbounds %struct.nonbonded, %struct.nonbonded* %params, i64 0, i32 16
-; CHECK-NOT: getelementptr inbounds %struct.nonbonded, %struct.nonbonded* %params, i64 0, i32 16
+; CHECK-COUNT-1: getelementptr inbounds %struct.nonbonded, ptr %params, i64 0, i32 16
+; CHECK-NOT: getelementptr inbounds %struct.nonbonded, ptr %params, i64 0, i32 16
entry:
- %savePairlists3 = getelementptr inbounds %struct.nonbonded, %struct.nonbonded* %params, i64 0, i32 11
- %0 = load i32, i32* %savePairlists3, align 8
- %usePairlists4 = getelementptr inbounds %struct.nonbonded, %struct.nonbonded* %params, i64 0, i32 12
- %1 = load i32, i32* %usePairlists4, align 4
+ %savePairlists3 = getelementptr inbounds %struct.nonbonded, ptr %params, i64 0, i32 11
+ %0 = load i32, ptr %savePairlists3, align 8
+ %usePairlists4 = getelementptr inbounds %struct.nonbonded, ptr %params, i64 0, i32 12
+ %1 = load i32, ptr %usePairlists4, align 4
%tobool54.not = icmp eq i32 %0, 0
br i1 %tobool54.not, label %lor.lhs.false55, label %if.end109
@@ -31,14 +31,14 @@ lor.lhs.false55: ; preds = %entry
br i1 %tobool56.not, label %if.end109, label %if.end109.thread
if.end109.thread: ; preds = %lor.lhs.false55
- %minPart4 = getelementptr inbounds %struct.nonbonded, %struct.nonbonded* %params, i64 0, i32 16
- %2 = load i32, i32* %minPart4, align 4
+ %minPart4 = getelementptr inbounds %struct.nonbonded, ptr %params, i64 0, i32 16
+ %2 = load i32, ptr %minPart4, align 4
call void @llvm.pseudoprobe(i64 -6172701105289426098, i64 2, i32 0, i64 -1)
br label %if.then138
if.end109: ; preds = %lor.lhs.false55, %entry
- %minPart = getelementptr inbounds %struct.nonbonded, %struct.nonbonded* %params, i64 0, i32 16
- %3 = load i32, i32* %minPart, align 4
+ %minPart = getelementptr inbounds %struct.nonbonded, ptr %params, i64 0, i32 16
+ %3 = load i32, ptr %minPart, align 4
call void @llvm.pseudoprobe(i64 -6172701105289426098, i64 3, i32 0, i64 -1)
%tobool116.not = icmp eq i32 %1, 0
br i1 %tobool116.not, label %if.then117, label %if.then138
@@ -58,34 +58,34 @@ if.else147: ; preds = %if.then138
ret void
}
-define i32 @load(i32* nocapture %a, i32* nocapture %b) {
+define i32 @load(ptr nocapture %a, ptr nocapture %b) {
;; Check the last store is deleted.
; CHECK-LABEL: @load(
-; CHECK-NEXT: %1 = getelementptr inbounds i32, i32* %a, i64 1
-; CHECK-NEXT: %2 = load i32, i32* %1, align 8
-; CHECK-NEXT: %3 = getelementptr inbounds i32, i32* %b, i64 1
-; CHECK-NEXT: store i32 %2, i32* %3, align 8
+; CHECK-NEXT: %1 = getelementptr inbounds i32, ptr %a, i64 1
+; CHECK-NEXT: %2 = load i32, ptr %1, align 8
+; CHECK-NEXT: %3 = getelementptr inbounds i32, ptr %b, i64 1
+; CHECK-NEXT: store i32 %2, ptr %3, align 8
; CHECK-NEXT: call void @llvm.pseudoprobe(i64 5116412291814990879, i64 1, i32 0, i64 -1)
; CHECK-NEXT: ret i32 %[[#]]
- %1 = getelementptr inbounds i32, i32* %a, i32 1
- %2 = load i32, i32* %1, align 8
- %3 = getelementptr inbounds i32, i32* %b, i32 1
- store i32 %2, i32* %3, align 8
- %4 = getelementptr inbounds i32, i32* %b, i32 1
+ %1 = getelementptr inbounds i32, ptr %a, i32 1
+ %2 = load i32, ptr %1, align 8
+ %3 = getelementptr inbounds i32, ptr %b, i32 1
+ store i32 %2, ptr %3, align 8
+ %4 = getelementptr inbounds i32, ptr %b, i32 1
call void @llvm.pseudoprobe(i64 5116412291814990879, i64 1, i32 0, i64 -1)
- %5 = load i32, i32* %4, align 8
+ %5 = load i32, ptr %4, align 8
ret i32 %5
}
-define void @dse(i32* %p) {
+define void @dse(ptr %p) {
;; Check the first store is deleted.
; CHECK-LABEL: @dse(
; CHECK-NEXT: call void @llvm.pseudoprobe(i64 5116412291814990879, i64 1, i32 0, i64 -1)
-; CHECK-NEXT: store i32 0, i32* [[P:%.*]], align 4
+; CHECK-NEXT: store i32 0, ptr [[P:%.*]], align 4
; CHECK-NEXT: ret void
- store i32 0, i32* %p
+ store i32 0, ptr %p
call void @llvm.pseudoprobe(i64 5116412291814990879, i64 1, i32 0, i64 -1)
- store i32 0, i32* %p
+ store i32 0, ptr %p
ret void
}
diff --git a/llvm/test/Transforms/SampleProfile/pseudo-probe-loop-deletion.ll b/llvm/test/Transforms/SampleProfile/pseudo-probe-loop-deletion.ll
index cd4b1fd242d8..f6ce262acd7f 100644
--- a/llvm/test/Transforms/SampleProfile/pseudo-probe-loop-deletion.ll
+++ b/llvm/test/Transforms/SampleProfile/pseudo-probe-loop-deletion.ll
@@ -8,7 +8,7 @@
%class.Domain.67 = type { %class.DomainBase.68 }
%class.DomainBase.68 = type { i32 }
-define dso_local void @foo(%class.Loc.95* %0) {
+define dso_local void @foo(ptr %0) {
; CHECK-LABEL: @foo(
; CHECK-NEXT: br label [[foo:%.*]]
; CHECK: foo.exit:
@@ -17,13 +17,13 @@ define dso_local void @foo(%class.Loc.95* %0) {
br label %2
2: ; preds = %4, %1
- %.0.i.i = phi %class.Loc.95* [ undef, %1 ], [ %5, %4 ]
- %3 = icmp ne %class.Loc.95* %.0.i.i, %0
+ %.0.i.i = phi ptr [ undef, %1 ], [ %5, %4 ]
+ %3 = icmp ne ptr %.0.i.i, %0
br i1 %3, label %4, label %foo.exit
4: ; preds = %2
call void @llvm.pseudoprobe(i64 6878943695821059507, i64 9, i32 0, i64 -1)
- %5 = getelementptr inbounds %class.Loc.95, %class.Loc.95* %.0.i.i, i32 1
+ %5 = getelementptr inbounds %class.Loc.95, ptr %.0.i.i, i32 1
br label %2
foo.exit: ; preds = %2
diff --git a/llvm/test/Transforms/SampleProfile/pseudo-probe-memset.ll b/llvm/test/Transforms/SampleProfile/pseudo-probe-memset.ll
index 0b2b530bd5e2..ca21f6888a46 100644
--- a/llvm/test/Transforms/SampleProfile/pseudo-probe-memset.ll
+++ b/llvm/test/Transforms/SampleProfile/pseudo-probe-memset.ll
@@ -2,20 +2,20 @@
%struct.MV = type { i16, i16 }
-define void @test(i32* nocapture %c) nounwind optsize {
+define void @test(ptr nocapture %c) nounwind optsize {
; All the stores in this example should be merged into a single memset.
; CHECK-NOT: store i32 -1
-; CHECK: call void @llvm.memset.p0i8.i64
- store i32 -1, i32* %c, align 4
- %1 = getelementptr inbounds i32, i32* %c, i32 1
- store i32 -1, i32* %1, align 4
- %2 = getelementptr inbounds i32, i32* %c, i32 2
- store i32 -1, i32* %2, align 4
+; CHECK: call void @llvm.memset.p0.i64
+ store i32 -1, ptr %c, align 4
+ %1 = getelementptr inbounds i32, ptr %c, i32 1
+ store i32 -1, ptr %1, align 4
+ %2 = getelementptr inbounds i32, ptr %c, i32 2
+ store i32 -1, ptr %2, align 4
call void @llvm.pseudoprobe(i64 5116412291814990879, i64 1, i32 0, i64 -1)
- %3 = getelementptr inbounds i32, i32* %c, i32 3
- store i32 -1, i32* %3, align 4
- %4 = getelementptr inbounds i32, i32* %c, i32 4
- store i32 -1, i32* %4, align 4
+ %3 = getelementptr inbounds i32, ptr %c, i32 3
+ store i32 -1, ptr %3, align 4
+ %4 = getelementptr inbounds i32, ptr %c, i32 4
+ store i32 -1, ptr %4, align 4
ret void
}
diff --git a/llvm/test/Transforms/SampleProfile/pseudo-probe-peep.ll b/llvm/test/Transforms/SampleProfile/pseudo-probe-peep.ll
index d94dac4de95d..00d641105a48 100644
--- a/llvm/test/Transforms/SampleProfile/pseudo-probe-peep.ll
+++ b/llvm/test/Transforms/SampleProfile/pseudo-probe-peep.ll
@@ -3,7 +3,7 @@
define internal i32 @arc_compare() {
entry:
- %0 = load i64, i64* undef, align 8
+ %0 = load i64, ptr undef, align 8
br i1 undef, label %return, label %if.end
if.end: ; preds = %entry
diff --git a/llvm/test/Transforms/SampleProfile/pseudo-probe-profile-metadata-2.ll b/llvm/test/Transforms/SampleProfile/pseudo-probe-profile-metadata-2.ll
index 1b4e5db669ff..148f3ede5ab4 100644
--- a/llvm/test/Transforms/SampleProfile/pseudo-probe-profile-metadata-2.ll
+++ b/llvm/test/Transforms/SampleProfile/pseudo-probe-profile-metadata-2.ll
@@ -1,12 +1,12 @@
; RUN: opt < %s -passes=sample-profile -sample-profile-file=%S/Inputs/pseudo-probe-profile.prof -pass-remarks=sample-profile -S | FileCheck %s
; RUN: opt < %s -passes=sample-profile -sample-profile-file=%S/Inputs/pseudo-probe-profile.prof -pass-remarks=sample-profile -overwrite-existing-weights=1 -S | FileCheck %s -check-prefix=OVW
-define dso_local i32 @foo(i32 %x, void (i32)* %f) #0 !dbg !4 !prof !10 {
+define dso_local i32 @foo(i32 %x, ptr %f) #0 !dbg !4 !prof !10 {
entry:
%retval = alloca i32, align 4
%x.addr = alloca i32, align 4
- store i32 %x, i32* %x.addr, align 4
- %0 = load i32, i32* %x.addr, align 4
+ store i32 %x, ptr %x.addr, align 4
+ %0 = load i32, ptr %x.addr, align 4
%cmp = icmp eq i32 %0, 0
call void @llvm.pseudoprobe(i64 6699318081062747564, i64 1, i32 0, i64 -1)
br i1 %cmp, label %if.then, label %if.else, !prof !11
@@ -16,7 +16,7 @@ if.then:
; CHECK: call {{.*}}, !dbg ![[#]], !prof ![[#PROF:]]
; OVW: call {{.*}}, !dbg ![[#]], !prof ![[#PROF:]]
call void %f(i32 1), !dbg !13, !prof !16
- store i32 1, i32* %retval, align 4
+ store i32 1, ptr %retval, align 4
br label %return
if.else:
@@ -25,12 +25,12 @@ if.else:
;; The block should have a 0 weight. Check the profile metadata is dropped.
; OVW-NOT: call {{.*}}, !dbg ![[#]], !prof
call void %f(i32 2), !dbg !15, !prof !16
- store i32 2, i32* %retval, align 4
+ store i32 2, ptr %retval, align 4
br label %return
return:
call void @llvm.pseudoprobe(i64 6699318081062747564, i64 4, i32 0, i64 -1)
- %1 = load i32, i32* %retval, align 4
+ %1 = load i32, ptr %retval, align 4
ret i32 %1
}
diff --git a/llvm/test/Transforms/SampleProfile/pseudo-probe-profile-metadata.ll b/llvm/test/Transforms/SampleProfile/pseudo-probe-profile-metadata.ll
index b8c9c2c65d5c..d7a58b4cbbcf 100644
--- a/llvm/test/Transforms/SampleProfile/pseudo-probe-profile-metadata.ll
+++ b/llvm/test/Transforms/SampleProfile/pseudo-probe-profile-metadata.ll
@@ -8,14 +8,14 @@
define dso_local i32 @foo() #0 {
entry:
call void @llvm.pseudoprobe(i64 6699318081062747564, i64 1, i32 0, i64 -1)
- %0 = load i32, i32* @yydebug, align 4
+ %0 = load i32, ptr @yydebug, align 4
%cmp = icmp ne i32 %0, 0
br i1 %cmp, label %b1, label %exit
; CHECK: br i1 %cmp, label %b1, label %exit, !prof ![[ENTRY_PROF:[0-9]+]]
b1:
call void @llvm.pseudoprobe(i64 6699318081062747564, i64 2, i32 0, i64 -1)
- %1 = load i32, i32* @yydebug, align 4
+ %1 = load i32, ptr @yydebug, align 4
switch i32 %1, label %b3 [
i32 124, label %indirectgoto
i32 92, label %b2
@@ -28,18 +28,18 @@ b2:
b3:
call void @llvm.pseudoprobe(i64 6699318081062747564, i64 4, i32 0, i64 -1)
- %2 = load i32, i32* @yydebug, align 4
+ %2 = load i32, ptr @yydebug, align 4
ret i32 %2
indirectgoto:
%indirect.goto.dest = alloca i8, align 4
call void @llvm.pseudoprobe(i64 6699318081062747564, i64 5, i32 0, i64 -1)
- indirectbr i8* %indirect.goto.dest, [label %b1, label %b3, label %b2]
-; CHECK: indirectbr i8* %indirect.goto.dest, [label %b1, label %b3, label %b2], !prof ![[GOTO_PROF:[0-9]+]]
+ indirectbr ptr %indirect.goto.dest, [label %b1, label %b3, label %b2]
+; CHECK: indirectbr ptr %indirect.goto.dest, [label %b1, label %b3, label %b2], !prof ![[GOTO_PROF:[0-9]+]]
exit:
call void @llvm.pseudoprobe(i64 6699318081062747564, i64 6, i32 0, i64 -1)
- %3 = load i32, i32* @yydebug, align 4
+ %3 = load i32, ptr @yydebug, align 4
ret i32 %3
}
diff --git a/llvm/test/Transforms/SampleProfile/pseudo-probe-profile.ll b/llvm/test/Transforms/SampleProfile/pseudo-probe-profile.ll
index d9de3716e390..474b6668b0a7 100644
--- a/llvm/test/Transforms/SampleProfile/pseudo-probe-profile.ll
+++ b/llvm/test/Transforms/SampleProfile/pseudo-probe-profile.ll
@@ -1,12 +1,12 @@
; RUN: opt < %s -passes=pseudo-probe,sample-profile -sample-profile-file=%S/Inputs/pseudo-probe-profile.prof -pass-remarks=sample-profile -pass-remarks-output=%t.opt.yaml -sample-profile-use-profi=0 -S | FileCheck %s
; RUN: FileCheck %s -check-prefix=YAML < %t.opt.yaml
-define dso_local i32 @foo(i32 %x, void (i32)* %f) #0 !dbg !4 {
+define dso_local i32 @foo(i32 %x, ptr %f) #0 !dbg !4 {
entry:
%retval = alloca i32, align 4
%x.addr = alloca i32, align 4
- store i32 %x, i32* %x.addr, align 4
- %0 = load i32, i32* %x.addr, align 4
+ store i32 %x, ptr %x.addr, align 4
+ %0 = load i32, ptr %x.addr, align 4
%cmp = icmp eq i32 %0, 0
; CHECK: call void @llvm.pseudoprobe(i64 [[#GUID:]], i64 1, i32 0, i64 -1)
br i1 %cmp, label %if.then, label %if.else
@@ -16,19 +16,19 @@ if.then:
; CHECK: call {{.*}}, !dbg ![[#PROBE1:]], !prof ![[PROF1:[0-9]+]]
call void %f(i32 1)
; CHECK: call void @llvm.pseudoprobe(i64 [[#GUID:]], i64 2, i32 0, i64 -1)
- store i32 1, i32* %retval, align 4
+ store i32 1, ptr %retval, align 4
br label %return
if.else:
; CHECK: call {{.*}}, !dbg ![[#PROBE2:]], !prof ![[PROF2:[0-9]+]]
call void %f(i32 2)
; CHECK: call void @llvm.pseudoprobe(i64 [[#GUID:]], i64 3, i32 0, i64 -1)
- store i32 2, i32* %retval, align 4
+ store i32 2, ptr %retval, align 4
br label %return
return:
; CHECK: call void @llvm.pseudoprobe(i64 [[#GUID:]], i64 4, i32 0, i64 -1)
- %1 = load i32, i32* %retval, align 4
+ %1 = load i32, ptr %retval, align 4
ret i32 %1
}
diff --git a/llvm/test/Transforms/SampleProfile/pseudo-probe-selectionDAG.ll b/llvm/test/Transforms/SampleProfile/pseudo-probe-selectionDAG.ll
index 1d16b853acaf..535e9b0e95f2 100644
--- a/llvm/test/Transforms/SampleProfile/pseudo-probe-selectionDAG.ll
+++ b/llvm/test/Transforms/SampleProfile/pseudo-probe-selectionDAG.ll
@@ -5,7 +5,7 @@
define internal i32 @arc_compare() {
entry:
- %0 = load i64, i64* undef, align 8
+ %0 = load i64, ptr undef, align 8
br i1 undef, label %return, label %if.end
if.end: ; preds = %entry
@@ -14,7 +14,7 @@ if.end: ; preds = %entry
; IR: call void @llvm.pseudoprobe(i64 5116412291814990879, i64 1, i32 0, i64 -1)
; IR: call void @llvm.pseudoprobe(i64 5116412291814990879, i64 3, i32 0, i64 -1)
call void @llvm.pseudoprobe(i64 5116412291814990879, i64 1, i32 0, i64 -1)
- %1 = load i16, i16* undef, align 8
+ %1 = load i16, ptr undef, align 8
call void @llvm.pseudoprobe(i64 5116412291814990879, i64 3, i32 0, i64 -1)
%2 = and i16 %1, 16
%3 = icmp eq i16 %2, 0
diff --git a/llvm/test/Transforms/SampleProfile/pseudo-probe-slotindex.ll b/llvm/test/Transforms/SampleProfile/pseudo-probe-slotindex.ll
index 416531836f39..4dd5af2bc99c 100644
--- a/llvm/test/Transforms/SampleProfile/pseudo-probe-slotindex.ll
+++ b/llvm/test/Transforms/SampleProfile/pseudo-probe-slotindex.ll
@@ -1,10 +1,10 @@
; REQUIRES: x86_64-linux
; RUN: llc -print-after=slotindexes -stop-after=slotindexes -mtriple=x86_64-- %s -filetype=asm -o %t 2>&1 | FileCheck %s
-define void @foo(i32* %p) {
- store i32 0, i32* %p
+define void @foo(ptr %p) {
+ store i32 0, ptr %p
call void @llvm.pseudoprobe(i64 5116412291814990879, i64 1, i32 0, i64 -1)
- store i32 0, i32* %p
+ store i32 0, ptr %p
ret void
}
diff --git a/llvm/test/Transforms/SampleProfile/pseudo-probe-twoaddr.ll b/llvm/test/Transforms/SampleProfile/pseudo-probe-twoaddr.ll
index 31b471ea08fd..f16a21a9ded3 100644
--- a/llvm/test/Transforms/SampleProfile/pseudo-probe-twoaddr.ll
+++ b/llvm/test/Transforms/SampleProfile/pseudo-probe-twoaddr.ll
@@ -4,7 +4,7 @@
define dso_local double @twoaddressinstruction() local_unnamed_addr {
for.end:
- %0 = load i64, i64* undef, align 8
+ %0 = load i64, ptr undef, align 8
br label %for.body14.preheader
for.body14.preheader: ; preds = %for.end
diff --git a/llvm/test/Transforms/SampleProfile/pseudo-probe-verify.ll b/llvm/test/Transforms/SampleProfile/pseudo-probe-verify.ll
index fd57dd8bc526..f70e5189ab12 100644
--- a/llvm/test/Transforms/SampleProfile/pseudo-probe-verify.ll
+++ b/llvm/test/Transforms/SampleProfile/pseudo-probe-verify.ll
@@ -12,7 +12,7 @@ declare void @foo2() nounwind
define void @foo(i32 %x) {
bb:
; CHECK: call void @llvm.pseudoprobe(i64 [[#GUID:]], i64 1, i32 0, i64 -1)
- %tmp = alloca [5 x i32*], align 16
+ %tmp = alloca [5 x ptr], align 16
br label %bb7.preheader
bb3.loopexit:
@@ -39,9 +39,9 @@ bb10:
; CHECK: call void @llvm.pseudoprobe(i64 [[#GUID:]], i64 2, i32 0, i64 -1)
%indvars.iv = phi i64 [ 0, %bb7.preheader ], [ %indvars.iv.next, %bb10 ]
%tmp1.14 = phi i32 [ %tmp1.06, %bb7.preheader ], [ %spec.select, %bb10 ]
- %tmp13 = getelementptr inbounds [5 x i32*], [5 x i32*]* %tmp, i64 0, i64 %indvars.iv
- %tmp14 = load i32*, i32** %tmp13, align 8
- %tmp15.not = icmp ne i32* %tmp14, null
+ %tmp13 = getelementptr inbounds [5 x ptr], ptr %tmp, i64 0, i64 %indvars.iv
+ %tmp14 = load ptr, ptr %tmp13, align 8
+ %tmp15.not = icmp ne ptr %tmp14, null
%tmp18 = sext i1 %tmp15.not to i32
%spec.select = add nsw i32 %tmp1.14, %tmp18
call void @foo2(), !dbg !12
diff --git a/llvm/test/Transforms/SampleProfile/remap-2.ll b/llvm/test/Transforms/SampleProfile/remap-2.ll
index 668fa275e133..6df85a6f5c76 100644
--- a/llvm/test/Transforms/SampleProfile/remap-2.ll
+++ b/llvm/test/Transforms/SampleProfile/remap-2.ll
@@ -7,43 +7,43 @@
define i32 @_ZN3foo3barERKN1M1XINS_6detail3quxEEE() #0 !dbg !9 {
entry:
- %t0 = load i32, i32* @x.addr, align 4
- %t1 = load i32, i32* @y.addr, align 4
+ %t0 = load i32, ptr @x.addr, align 4
+ %t1 = load i32, ptr @y.addr, align 4
%add = add nsw i32 %t0, %t1
ret i32 %add
}
define i32 @_ZN1M1XE() #0 !dbg !10 {
entry:
- %t0 = load i32, i32* @x.addr, align 4
- %t1 = load i32, i32* @y.addr, align 4
+ %t0 = load i32, ptr @x.addr, align 4
+ %t1 = load i32, ptr @y.addr, align 4
%sub = sub nsw i32 %t0, %t1
ret i32 %sub
}
-define void @test(i32 ()*) #0 !dbg !4 {
- %t2 = alloca i32 ()*
- store i32 ()* %0, i32 ()** %t2
- %t3 = load i32 ()*, i32 ()** %t2
+define void @test(ptr) #0 !dbg !4 {
+ %t2 = alloca ptr
+ store ptr %0, ptr %t2
+ %t3 = load ptr, ptr %t2
; Check call i32 %t3 has been indirect call promoted and call i32 @_ZN1M1XE
; has been inlined.
; CHECK-LABEL: @test(
-; CHECK: icmp eq i32 ()* %t3, @_ZN3foo3barERKN1M1XINS_6detail3quxEEE
+; CHECK: icmp eq ptr %t3, @_ZN3foo3barERKN1M1XINS_6detail3quxEEE
; CHECK-NOT: call i32 @_ZN1M1XE
%t4 = call i32 %t3(), !dbg !7
%t5 = call i32 @_ZN1M1XE(), !dbg !8
ret void
}
-define void @_ZN1M1X1YE(i32 ()*) #0 !dbg !11 {
- %t2 = alloca i32 ()*
- store i32 ()* %0, i32 ()** %t2
- %t3 = load i32 ()*, i32 ()** %t2
+define void @_ZN1M1X1YE(ptr) #0 !dbg !11 {
+ %t2 = alloca ptr
+ store ptr %0, ptr %t2
+ %t3 = load ptr, ptr %t2
; Check call i32 %t3 has got its profile but is not indirect call promoted
; because the promotion candidate is a recursive call to the current function.
; CHECK-LABEL: @_ZN1M1X1YE(
; CHECK: call i32 %t3(), {{.*}} !prof ![[PROFID:[0-9]+]]
-; CHECK-NOT: icmp eq i32 ()* %t3, @_ZN1M1X1YE
+; CHECK-NOT: icmp eq ptr %t3, @_ZN1M1X1YE
%t4 = call i32 %t3(), !dbg !12
ret void
}
diff --git a/llvm/test/Transforms/SampleProfile/remarks.ll b/llvm/test/Transforms/SampleProfile/remarks.ll
index ab7b95cb131d..997e02bb5b54 100644
--- a/llvm/test/Transforms/SampleProfile/remarks.ll
+++ b/llvm/test/Transforms/SampleProfile/remarks.ll
@@ -96,7 +96,7 @@
;YAML: --- !Analysis
;YAML-NEXT: Pass: sample-profile
;YAML-NEXT: Name: AppliedSamples
-;YAML-NEXT: DebugLoc: { File: remarks.cc, Line: 5, Column: 8 }
+;YAML-NEXT: DebugLoc: { File: remarks.cc, Line: 5, Column: 12 }
;YAML-NEXT: Function: main
;YAML-NEXT: Args:
;YAML-NEXT: - String: 'Applied '
@@ -121,68 +121,64 @@ define i64 @_Z3foov() #0 !dbg !4 {
entry:
%sum = alloca i64, align 8
%i = alloca i32, align 4
- %0 = bitcast i64* %sum to i8*, !dbg !19
- call void @llvm.lifetime.start.p0i8(i64 8, i8* %0) #4, !dbg !19
- call void @llvm.dbg.declare(metadata i64* %sum, metadata !9, metadata !20), !dbg !21
- store i64 0, i64* %sum, align 8, !dbg !21, !tbaa !22
- %1 = bitcast i32* %i to i8*, !dbg !26
- call void @llvm.lifetime.start.p0i8(i64 4, i8* %1) #4, !dbg !26
- call void @llvm.dbg.declare(metadata i32* %i, metadata !10, metadata !20), !dbg !27
- store i32 0, i32* %i, align 4, !dbg !27, !tbaa !28
+ call void @llvm.lifetime.start.p0(i64 8, ptr %sum) #4, !dbg !19
+ call void @llvm.dbg.declare(metadata ptr %sum, metadata !9, metadata !20), !dbg !21
+ store i64 0, ptr %sum, align 8, !dbg !21, !tbaa !22
+ call void @llvm.lifetime.start.p0(i64 4, ptr %i) #4, !dbg !26
+ call void @llvm.dbg.declare(metadata ptr %i, metadata !10, metadata !20), !dbg !27
+ store i32 0, ptr %i, align 4, !dbg !27, !tbaa !28
br label %for.cond, !dbg !26
for.cond: ; preds = %for.inc, %entry
- %2 = load i32, i32* %i, align 4, !dbg !30, !tbaa !28
- %cmp = icmp slt i32 %2, 500000000, !dbg !34
+ %0 = load i32, ptr %i, align 4, !dbg !30, !tbaa !28
+ %cmp = icmp slt i32 %0, 500000000, !dbg !34
br i1 %cmp, label %for.body, label %for.cond.cleanup, !dbg !35
for.cond.cleanup: ; preds = %for.cond
- %3 = bitcast i32* %i to i8*, !dbg !36
- call void @llvm.lifetime.end.p0i8(i64 4, i8* %3) #4, !dbg !36
+ call void @llvm.lifetime.end.p0(i64 4, ptr %i) #4, !dbg !36
br label %for.end
for.body: ; preds = %for.cond
- %4 = load i32, i32* %i, align 4, !dbg !38, !tbaa !28
- %cmp1 = icmp slt i32 %4, 1000, !dbg !40
+ %1 = load i32, ptr %i, align 4, !dbg !38, !tbaa !28
+ %cmp1 = icmp slt i32 %1, 1000, !dbg !40
br i1 %cmp1, label %if.then, label %if.else, !dbg !41
if.then: ; preds = %for.body
- %5 = load i32, i32* %i, align 4, !dbg !42, !tbaa !28
- %conv = sext i32 %5 to i64, !dbg !42
- %6 = load i64, i64* %sum, align 8, !dbg !43, !tbaa !22
- %sub = sub nsw i64 %6, %conv, !dbg !43
- store i64 %sub, i64* %sum, align 8, !dbg !43, !tbaa !22
+ %2 = load i32, ptr %i, align 4, !dbg !42, !tbaa !28
+ %conv = sext i32 %2 to i64, !dbg !42
+ %3 = load i64, ptr %sum, align 8, !dbg !43, !tbaa !22
+ %sub = sub nsw i64 %3, %conv, !dbg !43
+ store i64 %sub, ptr %sum, align 8, !dbg !43, !tbaa !22
br label %if.end, !dbg !44
if.else: ; preds = %for.body
- %7 = load i32, i32* %i, align 4, !dbg !45, !tbaa !28
- %sub2 = sub nsw i32 0, %7, !dbg !46
+ %4 = load i32, ptr %i, align 4, !dbg !45, !tbaa !28
+ %sub2 = sub nsw i32 0, %4, !dbg !46
%call = call i32 @rand() #4, !dbg !47
%mul = mul nsw i32 %sub2, %call, !dbg !48
%conv3 = sext i32 %mul to i64, !dbg !46
- %8 = load i64, i64* %sum, align 8, !dbg !49, !tbaa !22
- %add = add nsw i64 %8, %conv3, !dbg !49
- store i64 %add, i64* %sum, align 8, !dbg !49, !tbaa !22
+ %5 = load i64, ptr %sum, align 8, !dbg !49, !tbaa !22
+ %add = add nsw i64 %5, %conv3, !dbg !49
+ store i64 %add, ptr %sum, align 8, !dbg !49, !tbaa !22
br label %if.end
if.end: ; preds = %if.else, %if.then
br label %for.inc, !dbg !50
for.inc: ; preds = %if.end
- %9 = load i32, i32* %i, align 4, !dbg !51, !tbaa !28
- %inc = add nsw i32 %9, 1, !dbg !51
- store i32 %inc, i32* %i, align 4, !dbg !51, !tbaa !28
+ %6 = load i32, ptr %i, align 4, !dbg !51, !tbaa !28
+ %inc = add nsw i32 %6, 1, !dbg !51
+ store i32 %inc, ptr %i, align 4, !dbg !51, !tbaa !28
br label %for.cond, !dbg !52
for.end: ; preds = %for.cond.cleanup
- %10 = load i64, i64* %sum, align 8, !dbg !53, !tbaa !22
- %11 = bitcast i64* %sum to i8*, !dbg !54
- call void @llvm.lifetime.end.p0i8(i64 8, i8* %11) #4, !dbg !54
- ret i64 %10, !dbg !55
+ %7 = load i64, ptr %sum, align 8, !dbg !53, !tbaa !22
+ call void @llvm.lifetime.end.p0(i64 8, ptr %sum) #4, !dbg !54
+ ret i64 %7, !dbg !55
}
; Function Attrs: nounwind argmemonly
-declare void @llvm.lifetime.start.p0i8(i64, i8* nocapture) #1
+declare void @llvm.lifetime.start.p0(i64, ptr nocapture) #1
; Function Attrs: nounwind readnone
declare void @llvm.dbg.declare(metadata, metadata, metadata) #2
@@ -193,13 +189,13 @@ define i32 @rand() #3 !dbg !59 {
}
; Function Attrs: nounwind argmemonly
-declare void @llvm.lifetime.end.p0i8(i64, i8* nocapture) #1
+declare void @llvm.lifetime.end.p0(i64, ptr nocapture) #1
; Function Attrs: nounwind uwtable
define i32 @main() #0 !dbg !13 {
entry:
%retval = alloca i32, align 4
- store i32 0, i32* %retval, align 4
+ store i32 0, ptr %retval, align 4
%call = call i64 @_Z3foov(), !dbg !56
%cmp = icmp sgt i64 %call, 0, !dbg !57
%conv = zext i1 %cmp to i32, !dbg !56
diff --git a/llvm/test/Transforms/SampleProfile/uniqname.ll b/llvm/test/Transforms/SampleProfile/uniqname.ll
index 1d304af85368..23c3ac92f8f0 100644
--- a/llvm/test/Transforms/SampleProfile/uniqname.ll
+++ b/llvm/test/Transforms/SampleProfile/uniqname.ll
@@ -10,7 +10,7 @@ target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16
target triple = "x86_64-unknown-linux-gnu"
@cond = dso_local global i8 0, align 1
- at p = dso_local global void ()* null, align 8
+ at p = dso_local global ptr null, align 8
; Check the callsite in inlined function with uniq suffix is annotated with
; profile correctly.
@@ -22,7 +22,7 @@ target triple = "x86_64-unknown-linux-gnu"
; Function Attrs: uwtable mustprogress
define dso_local void @_Z3foov() #0 !dbg !7 {
entry:
- store void ()* @_ZL3hoov.__uniq.334154460836426447066042049082945760258, void ()** @p, align 8, !dbg !9, !tbaa !10
+ store ptr @_ZL3hoov.__uniq.334154460836426447066042049082945760258, ptr @p, align 8, !dbg !9, !tbaa !10
call void @_ZL3goov.__uniq.334154460836426447066042049082945760258.llvm.4206369970847378271(), !dbg !14
call void @_ZL3moov.__uniq.334154460836426447066042049082945760258(), !dbg !15
ret void, !dbg !16
@@ -38,13 +38,13 @@ entry:
; Check the indirect call target with uniq suffix is promoted and the inlined
; body is annotated with profile.
; CHECK: define internal void @_ZL3goov.__uniq.334154460836426447066042049082945760258.llvm.4206369970847378271{{.*}} !prof ![[PROF_ID3:[0-9]+]]
-; CHECK: icmp eq void ()* {{.*}} @_ZL3hoov.__uniq.334154460836426447066042049082945760258
+; CHECK: icmp eq ptr {{.*}} @_ZL3hoov.__uniq.334154460836426447066042049082945760258
; CHECK: call void @_Z10hoo_calleev(), {{.*}} !prof ![[PROF_ID4:[0-9]+]]
; Function Attrs: noinline uwtable mustprogress
define internal void @_ZL3goov.__uniq.334154460836426447066042049082945760258.llvm.4206369970847378271() #2 !dbg !20 {
entry:
- %0 = load void ()*, void ()** @p, align 8, !dbg !21, !tbaa !10
+ %0 = load ptr, ptr @p, align 8, !dbg !21, !tbaa !10
call void %0(), !dbg !22
ret void, !dbg !23
}
@@ -53,7 +53,7 @@ entry:
define internal void @_ZL3moov.__uniq.334154460836426447066042049082945760258() #1 !dbg !24 {
entry:
call void @_Z10moo_calleev(), !dbg !25
- %0 = load volatile i8, i8* @cond, align 1, !dbg !26, !tbaa !27, !range !29
+ %0 = load volatile i8, ptr @cond, align 1, !dbg !26, !tbaa !27, !range !29
%tobool.not = icmp eq i8 %0, 0, !dbg !26
br i1 %tobool.not, label %if.end, label %if.then, !dbg !26
@@ -72,7 +72,7 @@ declare !dbg !33 dso_local void @_Z10moo_calleev() #3
; Function Attrs: uwtable mustprogress
define internal void @_ZL3noov.__uniq.334154460836426447066042049082945760258() #1 !dbg !34 {
entry:
- %0 = load volatile i8, i8* @cond, align 1, !dbg !35, !tbaa !27, !range !29
+ %0 = load volatile i8, ptr @cond, align 1, !dbg !35, !tbaa !27, !range !29
%tobool.not = icmp eq i8 %0, 0, !dbg !35
br i1 %tobool.not, label %if.end, label %if.then, !dbg !35
diff --git a/llvm/test/Transforms/SampleProfile/use-sample-profile-attr.ll b/llvm/test/Transforms/SampleProfile/use-sample-profile-attr.ll
index fcebb180df69..e0d4a13167a5 100644
--- a/llvm/test/Transforms/SampleProfile/use-sample-profile-attr.ll
+++ b/llvm/test/Transforms/SampleProfile/use-sample-profile-attr.ll
@@ -15,10 +15,10 @@ define i32 @foo(i32 %x, i32 %y) #0 !dbg !4 {
entry:
%x.addr = alloca i32, align 4
%y.addr = alloca i32, align 4
- store i32 %x, i32* %x.addr, align 4
- store i32 %y, i32* %y.addr, align 4
- %0 = load i32, i32* %x.addr, align 4, !dbg !11
- %1 = load i32, i32* %y.addr, align 4, !dbg !11
+ store i32 %x, ptr %x.addr, align 4
+ store i32 %y, ptr %y.addr, align 4
+ %0 = load i32, ptr %x.addr, align 4, !dbg !11
+ %1 = load i32, ptr %y.addr, align 4, !dbg !11
%add = add nsw i32 %0, %1, !dbg !11
ret i32 %add, !dbg !11
}
@@ -30,32 +30,32 @@ entry:
%retval = alloca i32, align 4
%s = alloca i32, align 4
%i = alloca i32, align 4
- store i32 0, i32* %retval
- store i32 0, i32* %i, align 4, !dbg !12
+ store i32 0, ptr %retval
+ store i32 0, ptr %i, align 4, !dbg !12
br label %while.cond, !dbg !13
while.cond: ; preds = %if.end, %entry
- %0 = load i32, i32* %i, align 4, !dbg !14
+ %0 = load i32, ptr %i, align 4, !dbg !14
%inc = add nsw i32 %0, 1, !dbg !14
- store i32 %inc, i32* %i, align 4, !dbg !14
+ store i32 %inc, ptr %i, align 4, !dbg !14
%cmp = icmp slt i32 %0, 400000000, !dbg !14
br i1 %cmp, label %while.body, label %while.end, !dbg !14
while.body: ; preds = %while.cond
- %1 = load i32, i32* %i, align 4, !dbg !16
+ %1 = load i32, ptr %i, align 4, !dbg !16
%cmp1 = icmp ne i32 %1, 100, !dbg !16
br i1 %cmp1, label %if.then, label %if.else, !dbg !16
if.then: ; preds = %while.body
- %2 = load i32, i32* %i, align 4, !dbg !18
- %3 = load i32, i32* %s, align 4, !dbg !18
+ %2 = load i32, ptr %i, align 4, !dbg !18
+ %3 = load i32, ptr %s, align 4, !dbg !18
;; @foo is inlined because the callsite is hot and @foo has use-sample-profile
;; attribute.
; CHECK: if.then:
; CHECK-NOT: call i32 @foo
%call = call i32 @foo(i32 %2, i32 %3), !dbg !18
- store i32 %call, i32* %s, align 4, !dbg !18
+ store i32 %call, ptr %s, align 4, !dbg !18
br label %if.end, !dbg !18
if.else: ; preds = %while.body
@@ -63,15 +63,15 @@ if.else: ; preds = %while.body
; CHECK: if.else:
; CHECK: call void @goo
call void @goo(), !dbg !27
- store i32 30, i32* %s, align 4, !dbg !20
+ store i32 30, ptr %s, align 4, !dbg !20
br label %if.end
if.end: ; preds = %if.else, %if.then
br label %while.cond, !dbg !22
while.end: ; preds = %while.cond
- %4 = load i32, i32* %s, align 4, !dbg !24
- %call2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i32 0, i32 0), i32 %4), !dbg !24
+ %4 = load i32, ptr %s, align 4, !dbg !24
+ %call2 = call i32 (ptr, ...) @printf(ptr @.str, i32 %4), !dbg !24
ret i32 0, !dbg !25
}
@@ -81,7 +81,7 @@ while.end: ; preds = %while.cond
attributes #0 = {"use-sample-profile"}
attributes #1 = {"use-sample-profile"}
-declare i32 @printf(i8*, ...)
+declare i32 @printf(ptr, ...)
!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!8, !9}
diff --git a/llvm/test/Transforms/SampleProfile/warm-inline-instance.ll b/llvm/test/Transforms/SampleProfile/warm-inline-instance.ll
index 2a63822bb1bc..3f9d7c003059 100644
--- a/llvm/test/Transforms/SampleProfile/warm-inline-instance.ll
+++ b/llvm/test/Transforms/SampleProfile/warm-inline-instance.ll
@@ -7,10 +7,10 @@ define i32 @foo(i32 %x, i32 %y) #0 !dbg !4 {
entry:
%x.addr = alloca i32, align 4
%y.addr = alloca i32, align 4
- store i32 %x, i32* %x.addr, align 4
- store i32 %y, i32* %y.addr, align 4
- %t0 = load i32, i32* %x.addr, align 4, !dbg !11
- %t1 = load i32, i32* %y.addr, align 4, !dbg !11
+ store i32 %x, ptr %x.addr, align 4
+ store i32 %y, ptr %y.addr, align 4
+ %t0 = load i32, ptr %x.addr, align 4, !dbg !11
+ %t1 = load i32, ptr %y.addr, align 4, !dbg !11
%add = add nsw i32 %t0, %t1, !dbg !11
ret i32 %add, !dbg !11
}
@@ -19,10 +19,10 @@ define i32 @goo(i32 %x, i32 %y) #0 {
entry:
%x.addr = alloca i32, align 4
%y.addr = alloca i32, align 4
- store i32 %x, i32* %x.addr, align 4
- store i32 %y, i32* %y.addr, align 4
- %t0 = load i32, i32* %x.addr, align 4, !dbg !11
- %t1 = load i32, i32* %y.addr, align 4, !dbg !11
+ store i32 %x, ptr %x.addr, align 4
+ store i32 %y, ptr %y.addr, align 4
+ %t0 = load i32, ptr %x.addr, align 4, !dbg !11
+ %t1 = load i32, ptr %y.addr, align 4, !dbg !11
%add = add nsw i32 %t0, %t1, !dbg !11
ret i32 %add, !dbg !11
}
@@ -33,25 +33,25 @@ entry:
%retval = alloca i32, align 4
%s = alloca i32, align 4
%i = alloca i32, align 4
- store i32 0, i32* %retval
- store i32 0, i32* %i, align 4, !dbg !12
+ store i32 0, ptr %retval
+ store i32 0, ptr %i, align 4, !dbg !12
br label %while.cond, !dbg !13
while.cond: ; preds = %if.end, %entry
- %t0 = load i32, i32* %i, align 4, !dbg !14
+ %t0 = load i32, ptr %i, align 4, !dbg !14
%inc = add nsw i32 %t0, 1, !dbg !14
- store i32 %inc, i32* %i, align 4, !dbg !14
+ store i32 %inc, ptr %i, align 4, !dbg !14
%cmp = icmp slt i32 %t0, 400000000, !dbg !14
br i1 %cmp, label %while.body, label %while.end, !dbg !14
while.body: ; preds = %while.cond
- %t1 = load i32, i32* %i, align 4, !dbg !16
+ %t1 = load i32, ptr %i, align 4, !dbg !16
%cmp1 = icmp ne i32 %t1, 100, !dbg !16
br i1 %cmp1, label %if.then, label %if.else, !dbg !16
if.then: ; preds = %while.body
- %t2 = load i32, i32* %i, align 4, !dbg !18
- %t3 = load i32, i32* %s, align 4, !dbg !18
+ %t2 = load i32, ptr %i, align 4, !dbg !18
+ %t3 = load i32, ptr %s, align 4, !dbg !18
; Although the ratio of total samples of @foo vs total samples of @main is
; small, since the total samples count is larger than hot cutoff computed by
; ProfileSummaryInfo, we will still regard the callsite of foo as hot and
@@ -59,7 +59,7 @@ if.then: ; preds = %while.body
; CHECK-LABEL: @main(
; CHECK-NOT: call i32 @foo(i32 %t2, i32 %t3)
%call1 = call i32 @foo(i32 %t2, i32 %t3), !dbg !18
- store i32 %call1, i32* %s, align 4, !dbg !18
+ store i32 %call1, ptr %s, align 4, !dbg !18
br label %if.end, !dbg !18
if.else: ; preds = %while.body
@@ -68,19 +68,19 @@ if.else: ; preds = %while.body
; CHECK-NOT: !prof
; CHECK-SAME: {{$}}
%call2 = call i32 @goo(i32 2, i32 3), !dbg !26
- store i32 %call2, i32* %s, align 4, !dbg !20
+ store i32 %call2, ptr %s, align 4, !dbg !20
br label %if.end
if.end: ; preds = %if.else, %if.then
br label %while.cond, !dbg !22
while.end: ; preds = %while.cond
- %t4 = load i32, i32* %s, align 4, !dbg !24
- %call3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i32 0, i32 0), i32 %t4), !dbg !24
+ %t4 = load i32, ptr %s, align 4, !dbg !24
+ %call3 = call i32 (ptr, ...) @printf(ptr @.str, i32 %t4), !dbg !24
ret i32 0, !dbg !25
}
-declare i32 @printf(i8*, ...) #2
+declare i32 @printf(ptr, ...) #2
attributes #0 = { "use-sample-profile" }
More information about the llvm-commits
mailing list