[llvm] 9ff36df - [PGO][InstrProf][test] Convert to opaque pointers and fix some stale tests
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Sat Jul 16 11:42:44 PDT 2022
Author: Fangrui Song
Date: 2022-07-16T11:42:35-07:00
New Revision: 9ff36df5a4a7d52c51e950522870bb64912688d2
URL: https://github.com/llvm/llvm-project/commit/9ff36df5a4a7d52c51e950522870bb64912688d2
DIFF: https://github.com/llvm/llvm-project/commit/9ff36df5a4a7d52c51e950522870bb64912688d2.diff
LOG: [PGO][InstrProf][test] Convert to opaque pointers and fix some stale tests
Added:
Modified:
llvm/test/Instrumentation/InstrProfiling/always_inline.ll
llvm/test/Instrumentation/InstrProfiling/atomic-updates.ll
llvm/test/Instrumentation/InstrProfiling/comdat.ll
llvm/test/Instrumentation/InstrProfiling/coverage.ll
llvm/test/Instrumentation/InstrProfiling/debug-info-correlate-coverage.ll
llvm/test/Instrumentation/InstrProfiling/debug-info-correlate.ll
llvm/test/Instrumentation/InstrProfiling/early-exit.ll
llvm/test/Instrumentation/InstrProfiling/icall-comdat.ll
llvm/test/Instrumentation/InstrProfiling/icall-nocomdat.ll
llvm/test/Instrumentation/InstrProfiling/noruntime.ll
llvm/test/Instrumentation/InstrProfiling/platform.ll
llvm/test/Instrumentation/InstrProfiling/profiling.ll
llvm/test/Instrumentation/InstrProfiling/runtime-counter-relocation.ll
llvm/test/Transforms/PGOProfile/Inputs/thinlto_cspgo_bar_gen.ll
llvm/test/Transforms/PGOProfile/Inputs/thinlto_cspgo_bar_use.ll
llvm/test/Transforms/PGOProfile/Inputs/thinlto_samplepgo_icp.ll
llvm/test/Transforms/PGOProfile/Inputs/thinlto_samplepgo_icp3.ll
llvm/test/Transforms/PGOProfile/PR41279.ll
llvm/test/Transforms/PGOProfile/PR41279_2.ll
llvm/test/Transforms/PGOProfile/bfi_verification.ll
llvm/test/Transforms/PGOProfile/callbr.ll
llvm/test/Transforms/PGOProfile/chr.ll
llvm/test/Transforms/PGOProfile/chr_coro.ll
llvm/test/Transforms/PGOProfile/comdat_internal.ll
llvm/test/Transforms/PGOProfile/comdat_rename.ll
llvm/test/Transforms/PGOProfile/consecutive-zeros.ll
llvm/test/Transforms/PGOProfile/counter_promo_exit_catchswitch.ll
llvm/test/Transforms/PGOProfile/counter_promo_exit_merge.ll
llvm/test/Transforms/PGOProfile/counter_promo_mexits.ll
llvm/test/Transforms/PGOProfile/counter_promo_nest-inseltpoison.ll
llvm/test/Transforms/PGOProfile/counter_promo_nest.ll
llvm/test/Transforms/PGOProfile/counter_promo_with_bias.ll
llvm/test/Transforms/PGOProfile/cspgo_profile_summary.ll
llvm/test/Transforms/PGOProfile/diag_no_value_sites.ll
llvm/test/Transforms/PGOProfile/do-not-instrument.ll
llvm/test/Transforms/PGOProfile/fix_bfi.ll
llvm/test/Transforms/PGOProfile/func_entry.ll
llvm/test/Transforms/PGOProfile/icp_covariant_call_return.ll
llvm/test/Transforms/PGOProfile/icp_covariant_invoke_return.ll
llvm/test/Transforms/PGOProfile/icp_invoke.ll
llvm/test/Transforms/PGOProfile/icp_invoke_nouse.ll
llvm/test/Transforms/PGOProfile/icp_mismatch_msg.ll
llvm/test/Transforms/PGOProfile/icp_sample.ll
llvm/test/Transforms/PGOProfile/icp_vararg.ll
llvm/test/Transforms/PGOProfile/icp_vararg_sret.ll
llvm/test/Transforms/PGOProfile/indirect_call_annotation.ll
llvm/test/Transforms/PGOProfile/indirect_call_profile.ll
llvm/test/Transforms/PGOProfile/indirect_call_profile_funclet.ll
llvm/test/Transforms/PGOProfile/indirect_call_promotion.ll
llvm/test/Transforms/PGOProfile/indirect_call_promotion_byval.ll
llvm/test/Transforms/PGOProfile/indirect_call_promotion_musttail.ll
llvm/test/Transforms/PGOProfile/indirect_call_promotion_unique.ll
llvm/test/Transforms/PGOProfile/indirect_call_promotion_vla.ll
llvm/test/Transforms/PGOProfile/indirectbr.ll
llvm/test/Transforms/PGOProfile/infinite_loop.ll
llvm/test/Transforms/PGOProfile/irreducible.ll
llvm/test/Transforms/PGOProfile/landingpad.ll
llvm/test/Transforms/PGOProfile/memcpy.ll
llvm/test/Transforms/PGOProfile/memop_clone.ll
llvm/test/Transforms/PGOProfile/memop_hash.ll
llvm/test/Transforms/PGOProfile/memop_profile_funclet.ll
llvm/test/Transforms/PGOProfile/memop_size_annotation.ll
llvm/test/Transforms/PGOProfile/memop_size_from_strlen.ll
llvm/test/Transforms/PGOProfile/memop_size_opt.ll
llvm/test/Transforms/PGOProfile/memop_size_opt_skip_ranges_promote_three.ll
llvm/test/Transforms/PGOProfile/memop_size_opt_zero.ll
llvm/test/Transforms/PGOProfile/misexpect-branch-correct.ll
llvm/test/Transforms/PGOProfile/misexpect-branch-overflow.ll
llvm/test/Transforms/PGOProfile/misexpect-branch-stripped.ll
llvm/test/Transforms/PGOProfile/misexpect-branch-unpredictable.ll
llvm/test/Transforms/PGOProfile/misexpect-branch.ll
llvm/test/Transforms/PGOProfile/misexpect-switch-default.ll
llvm/test/Transforms/PGOProfile/misexpect-switch.ll
llvm/test/Transforms/PGOProfile/multiple_hash_profile.ll
llvm/test/Transforms/PGOProfile/noprofile.ll
llvm/test/Transforms/PGOProfile/not_promote_ret_exit.ll
llvm/test/Transforms/PGOProfile/ppc-prevent-mma-types.ll
llvm/test/Transforms/PGOProfile/select_hash_conflict.ll
llvm/test/Transforms/PGOProfile/split-indirectbr-critical-edges.ll
llvm/test/Transforms/PGOProfile/thinlto_samplepgo_icp.ll
llvm/test/Transforms/PGOProfile/thinlto_samplepgo_icp3.ll
llvm/test/Transforms/PGOProfile/thinlto_samplepgo_icp_droppeddead.ll
Removed:
################################################################################
diff --git a/llvm/test/Instrumentation/InstrProfiling/always_inline.ll b/llvm/test/Instrumentation/InstrProfiling/always_inline.ll
index 9effb6f957962..0b21b24254141 100644
--- a/llvm/test/Instrumentation/InstrProfiling/always_inline.ll
+++ b/llvm/test/Instrumentation/InstrProfiling/always_inline.ll
@@ -20,11 +20,11 @@ entry:
ret i32 %call
}
-declare void @llvm.instrprof.increment(i8*, i64, i32, i32) #0
+declare void @llvm.instrprof.increment(ptr, i64, i32, i32) #0
define available_externally i32 @foo() #1 {
entry:
- call void @llvm.instrprof.increment(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__profn_foo, i32 0, i32 0), i64 0, i32 1, i32 0)
+ call void @llvm.instrprof.increment(ptr @__profn_foo, i64 0, i32 1, i32 0)
ret i32 0
}
diff --git a/llvm/test/Instrumentation/InstrProfiling/atomic-updates.ll b/llvm/test/Instrumentation/InstrProfiling/atomic-updates.ll
index 2faf44333e8bb..1bd3b7ea5a835 100644
--- a/llvm/test/Instrumentation/InstrProfiling/atomic-updates.ll
+++ b/llvm/test/Instrumentation/InstrProfiling/atomic-updates.ll
@@ -5,10 +5,10 @@ target triple = "x86_64-apple-macosx10.10.0"
@__profn_foo = private constant [3 x i8] c"foo"
; CHECK-LABEL: define void @foo
-; CHECK-NEXT: atomicrmw add i64* getelementptr inbounds ([1 x i64], [1 x i64]* @__profc_foo, i32 0, i32 0), i64 1 monotonic
+; CHECK-NEXT: atomicrmw add ptr @__profc_foo, i64 1 monotonic
define void @foo() {
- call void @llvm.instrprof.increment(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__profn_foo, i32 0, i32 0), i64 0, i32 1, i32 0)
+ call void @llvm.instrprof.increment(ptr @__profn_foo, i64 0, i32 1, i32 0)
ret void
}
-declare void @llvm.instrprof.increment(i8*, i64, i32, i32)
+declare void @llvm.instrprof.increment(ptr, i64, i32, i32)
diff --git a/llvm/test/Instrumentation/InstrProfiling/comdat.ll b/llvm/test/Instrumentation/InstrProfiling/comdat.ll
index fb2e947466bf3..9655a0a0fada4 100644
--- a/llvm/test/Instrumentation/InstrProfiling/comdat.ll
+++ b/llvm/test/Instrumentation/InstrProfiling/comdat.ll
@@ -8,13 +8,13 @@
; RUN: split-file %s %t
; RUN: cat %t/main.ll %t/disable.ll > %t0.ll
; RUN: cat %t/main.ll %t/enable.ll > %t1.ll
-; RUN: opt < %t0.ll -mtriple=x86_64-linux -passes=instrprof -S | FileCheck %s --check-prefixes=ELF
-; RUN: opt < %t1.ll -mtriple=x86_64-linux -passes=instrprof -S | FileCheck %s --check-prefixes=ELF
-; RUN: opt < %t0.ll -mtriple=x86_64-windows -passes=instrprof -S | FileCheck %s --check-prefixes=COFF
-; RUN: opt < %t1.ll -mtriple=x86_64-windows -passes=instrprof -S | FileCheck %s --check-prefixes=COFF
+; RUN: opt < %t0.ll -mtriple=x86_64-linux -passes=instrprof -S | FileCheck %s --check-prefixes=ELF,ELF0
+; RUN: opt < %t1.ll -mtriple=x86_64-linux -passes=instrprof -S | FileCheck %s --check-prefixes=ELF,ELF1
+; RUN: opt < %t0.ll -mtriple=x86_64-windows -passes=instrprof -S | FileCheck %s --check-prefixes=COFF,COFF0
+; RUN: opt < %t1.ll -mtriple=x86_64-windows -passes=instrprof -S | FileCheck %s --check-prefixes=COFF,COFF1
;--- main.ll
-declare void @llvm.instrprof.increment(i8*, i64, i32, i32)
+declare void @llvm.instrprof.increment(ptr, i64, i32, i32)
$foo_inline = comdat any
$foo_extern = comdat any
@@ -34,7 +34,7 @@ $foo_extern = comdat any
; COFF1: @__profc_foo_inline = linkonce_odr hidden global {{.*}}, section ".lprfc$M", comdat, align 8
; COFF1: @__profd_foo_inline = linkonce_odr hidden global {{.*}}, section ".lprfd$M", comdat, align 8
define weak_odr void @foo_inline() comdat {
- call void @llvm.instrprof.increment(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__profn_foo_inline, i32 0, i32 0), i64 0, i32 1, i32 0)
+ call void @llvm.instrprof.increment(ptr @__profn_foo_inline, i64 0, i32 1, i32 0)
ret void
}
@@ -45,13 +45,13 @@ define weak_odr void @foo_inline() comdat {
; COFF0: @__profd_foo_extern = private global{{.*}}, section ".lprfd$M", comdat($__profc_foo_extern), align 8
; COFF1: @__profd_foo_extern = linkonce_odr hidden global{{.*}}, section ".lprfd$M", comdat, align 8
define available_externally void @foo_extern() {
- call void @llvm.instrprof.increment(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__profn_foo_extern, i32 0, i32 0), i64 0, i32 1, i32 0)
+ call void @llvm.instrprof.increment(ptr @__profn_foo_extern, i64 0, i32 1, i32 0)
ret void
}
-; ELF: @llvm.compiler.used = appending global {{.*}} @__profd_foo_inline {{.*}} @__profd_foo_extern
-; COFF0: @llvm.compiler.used = appending global {{.*}} @__llvm_profile_runtime_user {{.*}} @__profd_foo_inline {{.*}} @__profd_foo_extern
-; COFF1: @llvm.used = appending global {{.*}} @__llvm_profile_runtime_user {{.*}} @__profd_foo_inline {{.*}} @__profd_foo_extern
+; ELF: @llvm.compiler.used = appending global [2 x ptr] [ptr @__profd_foo_inline, ptr @__profd_foo_extern]
+; COFF0: @llvm.compiler.used = appending global [3 x ptr] [ptr @__llvm_profile_runtime_user, ptr @__profd_foo_inline, ptr @__profd_foo_extern]
+; COFF1: @llvm.used = appending global [4 x ptr] [ptr @__llvm_profile_runtime_user, ptr @__profd_foo_inline, ptr @__profd_foo_extern, ptr @__llvm_prf_nm]
;--- disable.ll
!llvm.module.flags = !{!0}
diff --git a/llvm/test/Instrumentation/InstrProfiling/coverage.ll b/llvm/test/Instrumentation/InstrProfiling/coverage.ll
index 1ab1098434320..1401d8f620b3f 100644
--- a/llvm/test/Instrumentation/InstrProfiling/coverage.ll
+++ b/llvm/test/Instrumentation/InstrProfiling/coverage.ll
@@ -8,16 +8,16 @@ target triple = "aarch64-unknown-linux-gnu"
; CHECK: @__profc_bar = private global [1 x i8] c"\FF", section "__llvm_prf_cnts", comdat, align 1
define void @_Z3foov() {
- call void @llvm.instrprof.cover(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__profn_foo, i32 0, i32 0), i64 12345678, i32 1, i32 0)
- ; CHECK: store i8 0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @__profc_foo, i32 0, i32 0), align 1
+ call void @llvm.instrprof.cover(ptr @__profn_foo, i64 12345678, i32 1, i32 0)
+ ; CHECK: store i8 0, ptr @__profc_foo, align 1
ret void
}
-%class.A = type { i32 (...)** }
-define dso_local void @_Z3barv(%class.A* nocapture nonnull align 8 %0) unnamed_addr #0 align 2 {
- call void @llvm.instrprof.cover(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__profn_bar, i32 0, i32 0), i64 87654321, i32 1, i32 0)
- ; CHECK: store i8 0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @__profc_bar, i32 0, i32 0), align 1
+%class.A = type { ptr }
+define dso_local void @_Z3barv(ptr nocapture nonnull align 8 %0) unnamed_addr #0 align 2 {
+ call void @llvm.instrprof.cover(ptr @__profn_bar, i64 87654321, i32 1, i32 0)
+ ; CHECK: store i8 0, ptr @__profc_bar, align 1
ret void
}
-declare void @llvm.instrprof.cover(i8*, i64, i32, i32)
+declare void @llvm.instrprof.cover(ptr, i64, i32, i32)
diff --git a/llvm/test/Instrumentation/InstrProfiling/debug-info-correlate-coverage.ll b/llvm/test/Instrumentation/InstrProfiling/debug-info-correlate-coverage.ll
index c3f137bc48e36..192bac6e503a0 100644
--- a/llvm/test/Instrumentation/InstrProfiling/debug-info-correlate-coverage.ll
+++ b/llvm/test/Instrumentation/InstrProfiling/debug-info-correlate-coverage.ll
@@ -4,12 +4,12 @@
; CHECK: @__profc_foo
define void @_Z3foov() !dbg !12 {
- call void @llvm.instrprof.cover(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__profn_foo, i32 0, i32 0), i64 12345678, i32 1, i32 0)
- ; CHECK: store i8 0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @__profc_foo
+ call void @llvm.instrprof.cover(ptr @__profn_foo, i64 12345678, i32 1, i32 0)
+ ; CHECK: store i8 0, ptr @__profc_foo, align 1
ret void
}
-declare void @llvm.instrprof.cover(i8*, i64, i32, i32)
+declare void @llvm.instrprof.cover(ptr, i64, i32, i32)
!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!2, !3, !4, !5, !6, !7, !8, !9, !10}
diff --git a/llvm/test/Instrumentation/InstrProfiling/debug-info-correlate.ll b/llvm/test/Instrumentation/InstrProfiling/debug-info-correlate.ll
index 8f389226222db..6ab7f055602cb 100644
--- a/llvm/test/Instrumentation/InstrProfiling/debug-info-correlate.ll
+++ b/llvm/test/Instrumentation/InstrProfiling/debug-info-correlate.ll
@@ -19,11 +19,11 @@
; CHECK: ![[COUNTERS]] = !{!"Num Counters", i32 2}
define void @_Z3foov() !dbg !12 {
- call void @llvm.instrprof.increment(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__profn_foo, i32 0, i32 0), i64 12345678, i32 2, i32 0)
+ call void @llvm.instrprof.increment(ptr @__profn_foo, i64 12345678, i32 2, i32 0)
ret void
}
-declare void @llvm.instrprof.increment(i8*, i64, i32, i32)
+declare void @llvm.instrprof.increment(ptr, i64, i32, i32)
!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!2, !3, !4, !5, !6, !7, !8, !9, !10}
diff --git a/llvm/test/Instrumentation/InstrProfiling/early-exit.ll b/llvm/test/Instrumentation/InstrProfiling/early-exit.ll
index b781fbc942a87..6f5b5eabb9db9 100644
--- a/llvm/test/Instrumentation/InstrProfiling/early-exit.ll
+++ b/llvm/test/Instrumentation/InstrProfiling/early-exit.ll
@@ -2,14 +2,14 @@
target triple = "x86_64-apple-macosx10.10.0"
-declare void @llvm.instrprof.increment(i8*, i64, i32, i32)
+declare void @llvm.instrprof.increment(ptr, i64, i32, i32)
-declare void @llvm.instrprof.increment.step(i8*, i64, i32, i32, i64)
+declare void @llvm.instrprof.increment.step(ptr, i64, i32, i32, i64)
; CHECK: @__profc_foo = private global [1 x i64] zeroinitializer, section "__DATA,__llvm_prf_cnts", align 8
@__profn_foo = private constant [3 x i8] c"foo"
define void @foo() {
- call void @llvm.instrprof.increment.step(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__profn_foo, i32 0, i32 0), i64 0, i32 1, i32 0, i64 0)
+ call void @llvm.instrprof.increment.step(ptr @__profn_foo, i64 0, i32 1, i32 0, i64 0)
ret void
}
diff --git a/llvm/test/Instrumentation/InstrProfiling/icall-comdat.ll b/llvm/test/Instrumentation/InstrProfiling/icall-comdat.ll
index 03e5b42bd3f5b..124eaca56e42b 100644
--- a/llvm/test/Instrumentation/InstrProfiling/icall-comdat.ll
+++ b/llvm/test/Instrumentation/InstrProfiling/icall-comdat.ll
@@ -15,30 +15,30 @@
@__profn_foo = private constant [3 x i8] c"foo"
@__profn_bar = private constant [3 x i8] c"bar"
-define i32 @foo(i32 ()* ) {
- call void @llvm.instrprof.increment(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__profn_foo, i32 0, i32 0), i64 12884901887, i32 1, i32 0)
- %2 = ptrtoint i32 ()* %0 to i64
- call void @llvm.instrprof.value.profile(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__profn_foo, i32 0, i32 0), i64 12884901887, i64 %2, i32 0, i32 0)
+define i32 @foo(ptr ) {
+ call void @llvm.instrprof.increment(ptr @__profn_foo, i64 12884901887, i32 1, i32 0)
+ %2 = ptrtoint ptr %0 to i64
+ call void @llvm.instrprof.value.profile(ptr @__profn_foo, i64 12884901887, i64 %2, i32 0, i32 0)
%3 = tail call i32 %0()
ret i32 %3
}
$bar = comdat any
-define i32 @bar(i32 ()* ) comdat {
+define i32 @bar(ptr ) comdat {
entry:
- call void @llvm.instrprof.increment(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__profn_bar, i32 0, i32 0), i64 12884901887, i32 1, i32 0)
- %1 = ptrtoint i32 ()* %0 to i64
- call void @llvm.instrprof.value.profile(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__profn_bar, i32 0, i32 0), i64 12884901887, i64 %1, i32 0, i32 0)
+ call void @llvm.instrprof.increment(ptr @__profn_bar, i64 12884901887, i32 1, i32 0)
+ %1 = ptrtoint ptr %0 to i64
+ call void @llvm.instrprof.value.profile(ptr @__profn_bar, i64 12884901887, i64 %1, i32 0, i32 0)
%2 = tail call i32 %0()
ret i32 %2
}
; Function Attrs: nounwind
-declare void @llvm.instrprof.increment(i8*, i64, i32, i32) #0
+declare void @llvm.instrprof.increment(ptr, i64, i32, i32) #0
; Function Attrs: nounwind
-declare void @llvm.instrprof.value.profile(i8*, i64, i64, i32, i32) #0
+declare void @llvm.instrprof.value.profile(ptr, i64, i64, i32, i32) #0
attributes #0 = { nounwind }
@@ -55,10 +55,10 @@ attributes #0 = { nounwind }
; STATIC-SAME: @__llvm_prf_vnodes
; STATIC-SAME: @__llvm_prf_nm
-; STATIC: call void @__llvm_profile_instrument_target(i64 %3, i8* bitcast ({ i64, i64, i64, i8*, i8*, i32, [2 x i16] }* @__profd_foo to i8*), i32 0)
-; STATIC-EXT: call void @__llvm_profile_instrument_target(i64 %3, i8* bitcast ({ i64, i64, i64, i8*, i8*, i32, [2 x i16] }* @__profd_foo to i8*), i32 zeroext 0)
-; STATIC-SEXT: call void @__llvm_profile_instrument_target(i64 %3, i8* bitcast ({ i64, i64, i64, i8*, i8*, i32, [2 x i16] }* @__profd_foo to i8*), i32 signext 0)
+; STATIC: call void @__llvm_profile_instrument_target(i64 %3, ptr @__profd_foo, i32 0)
+; STATIC-EXT: call void @__llvm_profile_instrument_target(i64 %3, ptr @__profd_foo, i32 zeroext 0)
+; STATIC-SEXT: call void @__llvm_profile_instrument_target(i64 %3, ptr @__profd_foo, i32 signext 0)
-; STATIC: declare void @__llvm_profile_instrument_target(i64, i8*, i32)
-; STATIC-EXT: declare void @__llvm_profile_instrument_target(i64, i8*, i32 zeroext)
-; STATIC-SEXT: declare void @__llvm_profile_instrument_target(i64, i8*, i32 signext)
+; STATIC: declare void @__llvm_profile_instrument_target(i64, ptr, i32)
+; STATIC-EXT: declare void @__llvm_profile_instrument_target(i64, ptr, i32 zeroext)
+; STATIC-SEXT: declare void @__llvm_profile_instrument_target(i64, ptr, i32 signext)
diff --git a/llvm/test/Instrumentation/InstrProfiling/icall-nocomdat.ll b/llvm/test/Instrumentation/InstrProfiling/icall-nocomdat.ll
index cb381254314da..2369630b6ddbf 100644
--- a/llvm/test/Instrumentation/InstrProfiling/icall-nocomdat.ll
+++ b/llvm/test/Instrumentation/InstrProfiling/icall-nocomdat.ll
@@ -7,19 +7,19 @@
@__profn_foo = private constant [3 x i8] c"foo"
@__profn_bar = private constant [3 x i8] c"bar"
-define i32 @foo(i32 ()* ) {
- call void @llvm.instrprof.increment(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__profn_foo, i32 0, i32 0), i64 12884901887, i32 1, i32 0)
- %2 = ptrtoint i32 ()* %0 to i64
- call void @llvm.instrprof.value.profile(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__profn_foo, i32 0, i32 0), i64 12884901887, i64 %2, i32 0, i32 0)
+define i32 @foo(ptr ) {
+ call void @llvm.instrprof.increment(ptr @__profn_foo, i64 12884901887, i32 1, i32 0)
+ %2 = ptrtoint ptr %0 to i64
+ call void @llvm.instrprof.value.profile(ptr @__profn_foo, i64 12884901887, i64 %2, i32 0, i32 0)
%3 = tail call i32 %0()
ret i32 %3
}
; Function Attrs: nounwind
-declare void @llvm.instrprof.increment(i8*, i64, i32, i32) #0
+declare void @llvm.instrprof.increment(ptr, i64, i32, i32) #0
; Function Attrs: nounwind
-declare void @llvm.instrprof.value.profile(i8*, i64, i64, i32, i32) #0
+declare void @llvm.instrprof.value.profile(ptr, i64, i64, i32, i32) #0
attributes #0 = { nounwind }
@@ -35,10 +35,10 @@ attributes #0 = { nounwind }
; STATIC-SAME: @__llvm_prf_vnodes
; STATIC-SAME: @__llvm_prf_nm
-; STATIC: call void @__llvm_profile_instrument_target(i64 %3, i8* bitcast ({ i64, i64, i64, i8*, i8*, i32, [2 x i16] }* @__profd_foo to i8*), i32 0)
-; STATIC-EXT: call void @__llvm_profile_instrument_target(i64 %3, i8* bitcast ({ i64, i64, i64, i8*, i8*, i32, [2 x i16] }* @__profd_foo to i8*), i32 zeroext 0)
-; STATIC-SEXT: call void @__llvm_profile_instrument_target(i64 %3, i8* bitcast ({ i64, i64, i64, i8*, i8*, i32, [2 x i16] }* @__profd_foo to i8*), i32 signext 0)
+; STATIC: call void @__llvm_profile_instrument_target(i64 %3, ptr @__profd_foo, i32 0)
+; STATIC-EXT: call void @__llvm_profile_instrument_target(i64 %3, ptr @__profd_foo, i32 zeroext 0)
+; STATIC-SEXT: call void @__llvm_profile_instrument_target(i64 %3, ptr @__profd_foo, i32 signext 0)
-; STATIC: declare void @__llvm_profile_instrument_target(i64, i8*, i32)
-; STATIC-EXT: declare void @__llvm_profile_instrument_target(i64, i8*, i32 zeroext)
-; STATIC-SEXT: declare void @__llvm_profile_instrument_target(i64, i8*, i32 signext)
+; STATIC: declare void @__llvm_profile_instrument_target(i64, ptr, i32)
+; STATIC-EXT: declare void @__llvm_profile_instrument_target(i64, ptr, i32 zeroext)
+; STATIC-SEXT: declare void @__llvm_profile_instrument_target(i64, ptr, i32 signext)
diff --git a/llvm/test/Instrumentation/InstrProfiling/noruntime.ll b/llvm/test/Instrumentation/InstrProfiling/noruntime.ll
index f27ecf7b35f5d..e5227e4fd78d7 100644
--- a/llvm/test/Instrumentation/InstrProfiling/noruntime.ll
+++ b/llvm/test/Instrumentation/InstrProfiling/noruntime.ll
@@ -2,15 +2,15 @@
; RUN: opt < %s -passes=instrprof -S | FileCheck %s
; CHECK-NOT: define {{.*}} @__llvm_profile_runtime_user()
-; CHECK-NOT: load i32, i32* @__llvm_profile_runtime
+; CHECK-NOT: load i32, ptr @__llvm_profile_runtime
@__llvm_profile_runtime = global i32 0, align 4
@__profn_foo = private constant [3 x i8] c"foo"
define void @foo() {
- call void @llvm.instrprof.increment(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__profn_foo, i32 0, i32 0), i64 0, i32 1, i32 0)
+ call void @llvm.instrprof.increment(ptr @__profn_foo, i64 0, i32 1, i32 0)
ret void
}
-declare void @llvm.instrprof.increment(i8*, i64, i32, i32)
+declare void @llvm.instrprof.increment(ptr, i64, i32, i32)
diff --git a/llvm/test/Instrumentation/InstrProfiling/platform.ll b/llvm/test/Instrumentation/InstrProfiling/platform.ll
index 0bd35dc5ef345..3c3712240d1e8 100644
--- a/llvm/test/Instrumentation/InstrProfiling/platform.ll
+++ b/llvm/test/Instrumentation/InstrProfiling/platform.ll
@@ -30,11 +30,11 @@
; AIX: @__llvm_prf_nm = private constant [{{.*}} x i8] c"{{.*}}", section "{{.*}}__llvm_prf_names", align 1
define void @foo() {
- call void @llvm.instrprof.increment(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__profn_foo, i32 0, i32 0), i64 0, i32 1, i32 0)
+ call void @llvm.instrprof.increment(ptr @__profn_foo, i64 0, i32 1, i32 0)
ret void
}
-declare void @llvm.instrprof.increment(i8*, i64, i32, i32)
+declare void @llvm.instrprof.increment(ptr, i64, i32, i32)
;; Emit registration functions for platforms that don't find the
;; symbols by their sections.
diff --git a/llvm/test/Instrumentation/InstrProfiling/profiling.ll b/llvm/test/Instrumentation/InstrProfiling/profiling.ll
index 15cc53caf91e8..948576abf1e87 100644
--- a/llvm/test/Instrumentation/InstrProfiling/profiling.ll
+++ b/llvm/test/Instrumentation/InstrProfiling/profiling.ll
@@ -39,7 +39,7 @@
; XCOFF-NOT: comdat
; XCOFF: @__profd_foo = private global
define void @foo() {
- call void @llvm.instrprof.increment(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__profn_foo, i32 0, i32 0), i64 0, i32 1, i32 0)
+ call void @llvm.instrprof.increment(ptr @__profn_foo, i64 0, i32 1, i32 0)
ret void
}
@@ -52,7 +52,7 @@ define void @foo() {
; XCOFF: @__profc_foo_weak = private global
; XCOFF: @__profd_foo_weak = private global
define weak void @foo_weak() {
- call void @llvm.instrprof.increment(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @__profn_foo_weak, i32 0, i32 0), i64 0, i32 1, i32 0)
+ call void @llvm.instrprof.increment(ptr @__profn_foo_weak, i64 0, i32 1, i32 0)
ret void
}
@@ -65,7 +65,7 @@ define weak void @foo_weak() {
; XCOFF: @"__profc_linkage.ll:foo_internal" = private global
; XCOFF: @"__profd_linkage.ll:foo_internal" = private global
define internal void @foo_internal() {
- call void @llvm.instrprof.increment(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @"__profn_linkage.ll:foo_internal", i32 0, i32 0), i64 0, i32 1, i32 0)
+ call void @llvm.instrprof.increment(ptr @"__profn_linkage.ll:foo_internal", i64 0, i32 1, i32 0)
ret void
}
@@ -78,7 +78,7 @@ define internal void @foo_internal() {
; XCOFF: @__profc_foo_inline = private global
; XCOFF: @__profd_foo_inline = private global
define linkonce_odr void @foo_inline() {
- call void @llvm.instrprof.increment(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__profn_foo_inline, i32 0, i32 0), i64 0, i32 1, i32 0)
+ call void @llvm.instrprof.increment(ptr @__profn_foo_inline, i64 0, i32 1, i32 0)
ret void
}
@@ -91,37 +91,37 @@ define linkonce_odr void @foo_inline() {
; XCOFF: @__profc_foo_extern = private global
; XCOFF: @__profd_foo_extern = private global
define available_externally void @foo_extern() {
- call void @llvm.instrprof.increment(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__profn_foo_extern, i32 0, i32 0), i64 0, i32 1, i32 0)
+ call void @llvm.instrprof.increment(ptr @__profn_foo_extern, i64 0, i32 1, i32 0)
ret void
}
-declare void @llvm.instrprof.increment(i8*, i64, i32, i32)
+declare void @llvm.instrprof.increment(ptr, i64, i32, i32)
-; ELF: @llvm.compiler.used = appending global {{.*}} @__profd_foo {{.*}}
-; ELF_GENERIC: @llvm.compiler.used = appending global {{.*}} @__llvm_profile_runtime {{.*}} @__profd_foo {{.*}}
-; MACHO: @llvm.compiler.used = appending global {{.*}} @__llvm_profile_runtime_user {{.*}} @__profd_foo {{.*}}
-; COFF: @llvm.compiler.used = appending global {{.*}} @__llvm_profile_runtime_user {{.*}} @__profd_foo {{.*}}
-; XCOFF: @llvm.used = appending global {{.*}} @__llvm_profile_runtime_user {{.*}} @__profd_foo {{.*}}
+; ELF: @llvm.compiler.used = appending global {{.*}} [{{.*}}ptr @__profd_foo, ptr @__profd_foo_weak, ptr @"__profd_linkage.ll:foo_internal", ptr @__profd_foo_inline, ptr @__profd_foo_extern{{.*}}]
+; ELF_GENERIC: @llvm.compiler.used = appending global [6 x ptr] [ptr @__llvm_profile_runtime, ptr @__profd_foo, ptr @__profd_foo_weak, ptr @"__profd_linkage.ll:foo_internal", ptr @__profd_foo_inline, ptr @__profd_foo_extern]
+; MACHO: @llvm.compiler.used = appending global [6 x ptr] [ptr @__llvm_profile_runtime_user, ptr @__profd_foo, {{.*}}
+; COFF: @llvm.compiler.used = appending global [6 x ptr] [ptr @__llvm_profile_runtime_user, ptr @__profd_foo, ptr @__profd_foo_weak, ptr @"__profd_linkage.ll:foo_internal", ptr @__profd_foo_inline, ptr @__profd_foo_extern]
+; XCOFF: @llvm.used = appending global [7 x ptr] [ptr @__llvm_profile_runtime_user, ptr @__profd_foo, ptr @__profd_foo_weak, ptr @"__profd_linkage.ll:foo_internal", ptr @__profd_foo_inline, ptr @__profd_foo_extern, ptr @__llvm_prf_nm]
; MACHO: define linkonce_odr hidden i32 @__llvm_profile_runtime_user() {{.*}} {
-; MACHO: %[[REG:.*]] = load i32, i32* @__llvm_profile_runtime
+; MACHO: %[[REG:.*]] = load i32, ptr @__llvm_profile_runtime
; MACHO: ret i32 %[[REG]]
; MACHO: }
; COFF: define linkonce_odr hidden i32 @__llvm_profile_runtime_user() {{.*}} comdat {
; ELFRT-NOT: define linkonce_odr hidden i32 @__llvm_profile_runtime_user() {{.*}} {
-; ELFRT-NOT: %[[REG:.*]] = load i32, i32* @__llvm_profile_runtime
+; ELFRT-NOT: %[[REG:.*]] = load i32, ptr @__llvm_profile_runtime
; PS: define linkonce_odr hidden i32 @__llvm_profile_runtime_user() {{.*}} {
-; PS: %[[REG:.*]] = load i32, i32* @__llvm_profile_runtime
+; PS: %[[REG:.*]] = load i32, ptr @__llvm_profile_runtime
; XCOFF: define linkonce_odr hidden i32 @__llvm_profile_runtime_user() {{.*}} {
-; XCOFF: %[[REG:.*]] = load i32, i32* @__llvm_profile_runtime
+; XCOFF: %[[REG:.*]] = load i32, ptr @__llvm_profile_runtime
; XCOFF: ret i32 %[[REG]]
; XCOFF: }
; ELF_GENERIC: define internal void @__llvm_profile_register_functions() unnamed_addr {
-; ELF_GENERIC-NEXT: call void @__llvm_profile_register_function(i8* bitcast (i32* @__llvm_profile_runtime to i8*))
-; ELF_GENERIC-NEXT: call void @__llvm_profile_register_function(i8* bitcast ({ i64, i64, i64, i8*, i8*, i32, [{{.*}} x i16] }* @__profd_foo to i8*))
-; ELF_GENERIC-NEXT: call void @__llvm_profile_register_function(i8* bitcast ({ i64, i64, i64, i8*, i8*, i32, [{{.*}} x i16] }* @__profd_foo_weak to i8*))
-; ELF_GENERIC: call void @__llvm_profile_register_names_function(i8* getelementptr inbounds {{.*}} @__llvm_prf_nm
+; ELF_GENERIC-NEXT: call void @__llvm_profile_register_function(ptr @__llvm_profile_runtime)
+; ELF_GENERIC-NEXT: call void @__llvm_profile_register_function(ptr @__profd_foo)
+; ELF_GENERIC-NEXT: call void @__llvm_profile_register_function(ptr @__profd_foo_weak)
+; ELF_GENERIC: call void @__llvm_profile_register_names_function(ptr @__llvm_prf_nm
; ELF_GENERIC-NEXT: ret void
; ELF_GENERIC-NEXT: }
diff --git a/llvm/test/Instrumentation/InstrProfiling/runtime-counter-relocation.ll b/llvm/test/Instrumentation/InstrProfiling/runtime-counter-relocation.ll
index bda89a311dad8..44a2efd4a959a 100644
--- a/llvm/test/Instrumentation/InstrProfiling/runtime-counter-relocation.ll
+++ b/llvm/test/Instrumentation/InstrProfiling/runtime-counter-relocation.ll
@@ -8,19 +8,19 @@ target triple = "x86_64-unknown-linux-gnu"
; RELOC: @__llvm_profile_counter_bias = linkonce_odr hidden global i64 0, comdat
; CHECK-LABEL: define void @foo
-; CHECK-NEXT: %pgocount = load i64, i64* getelementptr inbounds ([1 x i64], [1 x i64]* @__profc_foo, i32 0, i32 0)
+; CHECK-NEXT: %pgocount = load i64, ptr @__profc_foo
; CHECK-NEXT: %1 = add i64 %pgocount, 1
-; CHECK-NEXT: store i64 %1, i64* getelementptr inbounds ([1 x i64], [1 x i64]* @__profc_foo, i32 0, i32 0)
+; CHECK-NEXT: store i64 %1, ptr @__profc_foo
; RELOC-LABEL: define void @foo
-; RELOC-NEXT: %1 = load i64, i64* @__llvm_profile_counter_bias
-; RELOC-NEXT: %2 = add i64 ptrtoint ([1 x i64]* @__profc_foo to i64), %1
-; RELOC-NEXT: %3 = inttoptr i64 %2 to i64*
-; RELOC-NEXT: %pgocount = load i64, i64* %3
+; RELOC-NEXT: %1 = load i64, ptr @__llvm_profile_counter_bias
+; RELOC-NEXT: %2 = add i64 ptrtoint (ptr @__profc_foo to i64), %1
+; RELOC-NEXT: %3 = inttoptr i64 %2 to ptr
+; RELOC-NEXT: %pgocount = load i64, ptr %3
; RELOC-NEXT: %4 = add i64 %pgocount, 1
-; RELOC-NEXT: store i64 %4, i64* %3
+; RELOC-NEXT: store i64 %4, ptr %3
define void @foo() {
- call void @llvm.instrprof.increment(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__profn_foo, i32 0, i32 0), i64 0, i32 1, i32 0)
+ call void @llvm.instrprof.increment(ptr @__profn_foo, i64 0, i32 1, i32 0)
ret void
}
-declare void @llvm.instrprof.increment(i8*, i64, i32, i32)
+declare void @llvm.instrprof.increment(ptr, i64, i32, i32)
diff --git a/llvm/test/Transforms/PGOProfile/Inputs/thinlto_cspgo_bar_gen.ll b/llvm/test/Transforms/PGOProfile/Inputs/thinlto_cspgo_bar_gen.ll
index d75bfbc56b735..8ba468554d439 100644
--- a/llvm/test/Transforms/PGOProfile/Inputs/thinlto_cspgo_bar_gen.ll
+++ b/llvm/test/Transforms/PGOProfile/Inputs/thinlto_cspgo_bar_gen.ll
@@ -11,15 +11,15 @@ entry:
br i1 %tobool, label %if.else, label %if.then, !prof !30
if.then:
- %0 = load i32, i32* @odd, align 4
+ %0 = load i32, ptr @odd, align 4
%inc = add i32 %0, 1
- store i32 %inc, i32* @odd, align 4
+ store i32 %inc, ptr @odd, align 4
br label %if.end
if.else:
- %1 = load i32, i32* @even, align 4
+ %1 = load i32, ptr @even, align 4
%inc1 = add i32 %1, 1
- store i32 %inc1, i32* @even, align 4
+ store i32 %inc1, ptr @even, align 4
br label %if.end
if.end:
diff --git a/llvm/test/Transforms/PGOProfile/Inputs/thinlto_cspgo_bar_use.ll b/llvm/test/Transforms/PGOProfile/Inputs/thinlto_cspgo_bar_use.ll
index 80edc4ee954e7..0412deb8aee21 100644
--- a/llvm/test/Transforms/PGOProfile/Inputs/thinlto_cspgo_bar_use.ll
+++ b/llvm/test/Transforms/PGOProfile/Inputs/thinlto_cspgo_bar_use.ll
@@ -13,16 +13,16 @@ entry:
if.then:
; The calls here ensure that the instructions are not hoisted by SimplifyCFG.
call void @clobber()
- %0 = load i32, i32* @odd, align 4
+ %0 = load i32, ptr @odd, align 4
%inc = add i32 %0, 1
- store i32 %inc, i32* @odd, align 4
+ store i32 %inc, ptr @odd, align 4
call void @clobber()
br label %if.end
if.else:
- %1 = load i32, i32* @even, align 4
+ %1 = load i32, ptr @even, align 4
%inc1 = add i32 %1, 1
- store i32 %inc1, i32* @even, align 4
+ store i32 %inc1, ptr @even, align 4
br label %if.end
if.end:
diff --git a/llvm/test/Transforms/PGOProfile/Inputs/thinlto_samplepgo_icp.ll b/llvm/test/Transforms/PGOProfile/Inputs/thinlto_samplepgo_icp.ll
index 709c950ce176c..d44f1251014fe 100644
--- a/llvm/test/Transforms/PGOProfile/Inputs/thinlto_samplepgo_icp.ll
+++ b/llvm/test/Transforms/PGOProfile/Inputs/thinlto_samplepgo_icp.ll
@@ -1,12 +1,12 @@
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 fptr = external local_unnamed_addr global void ()*, align 8
+ at fptr = external local_unnamed_addr global ptr, align 8
; Function Attrs: norecurse nounwind uwtable
define void @_Z6updatei(i32 %i) local_unnamed_addr #0 {
entry:
- store void ()* @_ZL3foov, void ()** @fptr, align 8
+ store ptr @_ZL3foov, ptr @fptr, align 8
ret void
}
diff --git a/llvm/test/Transforms/PGOProfile/Inputs/thinlto_samplepgo_icp3.ll b/llvm/test/Transforms/PGOProfile/Inputs/thinlto_samplepgo_icp3.ll
index d040f1fcee9e8..f0270cdf80058 100644
--- a/llvm/test/Transforms/PGOProfile/Inputs/thinlto_samplepgo_icp3.ll
+++ b/llvm/test/Transforms/PGOProfile/Inputs/thinlto_samplepgo_icp3.ll
@@ -1,19 +1,19 @@
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 fptr = external local_unnamed_addr global void ()*, align 8
+ at fptr = external local_unnamed_addr global ptr, align 8
; Function Attrs: norecurse nounwind uwtable
define void @_Z6updatei(i32 %i) local_unnamed_addr #0 {
entry:
- store void ()* @_ZL3foov, void ()** @fptr, align 8
+ store ptr @_ZL3foov, ptr @fptr, align 8
ret void
}
; Function Attrs: nounwind readnone uwtable
define internal void @_ZL3foov() !prof !34 {
entry:
- %0 = load void ()*, void ()** @fptr, align 8
+ %0 = load ptr, ptr @fptr, align 8
tail call void %0(), !prof !40
ret void
}
diff --git a/llvm/test/Transforms/PGOProfile/PR41279.ll b/llvm/test/Transforms/PGOProfile/PR41279.ll
index ff762d26e1289..5f7a3f076f3a1 100644
--- a/llvm/test/Transforms/PGOProfile/PR41279.ll
+++ b/llvm/test/Transforms/PGOProfile/PR41279.ll
@@ -3,19 +3,19 @@
; RUN: llvm-profdata merge %S/Inputs/PR41279.proftext -o %t.profdata
; RUN: opt < %s -passes=pgo-instr-use -pgo-test-profile-file=%t.profdata -S | FileCheck %s --check-prefix=USE
-declare void @f3({ i8*, i64 }*, { i8*, i64 }*, i64)
-declare { i8*, i64 } @f0({ i8*, i64 }*)
+declare void @f3(ptr, ptr, i64)
+declare { ptr, i64 } @f0(ptr)
declare i64 @f1()
-declare void @invok2({ i8*, i64 }*, i8* noalias readonly align 1, i64)
-declare void @invok1({ i8*, i64 }*, { i8*, i64 }*, i64)
+declare void @invok2(ptr, ptr noalias readonly align 1, i64)
+declare void @invok1(ptr, ptr, i64)
declare i32 @__CxxFrameHandler3(...)
-define void @foo({ i8*, i64 }*, { i8*, i64 }*) personality i32 (...)* @__CxxFrameHandler3 {
+define void @foo(ptr, ptr) personality ptr @__CxxFrameHandler3 {
; USE-LABEL: @foo
; USE-SAME: !prof ![[FUNC_ENTRY_COUNT:[0-9]+]]
%3 = alloca i8, align 1
- store i8 0, i8* %3, align 1
+ store i8 0, ptr %3, align 1
%4 = call i64 @f1()
%5 = icmp ult i64 %4, 32
br i1 %5, label %7, label %13
@@ -25,49 +25,49 @@ define void @foo({ i8*, i64 }*, { i8*, i64 }*) personality i32 (...)* @__CxxFram
6:
cleanupret from %17 unwind to caller
; GEN: 6:
-; GEN: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__profn_foo, i32 0, i32 0), i64 {{[0-9]+}}, i32 4, i32 2)
+; GEN: call void @llvm.instrprof.increment(ptr @__profn_foo, i64 {{[0-9]+}}, i32 4, i32 2)
7:
- store i8 1, i8* %3, align 1
- %8 = call { i8*, i64 } @f0({ i8*, i64 }* %0)
- %9 = extractvalue { i8*, i64 } %8, 0
- %10 = extractvalue { i8*, i64 } %8, 1
- invoke void @invok1({ i8*, i64 }* %1, { i8*, i64 }* %0, i64 1)
+ store i8 1, ptr %3, align 1
+ %8 = call { ptr, i64 } @f0(ptr %0)
+ %9 = extractvalue { ptr, i64 } %8, 0
+ %10 = extractvalue { ptr, i64 } %8, 1
+ invoke void @invok1(ptr %1, ptr %0, i64 1)
to label %11 unwind label %16
; GEN: 7:
; GEN-NOT: call void @llvm.instrprof.increment
11:
- store i8 0, i8* %3, align 1
- invoke void @invok2({ i8*, i64 }* %1, i8* noalias readonly align 1 %9, i64 %10)
+ store i8 0, ptr %3, align 1
+ invoke void @invok2(ptr %1, ptr noalias readonly align 1 %9, i64 %10)
to label %12 unwind label %16
; GEN: 11:
; GEN-NOT: call void @llvm.instrprof.increment
12:
- store i8 0, i8* %3, align 1
+ store i8 0, ptr %3, align 1
br label %14
; GEN: 12:
-; GEN: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__profn_foo, i32 0, i32 0), i64 {{[0-9]+}}, i32 4, i32 1)
+; GEN: call void @llvm.instrprof.increment(ptr @__profn_foo, i64 {{[0-9]+}}, i32 4, i32 1)
13:
- call void @f3({ i8*, i64 }* %0, { i8*, i64 }* %1, i64 1)
+ call void @f3(ptr %0, ptr %1, i64 1)
br label %14
; GEN: 13:
-; GEN: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__profn_foo, i32 0, i32 0), i64 {{[0-9]+}}, i32 4, i32 0)
+; GEN: call void @llvm.instrprof.increment(ptr @__profn_foo, i64 {{[0-9]+}}, i32 4, i32 0)
14:
ret void
15:
- store i8 0, i8* %3, align 1
+ store i8 0, ptr %3, align 1
br label %6
; GEN: 15:
-; GEN: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__profn_foo, i32 0, i32 0), i64 {{[0-9]+}}, i32 4, i32 3)
+; GEN: call void @llvm.instrprof.increment(ptr @__profn_foo, i64 {{[0-9]+}}, i32 4, i32 3)
16:
%17 = cleanuppad within none []
- %18 = load i8, i8* %3, align 1
+ %18 = load i8, ptr %3, align 1
%19 = trunc i8 %18 to i1
br i1 %19, label %15, label %6
; USE: br i1 %19, label %15, label %6
diff --git a/llvm/test/Transforms/PGOProfile/PR41279_2.ll b/llvm/test/Transforms/PGOProfile/PR41279_2.ll
index 59dc81907340a..fc3e54fcb4c17 100644
--- a/llvm/test/Transforms/PGOProfile/PR41279_2.ll
+++ b/llvm/test/Transforms/PGOProfile/PR41279_2.ll
@@ -4,7 +4,7 @@
; RUN: opt < %s -passes=pgo-instr-use -pgo-test-profile-file=%t.profdata -S | FileCheck %s --check-prefix=USE
-define dso_local void @f() personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*) {
+define dso_local void @f() personality ptr @__C_specific_handler {
; USE-LABEL: @f
; USE-SAME: !prof ![[FUNC_ENTRY_COUNT:[0-9]+]]
; USE-DAG: {{![0-9]+}} = !{i32 1, !"ProfileSummary", {{![0-9]+}}}
@@ -20,15 +20,15 @@ catch.dispatch:
%0 = catchswitch within none [label %__except] unwind to caller
__except:
- %1 = catchpad within %0 [i8* null]
+ %1 = catchpad within %0 [ptr null]
catchret from %1 to label %__except1
__except1:
%2 = call i32 @llvm.eh.exceptioncode(token %1)
- store i32 %2, i32* %__exception_code, align 4
+ store i32 %2, ptr %__exception_code, align 4
br label %__try.cont7
;GEN: _except1:
-;GEN: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @__profn_f, i32 0, i32 0), i64 {{[0-9]+}}, i32 2, i32 1)
+;GEN: call void @llvm.instrprof.increment(ptr @__profn_f, i64 {{[0-9]+}}, i32 2, i32 1)
invoke.cont:
br label %__try.cont
@@ -43,12 +43,12 @@ catch.dispatch4:
; GEN-NOT: call void @llvm.instrprof.increment
__except5:
- %4 = catchpad within %3 [i8* null]
+ %4 = catchpad within %3 [ptr null]
catchret from %4 to label %__except6
__except6:
%5 = call i32 @llvm.eh.exceptioncode(token %4)
- store i32 %5, i32* %__exception_code2, align 4
+ store i32 %5, ptr %__exception_code2, align 4
br label %__try.cont7
__try.cont7:
@@ -57,7 +57,7 @@ __try.cont7:
invoke.cont3:
br label %__try.cont7
;GEN: invoke.cont3:
-;GEN: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @__profn_f, i32 0, i32 0), i64 {{[0-9]+}}, i32 2, i32 0)
+;GEN: call void @llvm.instrprof.increment(ptr @__profn_f, i64 {{[0-9]+}}, i32 2, i32 0)
}
diff --git a/llvm/test/Transforms/PGOProfile/bfi_verification.ll b/llvm/test/Transforms/PGOProfile/bfi_verification.ll
index 22dbf45a44c19..9d07842a31221 100644
--- a/llvm/test/Transforms/PGOProfile/bfi_verification.ll
+++ b/llvm/test/Transforms/PGOProfile/bfi_verification.ll
@@ -6,20 +6,20 @@
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
-%struct.basket = type { %struct.arc*, i64, i64 }
-%struct.arc = type { i64, %struct.node*, %struct.node*, i32, %struct.arc*, %struct.arc*, i64, i64 }
-%struct.node = type { i64, i32, %struct.node*, %struct.node*, %struct.node*, %struct.node*, %struct.arc*, %struct.arc*, %struct.arc*, %struct.arc*, i64, i64, i32, i32 }
+%struct.basket = type { ptr, i64, i64 }
+%struct.arc = type { i64, ptr, ptr, i32, ptr, ptr, i64, i64 }
+%struct.node = type { i64, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i64, i64, i32, i32 }
- at perm = internal unnamed_addr global [351 x %struct.basket*] zeroinitializer, align 16
+ at perm = internal unnamed_addr global [351 x ptr] zeroinitializer, align 16
define dso_local void @sort_basket(i64 %min, i64 %max) {
entry:
%add = add nsw i64 %min, %max
%div = sdiv i64 %add, 2
- %arrayidx = getelementptr inbounds [351 x %struct.basket*], [351 x %struct.basket*]* @perm, i64 0, i64 %div
- %0 = load %struct.basket*, %struct.basket** %arrayidx, align 8
- %abs_cost = getelementptr inbounds %struct.basket, %struct.basket* %0, i64 0, i32 2
- %1 = load i64, i64* %abs_cost, align 8
+ %arrayidx = getelementptr inbounds [351 x ptr], ptr @perm, i64 0, i64 %div
+ %0 = load ptr, ptr %arrayidx, align 8
+ %abs_cost = getelementptr inbounds %struct.basket, ptr %0, i64 0, i32 2
+ %1 = load i64, ptr %abs_cost, align 8
br label %do.body
do.body:
@@ -29,10 +29,10 @@ do.body:
while.cond:
%l.1 = phi i64 [ %l.0, %do.body ], [ %inc, %while.body ]
- %arrayidx1 = getelementptr inbounds [351 x %struct.basket*], [351 x %struct.basket*]* @perm, i64 0, i64 %l.1
- %2 = load %struct.basket*, %struct.basket** %arrayidx1, align 8
- %abs_cost2 = getelementptr inbounds %struct.basket, %struct.basket* %2, i64 0, i32 2
- %3 = load i64, i64* %abs_cost2, align 8
+ %arrayidx1 = getelementptr inbounds [351 x ptr], ptr @perm, i64 0, i64 %l.1
+ %2 = load ptr, ptr %arrayidx1, align 8
+ %abs_cost2 = getelementptr inbounds %struct.basket, ptr %2, i64 0, i32 2
+ %3 = load i64, ptr %abs_cost2, align 8
%cmp = icmp sgt i64 %3, %1
br i1 %cmp, label %while.body, label %while.cond3
@@ -42,10 +42,10 @@ while.body:
while.cond3:
%r.1 = phi i64 [ %r.0, %while.cond ], [ %dec, %while.body7 ]
- %arrayidx4 = getelementptr inbounds [351 x %struct.basket*], [351 x %struct.basket*]* @perm, i64 0, i64 %r.1
- %4 = load %struct.basket*, %struct.basket** %arrayidx4, align 8
- %abs_cost5 = getelementptr inbounds %struct.basket, %struct.basket* %4, i64 0, i32 2
- %5 = load i64, i64* %abs_cost5, align 8
+ %arrayidx4 = getelementptr inbounds [351 x ptr], ptr @perm, i64 0, i64 %r.1
+ %4 = load ptr, ptr %arrayidx4, align 8
+ %abs_cost5 = getelementptr inbounds %struct.basket, ptr %4, i64 0, i32 2
+ %5 = load i64, ptr %abs_cost5, align 8
%cmp6 = icmp sgt i64 %1, %5
br i1 %cmp6, label %while.body7, label %while.end8
@@ -58,18 +58,16 @@ while.end8:
br i1 %cmp9, label %if.then, label %if.end
if.then:
- %6 = bitcast %struct.basket** %arrayidx1 to i64*
- %7 = load i64, i64* %6, align 8
- store %struct.basket* %4, %struct.basket** %arrayidx1, align 8
- %8 = bitcast %struct.basket** %arrayidx4 to i64*
- store i64 %7, i64* %8, align 8
+ %6 = load i64, ptr %arrayidx1, align 8
+ store ptr %4, ptr %arrayidx1, align 8
+ store i64 %6, ptr %arrayidx4, align 8
br label %if.end
if.end:
%cmp14 = icmp sgt i64 %l.1, %r.1
%not.cmp14 = xor i1 %cmp14, true
- %9 = zext i1 %not.cmp14 to i64
- %r.2 = sub i64 %r.1, %9
+ %7 = zext i1 %not.cmp14 to i64
+ %r.2 = sub i64 %r.1, %7
%not.cmp1457 = xor i1 %cmp14, true
%inc16 = zext i1 %not.cmp1457 to i64
%l.2 = add nsw i64 %l.1, %inc16
diff --git a/llvm/test/Transforms/PGOProfile/callbr.ll b/llvm/test/Transforms/PGOProfile/callbr.ll
index b5f5f41fe6ae4..d171f1a58758c 100644
--- a/llvm/test/Transforms/PGOProfile/callbr.ll
+++ b/llvm/test/Transforms/PGOProfile/callbr.ll
@@ -2,7 +2,7 @@
define i32 @a() {
entry:
-; CHECK-NOT: ptrtoint void (i8*)* asm sideeffect
+; CHECK-NOT: ptrtoint ptr asm sideeffect
; CHECK: callbr void asm sideeffect
%retval = alloca i32, align 4
callbr void asm sideeffect "", "!i,~{dirflag},~{fpsr},~{flags}"() #1
@@ -12,6 +12,6 @@ asm.fallthrough:
br label %b
b:
- %0 = load i32, i32* %retval, align 4
+ %0 = load i32, ptr %retval, align 4
ret i32 %0
}
diff --git a/llvm/test/Transforms/PGOProfile/chr.ll b/llvm/test/Transforms/PGOProfile/chr.ll
index 280ecc4124d04..124bc5010fe5c 100644
--- a/llvm/test/Transforms/PGOProfile/chr.ll
+++ b/llvm/test/Transforms/PGOProfile/chr.ll
@@ -22,10 +22,10 @@ declare void @bar()
; if ((t0 & 2) != 0)
; foo()
; }
-define void @test_chr_1(i32* %i) !prof !14 {
+define void @test_chr_1(ptr %i) !prof !14 {
; CHECK-LABEL: @test_chr_1(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[TMP0:%.*]] = load i32, i32* [[I:%.*]], align 4
+; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[I:%.*]], align 4
; CHECK-NEXT: [[TMP1:%.*]] = and i32 [[TMP0]], 3
; CHECK-NEXT: [[TMP2:%.*]] = icmp eq i32 [[TMP1]], 3
; CHECK-NEXT: br i1 [[TMP2]], label [[BB0:%.*]], label [[ENTRY_SPLIT_NONCHR:%.*]], !prof [[PROF15:![0-9]+]]
@@ -51,7 +51,7 @@ define void @test_chr_1(i32* %i) !prof !14 {
; CHECK-NEXT: ret void
;
entry:
- %0 = load i32, i32* %i
+ %0 = load i32, ptr %i
%1 = and i32 %0, 1
%2 = icmp eq i32 %1, 0
br i1 %2, label %bb1, label %bb0, !prof !15
@@ -95,10 +95,10 @@ bb3:
; if ((t0 & 4) != 0)
; foo()
; }
-define void @test_chr_1_1(i32* %i) !prof !14 {
+define void @test_chr_1_1(ptr %i) !prof !14 {
; CHECK-LABEL: @test_chr_1_1(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[TMP0:%.*]] = load i32, i32* [[I:%.*]], align 4
+; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[I:%.*]], align 4
; CHECK-NEXT: [[TMP1:%.*]] = and i32 [[TMP0]], 7
; CHECK-NEXT: [[TMP2:%.*]] = icmp eq i32 [[TMP1]], 7
; CHECK-NEXT: br i1 [[TMP2]], label [[BB0:%.*]], label [[ENTRY_SPLIT_NONCHR:%.*]], !prof [[PROF15]]
@@ -131,7 +131,7 @@ define void @test_chr_1_1(i32* %i) !prof !14 {
; CHECK-NEXT: ret void
;
entry:
- %0 = load i32, i32* %i
+ %0 = load i32, ptr %i
%1 = and i32 %0, 1
%2 = icmp eq i32 %1, 0
br i1 %2, label %bb1, label %bb0, !prof !15
@@ -181,10 +181,10 @@ bb5:
; if ((t0 & 2) != 0)
; foo()
; }
-define void @test_chr_2(i32* %i) !prof !14 {
+define void @test_chr_2(ptr %i) !prof !14 {
; CHECK-LABEL: @test_chr_2(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[TMP0:%.*]] = load i32, i32* [[I:%.*]], align 4
+; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[I:%.*]], align 4
; CHECK-NEXT: [[TMP1:%.*]] = and i32 [[TMP0]], 3
; CHECK-NEXT: [[TMP2:%.*]] = icmp eq i32 [[TMP1]], 3
; CHECK-NEXT: br i1 [[TMP2]], label [[BB1:%.*]], label [[ENTRY_SPLIT_NONCHR:%.*]], !prof [[PROF15]]
@@ -214,7 +214,7 @@ define void @test_chr_2(i32* %i) !prof !14 {
; CHECK-NEXT: ret void
;
entry:
- %0 = load i32, i32* %i
+ %0 = load i32, ptr %i
%1 = and i32 %0, 255
%2 = icmp eq i32 %1, 0
br i1 %2, label %bb4, label %bb0, !prof !15
@@ -274,10 +274,10 @@ bb4:
; if ((t2 & 8) != 0)
; foo()
; }
-define void @test_chr_3(i32* %i) !prof !14 {
+define void @test_chr_3(ptr %i) !prof !14 {
; CHECK-LABEL: @test_chr_3(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[TMP0:%.*]] = load i32, i32* [[I:%.*]], align 4
+; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[I:%.*]], align 4
; CHECK-NEXT: [[TMP1:%.*]] = and i32 [[TMP0]], 3
; CHECK-NEXT: [[TMP2:%.*]] = icmp eq i32 [[TMP1]], 3
; CHECK-NEXT: br i1 [[TMP2]], label [[BB0:%.*]], label [[ENTRY_SPLIT_NONCHR:%.*]], !prof [[PROF15]]
@@ -300,7 +300,7 @@ define void @test_chr_3(i32* %i) !prof !14 {
; CHECK-NEXT: call void @foo()
; CHECK-NEXT: br label [[BB3]]
; CHECK: bb3:
-; CHECK-NEXT: [[TMP6:%.*]] = load i32, i32* [[I]], align 4
+; CHECK-NEXT: [[TMP6:%.*]] = load i32, ptr [[I]], align 4
; CHECK-NEXT: [[TMP7:%.*]] = and i32 [[TMP6]], 12
; CHECK-NEXT: [[TMP8:%.*]] = icmp eq i32 [[TMP7]], 12
; CHECK-NEXT: br i1 [[TMP8]], label [[BB4:%.*]], label [[BB3_SPLIT_NONCHR:%.*]], !prof [[PROF15]]
@@ -326,7 +326,7 @@ define void @test_chr_3(i32* %i) !prof !14 {
; CHECK-NEXT: ret void
;
entry:
- %0 = load i32, i32* %i
+ %0 = load i32, ptr %i
%1 = and i32 %0, 1
%2 = icmp eq i32 %1, 0
br i1 %2, label %bb1, label %bb0, !prof !15
@@ -345,7 +345,7 @@ bb2:
br label %bb3
bb3:
- %5 = load i32, i32* %i
+ %5 = load i32, ptr %i
%6 = and i32 %5, 4
%7 = icmp eq i32 %6, 0
br i1 %7, label %bb5, label %bb4, !prof !15
@@ -382,10 +382,10 @@ bb7:
; sum2 = (t0 & 2) ? sum1 : (sum1 + 43)
; return sum2
; }
-define i32 @test_chr_4(i32* %i, i32 %sum0) !prof !14 {
+define i32 @test_chr_4(ptr %i, i32 %sum0) !prof !14 {
; CHECK-LABEL: @test_chr_4(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[TMP0:%.*]] = load i32, i32* [[I:%.*]], align 4
+; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[I:%.*]], align 4
; CHECK-NEXT: [[DOTFR1:%.*]] = freeze i32 [[TMP0]]
; CHECK-NEXT: [[TMP1:%.*]] = and i32 [[DOTFR1]], 3
; CHECK-NEXT: [[TMP2:%.*]] = icmp eq i32 [[TMP1]], 3
@@ -408,7 +408,7 @@ define i32 @test_chr_4(i32* %i, i32 %sum0) !prof !14 {
; CHECK-NEXT: br label [[COMMON_RET]]
;
entry:
- %0 = load i32, i32* %i
+ %0 = load i32, ptr %i
%1 = and i32 %0, 1
%2 = icmp eq i32 %1, 0
%3 = add i32 %sum0, 42
@@ -445,10 +445,10 @@ entry:
; }
; }
; return sum
-define i32 @test_chr_5(i32* %i, i32 %sum0) !prof !14 {
+define i32 @test_chr_5(ptr %i, i32 %sum0) !prof !14 {
; CHECK-LABEL: @test_chr_5(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[TMP0:%.*]] = load i32, i32* [[I:%.*]], align 4
+; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[I:%.*]], align 4
; CHECK-NEXT: [[DOTFR1:%.*]] = freeze i32 [[TMP0]]
; CHECK-NEXT: [[TMP1:%.*]] = and i32 [[DOTFR1]], 15
; CHECK-NEXT: [[TMP2:%.*]] = icmp eq i32 [[TMP1]], 15
@@ -483,7 +483,7 @@ define i32 @test_chr_5(i32* %i, i32 %sum0) !prof !14 {
; CHECK-NEXT: ret i32 [[SUM6]]
;
entry:
- %0 = load i32, i32* %i
+ %0 = load i32, ptr %i
%1 = and i32 %0, 255
%2 = icmp eq i32 %1, 0
br i1 %2, label %bb3, label %bb0, !prof !15
@@ -543,10 +543,10 @@ bb3:
; }
; }
; return sum
-define i32 @test_chr_5_1(i32* %i, i32 %sum0) !prof !14 {
+define i32 @test_chr_5_1(ptr %i, i32 %sum0) !prof !14 {
; CHECK-LABEL: @test_chr_5_1(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[TMP0:%.*]] = load i32, i32* [[I:%.*]], align 4
+; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[I:%.*]], align 4
; CHECK-NEXT: [[DOTFR1:%.*]] = freeze i32 [[TMP0]]
; CHECK-NEXT: [[TMP1:%.*]] = and i32 [[SUM0:%.*]], 4
; CHECK-NEXT: [[TMP2:%.*]] = icmp ne i32 [[TMP1]], 0
@@ -584,7 +584,7 @@ define i32 @test_chr_5_1(i32* %i, i32 %sum0) !prof !14 {
; CHECK-NEXT: ret i32 [[SUM6]]
;
entry:
- %0 = load i32, i32* %i
+ %0 = load i32, ptr %i
%1 = and i32 %0, 255
%2 = icmp eq i32 %1, 0
br i1 %2, label %bb3, label %bb0, !prof !15
@@ -644,12 +644,12 @@ bb3:
; }
; }
; return sum
-define i32 @test_chr_6(i32* %i, i32* %j, i32 %sum0) !prof !14 {
+define i32 @test_chr_6(ptr %i, ptr %j, i32 %sum0) !prof !14 {
; CHECK-LABEL: @test_chr_6(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[I0:%.*]] = load i32, i32* [[I:%.*]], align 4
+; CHECK-NEXT: [[I0:%.*]] = load i32, ptr [[I:%.*]], align 4
; CHECK-NEXT: [[I0_FR:%.*]] = freeze i32 [[I0]]
-; CHECK-NEXT: [[J0:%.*]] = load i32, i32* [[J:%.*]], align 4
+; CHECK-NEXT: [[J0:%.*]] = load i32, ptr [[J:%.*]], align 4
; CHECK-NEXT: [[V9:%.*]] = and i32 [[J0]], 4
; CHECK-NEXT: [[V10:%.*]] = icmp ne i32 [[V9]], 0
; CHECK-NEXT: [[TMP0:%.*]] = and i32 [[I0_FR]], 10
@@ -682,8 +682,8 @@ define i32 @test_chr_6(i32* %i, i32* %j, i32 %sum0) !prof !14 {
; CHECK-NEXT: ret i32 [[SUM6]]
;
entry:
- %i0 = load i32, i32* %i
- %j0 = load i32, i32* %j
+ %i0 = load i32, ptr %i
+ %j0 = load i32, ptr %j
%v1 = and i32 %i0, 255
%v2 = icmp eq i32 %v1, 0
br i1 %v2, label %bb3, label %bb0, !prof !15
@@ -728,16 +728,16 @@ bb3:
; return sum
; ->
; (no change)
-define i32 @test_chr_7(i32* %i, i32* %j, i32 %sum0) !prof !14 {
+define i32 @test_chr_7(ptr %i, ptr %j, i32 %sum0) !prof !14 {
; CHECK-LABEL: @test_chr_7(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[I0:%.*]] = load i32, i32* [[I:%.*]], align 4
+; CHECK-NEXT: [[I0:%.*]] = load i32, ptr [[I:%.*]], align 4
; CHECK-NEXT: [[V3:%.*]] = and i32 [[I0]], 2
; CHECK-NEXT: [[V4:%.*]] = icmp eq i32 [[V3]], 0
; CHECK-NEXT: [[V8:%.*]] = add i32 [[SUM0:%.*]], 43
; CHECK-NEXT: [[SUM2:%.*]] = select i1 [[V4]], i32 [[SUM0]], i32 [[V8]], !prof [[PROF16]]
; CHECK-NEXT: call void @foo()
-; CHECK-NEXT: [[J0:%.*]] = load i32, i32* [[J:%.*]], align 4
+; CHECK-NEXT: [[J0:%.*]] = load i32, ptr [[J:%.*]], align 4
; CHECK-NEXT: [[V9:%.*]] = and i32 [[J0]], 4
; CHECK-NEXT: [[V10:%.*]] = icmp eq i32 [[V9]], 0
; CHECK-NEXT: br i1 [[V10]], label [[BB2:%.*]], label [[BB1:%.*]], !prof [[PROF16]]
@@ -750,13 +750,13 @@ define i32 @test_chr_7(i32* %i, i32* %j, i32 %sum0) !prof !14 {
; CHECK-NEXT: ret i32 [[SUM5]]
;
entry:
- %i0 = load i32, i32* %i
+ %i0 = load i32, ptr %i
%v3 = and i32 %i0, 2
%v4 = icmp eq i32 %v3, 0
%v8 = add i32 %sum0, 43
%sum2 = select i1 %v4, i32 %sum0, i32 %v8, !prof !15
call void @foo()
- %j0 = load i32, i32* %j
+ %j0 = load i32, ptr %j
%v9 = and i32 %j0, 4
%v10 = icmp eq i32 %v9, 0
br i1 %v10, label %bb2, label %bb1, !prof !15 ; %v10 can't be hoisted above the above select
@@ -798,12 +798,12 @@ bb2:
; foo()
; }
; return sum
-define i32 @test_chr_7_1(i32* %i, i32* %j, i32 %sum0) !prof !14 {
+define i32 @test_chr_7_1(ptr %i, ptr %j, i32 %sum0) !prof !14 {
; CHECK-LABEL: @test_chr_7_1(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[I0:%.*]] = load i32, i32* [[I:%.*]], align 4
+; CHECK-NEXT: [[I0:%.*]] = load i32, ptr [[I:%.*]], align 4
; CHECK-NEXT: call void @foo()
-; CHECK-NEXT: [[J0:%.*]] = load i32, i32* [[J:%.*]], align 4
+; CHECK-NEXT: [[J0:%.*]] = load i32, ptr [[J:%.*]], align 4
; CHECK-NEXT: [[TMP0:%.*]] = and i32 [[J0]], 12
; CHECK-NEXT: [[TMP1:%.*]] = icmp eq i32 [[TMP0]], 12
; CHECK-NEXT: br i1 [[TMP1]], label [[BB0:%.*]], label [[ENTRY_SPLIT_NONCHR:%.*]], !prof [[PROF15]]
@@ -833,13 +833,13 @@ define i32 @test_chr_7_1(i32* %i, i32* %j, i32 %sum0) !prof !14 {
; CHECK-NEXT: ret i32 [[SUM2]]
;
entry:
- %i0 = load i32, i32* %i
+ %i0 = load i32, ptr %i
%v3 = and i32 %i0, 2
%v4 = icmp eq i32 %v3, 0
%v8 = add i32 %sum0, 43
%sum2 = select i1 %v4, i32 %sum0, i32 %v8, !prof !15
call void @foo()
- %j0 = load i32, i32* %j
+ %j0 = load i32, ptr %j
%v9 = and i32 %j0, 4
%v10 = icmp eq i32 %v9, 0
br i1 %v10, label %bb1, label %bb0, !prof !15 ; %v10 can't be hoisted above the above select
@@ -870,10 +870,10 @@ bb3:
; foo()
; ->
; (no change)
-define void @test_chr_8(i32* %i) !prof !14 {
+define void @test_chr_8(ptr %i) !prof !14 {
; CHECK-LABEL: @test_chr_8(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[TMP0:%.*]] = load i32, i32* [[I:%.*]], align 4
+; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[I:%.*]], align 4
; CHECK-NEXT: [[TMP1:%.*]] = and i32 [[TMP0]], 1
; CHECK-NEXT: [[TMP2:%.*]] = icmp eq i32 [[TMP1]], 0
; CHECK-NEXT: br i1 [[TMP2]], label [[BB1:%.*]], label [[BB0:%.*]], !prof [[PROF17:![0-9]+]]
@@ -891,7 +891,7 @@ define void @test_chr_8(i32* %i) !prof !14 {
; CHECK-NEXT: ret void
;
entry:
- %0 = load i32, i32* %i
+ %0 = load i32, ptr %i
%1 = and i32 %0, 1
%2 = icmp eq i32 %1, 0
br i1 %2, label %bb1, label %bb0, !prof !16
@@ -940,16 +940,16 @@ bb3:
; }
; // There's a phi for t here.
; return t
-define i32 @test_chr_9(i32* %i, i32* %j) !prof !14 {
+define i32 @test_chr_9(ptr %i, ptr %j) !prof !14 {
; CHECK-LABEL: @test_chr_9(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[TMP0:%.*]] = load i32, i32* [[I:%.*]], align 4
+; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[I:%.*]], align 4
; CHECK-NEXT: [[TMP1:%.*]] = and i32 [[TMP0]], 3
; CHECK-NEXT: [[TMP2:%.*]] = icmp eq i32 [[TMP1]], 3
; CHECK-NEXT: br i1 [[TMP2]], label [[BB0:%.*]], label [[ENTRY_SPLIT_NONCHR:%.*]], !prof [[PROF15]]
; CHECK: bb0:
; CHECK-NEXT: call void @foo()
-; CHECK-NEXT: [[TMP3:%.*]] = load i32, i32* [[J:%.*]], align 4
+; CHECK-NEXT: [[TMP3:%.*]] = load i32, ptr [[J:%.*]], align 4
; CHECK-NEXT: call void @foo()
; CHECK-NEXT: br label [[BB3:%.*]]
; CHECK: entry.split.nonchr:
@@ -964,7 +964,7 @@ define i32 @test_chr_9(i32* %i, i32* %j) !prof !14 {
; CHECK-NEXT: [[TMP6:%.*]] = icmp eq i32 [[TMP5]], 0
; CHECK-NEXT: br i1 [[TMP6]], label [[BB3]], label [[BB2_NONCHR:%.*]], !prof [[PROF16]]
; CHECK: bb2.nonchr:
-; CHECK-NEXT: [[TMP7:%.*]] = load i32, i32* [[J]], align 4
+; CHECK-NEXT: [[TMP7:%.*]] = load i32, ptr [[J]], align 4
; CHECK-NEXT: call void @foo()
; CHECK-NEXT: br label [[BB3]]
; CHECK: bb3:
@@ -972,7 +972,7 @@ define i32 @test_chr_9(i32* %i, i32* %j) !prof !14 {
; CHECK-NEXT: ret i32 [[TMP8]]
;
entry:
- %0 = load i32, i32* %i
+ %0 = load i32, ptr %i
%1 = and i32 %0, 1
%2 = icmp eq i32 %1, 0
br i1 %2, label %bb1, label %bb0, !prof !15
@@ -987,7 +987,7 @@ bb1:
br i1 %4, label %bb3, label %bb2, !prof !15
bb2:
- %5 = load i32, i32* %j
+ %5 = load i32, ptr %j
call void @foo()
br label %bb3
@@ -1021,16 +1021,16 @@ bb3:
; }
; // A new phi for t1 is inserted here.
; return (t1 * 42) - (t1 - 99)
-define i32 @test_chr_10(i32* %i, i32* %j) !prof !14 {
+define i32 @test_chr_10(ptr %i, ptr %j) !prof !14 {
; CHECK-LABEL: @test_chr_10(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[TMP0:%.*]] = load i32, i32* [[I:%.*]], align 4
+; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[I:%.*]], align 4
; CHECK-NEXT: [[TMP1:%.*]] = and i32 [[TMP0]], 3
; CHECK-NEXT: [[TMP2:%.*]] = icmp eq i32 [[TMP1]], 3
; CHECK-NEXT: br i1 [[TMP2]], label [[BB0:%.*]], label [[ENTRY_SPLIT_NONCHR:%.*]], !prof [[PROF15]]
; CHECK: bb0:
; CHECK-NEXT: call void @foo()
-; CHECK-NEXT: [[TMP3:%.*]] = load i32, i32* [[J:%.*]], align 4
+; CHECK-NEXT: [[TMP3:%.*]] = load i32, ptr [[J:%.*]], align 4
; CHECK-NEXT: call void @foo()
; CHECK-NEXT: br label [[BB3:%.*]]
; CHECK: entry.split.nonchr:
@@ -1041,7 +1041,7 @@ define i32 @test_chr_10(i32* %i, i32* %j) !prof !14 {
; CHECK-NEXT: call void @foo()
; CHECK-NEXT: br label [[BB1_NONCHR]]
; CHECK: bb1.nonchr:
-; CHECK-NEXT: [[TMP5:%.*]] = load i32, i32* [[J]], align 4
+; CHECK-NEXT: [[TMP5:%.*]] = load i32, ptr [[J]], align 4
; CHECK-NEXT: [[TMP6:%.*]] = and i32 [[TMP0]], 2
; CHECK-NEXT: [[TMP7:%.*]] = icmp eq i32 [[TMP6]], 0
; CHECK-NEXT: br i1 [[TMP7]], label [[BB3]], label [[BB2_NONCHR:%.*]], !prof [[PROF16]]
@@ -1056,7 +1056,7 @@ define i32 @test_chr_10(i32* %i, i32* %j) !prof !14 {
; CHECK-NEXT: ret i32 [[TMP11]]
;
entry:
- %0 = load i32, i32* %i
+ %0 = load i32, ptr %i
%1 = and i32 %0, 1
%2 = icmp eq i32 %1, 0
br i1 %2, label %bb1, label %bb0, !prof !15
@@ -1066,7 +1066,7 @@ bb0:
br label %bb1
bb1:
- %3 = load i32, i32* %j
+ %3 = load i32, ptr %j
%4 = and i32 %0, 2
%5 = icmp eq i32 %4, 0
br i1 %5, label %bb3, label %bb2, !prof !15
@@ -1111,10 +1111,10 @@ bb3:
; if ((1.0 / t0) * t0 < 1) // Likely true
; foo()
; }
-define void @test_chr_11(i32* %i, i32 %x) !prof !14 {
+define void @test_chr_11(ptr %i, i32 %x) !prof !14 {
; CHECK-LABEL: @test_chr_11(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[TMP0:%.*]] = load i32, i32* [[I:%.*]], align 4
+; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[I:%.*]], align 4
; CHECK-NEXT: [[TMP1:%.*]] = and i32 [[TMP0]], 1
; CHECK-NEXT: [[TMP2:%.*]] = icmp ne i32 [[TMP1]], 0
; CHECK-NEXT: [[CONV:%.*]] = sitofp i32 [[TMP0]] to double
@@ -1147,7 +1147,7 @@ define void @test_chr_11(i32* %i, i32 %x) !prof !14 {
; CHECK-NEXT: ret void
;
entry:
- %0 = load i32, i32* %i
+ %0 = load i32, ptr %i
%1 = and i32 %0, 1
%2 = icmp eq i32 %1, 0
br i1 %2, label %bb1, label %bb0, !prof !15
@@ -1173,10 +1173,10 @@ bb3:
}
; Selects + unrelated br only
-define i32 @test_chr_12(i32* %i, i32 %sum0) !prof !14 {
+define i32 @test_chr_12(ptr %i, i32 %sum0) !prof !14 {
; CHECK-LABEL: @test_chr_12(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[TMP0:%.*]] = load i32, i32* [[I:%.*]], align 4
+; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[I:%.*]], align 4
; CHECK-NEXT: [[DOTFR1:%.*]] = freeze i32 [[TMP0]]
; CHECK-NEXT: [[TMP1:%.*]] = and i32 [[DOTFR1]], 255
; CHECK-NEXT: [[TMP2:%.*]] = icmp eq i32 [[TMP1]], 0
@@ -1190,7 +1190,7 @@ define i32 @test_chr_12(i32* %i, i32 %sum0) !prof !14 {
; CHECK-NEXT: [[TMP7:%.*]] = icmp eq i32 [[TMP6]], 0
; CHECK-NEXT: [[TMP8:%.*]] = add i32 [[SUM1]], 43
; CHECK-NEXT: [[SUM2:%.*]] = select i1 [[TMP7]], i32 [[SUM1]], i32 [[TMP8]], !prof [[PROF16]]
-; CHECK-NEXT: [[TMP9:%.*]] = load i32, i32* [[I]], align 4
+; CHECK-NEXT: [[TMP9:%.*]] = load i32, ptr [[I]], align 4
; CHECK-NEXT: [[TMP10:%.*]] = icmp ne i32 [[TMP9]], 0
; CHECK-NEXT: [[TMP11:%.*]] = and i32 [[DOTFR1]], 8
; CHECK-NEXT: [[TMP12:%.*]] = icmp ne i32 [[TMP11]], 0
@@ -1212,7 +1212,7 @@ define i32 @test_chr_12(i32* %i, i32 %sum0) !prof !14 {
; CHECK-NEXT: ret i32 [[SUM6]]
;
entry:
- %0 = load i32, i32* %i
+ %0 = load i32, ptr %i
%1 = and i32 %0, 255
%2 = icmp eq i32 %1, 0
br i1 %2, label %bb3, label %bb0, !prof !15
@@ -1226,7 +1226,7 @@ bb0:
%7 = icmp eq i32 %6, 0
%8 = add i32 %sum1, 43
%sum2 = select i1 %7, i32 %sum1, i32 %8, !prof !15
- %9 = load i32, i32* %i
+ %9 = load i32, ptr %i
%10 = icmp eq i32 %9, 0
br i1 %10, label %bb2, label %bb1, !prof !15
@@ -1280,11 +1280,11 @@ bb3:
; foo()
; }
; return i0 + sum3
-define i32 @test_chr_14(i32* %i, i32* %j, i32 %sum0, i1 %pred, i32 %z) !prof !14 {
+define i32 @test_chr_14(ptr %i, ptr %j, i32 %sum0, i1 %pred, i32 %z) !prof !14 {
; CHECK-LABEL: @test_chr_14(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[Z_FR:%.*]] = freeze i32 [[Z:%.*]]
-; CHECK-NEXT: [[I0:%.*]] = load i32, i32* [[I:%.*]], align 4
+; CHECK-NEXT: [[I0:%.*]] = load i32, ptr [[I:%.*]], align 4
; CHECK-NEXT: [[V1:%.*]] = icmp eq i32 [[Z_FR]], 1
; CHECK-NEXT: br i1 [[V1]], label [[BB1:%.*]], label [[ENTRY_SPLIT_NONCHR:%.*]], !prof [[PROF15]]
; CHECK: entry.split.nonchr:
@@ -1295,7 +1295,7 @@ define i32 @test_chr_14(i32* %i, i32* %j, i32 %sum0, i1 %pred, i32 %z) !prof !14
; CHECK-NEXT: call void @foo()
; CHECK-NEXT: br label [[BB1]]
; CHECK: bb1:
-; CHECK-NEXT: [[J0:%.*]] = load i32, i32* [[J:%.*]], align 4
+; CHECK-NEXT: [[J0:%.*]] = load i32, ptr [[J:%.*]], align 4
; CHECK-NEXT: [[V6:%.*]] = and i32 [[I0]], 2
; CHECK-NEXT: [[V4:%.*]] = icmp ne i32 [[V6]], [[J0]]
; CHECK-NEXT: [[V8:%.*]] = add i32 [[SUM0:%.*]], 43
@@ -1328,7 +1328,7 @@ define i32 @test_chr_14(i32* %i, i32* %j, i32 %sum0, i1 %pred, i32 %z) !prof !14
; CHECK-NEXT: ret i32 [[V11]]
;
entry:
- %i0 = load i32, i32* %i
+ %i0 = load i32, ptr %i
%v0 = icmp eq i32 %z, 0
%v1 = icmp ne i32 %z, 1
%v2 = select i1 %v1, i1 %pred, i1 true, !prof !15
@@ -1340,7 +1340,7 @@ bb0:
br label %bb1
bb1:
- %j0 = load i32, i32* %j
+ %j0 = load i32, ptr %j
%v6 = and i32 %i0, 2
%v4 = icmp eq i32 %v6, %j0
%v8 = add i32 %sum0, 43
@@ -1376,10 +1376,10 @@ bb3:
; return i0 + sum3
; ->
; (no change)
-define i32 @test_chr_15(i32* %i, i32* %j, i32 %sum0, i1 %pred, i32 %z) !prof !14 {
+define i32 @test_chr_15(ptr %i, ptr %j, i32 %sum0, i1 %pred, i32 %z) !prof !14 {
; CHECK-LABEL: @test_chr_15(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[I0:%.*]] = load i32, i32* [[I:%.*]], align 4
+; CHECK-NEXT: [[I0:%.*]] = load i32, ptr [[I:%.*]], align 4
; CHECK-NEXT: [[V0:%.*]] = icmp eq i32 [[Z:%.*]], 0
; CHECK-NEXT: [[V3:%.*]] = select i1 [[V0]], i1 [[PRED:%.*]], i1 false
; CHECK-NEXT: br i1 [[V3]], label [[BB0:%.*]], label [[BB1:%.*]], !prof [[PROF16]]
@@ -1387,7 +1387,7 @@ define i32 @test_chr_15(i32* %i, i32* %j, i32 %sum0, i1 %pred, i32 %z) !prof !14
; CHECK-NEXT: call void @foo()
; CHECK-NEXT: br label [[BB1]]
; CHECK: bb1:
-; CHECK-NEXT: [[J0:%.*]] = load i32, i32* [[J:%.*]], align 4
+; CHECK-NEXT: [[J0:%.*]] = load i32, ptr [[J:%.*]], align 4
; CHECK-NEXT: call void @foo()
; CHECK-NEXT: [[V9:%.*]] = and i32 [[I0]], 4
; CHECK-NEXT: [[V10:%.*]] = icmp eq i32 [[V9]], 0
@@ -1406,7 +1406,7 @@ define i32 @test_chr_15(i32* %i, i32* %j, i32 %sum0, i1 %pred, i32 %z) !prof !14
; CHECK-NEXT: ret i32 [[V11]]
;
entry:
- %i0 = load i32, i32* %i
+ %i0 = load i32, ptr %i
%v0 = icmp eq i32 %z, 0
%v1 = icmp ne i32 %z, 1
%v2 = select i1 %v1, i1 %pred, i1 true, !prof !15
@@ -1418,7 +1418,7 @@ bb0:
br label %bb1
bb1:
- %j0 = load i32, i32* %j
+ %j0 = load i32, ptr %j
%v6 = and i32 %i0, 2
%v4 = icmp eq i32 %v6, %j0
%v8 = add i32 %sum0, 43
@@ -1472,10 +1472,10 @@ bb3:
; v42 = phi v41, v41_nc
; v43 = v42 + t7
; return v43
-define i32 @test_chr_16(i32* %i) !prof !14 {
+define i32 @test_chr_16(ptr %i) !prof !14 {
; CHECK-LABEL: @test_chr_16(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[TMP0:%.*]] = load i32, i32* [[I:%.*]], align 4
+; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[I:%.*]], align 4
; CHECK-NEXT: [[TMP1:%.*]] = and i32 [[TMP0]], 3
; CHECK-NEXT: [[TMP2:%.*]] = icmp eq i32 [[TMP1]], 3
; CHECK-NEXT: br i1 [[TMP2]], label [[BB0:%.*]], label [[ENTRY_SPLIT_NONCHR:%.*]], !prof [[PROF15]]
@@ -1508,7 +1508,7 @@ define i32 @test_chr_16(i32* %i) !prof !14 {
; CHECK-NEXT: ret i32 [[V43]]
;
entry:
- %0 = load i32, i32* %i
+ %0 = load i32, ptr %i
%1 = and i32 %0, 1
%2 = icmp eq i32 %1, 0
br i1 %2, label %bb1, label %bb0, !prof !15
@@ -1650,13 +1650,13 @@ bb3:
; sum4 = phi sum3, sum3_nc, sum1
; } while (tmp2 != 100)
; return sum4
-define i32 @test_chr_18(i32* %i, i32 %sum0) !prof !14 {
+define i32 @test_chr_18(ptr %i, i32 %sum0) !prof !14 {
; CHECK-LABEL: @test_chr_18(
; CHECK-NEXT: entry:
; CHECK-NEXT: br label [[BB0:%.*]]
; CHECK: bb0:
; CHECK-NEXT: [[INC1:%.*]] = phi i32 [ [[TMP2:%.*]], [[BB2:%.*]] ], [ 0, [[ENTRY:%.*]] ]
-; CHECK-NEXT: [[LI:%.*]] = load i32, i32* [[I:%.*]], align 4
+; CHECK-NEXT: [[LI:%.*]] = load i32, ptr [[I:%.*]], align 4
; CHECK-NEXT: [[LI_FR:%.*]] = freeze i32 [[LI]]
; CHECK-NEXT: [[SUM1:%.*]] = add i32 [[SUM0:%.*]], 42
; CHECK-NEXT: [[TMP0:%.*]] = and i32 [[LI_FR]], 5
@@ -1688,7 +1688,7 @@ entry:
bb0:
%inc1 = phi i32 [ %inc2, %bb2 ], [ 0, %entry ]
- %li = load i32, i32* %i
+ %li = load i32, ptr %i
%a1 = and i32 %li, 1
%cmp1 = icmp eq i32 %a1, 0
%sum1 = add i32 %sum0, 42
@@ -1741,10 +1741,10 @@ bb3:
; }
; sum6 = phi tmp4, sum0, sum2_nc, sum4_nc
; return sum6
-define i32 @test_chr_19(i32* %i, i32 %sum0) !prof !14 {
+define i32 @test_chr_19(ptr %i, i32 %sum0) !prof !14 {
; CHECK-LABEL: @test_chr_19(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[TMP0:%.*]] = load i32, i32* [[I:%.*]], align 4
+; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[I:%.*]], align 4
; CHECK-NEXT: [[DOTFR1:%.*]] = freeze i32 [[TMP0]]
; CHECK-NEXT: [[TMP1:%.*]] = and i32 [[DOTFR1]], 9
; CHECK-NEXT: [[TMP2:%.*]] = icmp eq i32 [[TMP1]], 9
@@ -1773,7 +1773,7 @@ define i32 @test_chr_19(i32* %i, i32 %sum0) !prof !14 {
; CHECK-NEXT: ret i32 [[SUM6]]
;
entry:
- %0 = load i32, i32* %i
+ %0 = load i32, ptr %i
%1 = and i32 %0, 255
%2 = icmp eq i32 %1, 0
br i1 %2, label %bb3, label %bb0, !prof !15
@@ -1837,10 +1837,10 @@ bb3:
; i5 = *i
; v13 = (i5 == 44) ? 44 : t2
; return v13
-define i32 @test_chr_20(i32* %i, i32 %sum0, i1 %j) !prof !14 {
+define i32 @test_chr_20(ptr %i, i32 %sum0, i1 %j) !prof !14 {
; CHECK-LABEL: @test_chr_20(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[I0:%.*]] = load i32, i32* [[I:%.*]], align 4
+; CHECK-NEXT: [[I0:%.*]] = load i32, ptr [[I:%.*]], align 4
; CHECK-NEXT: [[I0_FR:%.*]] = freeze i32 [[I0]]
; CHECK-NEXT: [[TMP0:%.*]] = and i32 [[I0_FR]], 6
; CHECK-NEXT: [[TMP1:%.*]] = icmp eq i32 [[TMP0]], 6
@@ -1866,13 +1866,13 @@ define i32 @test_chr_20(i32* %i, i32 %sum0, i1 %j) !prof !14 {
; CHECK-NEXT: br label [[BB4]]
; CHECK: bb4:
; CHECK-NEXT: [[TMP2:%.*]] = phi i32 [ [[V9]], [[BB1]] ], [ [[V9]], [[ENTRY_SPLIT]] ], [ [[SUM3_NONCHR]], [[BB1_NONCHR]] ], [ [[SUM3_NONCHR]], [[ENTRY_SPLIT_NONCHR]] ]
-; CHECK-NEXT: [[I5:%.*]] = load i32, i32* [[I]], align 4
+; CHECK-NEXT: [[I5:%.*]] = load i32, ptr [[I]], align 4
; CHECK-NEXT: [[V12:%.*]] = icmp eq i32 [[I5]], 44
; CHECK-NEXT: [[V13:%.*]] = select i1 [[V12]], i32 44, i32 [[TMP2]], !prof [[PROF16]]
; CHECK-NEXT: ret i32 [[V13]]
;
entry:
- %i0 = load i32, i32* %i
+ %i0 = load i32, ptr %i
%v3 = and i32 %i0, 2
%v4 = icmp eq i32 %v3, 0
%v8 = add i32 %sum0, 43
@@ -1888,7 +1888,7 @@ bb1:
br label %bb4
bb4:
- %i5 = load i32, i32* %i
+ %i5 = load i32, ptr %i
%v12 = icmp eq i32 %i5, 44
%v13 = select i1 %v12, i32 %i5, i32 %sum3, !prof !15
ret i32 %v13
@@ -2015,7 +2015,7 @@ bb10:
; Test a case with a really long use-def chains. This test checks that it's not
; really slow and doesn't appear to be hanging.
-define i64 @test_chr_22(i1 %i, i64* %j, i64 %v0) !prof !14 {
+define i64 @test_chr_22(i1 %i, ptr %j, i64 %v0) !prof !14 {
; CHECK-LABEL: @test_chr_22(
; CHECK-NEXT: bb0:
; CHECK-NEXT: [[V0_FR:%.*]] = freeze i64 [[V0:%.*]]
@@ -2028,11 +2028,11 @@ define i64 @test_chr_22(i1 %i, i64* %j, i64 %v0) !prof !14 {
; CHECK-NEXT: ret i64 [[COMMON_RET_OP]]
; CHECK: bb0.split:
; CHECK-NEXT: [[V299:%.*]] = mul i64 [[V2]], 7860086430977039991
-; CHECK-NEXT: store i64 [[V299]], i64* [[J:%.*]], align 4
+; CHECK-NEXT: store i64 [[V299]], ptr [[J:%.*]], align 4
; CHECK-NEXT: br label [[COMMON_RET:%.*]]
; CHECK: bb0.split.nonchr:
; CHECK-NEXT: [[V299_NONCHR:%.*]] = mul i64 [[V2]], 7860086430977039991
-; CHECK-NEXT: store i64 [[V299_NONCHR]], i64* [[J]], align 4
+; CHECK-NEXT: store i64 [[V299_NONCHR]], ptr [[J]], align 4
; CHECK-NEXT: br label [[COMMON_RET]]
;
bb0:
@@ -2339,7 +2339,7 @@ bb0:
%v300 = add i64 %v299, %v298
%v301 = icmp eq i64 %v300, 100
%v302 = select i1 %v301, i64 %v298, i64 %v299, !prof !15
- store i64 %v302, i64* %j
+ store i64 %v302, ptr %j
ret i64 99
}
@@ -2501,10 +2501,10 @@ end:
}
; Test to not crash upon a 0:0 branch_weight metadata.
-define void @test_chr_24(i32* %i) !prof !14 {
+define void @test_chr_24(ptr %i) !prof !14 {
; CHECK-LABEL: @test_chr_24(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[TMP0:%.*]] = load i32, i32* [[I:%.*]], align 4
+; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[I:%.*]], align 4
; CHECK-NEXT: [[TMP1:%.*]] = and i32 [[TMP0]], 1
; CHECK-NEXT: [[TMP2:%.*]] = icmp eq i32 [[TMP1]], 0
; CHECK-NEXT: br i1 [[TMP2]], label [[BB1:%.*]], label [[BB0:%.*]], !prof [[PROF20:![0-9]+]]
@@ -2522,7 +2522,7 @@ define void @test_chr_24(i32* %i) !prof !14 {
; CHECK-NEXT: ret void
;
entry:
- %0 = load i32, i32* %i
+ %0 = load i32, ptr %i
%1 = and i32 %0, 1
%2 = icmp eq i32 %1, 0
br i1 %2, label %bb1, label %bb0, !prof !17
@@ -2545,11 +2545,11 @@ bb3:
}
; Test that chr will skip this function when addresses are taken on basic blocks.
- at gototable1 = weak_odr dso_local local_unnamed_addr constant [2 x i8*] [i8* blockaddress(@test_chr_with_bbs_address_taken1, %bb3), i8* blockaddress(@test_chr_with_bbs_address_taken1, %bb3)]
-define void @test_chr_with_bbs_address_taken1(i32* %i) !prof !14 {
+ at gototable1 = weak_odr dso_local local_unnamed_addr constant [2 x ptr] [ptr blockaddress(@test_chr_with_bbs_address_taken1, %bb3), ptr blockaddress(@test_chr_with_bbs_address_taken1, %bb3)]
+define void @test_chr_with_bbs_address_taken1(ptr %i) !prof !14 {
; CHECK-LABEL: @test_chr_with_bbs_address_taken1(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[TMP0:%.*]] = load i32, i32* [[I:%.*]], align 4
+; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[I:%.*]], align 4
; CHECK-NEXT: [[TMP1:%.*]] = and i32 [[TMP0]], 1
; CHECK-NEXT: [[TMP2:%.*]] = icmp eq i32 [[TMP1]], 0
; CHECK-NEXT: br i1 [[TMP2]], label [[BB1:%.*]], label [[BB0:%.*]], !prof [[PROF16]]
@@ -2567,7 +2567,7 @@ define void @test_chr_with_bbs_address_taken1(i32* %i) !prof !14 {
; CHECK-NEXT: ret void
;
entry:
- %0 = load i32, i32* %i
+ %0 = load i32, ptr %i
%1 = and i32 %0, 1
%2 = icmp eq i32 %1, 0
br i1 %2, label %bb1, label %bb0, !prof !15
@@ -2583,8 +2583,7 @@ bb1:
bb2:
call void @foo()
- %pc = bitcast i32* %i to i8*
- indirectbr i8* %pc, [label %bb3, label %bb3]
+ indirectbr ptr %i, [label %bb3, label %bb3]
bb3:
br label %bb4
@@ -2595,11 +2594,11 @@ bb4:
; Test that chr will still optimize the first 2 regions,
; but will skip the last one due to basic blocks have address taken.
- at gototable2 = weak_odr dso_local local_unnamed_addr constant [2 x i8*] [i8* blockaddress(@test_chr_with_bbs_address_taken2, %bb5), i8* blockaddress(@test_chr_with_bbs_address_taken2, %bb5)]
-define void @test_chr_with_bbs_address_taken2(i32* %i) !prof !14 {
+ at gototable2 = weak_odr dso_local local_unnamed_addr constant [2 x ptr] [ptr blockaddress(@test_chr_with_bbs_address_taken2, %bb5), ptr blockaddress(@test_chr_with_bbs_address_taken2, %bb5)]
+define void @test_chr_with_bbs_address_taken2(ptr %i) !prof !14 {
; CHECK-LABEL: @test_chr_with_bbs_address_taken2(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[TMP0:%.*]] = load i32, i32* [[I:%.*]], align 4
+; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[I:%.*]], align 4
; CHECK-NEXT: [[TMP1:%.*]] = and i32 [[TMP0]], 3
; CHECK-NEXT: [[TMP2:%.*]] = icmp eq i32 [[TMP1]], 3
; CHECK-NEXT: br i1 [[TMP2]], label [[BB0:%.*]], label [[ENTRY_SPLIT_NONCHR:%.*]], !prof [[PROF15]]
@@ -2625,7 +2624,7 @@ define void @test_chr_with_bbs_address_taken2(i32* %i) !prof !14 {
; CHECK-NEXT: ret void
;
entry:
- %0 = load i32, i32* %i
+ %0 = load i32, ptr %i
%1 = and i32 %0, 1
%2 = icmp eq i32 %1, 0
br i1 %2, label %bb1, label %bb0, !prof !15
@@ -2649,8 +2648,7 @@ bb3:
br i1 %6, label %bb6, label %bb4, !prof !15
bb4:
- %pc = bitcast i32* %i to i8*
- indirectbr i8* %pc, [label %bb5, label %bb5]
+ indirectbr ptr %i, [label %bb5, label %bb5]
bb5:
br label %bb6
diff --git a/llvm/test/Transforms/PGOProfile/chr_coro.ll b/llvm/test/Transforms/PGOProfile/chr_coro.ll
index d902f3da14ec4..233948fa4a8fb 100644
--- a/llvm/test/Transforms/PGOProfile/chr_coro.ll
+++ b/llvm/test/Transforms/PGOProfile/chr_coro.ll
@@ -4,38 +4,38 @@
declare void @foo()
declare void @bar()
-declare token @llvm.coro.id(i32, i8*, i8*, i8*)
+declare token @llvm.coro.id(i32, ptr, ptr, ptr)
declare i1 @llvm.coro.alloc(token)
-declare i8* @llvm.coro.begin(token, i8*)
-declare noalias i8* @malloc(i32)
+declare ptr @llvm.coro.begin(token, ptr)
+declare noalias ptr @malloc(i32)
-%f.Frame = type { void (%f.Frame*)*, void (%f.Frame*)*, i1 }
+%f.Frame = type { ptr, ptr, i1 }
; resume part of the coroutine
-define fastcc void @f.resume(%f.Frame* noalias nonnull align 8 dereferenceable(24) %FramePtr) {
+define fastcc void @f.resume(ptr noalias nonnull align 8 dereferenceable(24) %FramePtr) {
tail call void @bar()
ret void
}
; destroy part of the coroutine
-define fastcc void @f.destroy(%f.Frame* noalias nonnull align 8 dereferenceable(24) %FramePtr) {
+define fastcc void @f.destroy(ptr noalias nonnull align 8 dereferenceable(24) %FramePtr) {
tail call void @bar()
ret void
}
; cleanup part of the coroutine
-define fastcc void @f.cleanup(%f.Frame* noalias nonnull align 8 dereferenceable(24) %FramePtr) {
+define fastcc void @f.cleanup(ptr noalias nonnull align 8 dereferenceable(24) %FramePtr) {
tail call void @bar()
ret void
}
- at f.resumers = private constant [3 x void (%f.Frame*)*] [void (%f.Frame*)* @f.resume, void (%f.Frame*)* @f.destroy, void (%f.Frame*)* @f.cleanup]
+ at f.resumers = private constant [3 x ptr] [ptr @f.resume, ptr @f.destroy, ptr @f.cleanup]
; Test that chr will skip block containing llvm.coro.id.
-define i8* @test_chr_with_coro_id(i32* %i) !prof !14 {
+define ptr @test_chr_with_coro_id(ptr %i) !prof !14 {
; CHECK-LABEL: @test_chr_with_coro_id(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[TMP0:%.*]] = load i32, i32* [[I:%.*]], align 4
+; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[I:%.*]], align 4
; CHECK-NEXT: [[TMP1:%.*]] = and i32 [[TMP0]], 3
; CHECK-NEXT: [[TMP2:%.*]] = icmp eq i32 [[TMP1]], 3
; CHECK-NEXT: br i1 [[TMP2]], label %[[BB0:.*]], label %[[ENTRY_SPLIT_NONCHR:.*]], !prof !15
@@ -54,11 +54,11 @@ define i8* @test_chr_with_coro_id(i32* %i) !prof !14 {
; CHECK-NEXT: [[NEED_DYN_ALLOC:%.*]] = call i1 @llvm.coro.alloc(token [[ID]])
; CHECK-NEXT: br i1 [[NEED_DYN_ALLOC]], label %[[BB_CORO_DYN_ALLOC:.*]], label %[[BB_CORO_BEGIN:.*]]
; CHECK: [[BB_CORO_BEGIN]]:
-; CHECK-NEXT: [[PHI:%.*]] = phi i8* [ null, %[[BB_CORO_ID]] ], [ %alloc, %[[BB_CORO_DYN_ALLOC]] ]
-; CHECK-NEXT: [[HDL:%.*]] = call noalias nonnull i8* @llvm.coro.begin(token [[ID]], i8* [[PHI]])
+; CHECK-NEXT: [[PHI:%.*]] = phi ptr [ null, %[[BB_CORO_ID]] ], [ %alloc, %[[BB_CORO_DYN_ALLOC]] ]
+; CHECK-NEXT: [[HDL:%.*]] = call noalias nonnull ptr @llvm.coro.begin(token [[ID]], ptr [[PHI]])
;
entry:
- %0 = load i32, i32* %i
+ %0 = load i32, ptr %i
%1 = and i32 %0, 1
%2 = icmp eq i32 %1, 0
br i1 %2, label %bb1, label %bb0, !prof !15
@@ -77,18 +77,18 @@ bb2:
br label %bb.coro.id
bb.coro.id:
- %id = call token @llvm.coro.id(i32 0, i8* null, i8* null, i8* bitcast ([3 x void (%f.Frame*)*]* @f.resumers to i8*))
+ %id = call token @llvm.coro.id(i32 0, ptr null, ptr null, ptr @f.resumers)
%need.dyn.alloc = call i1 @llvm.coro.alloc(token %id)
br i1 %need.dyn.alloc, label %bb.coro.dyn.alloc, label %bb.coro.begin
bb.coro.dyn.alloc:
- %alloc = call i8* @malloc(i32 24)
+ %alloc = call ptr @malloc(i32 24)
br label %bb.coro.begin
bb.coro.begin:
- %phi = phi i8* [ null, %bb.coro.id ], [ %alloc, %bb.coro.dyn.alloc ]
- %hdl = call noalias nonnull i8* @llvm.coro.begin(token %id, i8* %phi)
- ret i8* %hdl
+ %phi = phi ptr [ null, %bb.coro.id ], [ %alloc, %bb.coro.dyn.alloc ]
+ %hdl = call noalias nonnull ptr @llvm.coro.begin(token %id, ptr %phi)
+ ret ptr %hdl
}
!llvm.module.flags = !{!0}
diff --git a/llvm/test/Transforms/PGOProfile/comdat_internal.ll b/llvm/test/Transforms/PGOProfile/comdat_internal.ll
index 128384d2a2917..64274a33999df 100644
--- a/llvm/test/Transforms/PGOProfile/comdat_internal.ll
+++ b/llvm/test/Transforms/PGOProfile/comdat_internal.ll
@@ -8,14 +8,14 @@ $foo = comdat any
; CHECK: $__llvm_profile_raw_version = comdat any
; CHECK: $__profc__stdin__foo.[[#FOO_HASH:]] = comdat any
- at bar = global i32 ()* @foo, align 8
+ at bar = global ptr @foo, align 8
; CHECK: @__llvm_profile_raw_version = constant i64 {{[0-9]+}}, comdat
; CHECK-NOT: __profn__stdin__foo
; CHECK: @__profc__stdin__foo.[[#FOO_HASH]] = private global [1 x i64] zeroinitializer, section "__llvm_prf_cnts", comdat, align 8
-; CHECK: @__profd__stdin__foo.[[#FOO_HASH]] = private global { i64, i64, i64, i8*, i8*, i32, [2 x i16] } { i64 -5640069336071256030, i64 [[#FOO_HASH]], i64 sub (i64 ptrtoint ([1 x i64]* @__profc__stdin__foo.742261418966908927 to i64), i64 ptrtoint ({ i64, i64, i64, i8*, i8*, i32, [2 x i16] }* @__profd__stdin__foo.742261418966908927 to i64)), i8* null
-; CHECK-NOT: bitcast (i32 ()* @foo to i8*)
-; CHECK-SAME: , i8* null, i32 1, [2 x i16] zeroinitializer }, section "__llvm_prf_data", comdat($__profc__stdin__foo.[[#FOO_HASH]]), align 8
+; CHECK: @__profd__stdin__foo.[[#FOO_HASH]] = private global { i64, i64, i64, ptr, ptr, i32, [2 x i16] } { i64 -5640069336071256030, i64 [[#FOO_HASH]], i64 sub (i64 ptrtoint (ptr @__profc__stdin__foo.742261418966908927 to i64), i64 ptrtoint (ptr @__profd__stdin__foo.742261418966908927 to i64)), ptr null
+; CHECK-NOT: @foo
+; CHECK-SAME: , ptr null, i32 1, [2 x i16] zeroinitializer }, section "__llvm_prf_data", comdat($__profc__stdin__foo.[[#FOO_HASH]]), align 8
; CHECK: @__llvm_prf_nm
; CHECK: @llvm.compiler.used
diff --git a/llvm/test/Transforms/PGOProfile/comdat_rename.ll b/llvm/test/Transforms/PGOProfile/comdat_rename.ll
index 3400461e2c7c5..489c315efc853 100644
--- a/llvm/test/Transforms/PGOProfile/comdat_rename.ll
+++ b/llvm/test/Transforms/PGOProfile/comdat_rename.ll
@@ -14,7 +14,7 @@ $f_with_alias = comdat any
define linkonce_odr void @f_with_alias() comdat {
ret void
}
- at f_alias = alias void (), void ()* @f_with_alias
+ at f_alias = alias void (), ptr @f_with_alias
; Not rename Comdat with right linkage.
$nf = comdat any
@@ -28,9 +28,9 @@ $f_with_var = comdat any
; CHECK: $f_with_var = comdat any
@var = global i32 0, comdat($f_with_var)
define linkonce_odr void @f_with_var() comdat($f_with_var) {
- %tmp = load i32, i32* @var, align 4
+ %tmp = load i32, ptr @var, align 4
%inc = add nsw i32 %tmp, 1
- store i32 %inc, i32* @var, align 4
+ store i32 %inc, ptr @var, align 4
ret void
}
@@ -47,8 +47,8 @@ define linkonce void @tf2() comdat($tf) {
; Rename AvailableExternallyLinkage functions
; CHECK-DAG: $aef.[[SINGLEBB_HASH]] = comdat any
-; CHECK: @f = weak alias void (), void ()* @f.[[SINGLEBB_HASH]]
-; CHECK: @aef = weak alias void (), void ()* @aef.[[SINGLEBB_HASH]]
+; CHECK: @f = weak alias void (), ptr @f.[[SINGLEBB_HASH]]
+; CHECK: @aef = weak alias void (), ptr @aef.[[SINGLEBB_HASH]]
define available_externally void @aef() {
; CHECK: define linkonce_odr void @aef.[[SINGLEBB_HASH]]() comdat {
diff --git a/llvm/test/Transforms/PGOProfile/consecutive-zeros.ll b/llvm/test/Transforms/PGOProfile/consecutive-zeros.ll
index 90b941cae7cde..a388cbc37d5a6 100644
--- a/llvm/test/Transforms/PGOProfile/consecutive-zeros.ll
+++ b/llvm/test/Transforms/PGOProfile/consecutive-zeros.ll
@@ -5,7 +5,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"
-define void @foo(i8* %dst, i8* %src, i32* %a, i32 %n) {
+define void @foo(ptr %dst, ptr %src, ptr %a, i32 %n) {
; CHECK: Invalid Profile
entry:
br label %for.cond
@@ -21,17 +21,17 @@ for.body:
for.cond1:
%j.0 = phi i32 [ 0, %for.body ], [ %inc, %for.inc ]
%idx.ext = sext i32 %i.0 to i64
- %add.ptr = getelementptr inbounds i32, i32* %a, i64 %idx.ext
- %0 = load i32, i32* %add.ptr, align 4
+ %add.ptr = getelementptr inbounds i32, ptr %a, i64 %idx.ext
+ %0 = load i32, ptr %add.ptr, align 4
%cmp2 = icmp slt i32 %j.0, %0
br i1 %cmp2, label %for.body3, label %for.end
for.body3:
%add = add nsw i32 %i.0, 1
%conv = sext i32 %add to i64
- call void @llvm.memcpy.p0i8.p0i8.i64(i8* %dst, i8* %src, i64 %conv, i1 false)
- %memcmp = call i32 @memcmp(i8* %dst, i8* %src, i64 %conv)
- %bcmp = call i32 @bcmp(i8* %dst, i8* %src, i64 %conv)
+ call void @llvm.memcpy.p0.p0.i64(ptr %dst, ptr %src, i64 %conv, i1 false)
+ %memcmp = call i32 @memcmp(ptr %dst, ptr %src, i64 %conv)
+ %bcmp = call i32 @bcmp(ptr %dst, ptr %src, i64 %conv)
br label %for.inc
for.inc:
@@ -49,11 +49,11 @@ for.end6:
ret void
}
-declare void @llvm.lifetime.start(i64, i8* nocapture)
+declare void @llvm.lifetime.start(i64, ptr nocapture)
-declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture writeonly, i8* nocapture readonly, i64, i1)
+declare void @llvm.memcpy.p0.p0.i64(ptr nocapture writeonly, ptr nocapture readonly, i64, i1)
-declare i32 @memcmp(i8*, i8*, i64)
-declare i32 @bcmp(i8*, i8*, i64)
+declare i32 @memcmp(ptr, ptr, i64)
+declare i32 @bcmp(ptr, ptr, i64)
-declare void @llvm.lifetime.end(i64, i8* nocapture)
+declare void @llvm.lifetime.end(i64, ptr nocapture)
diff --git a/llvm/test/Transforms/PGOProfile/counter_promo_exit_catchswitch.ll b/llvm/test/Transforms/PGOProfile/counter_promo_exit_catchswitch.ll
index 7542e7917a3c7..d279f342666a7 100644
--- a/llvm/test/Transforms/PGOProfile/counter_promo_exit_catchswitch.ll
+++ b/llvm/test/Transforms/PGOProfile/counter_promo_exit_catchswitch.ll
@@ -25,7 +25,7 @@
%eh.ThrowInfo = type { i32, i32, i32, i32 }
@"?buffer@@3PADA" = dso_local local_unnamed_addr global [200 x i8] zeroinitializer, align 16
-define dso_local void @"?run@@YAXH at Z"(i32 %count) local_unnamed_addr personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
+define dso_local void @"?run@@YAXH at Z"(i32 %count) local_unnamed_addr personality ptr @__CxxFrameHandler3 {
entry:
br label %for.cond
@@ -36,14 +36,14 @@ for.cond: ; preds = %for.inc, %entry
for.body: ; preds = %for.cond
; CHECK: for.body:
-; NOTENTRY: %pgocount1 = load i64, i64* getelementptr inbounds ([3 x i64], [3 x i64]* @"__profc_?run@@YAXH at Z", i32 0, i32 0)
-; TENTRY: %pgocount1 = load i64, i64* getelementptr inbounds ([3 x i64], [3 x i64]* @"__profc_?run@@YAXH at Z", i32 0, i32 1)
+; NOTENTRY: %pgocount1 = load i64, ptr @"__profc_?run@@YAXH at Z"
+; TENTRY: %pgocount1 = load i64, ptr getelementptr inbounds ([3 x i64], ptr @"__profc_?run@@YAXH at Z", i32 0, i32 1)
; CHECK: %1 = add i64 %pgocount1, 1
-; NOTENTRY: store i64 %1, i64* getelementptr inbounds ([3 x i64], [3 x i64]* @"__profc_?run@@YAXH at Z", i32 0, i32 0)
-; ENTRY: store i64 %1, i64* getelementptr inbounds ([3 x i64], [3 x i64]* @"__profc_?run@@YAXH at Z", i32 0, i32 1)
+; NOTENTRY: store i64 %1, ptr @"__profc_?run@@YAXH at Z"
+; ENTRY: store i64 %1, ptr getelementptr inbounds ([3 x i64], ptr @"__profc_?run@@YAXH at Z", i32 0, i32 1)
%idxprom = zext i32 %i.0 to i64
- %arrayidx = getelementptr inbounds [200 x i8], [200 x i8]* @"?buffer@@3PADA", i64 0, i64 %idxprom
- %0 = load i8, i8* %arrayidx, align 1
+ %arrayidx = getelementptr inbounds [200 x i8], ptr @"?buffer@@3PADA", i64 0, i64 %idxprom
+ %0 = load i8, ptr %arrayidx, align 1
%cmp1 = icmp eq i8 %0, 0
br i1 %cmp1, label %cleanup, label %if.end
@@ -53,11 +53,11 @@ if.end: ; preds = %for.body
for.inc: ; preds = %if.end
; CHECK: for.inc:
-; NOTENTRY: %pgocount2 = load i64, i64* getelementptr inbounds ([3 x i64], [3 x i64]* @"__profc_?run@@YAXH at Z", i32 0, i32 1)
-; ENTRY: %pgocount2 = load i64, i64* getelementptr inbounds ([3 x i64], [3 x i64]* @"__profc_?run@@YAXH at Z", i32 0, i32 2)
+; NOTENTRY: %pgocount2 = load i64, ptr getelementptr inbounds ([3 x i64], ptr @"__profc_?run@@YAXH at Z", i32 0, i32 1)
+; ENTRY: %pgocount2 = load i64, ptr getelementptr inbounds ([3 x i64], ptr @"__profc_?run@@YAXH at Z", i32 0, i32 2)
; CHECK: %3 = add i64 %pgocount2, 1
-; NOTENTRY: store i64 %3, i64* getelementptr inbounds ([3 x i64], [3 x i64]* @"__profc_?run@@YAXH at Z", i32 0, i32 1)
-; ENTRY: store i64 %3, i64* getelementptr inbounds ([3 x i64], [3 x i64]* @"__profc_?run@@YAXH at Z", i32 0, i32 2)
+; NOTENTRY: store i64 %3, ptr getelementptr inbounds ([3 x i64], ptr @"__profc_?run@@YAXH at Z", i32 0, i32 1)
+; ENTRY: store i64 %3, ptr getelementptr inbounds ([3 x i64], ptr @"__profc_?run@@YAXH at Z", i32 0, i32 2)
%inc = add nuw nsw i32 %i.0, 1
br label %for.cond
@@ -68,10 +68,10 @@ catch.dispatch: ; preds = %if.end
%1 = catchswitch within none [label %catch] unwind to caller
catch: ; preds = %catch.dispatch
- %2 = catchpad within %1 [i8* null, i32 64, i8* null]
- call void @_CxxThrowException(i8* null, %eh.ThrowInfo* null) #2 [ "funclet"(token %2) ]
+ %2 = catchpad within %1 [ptr null, i32 64, ptr null]
+ call void @_CxxThrowException(ptr null, ptr null) #2 [ "funclet"(token %2) ]
unreachable
}
declare dso_local void @"?may_throw@@YAXH at Z"(i32)
-declare dso_local void @_CxxThrowException(i8*, %eh.ThrowInfo*)
+declare dso_local void @_CxxThrowException(ptr, ptr)
declare dso_local i32 @__CxxFrameHandler3(...)
diff --git a/llvm/test/Transforms/PGOProfile/counter_promo_exit_merge.ll b/llvm/test/Transforms/PGOProfile/counter_promo_exit_merge.ll
index e53efe8fa73d1..c2af706df787e 100644
--- a/llvm/test/Transforms/PGOProfile/counter_promo_exit_merge.ll
+++ b/llvm/test/Transforms/PGOProfile/counter_promo_exit_merge.ll
@@ -17,9 +17,9 @@ bb1: ; preds = %bb11, %bb
br i1 %tmp3, label %bb7, label %bb4
bb4: ; preds = %bb1
- call void @llvm.instrprof.increment(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__profn_foo, i32 0, i32 0), i64 63969943867, i32 5, i32 1)
+ call void @llvm.instrprof.increment(ptr @__profn_foo, i64 63969943867, i32 5, i32 1)
tail call void @bar(i32 1)
- %tmp5 = load i32, i32* @g, align 4
+ %tmp5 = load i32, ptr @g, align 4
%tmp6 = icmp sgt i32 %tmp5, 100
br i1 %tmp6, label %bb14, label %bb11
@@ -28,12 +28,12 @@ bb7: ; preds = %bb1
br i1 %tmp8, label %bb9, label %bb10
bb9: ; preds = %bb7
- call void @llvm.instrprof.increment(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__profn_foo, i32 0, i32 0), i64 63969943867, i32 5, i32 2)
+ call void @llvm.instrprof.increment(ptr @__profn_foo, i64 63969943867, i32 5, i32 2)
tail call void @bar(i32 2)
br label %bb11
bb10: ; preds = %bb7
- call void @llvm.instrprof.increment(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__profn_foo, i32 0, i32 0), i64 63969943867, i32 5, i32 3)
+ call void @llvm.instrprof.increment(ptr @__profn_foo, i64 63969943867, i32 5, i32 3)
tail call void @bar(i32 3)
br label %bb11
@@ -60,7 +60,7 @@ bb14: ; preds = %bb4.bb14_crit_edge,
; PROMO-NEXT: store{{.*}}@__profc_foo{{.*}}3)
bb15: ; preds = %bb14
- call void @llvm.instrprof.increment(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__profn_foo, i32 0, i32 0), i64 63969943867, i32 5, i32 4)
+ call void @llvm.instrprof.increment(ptr @__profn_foo, i64 63969943867, i32 5, i32 4)
tail call void @bar(i32 1)
ret void
}
@@ -68,6 +68,6 @@ bb15: ; preds = %bb14
declare void @bar(i32) local_unnamed_addr
; Function Attrs: nounwind
-declare void @llvm.instrprof.increment(i8*, i64, i32, i32) #0
+declare void @llvm.instrprof.increment(ptr, i64, i32, i32) #0
attributes #0 = { nounwind }
diff --git a/llvm/test/Transforms/PGOProfile/counter_promo_mexits.ll b/llvm/test/Transforms/PGOProfile/counter_promo_mexits.ll
index f3411d4e6b218..7c0411fcb9921 100644
--- a/llvm/test/Transforms/PGOProfile/counter_promo_mexits.ll
+++ b/llvm/test/Transforms/PGOProfile/counter_promo_mexits.ll
@@ -14,7 +14,7 @@ bb1: ; preds = %bb11, %bb
bb4: ; preds = %bb1
tail call void @bar(i32 1)
- %tmp5 = load i32, i32* @g, align 4
+ %tmp5 = load i32, ptr @g, align 4
%tmp6 = icmp sgt i32 %tmp5, 100
br i1 %tmp6, label %bb15_0, label %bb11
@@ -39,16 +39,16 @@ bb14: ; preds = %bb11
; PROMO-LABEL: bb14:
tail call void @bar(i32 0)
br label %bb15
-; PROMO: %pgocount.promoted{{.*}} = load {{.*}} @__profc_foo{{.*}} 0)
+; PROMO: %pgocount.promoted{{.*}} = load i64, ptr @__profc_foo, align 4
; PROMO-NEXT: add
-; PROMO-NEXT: store {{.*}}@__profc_foo{{.*}}0)
-; PROMO-NEXT: %pgocount.promoted{{.*}} = load {{.*}} @__profc_foo{{.*}} 1)
+; PROMO-NEXT: store i64 %3, ptr @__profc_foo, align 4
+; PROMO-NEXT: %pgocount.promoted{{.*}} = load i64, ptr getelementptr inbounds ([5 x i64], ptr @__profc_foo, i32 0, i32 1), align 4
; PROMO-NEXT: add
; PROMO-NEXT: store {{.*}}@__profc_foo{{.*}}1)
-; PROMO-NEXT: %pgocount.promoted{{.*}} = load {{.*}} @__profc_foo{{.*}} 2)
+; PROMO-NEXT: %pgocount.promoted{{.*}} = load i64, ptr getelementptr inbounds ([5 x i64], ptr @__profc_foo, i32 0, i32 2), align 4
; PROMO-NEXT: add
; PROMO-NEXT: store {{.*}}@__profc_foo{{.*}}2)
-; PROMO-NEXT: %pgocount{{.*}} = load {{.*}} @__profc_foo{{.*}} 3)
+; PROMO-NEXT: %pgocount{{.*}} = load i64, ptr getelementptr inbounds ([5 x i64], ptr @__profc_foo, i32 0, i32 3), align 4
; PROMO-NEXT: add
; PROMO-NEXT: store {{.*}}@__profc_foo{{.*}}3)
@@ -56,18 +56,18 @@ bb14: ; preds = %bb11
bb15_0: ; preds = %bb11
; PROMO-LABEL: bb15_0:
br label %bb15
-; PROMO: %pgocount.promoted{{.*}} = load {{.*}} @__profc_foo{{.*}} 0)
+; PROMO: %pgocount.promoted{{.*}} = load i64, ptr @__profc_foo, align 4
; PROMO-NEXT: add
-; PROMO-NEXT: store {{.*}}@__profc_foo{{.*}}0)
-; PROMO-NEXT: %pgocount.promoted{{.*}} = load {{.*}} @__profc_foo{{.*}} 1)
+; PROMO-NEXT: store {{.*}} @__profc_foo, align 4
+; PROMO-NEXT: %pgocount.promoted{{.*}} = load i64, ptr getelementptr inbounds ([5 x i64], ptr @__profc_foo, i32 0, i32 1), align 4
; PROMO-NEXT: add
-; PROMO-NEXT: store {{.*}}@__profc_foo{{.*}}1)
-; PROMO-NEXT: %pgocount.promoted{{.*}} = load {{.*}} @__profc_foo{{.*}} 2)
+; PROMO-NEXT: store {{.*}} ptr getelementptr inbounds ([5 x i64], ptr @__profc_foo, i32 0, i32 1), align 4
+; PROMO-NEXT: %pgocount.promoted{{.*}} = load i64, ptr getelementptr inbounds ([5 x i64], ptr @__profc_foo, i32 0, i32 2), align 4
; PROMO-NEXT: add
-; PROMO-NEXT: store {{.*}}@__profc_foo{{.*}}2)
+; PROMO-NEXT: store {{.*}} ptr getelementptr inbounds ([5 x i64], ptr @__profc_foo, i32 0, i32 2), align 4
; PROMO-NEXT: %pgocount{{.*}} = load {{.*}} @__profc_foo{{.*}} 4)
; PROMO-NEXT: add
-; PROMO-NEXT: store {{.*}}@__profc_foo{{.*}}4)
+; PROMO-NEXT: store {{.*}} ptr getelementptr inbounds ([5 x i64], ptr @__profc_foo, i32 0, i32 4), align 4
; PROMO-NOT: @__profc_foo{{.*}})
diff --git a/llvm/test/Transforms/PGOProfile/counter_promo_nest-inseltpoison.ll b/llvm/test/Transforms/PGOProfile/counter_promo_nest-inseltpoison.ll
index c8fd55606d15e..3c583fd333363 100644
--- a/llvm/test/Transforms/PGOProfile/counter_promo_nest-inseltpoison.ll
+++ b/llvm/test/Transforms/PGOProfile/counter_promo_nest-inseltpoison.ll
@@ -7,17 +7,17 @@
; Function Attrs: noinline norecurse nounwind uwtable
define void @bar() local_unnamed_addr #0 {
bb:
- %tmp2 = load i32, i32* @g, align 4, !tbaa !2
+ %tmp2 = load i32, ptr @g, align 4, !tbaa !2
%tmp3 = add nsw i32 %tmp2, 1
- store i32 %tmp3, i32* @g, align 4, !tbaa !2
+ store i32 %tmp3, ptr @g, align 4, !tbaa !2
ret void
}
; Function Attrs: norecurse nounwind uwtable
define i32 @main() local_unnamed_addr #1 {
bb:
- store i32 0, i32* @g, align 4, !tbaa !2
- %tmp = load i32, i32* @c, align 4, !tbaa !2
+ store i32 0, ptr @g, align 4, !tbaa !2
+ %tmp = load i32, ptr @c, align 4, !tbaa !2
%tmp1 = icmp sgt i32 %tmp, 0
br i1 %tmp1, label %bb2_1, label %bb84
@@ -71,7 +71,7 @@ bb20: ; preds = %bb20, %bb14
%tmp23 = add nuw i64 %tmp21, 1
tail call void @bar()
%tmp24 = add nuw nsw i32 %tmp22, 1
- %tmp25 = load i32, i32* @c, align 4, !tbaa !2
+ %tmp25 = load i32, ptr @c, align 4, !tbaa !2
%tmp26 = icmp slt i32 %tmp24, %tmp25
br i1 %tmp26, label %bb20, label %bb27
@@ -115,7 +115,7 @@ bb57: ; preds = %bb57, %bb45
%tmp60 = add nuw i64 %tmp58, 1
tail call void @bar()
%tmp61 = add nuw nsw i32 %tmp59, 1
- %tmp62 = load i32, i32* @c, align 4, !tbaa !2
+ %tmp62 = load i32, ptr @c, align 4, !tbaa !2
%tmp63 = mul nsw i32 %tmp62, 10
%tmp64 = icmp slt i32 %tmp61, %tmp63
br i1 %tmp64, label %bb57, label %bb65
@@ -138,7 +138,7 @@ bb73: ; preds = %bb73, %bb51
%tmp76 = add nuw i64 %tmp74, 1
tail call void @bar()
%tmp77 = add nuw nsw i32 %tmp75, 1
- %tmp78 = load i32, i32* @c, align 4, !tbaa !2
+ %tmp78 = load i32, ptr @c, align 4, !tbaa !2
%tmp79 = mul nsw i32 %tmp78, 100
%tmp80 = icmp slt i32 %tmp77, %tmp79
br i1 %tmp80, label %bb73, label %bb81
diff --git a/llvm/test/Transforms/PGOProfile/counter_promo_nest.ll b/llvm/test/Transforms/PGOProfile/counter_promo_nest.ll
index 76a0dccaedda4..72982a87ce0ed 100644
--- a/llvm/test/Transforms/PGOProfile/counter_promo_nest.ll
+++ b/llvm/test/Transforms/PGOProfile/counter_promo_nest.ll
@@ -7,17 +7,17 @@
; Function Attrs: noinline norecurse nounwind uwtable
define void @bar() local_unnamed_addr #0 {
bb:
- %tmp2 = load i32, i32* @g, align 4, !tbaa !2
+ %tmp2 = load i32, ptr @g, align 4, !tbaa !2
%tmp3 = add nsw i32 %tmp2, 1
- store i32 %tmp3, i32* @g, align 4, !tbaa !2
+ store i32 %tmp3, ptr @g, align 4, !tbaa !2
ret void
}
; Function Attrs: norecurse nounwind uwtable
define i32 @main() local_unnamed_addr #1 {
bb:
- store i32 0, i32* @g, align 4, !tbaa !2
- %tmp = load i32, i32* @c, align 4, !tbaa !2
+ store i32 0, ptr @g, align 4, !tbaa !2
+ %tmp = load i32, ptr @c, align 4, !tbaa !2
%tmp1 = icmp sgt i32 %tmp, 0
br i1 %tmp1, label %bb2_1, label %bb84
@@ -71,7 +71,7 @@ bb20: ; preds = %bb20, %bb14
%tmp23 = add nuw i64 %tmp21, 1
tail call void @bar()
%tmp24 = add nuw nsw i32 %tmp22, 1
- %tmp25 = load i32, i32* @c, align 4, !tbaa !2
+ %tmp25 = load i32, ptr @c, align 4, !tbaa !2
%tmp26 = icmp slt i32 %tmp24, %tmp25
br i1 %tmp26, label %bb20, label %bb27
@@ -115,7 +115,7 @@ bb57: ; preds = %bb57, %bb45
%tmp60 = add nuw i64 %tmp58, 1
tail call void @bar()
%tmp61 = add nuw nsw i32 %tmp59, 1
- %tmp62 = load i32, i32* @c, align 4, !tbaa !2
+ %tmp62 = load i32, ptr @c, align 4, !tbaa !2
%tmp63 = mul nsw i32 %tmp62, 10
%tmp64 = icmp slt i32 %tmp61, %tmp63
br i1 %tmp64, label %bb57, label %bb65
@@ -138,7 +138,7 @@ bb73: ; preds = %bb73, %bb51
%tmp76 = add nuw i64 %tmp74, 1
tail call void @bar()
%tmp77 = add nuw nsw i32 %tmp75, 1
- %tmp78 = load i32, i32* @c, align 4, !tbaa !2
+ %tmp78 = load i32, ptr @c, align 4, !tbaa !2
%tmp79 = mul nsw i32 %tmp78, 100
%tmp80 = icmp slt i32 %tmp77, %tmp79
br i1 %tmp80, label %bb73, label %bb81
diff --git a/llvm/test/Transforms/PGOProfile/counter_promo_with_bias.ll b/llvm/test/Transforms/PGOProfile/counter_promo_with_bias.ll
index bcc4459e908c6..c489a9f8eea84 100644
--- a/llvm/test/Transforms/PGOProfile/counter_promo_with_bias.ll
+++ b/llvm/test/Transforms/PGOProfile/counter_promo_with_bias.ll
@@ -6,7 +6,7 @@ target triple = "x86_64-unknown-linux-gnu"
define void @foo(i1 %c) {
entry:
-; CHECK: %[[BIAS:[0-9]+]] = load i64, i64* @__llvm_profile_counter_bias
+; CHECK: %[[BIAS:[0-9]+]] = load i64, ptr @__llvm_profile_counter_bias
br label %while.cond
while.cond: ; preds = %land.rhs, %while.cond.preheader
@@ -14,15 +14,15 @@ while.cond: ; preds = %land.rhs, %while.co
br i1 %c, label %while.cond.cleanup_crit_edge, label %land.rhs
while.cond.cleanup_crit_edge: ; preds = %while.cond
-; CHECK: %[[COUNTER_PTR:[0-9]+]] = add i64 ptrtoint ([1 x i64]* @__profc_foo to i64), %[[BIAS]]
-; CHECK: %[[COUNTER_ADDR:[0-9]+]] = inttoptr i64 %[[COUNTER_PTR]] to i64*
-; CHECK: %[[COUNTER_PROMO:[a-z0-9.]+]] = load i64, i64* %[[COUNTER_ADDR]]
+; CHECK: %[[COUNTER_PTR:[0-9]+]] = add i64 ptrtoint (ptr @__profc_foo to i64), %[[BIAS]]
+; CHECK: %[[COUNTER_ADDR:[0-9]+]] = inttoptr i64 %[[COUNTER_PTR]] to ptr
+; CHECK: %[[COUNTER_PROMO:[a-z0-9.]+]] = load i64, ptr %[[COUNTER_ADDR]]
; CHECK: %[[VALUE:[0-9]+]] = add i64 %[[COUNTER_PROMO]], %[[COUNT]]
-; CHECK: store i64 %[[VALUE]], i64* %[[COUNTER_ADDR]]
+; CHECK: store i64 %[[VALUE]], ptr %[[COUNTER_ADDR]]
br label %cleanup
land.rhs: ; preds = %while.cond
- call void @llvm.instrprof.increment(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__profn_foo, i32 0, i32 0), i64 0, i32 1, i32 0)
+ call void @llvm.instrprof.increment(ptr @__profn_foo, i64 0, i32 1, i32 0)
; CHECK: %[[LAND_COUNT]] = add i64 %[[COUNT]], 1
br label %while.cond
@@ -30,4 +30,4 @@ cleanup: ; preds = %while.cond.cleanup_
ret void
}
-declare void @llvm.instrprof.increment(i8 *, i64, i32, i32)
+declare void @llvm.instrprof.increment(ptr, i64, i32, i32)
diff --git a/llvm/test/Transforms/PGOProfile/cspgo_profile_summary.ll b/llvm/test/Transforms/PGOProfile/cspgo_profile_summary.ll
index 681ebb55fbc38..b4a27ee656133 100644
--- a/llvm/test/Transforms/PGOProfile/cspgo_profile_summary.ll
+++ b/llvm/test/Transforms/PGOProfile/cspgo_profile_summary.ll
@@ -15,9 +15,8 @@ target triple = "x86_64-unknown-linux-gnu"
define dso_local i32 @goo(i32 %n) {
entry:
%i = alloca i32, align 4
- %i.0..sroa_cast = bitcast i32* %i to i8*
- store volatile i32 %n, i32* %i, align 4
- %i.0. = load volatile i32, i32* %i, align 4
+ store volatile i32 %n, ptr %i, align 4
+ %i.0. = load volatile i32, ptr %i, align 4
ret i32 %i.0.
}
@@ -28,15 +27,15 @@ entry:
br i1 %tobool, label %if.else, label %if.then
if.then:
- %0 = load i32, i32* @odd, align 4
+ %0 = load i32, ptr @odd, align 4
%inc = add i32 %0, 1
- store i32 %inc, i32* @odd, align 4
+ store i32 %inc, ptr @odd, align 4
br label %if.end
if.else:
- %1 = load i32, i32* @even, align 4
+ %1 = load i32, ptr @even, align 4
%inc1 = add i32 %1, 1
- store i32 %inc1, i32* @even, align 4
+ store i32 %inc1, ptr @even, align 4
br label %if.end
if.end:
@@ -54,9 +53,9 @@ for.body:
br i1 %tobool2, label %for.inc, label %if.then3
if.then3:
- %2 = load i32, i32* @not_six, align 4
+ %2 = load i32, ptr @not_six, align 4
%inc4 = add i32 %2, 1
- store i32 %inc4, i32* @not_six, align 4
+ store i32 %inc4, ptr @not_six, align 4
br label %for.inc
for.inc:
@@ -67,10 +66,10 @@ for.end:
ret void
}
; PGOSUMMARY-LABEL: @bar
-; PGOSUMMARY: %even.odd = select i1 %tobool{{[0-9]*}}, i32* @even, i32* @odd
+; PGOSUMMARY: %even.odd = select i1 %tobool{{[0-9]*}}, ptr @even, ptr @odd
; PGOSUMMARY-SAME: !prof ![[BW_PGO_BAR:[0-9]+]]
; CSPGOSUMMARY-LABEL: @bar
-; CSPGOSUMMARY: %even.odd = select i1 %tobool{{[0-9]*}}, i32* @even, i32* @odd
+; CSPGOSUMMARY: %even.odd = select i1 %tobool{{[0-9]*}}, ptr @even, ptr @odd
; CSPGOSUMMARY-SAME: !prof ![[BW_CSPGO_BAR:[0-9]+]]
define internal fastcc i32 @cond(i32 %i) {
@@ -103,9 +102,9 @@ for.end:
ret void
}
; CSPGOSUMMARY-LABEL: @foo
-; CSPGOSUMMARY: %even.odd.i = select i1 %tobool.i{{[0-9]*}}, i32* @even, i32* @odd
+; CSPGOSUMMARY: %even.odd.i = select i1 %tobool.i{{[0-9]*}}, ptr @even, ptr @odd
; CSPGOSUMMARY-SAME: !prof ![[BW_CSPGO_BAR]]
-; CSPGOSUMMARY: %even.odd.i2 = select i1 %tobool.i{{[0-9]*}}, i32* @even, i32* @odd
+; CSPGOSUMMARY: %even.odd.i2 = select i1 %tobool.i{{[0-9]*}}, ptr @even, ptr @odd
; CSPGOSUMMARY-SAME: !prof ![[BW_CSPGO_BAR]]
declare dso_local i32 @bar_m(i32)
@@ -113,9 +112,9 @@ declare dso_local i32 @bar_m2(i32)
define internal fastcc void @barbar() {
entry:
- %0 = load i32, i32* @odd, align 4
+ %0 = load i32, ptr @odd, align 4
%inc = add i32 %0, 1
- store i32 %inc, i32* @odd, align 4
+ store i32 %inc, ptr @odd, align 4
ret void
}
diff --git a/llvm/test/Transforms/PGOProfile/diag_no_value_sites.ll b/llvm/test/Transforms/PGOProfile/diag_no_value_sites.ll
index 5d187ff50c88c..fd32c6b4d6dcf 100644
--- a/llvm/test/Transforms/PGOProfile/diag_no_value_sites.ll
+++ b/llvm/test/Transforms/PGOProfile/diag_no_value_sites.ll
@@ -6,10 +6,10 @@
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"
-define void @foo(i8* %dst, i8* %src, i64 %n) {
+define void @foo(ptr %dst, ptr %src, i64 %n) {
entry:
- call void @llvm.memcpy.p0i8.p0i8.i64(i8* %dst, i8* %src, i64 %n, i1 false)
+ call void @llvm.memcpy.p0.p0.i64(ptr %dst, ptr %src, i64 %n, i1 false)
ret void
}
-declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture writeonly, i8* nocapture readonly, i64, i1)
+declare void @llvm.memcpy.p0.p0.i64(ptr nocapture writeonly, ptr nocapture readonly, i64, i1)
diff --git a/llvm/test/Transforms/PGOProfile/do-not-instrument.ll b/llvm/test/Transforms/PGOProfile/do-not-instrument.ll
index f7c31b071e8a0..e7f4ba2fedbe6 100644
--- a/llvm/test/Transforms/PGOProfile/do-not-instrument.ll
+++ b/llvm/test/Transforms/PGOProfile/do-not-instrument.ll
@@ -7,10 +7,10 @@ define i32 @f1() {
; CHECK-LABEL: @f1
entry:
; CHECK: call void @llvm.instrprof.increment
-; CHECK-NOT: ptrtoint void (i8*)* asm sideeffect
+; CHECK-NOT: ptrtoint ptr asm sideeffect
; CHECK-NOT: call void @llvm.instrprof.value.profile
; CHECK: tail call void asm sideeffect
- tail call void asm sideeffect "", "imr,~{memory},~{dirflag},~{fpsr},~{flags}"(i8* undef) #0
+ tail call void asm sideeffect "", "imr,~{memory},~{dirflag},~{fpsr},~{flags}"(ptr undef) #0
ret i32 0
}
@@ -18,7 +18,7 @@ define i32 @f2() {
entry:
; CHECK: call void @llvm.instrprof.increment
; CHECK-NOT: call void @llvm.instrprof.value.profile
- call void (i32, ...) bitcast (void (...)* @foo to void (i32, ...)*)(i32 21)
+ call void (i32, ...) @foo(i32 21)
ret i32 0
}
diff --git a/llvm/test/Transforms/PGOProfile/fix_bfi.ll b/llvm/test/Transforms/PGOProfile/fix_bfi.ll
index d7ea203e5a0a7..fcfe3aa7b3a9c 100644
--- a/llvm/test/Transforms/PGOProfile/fix_bfi.ll
+++ b/llvm/test/Transforms/PGOProfile/fix_bfi.ll
@@ -5,20 +5,20 @@
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
-%struct.basket = type { %struct.arc*, i64, i64 }
-%struct.arc = type { i64, %struct.node*, %struct.node*, i32, %struct.arc*, %struct.arc*, i64, i64 }
-%struct.node = type { i64, i32, %struct.node*, %struct.node*, %struct.node*, %struct.node*, %struct.arc*, %struct.arc*, %struct.arc*, %struct.arc*, i64, i64, i32, i32 }
+%struct.basket = type { ptr, i64, i64 }
+%struct.arc = type { i64, ptr, ptr, i32, ptr, ptr, i64, i64 }
+%struct.node = type { i64, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i64, i64, i32, i32 }
- at perm = internal unnamed_addr global [351 x %struct.basket*] zeroinitializer, align 16
+ at perm = internal unnamed_addr global [351 x ptr] zeroinitializer, align 16
define dso_local void @sort_basket(i64 %min, i64 %max) {
entry:
%add = add nsw i64 %min, %max
%div = sdiv i64 %add, 2
- %arrayidx = getelementptr inbounds [351 x %struct.basket*], [351 x %struct.basket*]* @perm, i64 0, i64 %div
- %0 = load %struct.basket*, %struct.basket** %arrayidx, align 8
- %abs_cost = getelementptr inbounds %struct.basket, %struct.basket* %0, i64 0, i32 2
- %1 = load i64, i64* %abs_cost, align 8
+ %arrayidx = getelementptr inbounds [351 x ptr], ptr @perm, i64 0, i64 %div
+ %0 = load ptr, ptr %arrayidx, align 8
+ %abs_cost = getelementptr inbounds %struct.basket, ptr %0, i64 0, i32 2
+ %1 = load i64, ptr %abs_cost, align 8
br label %do.body
do.body:
@@ -28,10 +28,10 @@ do.body:
while.cond:
%l.1 = phi i64 [ %l.0, %do.body ], [ %inc, %while.body ]
- %arrayidx1 = getelementptr inbounds [351 x %struct.basket*], [351 x %struct.basket*]* @perm, i64 0, i64 %l.1
- %2 = load %struct.basket*, %struct.basket** %arrayidx1, align 8
- %abs_cost2 = getelementptr inbounds %struct.basket, %struct.basket* %2, i64 0, i32 2
- %3 = load i64, i64* %abs_cost2, align 8
+ %arrayidx1 = getelementptr inbounds [351 x ptr], ptr @perm, i64 0, i64 %l.1
+ %2 = load ptr, ptr %arrayidx1, align 8
+ %abs_cost2 = getelementptr inbounds %struct.basket, ptr %2, i64 0, i32 2
+ %3 = load i64, ptr %abs_cost2, align 8
%cmp = icmp sgt i64 %3, %1
br i1 %cmp, label %while.body, label %while.cond3
@@ -41,10 +41,10 @@ while.body:
while.cond3:
%r.1 = phi i64 [ %r.0, %while.cond ], [ %dec, %while.body7 ]
- %arrayidx4 = getelementptr inbounds [351 x %struct.basket*], [351 x %struct.basket*]* @perm, i64 0, i64 %r.1
- %4 = load %struct.basket*, %struct.basket** %arrayidx4, align 8
- %abs_cost5 = getelementptr inbounds %struct.basket, %struct.basket* %4, i64 0, i32 2
- %5 = load i64, i64* %abs_cost5, align 8
+ %arrayidx4 = getelementptr inbounds [351 x ptr], ptr @perm, i64 0, i64 %r.1
+ %4 = load ptr, ptr %arrayidx4, align 8
+ %abs_cost5 = getelementptr inbounds %struct.basket, ptr %4, i64 0, i32 2
+ %5 = load i64, ptr %abs_cost5, align 8
%cmp6 = icmp sgt i64 %1, %5
br i1 %cmp6, label %while.body7, label %while.end8
@@ -57,18 +57,16 @@ while.end8:
br i1 %cmp9, label %if.then, label %if.end
if.then:
- %6 = bitcast %struct.basket** %arrayidx1 to i64*
- %7 = load i64, i64* %6, align 8
- store %struct.basket* %4, %struct.basket** %arrayidx1, align 8
- %8 = bitcast %struct.basket** %arrayidx4 to i64*
- store i64 %7, i64* %8, align 8
+ %6 = load i64, ptr %arrayidx1, align 8
+ store ptr %4, ptr %arrayidx1, align 8
+ store i64 %6, ptr %arrayidx4, align 8
br label %if.end
if.end:
%cmp14 = icmp sgt i64 %l.1, %r.1
%not.cmp14 = xor i1 %cmp14, true
- %9 = zext i1 %not.cmp14 to i64
- %r.2 = sub i64 %r.1, %9
+ %7 = zext i1 %not.cmp14 to i64
+ %r.2 = sub i64 %r.1, %7
%not.cmp1457 = xor i1 %cmp14, true
%inc16 = zext i1 %not.cmp1457 to i64
%l.2 = add nsw i64 %l.1, %inc16
diff --git a/llvm/test/Transforms/PGOProfile/func_entry.ll b/llvm/test/Transforms/PGOProfile/func_entry.ll
index fe1b44b0bd71d..ff770d5dc035c 100644
--- a/llvm/test/Transforms/PGOProfile/func_entry.ll
+++ b/llvm/test/Transforms/PGOProfile/func_entry.ll
@@ -12,7 +12,7 @@ define void @cold() {
; CHECK-SAME: !prof ![[FUNC_ENTRY_COUNT_ZERO:[0-9]+]]
entry:
- store i32 1, i32* @s, align 4
+ store i32 1, ptr @s, align 4
ret void
}
@@ -21,9 +21,9 @@ define void @hot() {
; CHECK-SAME: #[[HOT_ATTR:[0-1]+]]
; CHECK-SAME: !prof ![[FUNC_ENTRY_COUNT_NON_ZERO:[0-9]+]]
entry:
- %0 = load i32, i32* @s, align 4
+ %0 = load i32, ptr @s, align 4
%add = add nsw i32 %0, 4
- store i32 %add, i32* @s, align 4
+ store i32 %add, ptr @s, align 4
ret void
}
@@ -33,7 +33,7 @@ define void @med() {
; CHECK-SAME: !prof ![[FUNC_ENTRY_COUNT_MED:[0-9]+]]
entry:
- store i32 1, i32* @s, align 4
+ store i32 1, ptr @s, align 4
ret void
}
diff --git a/llvm/test/Transforms/PGOProfile/icp_covariant_call_return.ll b/llvm/test/Transforms/PGOProfile/icp_covariant_call_return.ll
index 7522c70336352..4c8b650420690 100644
--- a/llvm/test/Transforms/PGOProfile/icp_covariant_call_return.ll
+++ b/llvm/test/Transforms/PGOProfile/icp_covariant_call_return.ll
@@ -3,40 +3,34 @@ 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"
%struct.D = type { %struct.B }
-%struct.B = type { i32 (...)** }
+%struct.B = type { ptr }
%struct.Base = type { i8 }
%struct.Derived = type { i8 }
-declare noalias i8* @_Znwm(i64)
-declare void @_ZN1DC2Ev(%struct.D*);
-define %struct.Derived* @_ZN1D4funcEv(%struct.D*) {
- ret %struct.Derived* null
+declare noalias ptr @_Znwm(i64)
+declare void @_ZN1DC2Ev(ptr);
+define ptr @_ZN1D4funcEv(ptr) {
+ ret ptr null
}
-define %struct.Base* @bar() {
+define ptr @bar() {
entry:
- %call = call noalias i8* @_Znwm(i64 8)
- %tmp = bitcast i8* %call to %struct.D*
- call void @_ZN1DC2Ev(%struct.D* %tmp)
- %tmp1 = bitcast %struct.D* %tmp to %struct.B*
- %tmp2 = bitcast %struct.B* %tmp1 to %struct.Base* (%struct.B*)***
- %vtable = load %struct.Base* (%struct.B*)**, %struct.Base* (%struct.B*)*** %tmp2, align 8
- %vfn = getelementptr inbounds %struct.Base* (%struct.B*)*, %struct.Base* (%struct.B*)** %vtable, i64 0
- %tmp3 = load %struct.Base* (%struct.B*)*, %struct.Base* (%struct.B*)** %vfn, align 8
-; ICALL-PROM: [[CMP:%[0-9]+]] = icmp eq %struct.Base* (%struct.B*)* %tmp3, bitcast (%struct.Derived* (%struct.D*)* @_ZN1D4funcEv to %struct.Base* (%struct.B*)*)
+ %call = call noalias ptr @_Znwm(i64 8)
+ call void @_ZN1DC2Ev(ptr %call)
+ %vtable = load ptr, ptr %call, align 8
+ %tmp3 = load ptr, ptr %vtable, align 8
+; ICALL-PROM: [[CMP:%[0-9]+]] = icmp eq ptr %tmp3, @_ZN1D4funcEv
; ICALL-PROM: br i1 [[CMP]], label %if.true.direct_targ, label %if.false.orig_indirect, !prof [[BRANCH_WEIGHT:![0-9]+]]
; ICALL-PROM:if.true.direct_targ:
-; ICALL-PROM: [[ARG_BITCAST:%[0-9]+]] = bitcast %struct.B* %tmp1 to %struct.D*
-; ICALL-PROM: [[DIRCALL_RET:%[0-9]+]] = call %struct.Derived* @_ZN1D4funcEv(%struct.D* [[ARG_BITCAST]])
-; ICALL-PROM: [[DIRCALL_RET_CAST:%[0-9]+]] = bitcast %struct.Derived* [[DIRCALL_RET]] to %struct.Base*
+; ICALL-PROM: [[DIRCALL_RET:%[0-9]+]] = call ptr @_ZN1D4funcEv(ptr %call)
; ICALL-PROM: br label %if.end.icp
; ICALL-PROM:if.false.orig_indirect:
-; ICALL-PROM: %call1 = call %struct.Base* %tmp3(%struct.B* %tmp1)
+; ICALL-PROM: %call1 = call ptr %tmp3(ptr %call)
; ICALL-PROM: br label %if.end.icp
; ICALL-PROM:if.end.icp:
-; ICALL-PROM: [[PHI_RET:%[0-9]+]] = phi %struct.Base* [ %call1, %if.false.orig_indirect ], [ [[DIRCALL_RET_CAST]], %if.true.direct_targ ]
- %call1 = call %struct.Base* %tmp3(%struct.B* %tmp1), !prof !1
- ret %struct.Base* %call1
+; ICALL-PROM: [[PHI_RET:%[0-9]+]] = phi ptr [ %call1, %if.false.orig_indirect ], [ [[DIRCALL_RET]], %if.true.direct_targ ]
+ %call1 = call ptr %tmp3(ptr %call), !prof !1
+ ret ptr %call1
}
!1 = !{!"VP", i32 0, i64 12345, i64 -3913987384944532146, i64 12345}
diff --git a/llvm/test/Transforms/PGOProfile/icp_covariant_invoke_return.ll b/llvm/test/Transforms/PGOProfile/icp_covariant_invoke_return.ll
index b29229c24c8d3..5e23c93af71d0 100644
--- a/llvm/test/Transforms/PGOProfile/icp_covariant_invoke_return.ll
+++ b/llvm/test/Transforms/PGOProfile/icp_covariant_invoke_return.ll
@@ -2,75 +2,65 @@
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"
%struct.D = type { %struct.B }
-%struct.B = type { i32 (...)** }
+%struct.B = type { ptr }
%struct.Derived = type { %struct.Base, i32 }
%struct.Base = type { i32 }
- at _ZTIi = external constant i8*
-declare i8* @_Znwm(i64)
-declare void @_ZN1DC2Ev(%struct.D*)
-define %struct.Derived* @_ZN1D4funcEv(%struct.D*) {
- ret %struct.Derived* null
+ at _ZTIi = external constant ptr
+declare ptr @_Znwm(i64)
+declare void @_ZN1DC2Ev(ptr)
+define ptr @_ZN1D4funcEv(ptr) {
+ ret ptr null
}
-declare void @_ZN1DD0Ev(%struct.D*)
-declare void @_ZdlPv(i8*)
+declare void @_ZN1DD0Ev(ptr)
+declare void @_ZdlPv(ptr)
declare i32 @__gxx_personality_v0(...)
-declare i32 @llvm.eh.typeid.for(i8*)
-declare i8* @__cxa_begin_catch(i8*)
+declare i32 @llvm.eh.typeid.for(ptr)
+declare ptr @__cxa_begin_catch(ptr)
declare void @__cxa_end_catch()
-define i32 @foo() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
+define i32 @foo() personality ptr @__gxx_personality_v0 {
entry:
- %call = invoke i8* @_Znwm(i64 8)
+ %call = invoke ptr @_Znwm(i64 8)
to label %invoke.cont unwind label %lpad
invoke.cont:
- %tmp = bitcast i8* %call to %struct.D*
- call void @_ZN1DC2Ev(%struct.D* %tmp)
- %tmp1 = bitcast %struct.D* %tmp to %struct.B*
- %tmp2 = bitcast %struct.B* %tmp1 to %struct.Base* (%struct.B*)***
- %vtable = load %struct.Base* (%struct.B*)**, %struct.Base* (%struct.B*)*** %tmp2, align 8
- %vfn = getelementptr inbounds %struct.Base* (%struct.B*)*, %struct.Base* (%struct.B*)** %vtable, i64 0
- %tmp3 = load %struct.Base* (%struct.B*)*, %struct.Base* (%struct.B*)** %vfn, align 8
-; ICALL-PROM: [[CMP:%[0-9]+]] = icmp eq %struct.Base* (%struct.B*)* %tmp3, bitcast (%struct.Derived* (%struct.D*)* @_ZN1D4funcEv to %struct.Base* (%struct.B*)*)
+ call void @_ZN1DC2Ev(ptr %call)
+ %vtable = load ptr, ptr %call, align 8
+ %tmp3 = load ptr, ptr %vtable, align 8
+; ICALL-PROM: [[CMP:%[0-9]+]] = icmp eq ptr %tmp3, @_ZN1D4funcEv
; ICALL-PROM: br i1 [[CMP]], label %if.true.direct_targ, label %if.false.orig_indirect, !prof [[BRANCH_WEIGHT:![0-9]+]]
; ICALL-PROM:if.true.direct_targ:
-; ICALL-PROM: [[ARG_BITCAST:%[0-9]+]] = bitcast %struct.B* %tmp1 to %struct.D*
-; ICALL-PROM: [[DIRCALL_RET:%[0-9]+]] = invoke %struct.Derived* @_ZN1D4funcEv(%struct.D* [[ARG_BITCAST]])
-; ICALL-PROM: to label %if.true.direct_targ.if.end.icp_crit_edge unwind label %lpad
-; ICALL-PROM:if.true.direct_targ.if.end.icp_crit_edge:
-; ICALL-PROM: [[DIRCALL_RET_CAST:%[0-9]+]] = bitcast %struct.Derived* [[DIRCALL_RET]] to %struct.Base*
-; ICALL-PROM: br label %if.end.icp
+; ICALL-PROM: [[DIRCALL_RET:%[0-9]+]] = invoke ptr @_ZN1D4funcEv(ptr %call)
+; ICALL-PROM-NEXT: to label %if.end.icp unwind label %lpad
; ICALL-PROM:if.false.orig_indirect:
-; ICAll-PROM: %call2 = invoke %struct.Base* %tmp3(%struct.B* %tmp1)
+; ICAll-PROM: %call2 = invoke ptr %tmp3(ptr %call)
; ICAll-PROM: to label %invoke.cont1 unwind label %lpad
; ICALL-PROM:if.end.icp:
; ICALL-PROM: br label %invoke.cont1
- %call2 = invoke %struct.Base* %tmp3(%struct.B* %tmp1)
+ %call2 = invoke ptr %tmp3(ptr %call)
to label %invoke.cont1 unwind label %lpad, !prof !1
invoke.cont1:
-; ICAll-PROM: [[PHI_RET:%[0-9]+]] = phi %struct.Base* [ %call2, %if.false.orig_indirect ], [ [[DIRCALL_RET_CAST]], %if.end.icp ]
-; ICAll-PROM: %isnull = icmp eq %struct.Base* [[PHI_RET]], null
- %isnull = icmp eq %struct.Base* %call2, null
+; ICAll-PROM: [[PHI_RET:%[0-9]+]] = phi ptr [ %call2, %if.false.orig_indirect ], [ [[DIRCALL_RET]], %if.end.icp ]
+; ICAll-PROM: %isnull = icmp eq ptr [[PHI_RET]], null
+ %isnull = icmp eq ptr %call2, null
br i1 %isnull, label %delete.end, label %delete.notnull
delete.notnull:
- %tmp4 = bitcast %struct.Base* %call2 to i8*
- call void @_ZdlPv(i8* %tmp4)
+ call void @_ZdlPv(ptr %call2)
br label %delete.end
delete.end:
- %isnull3 = icmp eq %struct.B* %tmp1, null
+ %isnull3 = icmp eq ptr %call, null
br i1 %isnull3, label %delete.end8, label %delete.notnull4
delete.notnull4:
- %tmp5 = bitcast %struct.B* %tmp1 to void (%struct.B*)***
- %vtable5 = load void (%struct.B*)**, void (%struct.B*)*** %tmp5, align 8
- %vfn6 = getelementptr inbounds void (%struct.B*)*, void (%struct.B*)** %vtable5, i64 2
- %tmp6 = load void (%struct.B*)*, void (%struct.B*)** %vfn6, align 8
- invoke void %tmp6(%struct.B* %tmp1)
+ %vtable5 = load ptr, ptr %call, align 8
+ %vfn6 = getelementptr inbounds ptr, ptr %vtable5, i64 2
+ %tmp6 = load ptr, ptr %vfn6, align 8
+ invoke void %tmp6(ptr %call)
to label %invoke.cont7 unwind label %lpad
invoke.cont7:
@@ -80,21 +70,20 @@ delete.end8:
br label %try.cont
lpad:
- %tmp7 = landingpad { i8*, i32 }
- catch i8* bitcast (i8** @_ZTIi to i8*)
- %tmp8 = extractvalue { i8*, i32 } %tmp7, 0
- %tmp9 = extractvalue { i8*, i32 } %tmp7, 1
+ %tmp7 = landingpad { ptr, i32 }
+ catch ptr @_ZTIi
+ %tmp8 = extractvalue { ptr, i32 } %tmp7, 0
+ %tmp9 = extractvalue { ptr, i32 } %tmp7, 1
br label %catch.dispatch
catch.dispatch:
- %tmp10 = call i32 @llvm.eh.typeid.for(i8* bitcast (i8** @_ZTIi to i8*))
+ %tmp10 = call i32 @llvm.eh.typeid.for(ptr @_ZTIi)
%matches = icmp eq i32 %tmp9, %tmp10
br i1 %matches, label %catch, label %eh.resume
catch:
- %tmp11 = call i8* @__cxa_begin_catch(i8* %tmp8)
- %tmp12 = bitcast i8* %tmp11 to i32*
- %tmp13 = load i32, i32* %tmp12, align 4
+ %tmp11 = call ptr @__cxa_begin_catch(ptr %tmp8)
+ %tmp13 = load i32, ptr %tmp11, align 4
call void @__cxa_end_catch()
br label %try.cont
@@ -102,9 +91,9 @@ try.cont:
ret i32 0
eh.resume:
- %lpad.val = insertvalue { i8*, i32 } undef, i8* %tmp8, 0
- %lpad.val11 = insertvalue { i8*, i32 } %lpad.val, i32 %tmp9, 1
- resume { i8*, i32 } %lpad.val11
+ %lpad.val = insertvalue { ptr, i32 } undef, ptr %tmp8, 0
+ %lpad.val11 = insertvalue { ptr, i32 } %lpad.val, i32 %tmp9, 1
+ resume { ptr, i32 } %lpad.val11
}
!1 = !{!"VP", i32 0, i64 12345, i64 -3913987384944532146, i64 12345}
diff --git a/llvm/test/Transforms/PGOProfile/icp_invoke.ll b/llvm/test/Transforms/PGOProfile/icp_invoke.ll
index 0ca4be125290e..04fc012c8458a 100644
--- a/llvm/test/Transforms/PGOProfile/icp_invoke.ll
+++ b/llvm/test/Transforms/PGOProfile/icp_invoke.ll
@@ -2,9 +2,9 @@
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 foo1 = global void ()* null, align 8
- at foo2 = global i32 ()* null, align 8
- at _ZTIi = external constant i8*
+ at foo1 = global ptr null, align 8
+ at foo2 = global ptr null, align 8
+ at _ZTIi = external constant ptr
define internal void @_ZL4bar1v() !PGOFuncName !0 {
entry:
@@ -16,10 +16,10 @@ entry:
ret i32 100
}
-define i32 @_Z3goov() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
+define i32 @_Z3goov() personality ptr @__gxx_personality_v0 {
entry:
- %tmp = load void ()*, void ()** @foo1, align 8
-; ICP: [[CMP_IC1:%[0-9]+]] = icmp eq void ()* %tmp, @_ZL4bar1v
+ %tmp = load ptr, ptr @foo1, align 8
+; ICP: [[CMP_IC1:%[0-9]+]] = icmp eq ptr %tmp, @_ZL4bar1v
; ICP: br i1 [[CMP_IC1]], label %[[TRUE_LABEL_IC1:.*]], label %[[FALSE_LABEL_IC1:.*]], !prof [[BRANCH_WEIGHT:![0-9]+]]
; ICP:[[TRUE_LABEL_IC1]]:
; ICP: invoke void @_ZL4bar1v()
@@ -32,22 +32,22 @@ entry:
; ICP: br label %try.cont
lpad:
- %tmp1 = landingpad { i8*, i32 }
- catch i8* bitcast (i8** @_ZTIi to i8*)
- %tmp2 = extractvalue { i8*, i32 } %tmp1, 0
- %tmp3 = extractvalue { i8*, i32 } %tmp1, 1
- %tmp4 = tail call i32 @llvm.eh.typeid.for(i8* bitcast (i8** @_ZTIi to i8*))
+ %tmp1 = landingpad { ptr, i32 }
+ catch ptr @_ZTIi
+ %tmp2 = extractvalue { ptr, i32 } %tmp1, 0
+ %tmp3 = extractvalue { ptr, i32 } %tmp1, 1
+ %tmp4 = tail call i32 @llvm.eh.typeid.for(ptr @_ZTIi)
%matches = icmp eq i32 %tmp3, %tmp4
br i1 %matches, label %catch, label %eh.resume
catch:
- %tmp5 = tail call i8* @__cxa_begin_catch(i8* %tmp2)
+ %tmp5 = tail call ptr @__cxa_begin_catch(ptr %tmp2)
tail call void @__cxa_end_catch()
br label %try.cont
try.cont:
- %tmp6 = load i32 ()*, i32 ()** @foo2, align 8
-; ICP: [[CMP_IC2:%[0-9]+]] = icmp eq i32 ()* %tmp6, @_ZL4bar2v
+ %tmp6 = load ptr, ptr @foo2, align 8
+; ICP: [[CMP_IC2:%[0-9]+]] = icmp eq ptr %tmp6, @_ZL4bar2v
; ICP: br i1 [[CMP_IC2]], label %[[TRUE_LABEL_IC2:.*]], label %[[FALSE_LABEL_IC2:.*]], !prof [[BRANCH_WEIGHT:![0-9]+]]
; ICP:[[TRUE_LABEL_IC2]]:
; ICP: [[RESULT_IC2_0:%[0-9]+]] = invoke i32 @_ZL4bar2v()
@@ -62,16 +62,16 @@ try.cont:
; ICP: [[MERGE_PHI:%.+]] = phi i32 [ [[RESULT_IC2_1]], %[[FALSE_LABEL_IC2]] ], [ [[RESULT_IC2_0]], %[[TRUE_LABEL_IC2]] ]
; ICP: br label %try.cont8
lpad1:
- %tmp7 = landingpad { i8*, i32 }
- catch i8* bitcast (i8** @_ZTIi to i8*)
- %tmp8 = extractvalue { i8*, i32 } %tmp7, 0
- %tmp9 = extractvalue { i8*, i32 } %tmp7, 1
- %tmp10 = tail call i32 @llvm.eh.typeid.for(i8* bitcast (i8** @_ZTIi to i8*))
+ %tmp7 = landingpad { ptr, i32 }
+ catch ptr @_ZTIi
+ %tmp8 = extractvalue { ptr, i32 } %tmp7, 0
+ %tmp9 = extractvalue { ptr, i32 } %tmp7, 1
+ %tmp10 = tail call i32 @llvm.eh.typeid.for(ptr @_ZTIi)
%matches5 = icmp eq i32 %tmp9, %tmp10
br i1 %matches5, label %catch6, label %eh.resume
catch6:
- %tmp11 = tail call i8* @__cxa_begin_catch(i8* %tmp8)
+ %tmp11 = tail call ptr @__cxa_begin_catch(ptr %tmp8)
tail call void @__cxa_end_catch()
br label %try.cont8
@@ -82,17 +82,17 @@ try.cont8:
eh.resume:
%ehselector.slot.0 = phi i32 [ %tmp9, %lpad1 ], [ %tmp3, %lpad ]
- %exn.slot.0 = phi i8* [ %tmp8, %lpad1 ], [ %tmp2, %lpad ]
- %lpad.val = insertvalue { i8*, i32 } undef, i8* %exn.slot.0, 0
- %lpad.val11 = insertvalue { i8*, i32 } %lpad.val, i32 %ehselector.slot.0, 1
- resume { i8*, i32 } %lpad.val11
+ %exn.slot.0 = phi ptr [ %tmp8, %lpad1 ], [ %tmp2, %lpad ]
+ %lpad.val = insertvalue { ptr, i32 } undef, ptr %exn.slot.0, 0
+ %lpad.val11 = insertvalue { ptr, i32 } %lpad.val, i32 %ehselector.slot.0, 1
+ resume { ptr, i32 } %lpad.val11
}
declare i32 @__gxx_personality_v0(...)
-declare i32 @llvm.eh.typeid.for(i8*)
+declare i32 @llvm.eh.typeid.for(ptr)
-declare i8* @__cxa_begin_catch(i8*)
+declare ptr @__cxa_begin_catch(ptr)
declare void @__cxa_end_catch()
diff --git a/llvm/test/Transforms/PGOProfile/icp_invoke_nouse.ll b/llvm/test/Transforms/PGOProfile/icp_invoke_nouse.ll
index ee052e4fada57..9eb7b962ce736 100644
--- a/llvm/test/Transforms/PGOProfile/icp_invoke_nouse.ll
+++ b/llvm/test/Transforms/PGOProfile/icp_invoke_nouse.ll
@@ -2,8 +2,8 @@
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 _ZTISt9exception = external constant i8*
- at pfptr = global i32()* null, align 8
+ at _ZTISt9exception = external constant ptr
+ at pfptr = global ptr null, align 8
define internal i32 @_ZL4bar1v() !PGOFuncName !0 {
entry:
@@ -11,14 +11,14 @@ entry:
}
; Function Attrs: uwtable
-define i32 @_Z3fooi(i32 %x) local_unnamed_addr personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
+define i32 @_Z3fooi(i32 %x) local_unnamed_addr personality ptr @__gxx_personality_v0 {
entry:
%tobool = icmp eq i32 %x, 0
br i1 %tobool, label %if.end, label %cleanup
if.end: ; preds = %entry
- %fptr = load i32 ()*, i32 ()** @pfptr, align 8
-; ICP: [[CMP_IC1:%[0-9]+]] = icmp eq i32 ()* %fptr, @_ZL4bar1v
+ %fptr = load ptr, ptr @pfptr, align 8
+; ICP: [[CMP_IC1:%[0-9]+]] = icmp eq ptr %fptr, @_ZL4bar1v
; ICP: br i1 [[CMP_IC1]], label %[[TRUE_LABEL_IC1:.*]], label %[[FALSE_LABEL_IC1:.*]], !prof [[BRANCH_WEIGHT:![0-9]+]]
; ICP:[[TRUE_LABEL_IC1]]:
; ICP: invoke i32 @_ZL4bar1v()
@@ -31,17 +31,17 @@ if.end: ; preds = %entry
; ICP: br label %cleanup
lpad: ; preds = %if.end
- %0 = landingpad { i8*, i32 }
+ %0 = landingpad { ptr, i32 }
cleanup
- catch i8* bitcast (i8** @_ZTISt9exception to i8*)
- %1 = extractvalue { i8*, i32 } %0, 1
- %2 = tail call i32 @llvm.eh.typeid.for(i8* bitcast (i8** @_ZTISt9exception to i8*))
+ catch ptr @_ZTISt9exception
+ %1 = extractvalue { ptr, i32 } %0, 1
+ %2 = tail call i32 @llvm.eh.typeid.for(ptr @_ZTISt9exception)
%matches = icmp eq i32 %1, %2
br i1 %matches, label %catch, label %ehcleanup
catch: ; preds = %lpad
- %3 = extractvalue { i8*, i32 } %0, 0
- %4 = tail call i8* @__cxa_begin_catch(i8* %3)
+ %3 = extractvalue { ptr, i32 } %0, 0
+ %4 = tail call ptr @__cxa_begin_catch(ptr %3)
tail call void @__cxa_end_catch()
br label %cleanup
@@ -50,7 +50,7 @@ cleanup: ; preds = %catch, %if.end, %en
ret i32 0
ehcleanup: ; preds = %lpad
- resume { i8*, i32 } %0
+ resume { ptr, i32 } %0
}
declare i32 @_Z3barv() local_unnamed_addr
@@ -58,9 +58,9 @@ declare i32 @_Z3barv() local_unnamed_addr
declare i32 @__gxx_personality_v0(...)
; Function Attrs: nounwind readnone
-declare i32 @llvm.eh.typeid.for(i8*)
+declare i32 @llvm.eh.typeid.for(ptr)
-declare i8* @__cxa_begin_catch(i8*) local_unnamed_addr
+declare ptr @__cxa_begin_catch(ptr) local_unnamed_addr
declare void @__cxa_end_catch() local_unnamed_addr
diff --git a/llvm/test/Transforms/PGOProfile/icp_mismatch_msg.ll b/llvm/test/Transforms/PGOProfile/icp_mismatch_msg.ll
index 7b20eb8023b44..a81fb364a6f7a 100644
--- a/llvm/test/Transforms/PGOProfile/icp_mismatch_msg.ll
+++ b/llvm/test/Transforms/PGOProfile/icp_mismatch_msg.ll
@@ -7,9 +7,9 @@
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 foo = common global i32 ()* null, align 8
- at foo2 = common global i32 ()* null, align 8
- at foo3 = common global i32 ()* null, align 8
+ at foo = common global ptr null, align 8
+ at foo2 = common global ptr null, align 8
+ at foo3 = common global ptr null, align 8
define i32 @func4(i32 %i) {
entry:
@@ -23,12 +23,12 @@ entry:
define i32 @bar() {
entry:
- %tmp = load i32 ()*, i32 ()** @foo, align 8
+ %tmp = load ptr, ptr @foo, align 8
%call = call i32 %tmp(), !prof !1
- %tmp2 = load i32 ()*, i32 ()** @foo2, align 8
+ %tmp2 = load ptr, ptr @foo2, align 8
%call1 = call i32 %tmp2(), !prof !2
%add = add nsw i32 %call1, %call
- %tmp3 = load i32 ()*, i32 ()** @foo3, align 8
+ %tmp3 = load ptr, ptr @foo3, align 8
%call2 = call i32 %tmp3(), !prof !3
%add2 = add nsw i32 %add, %call2
ret i32 %add2
diff --git a/llvm/test/Transforms/PGOProfile/icp_sample.ll b/llvm/test/Transforms/PGOProfile/icp_sample.ll
index 2653c638b6d25..7d65a2c9f97a4 100644
--- a/llvm/test/Transforms/PGOProfile/icp_sample.ll
+++ b/llvm/test/Transforms/PGOProfile/icp_sample.ll
@@ -1,15 +1,15 @@
; RUN: opt -passes=pgo-icall-prom -icp-samplepgo -S < %s | FileCheck %s
-define i32* @_Z3fooPi(i32* readnone returned) {
- ret i32* %0
+define ptr @_Z3fooPi(ptr readnone returned) {
+ ret ptr %0
}
; CHECK-LABEL: _Z3barPFPiS_E
; CHECK: if.true.direct_targ
-; CHECK: call i32* @_Z3fooPi
-define i32* @_Z3barPFPiS_E(i32* (i32*)* nocapture) {
- %2 = tail call i32* %0(i32* null), !prof !33
- ret i32* %2
+; CHECK: call ptr @_Z3fooPi
+define ptr @_Z3barPFPiS_E(ptr nocapture) {
+ %2 = tail call ptr %0(ptr null), !prof !33
+ ret ptr %2
}
!llvm.module.flags = !{!3}
diff --git a/llvm/test/Transforms/PGOProfile/icp_vararg.ll b/llvm/test/Transforms/PGOProfile/icp_vararg.ll
index 7204549e69c00..26e04ffe5daf7 100644
--- a/llvm/test/Transforms/PGOProfile/icp_vararg.ll
+++ b/llvm/test/Transforms/PGOProfile/icp_vararg.ll
@@ -2,7 +2,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 foo = common global i32 (i32, ...)* null, align 8
+ at foo = common global ptr null, align 8
define i32 @va_func(i32 %num, ...) {
entry:
@@ -11,8 +11,8 @@ entry:
define i32 @bar() #1 {
entry:
- %tmp = load i32 (i32, ...)*, i32 (i32, ...)** @foo, align 8
-; ICALL-PROM: [[CMP:%[0-9]+]] = icmp eq i32 (i32, ...)* %tmp, @va_func
+ %tmp = load ptr, ptr @foo, align 8
+; ICALL-PROM: [[CMP:%[0-9]+]] = icmp eq ptr %tmp, @va_func
; ICALL-PROM: br i1 [[CMP]], label %if.true.direct_targ, label %if.false.orig_indirect, !prof [[BRANCH_WEIGHT:![0-9]+]]
; ICALL-PROM:if.true.direct_targ:
; ICALL-PROM: [[DIRCALL_RET:%[0-9]+]] = call i32 (i32, ...) @va_func(i32 3, i32 12, i32 22, i32 4)
diff --git a/llvm/test/Transforms/PGOProfile/icp_vararg_sret.ll b/llvm/test/Transforms/PGOProfile/icp_vararg_sret.ll
index b3c845912567a..ac7068b6294fc 100644
--- a/llvm/test/Transforms/PGOProfile/icp_vararg_sret.ll
+++ b/llvm/test/Transforms/PGOProfile/icp_vararg_sret.ll
@@ -8,7 +8,7 @@ entry:
}
%struct = type { i32 }
- at func_ptr = common global void (i32, %struct*)* null, align 8
+ at func_ptr = common global ptr null, align 8
define void @test() {
; Even though value profiling suggests @va_func is the call target, don't do
@@ -20,8 +20,8 @@ define void @test() {
; CHECK: ret void
%s = alloca %struct
- %tmp = load void (i32, %struct*)*, void (i32, %struct*)** @func_ptr, align 8
- call void %tmp(i32 1, %struct* sret(%struct) %s), !prof !1
+ %tmp = load ptr, ptr @func_ptr, align 8
+ call void %tmp(i32 1, ptr sret(%struct) %s), !prof !1
ret void
}
diff --git a/llvm/test/Transforms/PGOProfile/indirect_call_annotation.ll b/llvm/test/Transforms/PGOProfile/indirect_call_annotation.ll
index af95ae575ebb1..6f8b26fa6ae20 100644
--- a/llvm/test/Transforms/PGOProfile/indirect_call_annotation.ll
+++ b/llvm/test/Transforms/PGOProfile/indirect_call_annotation.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 foo = common global i32 (i32)* null, align 8
+ at foo = common global ptr null, align 8
define i32 @func1(i32 %x) {
entry:
@@ -24,7 +24,7 @@ entry:
define i32 @bar(i32 %i) {
entry:
- %tmp = load i32 (i32)*, i32 (i32)** @foo, align 8
+ %tmp = load ptr, ptr @foo, align 8
%call = call i32 %tmp(i32 %i)
; VP-ANNOTATION: %call = call i32 %tmp(i32 %i)
; VP-ANNOTATION-SAME: !prof ![[VP:[0-9]+]]
diff --git a/llvm/test/Transforms/PGOProfile/indirect_call_profile.ll b/llvm/test/Transforms/PGOProfile/indirect_call_profile.ll
index 0d9eaf8fcd573..db633807f4e78 100644
--- a/llvm/test/Transforms/PGOProfile/indirect_call_profile.ll
+++ b/llvm/test/Transforms/PGOProfile/indirect_call_profile.ll
@@ -8,7 +8,7 @@ target triple = "x86_64-unknown-linux-gnu"
$novp_inline = comdat any
$vp_inline = comdat any
- at bar = external global void ()*, align 8
+ at bar = external global ptr, align 8
; GEN: @__profn_novp_inline = linkonce_odr hidden constant [11 x i8] c"novp_inline"
; GEN: @__profn_foo = private constant [3 x i8] c"foo"
@@ -17,14 +17,14 @@ $vp_inline = comdat any
;; Test that a linkonce function's address is recorded.
;; We allow a linkonce profd to be private if the function does not use value profiling.
; LOWER: @__profd_novp_inline.[[HASH:[0-9]+]] = private global {{.*}} @__profc_novp_inline.[[HASH]]
-; LOWER-SAME: i8* bitcast (void ()* @novp_inline to i8*)
+; LOWER-SAME: ptr @novp_inline
; LOWER: @__profd_foo = private {{.*}} @__profc_foo
;; __profd_vp_inline.[[#]] is referenced by code and may be referenced by other
;; text sections due to inlining. It can't be local because a linker error would
;; occur if a prevailing text section references the non-prevailing local symbol.
; LOWER: @__profd_vp_inline.[[FOO_HASH:[0-9]+]] = linkonce_odr hidden {{.*}} @__profc_vp_inline.[[FOO_HASH]]
-; LOWER-SAME: i8* bitcast (void ()* @vp_inline to i8*)
+; LOWER-SAME: ptr @vp_inline
define linkonce_odr void @novp_inline() comdat {
ret void
@@ -34,11 +34,11 @@ define void @foo() {
entry:
; GEN: @foo()
; GEN: entry:
-; GEN-NEXT: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__profn_foo, i32 0, i32 0), i64 [[#FOO_HASH:]], i32 1, i32 0)
- %tmp = load void ()*, void ()** @bar, align 8
-; GEN: [[ICALL_TARGET:%[0-9]+]] = ptrtoint void ()* %tmp to i64
-; GEN-NEXT: call void @llvm.instrprof.value.profile(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__profn_foo, i32 0, i32 0), i64 [[#FOO_HASH]], i64 [[ICALL_TARGET]], i32 0, i32 0)
-; LOWER: call void @__llvm_profile_instrument_target(i64 %1, i8* bitcast ({ i64, i64, i64, i8*, i8*, i32, [2 x i16] }* @__profd_foo to i8*), i32 0)
+; GEN-NEXT: call void @llvm.instrprof.increment(ptr @__profn_foo, i64 [[#FOO_HASH:]], i32 1, i32 0)
+ %tmp = load ptr, ptr @bar, align 8
+; GEN: [[ICALL_TARGET:%[0-9]+]] = ptrtoint ptr %tmp to i64
+; GEN-NEXT: call void @llvm.instrprof.value.profile(ptr @__profn_foo, i64 [[#FOO_HASH]], i64 [[ICALL_TARGET]], i32 0, i32 0)
+; LOWER: call void @__llvm_profile_instrument_target(i64 %1, ptr @__profd_foo, i32 0)
call void %tmp()
ret void
}
@@ -47,37 +47,37 @@ define linkonce_odr void @vp_inline() comdat {
entry:
; GEN: @vp_inline()
; GEN: entry:
-; GEN-NEXT: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__profn_vp_inline, i32 0, i32 0), i64 [[#FOO_HASH:]], i32 1, i32 0)
- %tmp = load void ()*, void ()** @bar, align 8
-; GEN: [[ICALL_TARGET:%[0-9]+]] = ptrtoint void ()* %tmp to i64
-; GEN-NEXT: call void @llvm.instrprof.value.profile(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__profn_vp_inline, i32 0, i32 0), i64 [[#FOO_HASH]], i64 [[ICALL_TARGET]], i32 0, i32 0)
-; LOWER: call void @__llvm_profile_instrument_target(i64 %1, i8* bitcast ({ i64, i64, i64, i8*, i8*, i32, [2 x i16] }* @__profd_vp_inline.[[#]] to i8*), i32 0)
+; GEN-NEXT: call void @llvm.instrprof.increment(ptr @__profn_vp_inline, i64 [[#FOO_HASH:]], i32 1, i32 0)
+ %tmp = load ptr, ptr @bar, align 8
+; GEN: [[ICALL_TARGET:%[0-9]+]] = ptrtoint ptr %tmp to i64
+; GEN-NEXT: call void @llvm.instrprof.value.profile(ptr @__profn_vp_inline, i64 [[#FOO_HASH]], i64 [[ICALL_TARGET]], i32 0, i32 0)
+; LOWER: call void @__llvm_profile_instrument_target(i64 %1, ptr @__profd_vp_inline.[[#]], i32 0)
call void %tmp()
ret void
}
- at bar2 = global void ()* null, align 8
- at _ZTIi = external constant i8*
+ at bar2 = global ptr null, align 8
+ at _ZTIi = external constant ptr
-define i32 @foo2(i32 %arg, i8** nocapture readnone %arg1) personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
+define i32 @foo2(i32 %arg, ptr nocapture readnone %arg1) personality ptr @__gxx_personality_v0 {
bb:
- %tmp2 = load void ()*, void ()** @bar2, align 8
+ %tmp2 = load ptr, ptr @bar2, align 8
invoke void %tmp2()
to label %bb10 unwind label %bb2
-; GEN: [[ICALL_TARGET2:%[0-9]+]] = ptrtoint void ()* %tmp2 to i64
-; GEN-NEXT: call void @llvm.instrprof.value.profile(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @__profn_foo2, i32 0, i32 0), i64 [[FOO2_HASH:[0-9]+]], i64 [[ICALL_TARGET2]], i32 0, i32 0)
+; GEN: [[ICALL_TARGET2:%[0-9]+]] = ptrtoint ptr %tmp2 to i64
+; GEN-NEXT: call void @llvm.instrprof.value.profile(ptr @__profn_foo2, i64 [[FOO2_HASH:[0-9]+]], i64 [[ICALL_TARGET2]], i32 0, i32 0)
bb2: ; preds = %bb
- %tmp3 = landingpad { i8*, i32 }
- catch i8* bitcast (i8** @_ZTIi to i8*)
- %tmp4 = extractvalue { i8*, i32 } %tmp3, 1
- %tmp5 = tail call i32 @llvm.eh.typeid.for(i8* bitcast (i8** @_ZTIi to i8*))
+ %tmp3 = landingpad { ptr, i32 }
+ catch ptr @_ZTIi
+ %tmp4 = extractvalue { ptr, i32 } %tmp3, 1
+ %tmp5 = tail call i32 @llvm.eh.typeid.for(ptr @_ZTIi)
%tmp6 = icmp eq i32 %tmp4, %tmp5
br i1 %tmp6, label %bb7, label %bb11
bb7: ; preds = %bb2
- %tmp8 = extractvalue { i8*, i32 } %tmp3, 0
- %tmp9 = tail call i8* @__cxa_begin_catch(i8* %tmp8)
+ %tmp8 = extractvalue { ptr, i32 } %tmp3, 0
+ %tmp9 = tail call ptr @__cxa_begin_catch(ptr %tmp8)
tail call void @__cxa_end_catch()
br label %bb10
@@ -85,15 +85,15 @@ bb10: ; preds = %bb7, %bb
ret i32 0
bb11: ; preds = %bb2
- resume { i8*, i32 } %tmp3
+ resume { ptr, i32 } %tmp3
}
declare i32 @__gxx_personality_v0(...)
; Function Attrs: nounwind readnone
-declare i32 @llvm.eh.typeid.for(i8*) #0
+declare i32 @llvm.eh.typeid.for(ptr) #0
-declare i8* @__cxa_begin_catch(i8*)
+declare ptr @__cxa_begin_catch(ptr)
declare void @__cxa_end_catch()
diff --git a/llvm/test/Transforms/PGOProfile/indirect_call_profile_funclet.ll b/llvm/test/Transforms/PGOProfile/indirect_call_profile_funclet.ll
index 390eebae83a8b..42018e4d5e54d 100644
--- a/llvm/test/Transforms/PGOProfile/indirect_call_profile_funclet.ll
+++ b/llvm/test/Transforms/PGOProfile/indirect_call_profile_funclet.ll
@@ -33,8 +33,8 @@
; }
; }
-%class.base = type { i32 (...)**, i32 }
-define dso_local void @"?run@@YAXPEAVbase@@H at Z"(%class.base* %b, i32 %count) personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
+%class.base = type { ptr, i32 }
+define dso_local void @"?run@@YAXPEAVbase@@H at Z"(ptr %b, i32 %count) personality ptr @__CxxFrameHandler3 {
entry:
invoke void @"?may_throw@@YAXH at Z"(i32 %count)
to label %try.cont unwind label %catch.dispatch
@@ -43,11 +43,10 @@ catch.dispatch: ; preds = %entry
%tmp = catchswitch within none [label %catch] unwind to caller
catch: ; preds = %catch.dispatch
- %tmp1 = catchpad within %tmp [i8* null, i32 64, i8* null]
- %tmp2 = bitcast %class.base* %b to void (%class.base*)***
- %vtable = load void (%class.base*)**, void (%class.base*)*** %tmp2, align 8
- %tmp3 = load void (%class.base*)*, void (%class.base*)** %vtable, align 8
- call void %tmp3(%class.base* %b) [ "funclet"(token %tmp1) ]
+ %tmp1 = catchpad within %tmp [ptr null, i32 64, ptr null]
+ %vtable = load ptr, ptr %b, align 8
+ %tmp3 = load ptr, ptr %vtable, align 8
+ call void %tmp3(ptr %b) [ "funclet"(token %tmp1) ]
catchret from %tmp1 to label %try.cont
try.cont: ; preds = %catch, %entry
diff --git a/llvm/test/Transforms/PGOProfile/indirect_call_promotion.ll b/llvm/test/Transforms/PGOProfile/indirect_call_promotion.ll
index 5b293224e5dd6..3b0e3250cd6df 100644
--- a/llvm/test/Transforms/PGOProfile/indirect_call_promotion.ll
+++ b/llvm/test/Transforms/PGOProfile/indirect_call_promotion.ll
@@ -15,7 +15,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 foo = common global i32 ()* null, align 8
+ at foo = common global ptr null, align 8
define i32 @func1() {
entry:
@@ -39,8 +39,8 @@ entry:
define i32 @bar() {
entry:
- %tmp = load i32 ()*, i32 ()** @foo, align 8
-; ICALL-PROM: [[CMP:%[0-9]+]] = icmp eq i32 ()* %tmp, @func4
+ %tmp = load ptr, ptr @foo, align 8
+; ICALL-PROM: [[CMP:%[0-9]+]] = icmp eq ptr %tmp, @func4
; ICALL-PROM: br i1 [[CMP]], label %if.true.direct_targ, label %if.false.orig_indirect, !prof [[BRANCH_WEIGHT:![0-9]+]]
; ICALL-PROM: if.true.direct_targ:
; ICALL-PROM: [[DIRCALL_RET:%[0-9]+]] = call i32 @func4()
diff --git a/llvm/test/Transforms/PGOProfile/indirect_call_promotion_byval.ll b/llvm/test/Transforms/PGOProfile/indirect_call_promotion_byval.ll
index a0aa75b7a0426..6272a80b00a14 100644
--- a/llvm/test/Transforms/PGOProfile/indirect_call_promotion_byval.ll
+++ b/llvm/test/Transforms/PGOProfile/indirect_call_promotion_byval.ll
@@ -9,38 +9,34 @@ target triple = "i686-unknown-linux-gnu"
%struct.Foo.1 = type { i32 }
%struct.Foo.2 = type { i32 }
- at foo = common global i32 (%struct.Foo.2*)* null, align 8
+ at foo = common global ptr null, align 8
-define i32 @func4(%struct.Foo.1* byval(%struct.Foo.1) %p) {
+define i32 @func4(ptr byval(%struct.Foo.1) %p) {
entry:
- %gep = getelementptr inbounds %struct.Foo.1, %struct.Foo.1* %p, i32 0, i32 0
- %v = load i32, i32* %gep
+ %v = load i32, ptr %p
ret i32 %v
}
-define i32 @func5(%struct.Foo.1* byval(%struct.Foo.1) %p) {
+define i32 @func5(ptr byval(%struct.Foo.1) %p) {
entry:
- %gep = getelementptr inbounds %struct.Foo.1, %struct.Foo.1* %p, i32 0, i32 0
- %v = load i32, i32* %gep
+ %v = load i32, ptr %p
ret i32 %v
}
-define i32 @bar(%struct.Foo.2* %f2) {
+define i32 @bar(ptr %f2) {
entry:
- %tmp = load i32 (%struct.Foo.2*)*, i32 (%struct.Foo.2*)** @foo, align 8
- %call = call i32 %tmp(%struct.Foo.2* byval(%struct.Foo.2) %f2), !prof !1
+ %tmp = load ptr, ptr @foo, align 8
+ %call = call i32 %tmp(ptr byval(%struct.Foo.2) %f2), !prof !1
ret i32 %call
}
!1 = !{!"VP", i32 0, i64 3000, i64 7651369219802541373, i64 1000, i64 3667884930908592509, i64 1000}
-; CHECK: define i32 @bar(%struct.Foo.2* %f2)
-; Cast %struct.Foo.2* to %struct.Foo.1* and use byval(%struct.Foo.2).
-; CHECK: %[[cast:[^ ]*]] = bitcast %struct.Foo.2* %f2 to %struct.Foo.1*
-; CHECK: call i32 @func4(%struct.Foo.1* byval(%struct.Foo.1) %[[cast]])
+; CHECK: define i32 @bar(ptr %f2)
+; Use byval(%struct.Foo.2).
+; CHECK: call i32 @func4(ptr byval(%struct.Foo.2) %f2)
; Same but when callee doesn't have explicit byval type.
-; CHECK: %[[cast:[^ ]*]] = bitcast %struct.Foo.2* %f2 to %struct.Foo.1*
-; CHECK: call i32 @func5(%struct.Foo.1* byval(%struct.Foo.1) %[[cast]])
+; CHECK: call i32 @func5(ptr byval(%struct.Foo.2) %f2)
; Original call stays the same.
-; CHECK: call i32 %tmp(%struct.Foo.2* byval(%struct.Foo.2) %f2)
+; CHECK: call i32 %tmp(ptr byval(%struct.Foo.2) %f2)
diff --git a/llvm/test/Transforms/PGOProfile/indirect_call_promotion_musttail.ll b/llvm/test/Transforms/PGOProfile/indirect_call_promotion_musttail.ll
index 8425eae583840..128ab158d249b 100644
--- a/llvm/test/Transforms/PGOProfile/indirect_call_promotion_musttail.ll
+++ b/llvm/test/Transforms/PGOProfile/indirect_call_promotion_musttail.ll
@@ -3,67 +3,64 @@
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 foo = common global i32* ()* null, align 8
+ at foo = common global ptr null, align 8
-define i32* @func1() {
- ret i32* null
+define ptr @func1() {
+ ret ptr null
}
-define i32* @func2() {
- ret i32* null
+define ptr @func2() {
+ ret ptr null
}
-define i32* @func3() {
- ret i32* null
+define ptr @func3() {
+ ret ptr null
}
-define i32* @func4() {
- ret i32* null
+define ptr @func4() {
+ ret ptr null
}
-define i32* @bar() {
+define ptr @bar() {
entry:
- %tmp = load i32* ()*, i32* ()** @foo, align 8
-; ICALL-PROM: [[CMP1:%[0-9]+]] = icmp eq i32* ()* %tmp, @func4
+ %tmp = load ptr, ptr @foo, align 8
+; ICALL-PROM: [[CMP1:%[0-9]+]] = icmp eq ptr %tmp, @func4
; ICALL-PROM: br i1 [[CMP1]], label %if.true.direct_targ, label %[[L1:[0-9]+]], !prof [[BRANCH_WEIGHT1:![0-9]+]]
; ICALL-PROM: if.true.direct_targ:
-; ICALL-PROM: [[DIRCALL_RET1:%[0-9]+]] = musttail call i32* @func4()
-; ICALL-PROM: ret i32* [[DIRCALL_RET1]]
+; ICALL-PROM: [[DIRCALL_RET1:%[0-9]+]] = musttail call ptr @func4()
+; ICALL-PROM: ret ptr [[DIRCALL_RET1]]
; ICALL-PROM: [[L1]]:
-; ICALL-PROM: [[CMP2:%[0-9]+]] = icmp eq i32* ()* %tmp, @func2
+; ICALL-PROM: [[CMP2:%[0-9]+]] = icmp eq ptr %tmp, @func2
; ICALL-PROM: br i1 [[CMP2]], label %if.true.direct_targ1, label %[[L2:[0-9]+]], !prof [[BRANCH_WEIGHT2:![0-9]+]]
; ICALL-PROM: if.true.direct_targ1:
-; ICALL-PROM: [[DIRCALL_RET2:%[0-9]+]] = musttail call i32* @func2()
-; ICALL-PROM: ret i32* [[DIRCALL_RET2]]
+; ICALL-PROM: [[DIRCALL_RET2:%[0-9]+]] = musttail call ptr @func2()
+; ICALL-PROM: ret ptr [[DIRCALL_RET2]]
; ICALL-PROM: [[L2]]:
-; ICALL-PROM: [[CMP3:%[0-9]+]] = icmp eq i32* ()* %tmp, @func3
+; ICALL-PROM: [[CMP3:%[0-9]+]] = icmp eq ptr %tmp, @func3
; ICALL-PROM: br i1 [[CMP3]], label %if.true.direct_targ2, label %[[L3:[0-9]+]], !prof [[BRANCH_WEIGHT3:![0-9]+]]
; ICALL-PROM: if.true.direct_targ2:
-; ICALL-PROM: [[DIRCALL_RET3:%[0-9]+]] = musttail call i32* @func3()
-; ICALL-PROM: ret i32* [[DIRCALL_RET3]]
+; ICALL-PROM: [[DIRCALL_RET3:%[0-9]+]] = musttail call ptr @func3()
+; ICALL-PROM: ret ptr [[DIRCALL_RET3]]
; ICALL-PROM: [[L3]]:
-; ICALL-PROM: %call = musttail call i32* %tmp()
-; ICALL-PROM: ret i32* %call
- %call = musttail call i32* %tmp(), !prof !1
- ret i32* %call
+; ICALL-PROM: %call = musttail call ptr %tmp()
+; ICALL-PROM: ret ptr %call
+ %call = musttail call ptr %tmp(), !prof !1
+ ret ptr %call
}
-define i64* @bar2() {
+define ptr @bar2() {
entry:
- %tmp = load i32* ()*, i32* ()** @foo, align 8
-; ICALL-PROM: [[CMP1:%[0-9]+]] = icmp eq i32* ()* %tmp, @func4
+ %tmp = load ptr, ptr @foo, align 8
+; ICALL-PROM: [[CMP1:%[0-9]+]] = icmp eq ptr %tmp, @func4
; ICALL-PROM: br i1 [[CMP1]], label %if.true.direct_targ, label %[[L4:[0-9]+]], !prof [[BRANCH_WEIGHT4:![0-9]+]]
; ICALL-PROM: if.true.direct_targ:
-; ICALL-PROM: [[DIRCALL_RET1:%[0-9]+]] = musttail call i32* @func4()
-; ICALL-PROM: [[DIRCALL_RET2:%[0-9]+]] = bitcast i32* [[DIRCALL_RET1]] to i64*
-; ICALL-PROM: ret i64* [[DIRCALL_RET2]]
+; ICALL-PROM: [[DIRCALL_RET1:%[0-9]+]] = musttail call ptr @func4()
+; ICALL-PROM: ret ptr [[DIRCALL_RET1]]
; ICALL-PROM: [[L4]]:
-; ICALL-PROM: %call = musttail call i32* %tmp()
-; ICALL-PROM: %rv = bitcast i32* %call to i64*
-; ICALL-PROM: ret i64* %rv
- %call = musttail call i32* %tmp(), !prof !2
- %rv = bitcast i32* %call to i64*
- ret i64* %rv
+; ICALL-PROM: %call = musttail call ptr %tmp()
+; ICALL-PROM: ret ptr %call
+ %call = musttail call ptr %tmp(), !prof !2
+ ret ptr %call
}
!1 = !{!"VP", i32 0, i64 1600, i64 7651369219802541373, i64 1030, i64 -4377547752858689819, i64 410, i64 -6929281286627296573, i64 150, i64 -2545542355363006406, i64 10}
diff --git a/llvm/test/Transforms/PGOProfile/indirect_call_promotion_unique.ll b/llvm/test/Transforms/PGOProfile/indirect_call_promotion_unique.ll
index b41afc0d04dbc..2c51d6a47b65f 100644
--- a/llvm/test/Transforms/PGOProfile/indirect_call_promotion_unique.ll
+++ b/llvm/test/Transforms/PGOProfile/indirect_call_promotion_unique.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 foo = common global i32 ()* null, align 8
+ at foo = common global ptr null, align 8
; The names on the IR and in the profile are both "func1".
define i32 @func1() {
@@ -13,8 +13,8 @@ entry:
define i32 @bar1() {
entry:
- %tmp1 = load i32 ()*, i32 ()** @foo, align 8
-; CHECK: icmp eq i32 ()* %tmp1, @func1
+ %tmp1 = load ptr, ptr @foo, align 8
+; CHECK: icmp eq ptr %tmp1, @func1
%call = call i32 %tmp1(), !prof !1
ret i32 %call
}
@@ -28,8 +28,8 @@ entry:
define i32 @bar2() {
entry:
- %tmp2 = load i32 ()*, i32 ()** @foo, align 8
-; CHECK: icmp eq i32 ()* %tmp2, @func2.llvm.10895321227755557127
+ %tmp2 = load ptr, ptr @foo, align 8
+; CHECK: icmp eq ptr %tmp2, @func2.llvm.10895321227755557127
%call = call i32 %tmp2(), !prof !2
ret i32 %call
}
@@ -43,8 +43,8 @@ entry:
define i32 @bar3() {
entry:
- %tmp3 = load i32 ()*, i32 ()** @foo, align 8
-; CHECK: icmp eq i32 ()* %tmp3, @func3.__uniq.258901567653530696343884446915951489119
+ %tmp3 = load ptr, ptr @foo, align 8
+; CHECK: icmp eq ptr %tmp3, @func3.__uniq.258901567653530696343884446915951489119
%call = call i32 %tmp3(), !prof !3
ret i32 %call
}
@@ -60,8 +60,8 @@ entry:
define i32 @bar4() {
entry:
- %tmp4 = load i32 ()*, i32 ()** @foo, align 8
-; CHECK: icmp eq i32 ()* %tmp4, @func4.__uniq.140291095734751150107370763113257199296.llvm.10650195578168450516
+ %tmp4 = load ptr, ptr @foo, align 8
+; CHECK: icmp eq ptr %tmp4, @func4.__uniq.140291095734751150107370763113257199296.llvm.10650195578168450516
%call = call i32 %tmp4(), !prof !4
ret i32 %call
}
@@ -77,8 +77,8 @@ entry:
define i32 @bar5() {
entry:
- %tmp5 = load i32 ()*, i32 ()** @foo, align 8
-; CHECK: icmp eq i32 ()* %tmp5, @func5.__uniq.127882361580787111523790444488985774976.part.818292359123831.llvm.10650195578168450516
+ %tmp5 = load ptr, ptr @foo, align 8
+; CHECK: icmp eq ptr %tmp5, @func5.__uniq.127882361580787111523790444488985774976.part.818292359123831.llvm.10650195578168450516
%call = call i32 %tmp5(), !prof !5
ret i32 %call
}
diff --git a/llvm/test/Transforms/PGOProfile/indirect_call_promotion_vla.ll b/llvm/test/Transforms/PGOProfile/indirect_call_promotion_vla.ll
index a6d85c241d3cd..c4c525a0a1992 100644
--- a/llvm/test/Transforms/PGOProfile/indirect_call_promotion_vla.ll
+++ b/llvm/test/Transforms/PGOProfile/indirect_call_promotion_vla.ll
@@ -5,22 +5,22 @@ target triple = "x86_64-unknown-linux-gnu"
%struct.A = type { i8 }
%struct.B = type { i8 }
- at foo = common global i32 (%struct.A*, ...)* null, align 8
+ at foo = common global ptr null, align 8
-define i32 @func1(%struct.B* %x, ...) {
+define i32 @func1(ptr %x, ...) {
entry:
ret i32 0
}
-define i32 @bar(%struct.A* %x) {
+define i32 @bar(ptr %x) {
entry:
- %tmp = load i32 (%struct.A*, ...)*, i32 (%struct.A*, ...)** @foo, align 8
-; CHECK: [[CMP:%[0-9]+]] = icmp eq i32 (%struct.A*, ...)* %tmp, bitcast (i32 (%struct.B*, ...)* @func1 to i32 (%struct.A*, ...)*)
+ %tmp = load ptr, ptr @foo, align 8
+; CHECK: [[CMP:%[0-9]+]] = icmp eq ptr %tmp, @func1
; CHECK: br i1 [[CMP]], label %if.true.direct_targ, label %if.false.orig_indirect, !prof [[BRANCH_WEIGHT:![0-9]+]]
; CHECK: if.true.direct_targ:
-; CHECK: [[DIRCALL_RET:%[0-9]+]] = call i32 (%struct.B*, ...) @func1
+; CHECK: [[DIRCALL_RET:%[0-9]+]] = call i32 (ptr, ...) @func1
; CHECK: br label %if.end.icp
- %call = call i32 (%struct.A*, ...) %tmp(%struct.A* %x, i32 0), !prof !1
+ %call = call i32 (ptr, ...) %tmp(ptr %x, i32 0), !prof !1
ret i32 %call
}
diff --git a/llvm/test/Transforms/PGOProfile/indirectbr.ll b/llvm/test/Transforms/PGOProfile/indirectbr.ll
index 04c02b11c5e89..c51d5cc0477cd 100644
--- a/llvm/test/Transforms/PGOProfile/indirectbr.ll
+++ b/llvm/test/Transforms/PGOProfile/indirectbr.ll
@@ -9,7 +9,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 foo.table = internal unnamed_addr constant [3 x i8*] [i8* blockaddress(@foo, %return), i8* blockaddress(@foo, %label2), i8* blockaddress(@foo, %label3)], align 16
+ at foo.table = internal unnamed_addr constant [3 x ptr] [ptr blockaddress(@foo, %return), ptr blockaddress(@foo, %label2), ptr blockaddress(@foo, %label3)], align 16
define i32 @foo(i32 %i) {
entry:
@@ -18,10 +18,10 @@ entry:
if.then:
%idxprom = zext i32 %i to i64
- %arrayidx = getelementptr inbounds [3 x i8*], [3 x i8*]* @foo.table, i64 0, i64 %idxprom
- %0 = load i8*, i8** %arrayidx, align 8
- indirectbr i8* %0, [label %return, label %label2, label %label3]
-; USE: indirectbr i8* %0, [label %return, label %label2, label %label3]
+ %arrayidx = getelementptr inbounds [3 x ptr], ptr @foo.table, i64 0, i64 %idxprom
+ %0 = load ptr, ptr %arrayidx, align 8
+ indirectbr ptr %0, [label %return, label %label2, label %label3]
+; USE: indirectbr ptr %0, [label %return, label %label2, label %label3]
; USE-SAME: !prof ![[BW_INDBR:[0-9]+]]
; USE: ![[BW_INDBR]] = !{!"branch_weights", i32 63, i32 20, i32 5}
diff --git a/llvm/test/Transforms/PGOProfile/infinite_loop.ll b/llvm/test/Transforms/PGOProfile/infinite_loop.ll
index 09bfbdc11566e..9fdb3bfe921f3 100644
--- a/llvm/test/Transforms/PGOProfile/infinite_loop.ll
+++ b/llvm/test/Transforms/PGOProfile/infinite_loop.ll
@@ -8,14 +8,14 @@ entry:
br label %while.body
while.body: ; preds = %entry, %while.body
- call void @llvm.instrprof.increment(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__profn_foo, i32 0, i32 0), i64 14813359968, i32 1, i32 0)
+ call void @llvm.instrprof.increment(ptr @__profn_foo, i64 14813359968, i32 1, i32 0)
call void (...) @bar() #2
br label %while.body
}
declare void @bar(...)
-declare void @llvm.instrprof.increment(i8*, i64, i32, i32) #0
+declare void @llvm.instrprof.increment(ptr, i64, i32, i32) #0
attributes #0 = { nounwind }
diff --git a/llvm/test/Transforms/PGOProfile/irreducible.ll b/llvm/test/Transforms/PGOProfile/irreducible.ll
index 0f29f856a00c8..fa06db35e02c9 100644
--- a/llvm/test/Transforms/PGOProfile/irreducible.ll
+++ b/llvm/test/Transforms/PGOProfile/irreducible.ll
@@ -63,13 +63,13 @@ for.end: ; preds = %for.cond2
- at targets = local_unnamed_addr global [256 x i8*] zeroinitializer, align 16
+ at targets = local_unnamed_addr global [256 x ptr] zeroinitializer, align 16
@tracing = local_unnamed_addr global i32 0, align 4
; Function Attrs: noinline norecurse nounwind uwtable
-define i32 @_Z11irreduciblePh(i8* nocapture readonly %p) {
+define i32 @_Z11irreduciblePh(ptr nocapture readonly %p) {
entry:
- %0 = load i32, i32* @tracing, align 4
+ %0 = load i32, ptr @tracing, align 4
%1 = trunc i32 %0 to i8
%tobool = icmp eq i32 %0, 0
br label %for.cond1
@@ -125,10 +125,10 @@ exit: ; preds = %sw.bb15, %sw.bb
indirectgoto: ; preds = %if.then18, %if.then
%idxprom21 = zext i32 %0 to i64
- %arrayidx22 = getelementptr inbounds [256 x i8*], [256 x i8*]* @targets, i64 0, i64 %idxprom21
- %target = load i8*, i8** %arrayidx22, align 8
- indirectbr i8* %target, [label %unknown_op, label %sw.bb, label %TARGET_1, label %TARGET_2]
-; USE: indirectbr i8* %target, [label %unknown_op, label %sw.bb, label %TARGET_1, label %TARGET_2], !prof !{{[0-9]+}},
+ %arrayidx22 = getelementptr inbounds [256 x ptr], ptr @targets, i64 0, i64 %idxprom21
+ %target = load ptr, ptr %arrayidx22, align 8
+ indirectbr ptr %target, [label %unknown_op, label %sw.bb, label %TARGET_1, label %TARGET_2]
+; USE: indirectbr ptr %target, [label %unknown_op, label %sw.bb, label %TARGET_1, label %TARGET_2], !prof !{{[0-9]+}},
; USE-SAME: !irr_loop ![[INDIRECTGOTO_IRR_LOOP:[0-9]+]]
}
diff --git a/llvm/test/Transforms/PGOProfile/landingpad.ll b/llvm/test/Transforms/PGOProfile/landingpad.ll
index ced3063f850a1..1b2648fc2ff64 100644
--- a/llvm/test/Transforms/PGOProfile/landingpad.ll
+++ b/llvm/test/Transforms/PGOProfile/landingpad.ll
@@ -9,7 +9,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"
@val = global i32 0, align 4
- at _ZTIi = external constant i8*
+ at _ZTIi = external constant ptr
; GEN: $__llvm_profile_raw_version = comdat any
; GEN: @__llvm_profile_raw_version = constant i64 {{[0-9]+}}, comdat
; GEN: @__profn_bar = private constant [3 x i8] c"bar"
@@ -18,7 +18,7 @@ target triple = "x86_64-unknown-linux-gnu"
define i32 @bar(i32 %i) {
entry:
; GEN: entry:
-; GEN: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__profn_bar, i32 0, i32 0), i64 {{[0-9]+}}, i32 2, i32 0)
+; GEN: call void @llvm.instrprof.increment(ptr @__profn_bar, i64 {{[0-9]+}}, i32 2, i32 0)
%rem = srem i32 %i, 3
%tobool = icmp ne i32 %rem, 0
br i1 %tobool, label %if.then, label %if.end
@@ -27,11 +27,10 @@ entry:
if.then:
; GEN: if.then:
-; GEN: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__profn_bar, i32 0, i32 0), i64 {{[0-9]+}}, i32 2, i32 1)
- %exception = call i8* @__cxa_allocate_exception(i64 4)
- %tmp = bitcast i8* %exception to i32*
- store i32 %i, i32* %tmp, align 16
- call void @__cxa_throw(i8* %exception, i8* bitcast (i8** @_ZTIi to i8*), i8* null)
+; GEN: call void @llvm.instrprof.increment(ptr @__profn_bar, i64 {{[0-9]+}}, i32 2, i32 1)
+ %exception = call ptr @__cxa_allocate_exception(i64 4)
+ store i32 %i, ptr %exception, align 16
+ call void @__cxa_throw(ptr %exception, ptr @_ZTIi, ptr null)
unreachable
if.end:
@@ -41,15 +40,15 @@ if.end:
ret i32 0
}
-declare i8* @__cxa_allocate_exception(i64)
+declare ptr @__cxa_allocate_exception(i64)
-declare void @__cxa_throw(i8*, i8*, i8*)
+declare void @__cxa_throw(ptr, ptr, ptr)
-define i32 @foo(i32 %i) personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
+define i32 @foo(i32 %i) personality ptr @__gxx_personality_v0 {
entry:
; GEN: entry:
; NOTENTRY-NOT: call void @llvm.instrprof.increment
-; ENTRY: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__profn_foo, i32 0, i32 0), i64 {{[0-9]+}}, i32 4, i32 0)
+; ENTRY: call void @llvm.instrprof.increment(ptr @__profn_foo, i64 {{[0-9]+}}, i32 4, i32 0)
%rem = srem i32 %i, 2
%tobool = icmp ne i32 %rem, 0
br i1 %tobool, label %if.then, label %if.end
@@ -65,22 +64,22 @@ if.then:
invoke.cont:
; GEN: invoke.cont:
-; GEN: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__profn_foo, i32 0, i32 0), i64 {{[0-9]+}}, i32 4, i32 1)
+; GEN: call void @llvm.instrprof.increment(ptr @__profn_foo, i64 {{[0-9]+}}, i32 4, i32 1)
br label %if.end
lpad:
; GEN: lpad:
; GEN-NOT: call void @llvm.instrprof.increment
- %tmp = landingpad { i8*, i32 }
- catch i8* bitcast (i8** @_ZTIi to i8*)
- %tmp1 = extractvalue { i8*, i32 } %tmp, 0
- %tmp2 = extractvalue { i8*, i32 } %tmp, 1
+ %tmp = landingpad { ptr, i32 }
+ catch ptr @_ZTIi
+ %tmp1 = extractvalue { ptr, i32 } %tmp, 0
+ %tmp2 = extractvalue { ptr, i32 } %tmp, 1
br label %catch.dispatch
catch.dispatch:
; GEN: catch.dispatch:
; GEN-NOT: call void @llvm.instrprof.increment
- %tmp3 = call i32 @llvm.eh.typeid.for(i8* bitcast (i8** @_ZTIi to i8*))
+ %tmp3 = call i32 @llvm.eh.typeid.for(ptr @_ZTIi)
%matches = icmp eq i32 %tmp2, %tmp3
br i1 %matches, label %catch, label %eh.resume
; USE: br i1 %matches, label %catch, label %eh.resume
@@ -88,13 +87,12 @@ catch.dispatch:
catch:
; GEN: catch:
-; GEN: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__profn_foo, i32 0, i32 0), i64 {{[0-9]+}}, i32 4, i32 2)
- %tmp4 = call i8* @__cxa_begin_catch(i8* %tmp1)
- %tmp5 = bitcast i8* %tmp4 to i32*
- %tmp6 = load i32, i32* %tmp5, align 4
- %tmp7 = load i32, i32* @val, align 4
+; GEN: call void @llvm.instrprof.increment(ptr @__profn_foo, i64 {{[0-9]+}}, i32 4, i32 2)
+ %tmp4 = call ptr @__cxa_begin_catch(ptr %tmp1)
+ %tmp6 = load i32, ptr %tmp4, align 4
+ %tmp7 = load i32, ptr @val, align 4
%sub = sub nsw i32 %tmp7, %tmp6
- store i32 %sub, i32* @val, align 4
+ store i32 %sub, ptr @val, align 4
call void @__cxa_end_catch()
br label %try.cont
@@ -105,26 +103,26 @@ try.cont:
if.end:
; GEN: if.end:
-; NOTENTRY: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__profn_foo, i32 0, i32 0), i64 {{[0-9]+}}, i32 4, i32 0)
+; NOTENTRY: call void @llvm.instrprof.increment(ptr @__profn_foo, i64 {{[0-9]+}}, i32 4, i32 0)
; ENTRY-NOT: call void @llvm.instrprof.increment
- %tmp8 = load i32, i32* @val, align 4
+ %tmp8 = load i32, ptr @val, align 4
%add = add nsw i32 %tmp8, %i
- store i32 %add, i32* @val, align 4
+ store i32 %add, ptr @val, align 4
br label %try.cont
eh.resume:
; GEN: eh.resume:
-; GEN: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__profn_foo, i32 0, i32 0), i64 {{[0-9]+}}, i32 4, i32 3)
- %lpad.val = insertvalue { i8*, i32 } undef, i8* %tmp1, 0
- %lpad.val3 = insertvalue { i8*, i32 } %lpad.val, i32 %tmp2, 1
- resume { i8*, i32 } %lpad.val3
+; GEN: call void @llvm.instrprof.increment(ptr @__profn_foo, i64 {{[0-9]+}}, i32 4, i32 3)
+ %lpad.val = insertvalue { ptr, i32 } undef, ptr %tmp1, 0
+ %lpad.val3 = insertvalue { ptr, i32 } %lpad.val, i32 %tmp2, 1
+ resume { ptr, i32 } %lpad.val3
}
declare i32 @__gxx_personality_v0(...)
-declare i32 @llvm.eh.typeid.for(i8*)
+declare i32 @llvm.eh.typeid.for(ptr)
-declare i8* @__cxa_begin_catch(i8*)
+declare ptr @__cxa_begin_catch(ptr)
declare void @__cxa_end_catch()
diff --git a/llvm/test/Transforms/PGOProfile/memcpy.ll b/llvm/test/Transforms/PGOProfile/memcpy.ll
index 4eab21e4b91d6..ac67fd9fcbc51 100644
--- a/llvm/test/Transforms/PGOProfile/memcpy.ll
+++ b/llvm/test/Transforms/PGOProfile/memcpy.ll
@@ -2,7 +2,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"
-define void @foo(i8* %dst, i8* %src, i32* %a, i32 %n) {
+define void @foo(ptr %dst, ptr %src, ptr %a, i32 %n) {
entry:
br label %for.cond
@@ -14,16 +14,16 @@ for.cond:
for.cond1:
%j.0 = phi i32 [ %inc, %for.body3 ], [ 0, %for.cond ]
%idx.ext = sext i32 %i.0 to i64
- %add.ptr = getelementptr inbounds i32, i32* %a, i64 %idx.ext
- %0 = load i32, i32* %add.ptr, align 4
+ %add.ptr = getelementptr inbounds i32, ptr %a, i64 %idx.ext
+ %0 = load i32, ptr %add.ptr, align 4
%cmp2 = icmp slt i32 %j.0, %0
%add = add nsw i32 %i.0, 1
br i1 %cmp2, label %for.body3, label %for.cond
for.body3:
%conv = sext i32 %add to i64
-; CHECK: call void @__llvm_profile_instrument_memop(i64 %conv, i8* bitcast ({ i64, i64, i64, i8*, i8*, i32, [2 x i16] }* @__profd_foo to i8*), i32 0)
- call void @llvm.memcpy.p0i8.p0i8.i64(i8* %dst, i8* %src, i64 %conv, i1 false)
+; CHECK: call void @__llvm_profile_instrument_memop(i64 %conv, ptr @__profd_foo, i32 0)
+ call void @llvm.memcpy.p0.p0.i64(ptr %dst, ptr %src, i64 %conv, i1 false)
%inc = add nsw i32 %j.0, 1
br label %for.cond1
@@ -31,4 +31,4 @@ for.end6:
ret void
}
-declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture writeonly, i8* nocapture readonly, i64, i1)
+declare void @llvm.memcpy.p0.p0.i64(ptr nocapture writeonly, ptr nocapture readonly, i64, i1)
diff --git a/llvm/test/Transforms/PGOProfile/memop_clone.ll b/llvm/test/Transforms/PGOProfile/memop_clone.ll
index 3aa6f56a0817c..d822513d037ba 100644
--- a/llvm/test/Transforms/PGOProfile/memop_clone.ll
+++ b/llvm/test/Transforms/PGOProfile/memop_clone.ll
@@ -1,26 +1,26 @@
; RUN: opt < %s -passes=pgo-memop-opt -verify-dom-info -S | FileCheck %s
-define i32 @test(i8* %a, i8* %b) !prof !1 {
+define i32 @test(ptr %a, ptr %b) !prof !1 {
; CHECK-LABEL: test
; CHECK: MemOP.Case.3:
-; CHECK: tail call void @llvm.memcpy.p0i8.p0i8.i32(i8* undef, i8* %a, i32 3, i1 false)
+; CHECK: tail call void @llvm.memcpy.p0.p0.i32(ptr undef, ptr %a, i32 3, i1 false)
; CHECK: MemOP.Case.2:
-; CHECK: tail call void @llvm.memcpy.p0i8.p0i8.i32(i8* undef, i8* %a, i32 2, i1 false)
+; CHECK: tail call void @llvm.memcpy.p0.p0.i32(ptr undef, ptr %a, i32 2, i1 false)
; CHECK: MemOP.Default:
-; CHECK: tail call void @llvm.memcpy.p0i8.p0i8.i32(i8* undef, i8* %a, i32 undef, i1 false)
+; CHECK: tail call void @llvm.memcpy.p0.p0.i32(ptr undef, ptr %a, i32 undef, i1 false)
; CHECK: MemOP.Case.33:
-; CHECK: tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* undef, i8* %b, i64 3, i1 false)
+; CHECK: tail call void @llvm.memcpy.p0.p0.i64(ptr undef, ptr %b, i64 3, i1 false)
; CHECK: MemOP.Case.24:
-; CHECK: tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* undef, i8* %b, i64 2, i1 false)
+; CHECK: tail call void @llvm.memcpy.p0.p0.i64(ptr undef, ptr %b, i64 2, i1 false)
; CHECK: MemOP.Default2:
-; CHECK: tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* undef, i8* %b, i64 undef, i1 false)
- tail call void @llvm.memcpy.p0i8.p0i8.i32(i8* undef, i8* %a, i32 undef, i1 false), !prof !2
- tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* undef, i8* %b, i64 undef, i1 false), !prof !2
+; CHECK: tail call void @llvm.memcpy.p0.p0.i64(ptr undef, ptr %b, i64 undef, i1 false)
+ tail call void @llvm.memcpy.p0.p0.i32(ptr undef, ptr %a, i32 undef, i1 false), !prof !2
+ tail call void @llvm.memcpy.p0.p0.i64(ptr undef, ptr %b, i64 undef, i1 false), !prof !2
unreachable
}
-declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture writeonly, i8* nocapture readonly, i32, i1)
-declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture writeonly, i8* nocapture readonly, i64, i1)
+declare void @llvm.memcpy.p0.p0.i32(ptr nocapture writeonly, ptr nocapture readonly, i32, i1)
+declare void @llvm.memcpy.p0.p0.i64(ptr nocapture writeonly, ptr nocapture readonly, i64, i1)
!1 = !{!"function_entry_count", i64 5170}
!2 = !{!"VP", i32 1, i64 2585, i64 3, i64 1802, i64 2, i64 783}
diff --git a/llvm/test/Transforms/PGOProfile/memop_hash.ll b/llvm/test/Transforms/PGOProfile/memop_hash.ll
index 602ab98a8f951..0f40678996109 100644
--- a/llvm/test/Transforms/PGOProfile/memop_hash.ll
+++ b/llvm/test/Transforms/PGOProfile/memop_hash.ll
@@ -3,15 +3,15 @@
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"
-declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture writeonly, i8* nocapture readonly, i32, i1)
+declare void @llvm.memcpy.p0.p0.i32(ptr nocapture writeonly, ptr nocapture readonly, i32, i1)
-define i64 @foo1(i8* %a, i8* %b, i32 %s) {
+define i64 @foo1(ptr %a, ptr %b, i32 %s) {
entry:
- call void @llvm.memcpy.p0i8.p0i8.i32(i8* %a, i8* %b, i32 %s, i1 false);
+ call void @llvm.memcpy.p0.p0.i32(ptr %a, ptr %b, i32 %s, i1 false);
ret i64 0
}
-define i64 @foo2(i8* %a, i8* %b, i32 %s) {
+define i64 @foo2(ptr %a, ptr %b, i32 %s) {
entry:
ret i64 0
}
@@ -19,6 +19,6 @@ entry:
; The two hashes should not be equal as the existence of the memcpy should change the hash.
;
; CHECK: @foo1
-; CHECK: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @__profn_foo1, i32 0, i32 0), i64 [[FOO1_HASH:[0-9]+]], i32 1, i32 0)
+; CHECK: call void @llvm.instrprof.increment(ptr @__profn_foo1, i64 [[FOO1_HASH:[0-9]+]], i32 1, i32 0)
; CHECK: @foo2
-; CHECK-NOT: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @__profn_foo2, i32 0, i32 0), i64 [[FOO1_HASH]], i32 1, i32 0)
+; CHECK-NOT: call void @llvm.instrprof.increment(ptr @__profn_foo2, i64 [[FOO1_HASH]], i32 1, i32 0)
diff --git a/llvm/test/Transforms/PGOProfile/memop_profile_funclet.ll b/llvm/test/Transforms/PGOProfile/memop_profile_funclet.ll
index 56e502781e700..0e85afc1d7307 100644
--- a/llvm/test/Transforms/PGOProfile/memop_profile_funclet.ll
+++ b/llvm/test/Transforms/PGOProfile/memop_profile_funclet.ll
@@ -32,7 +32,7 @@ $"??_C at _0BC@CABPINND at Exception?5caught?$AA?$AA@" = comdat any
@"?msg@@3PADA" = dso_local global [200 x i8] zeroinitializer, align 16
@"??_C at _0BC@CABPINND at Exception?5caught?$AA?$AA@" = linkonce_odr dso_local unnamed_addr constant [18 x i8] c"0123456789012345\00\00", comdat, align 1
-define dso_local void @"?run@@YAXH at Z"(i32 %count) personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
+define dso_local void @"?run@@YAXH at Z"(i32 %count) personality ptr @__CxxFrameHandler3 {
entry:
invoke void @"?may_throw@@YAXH at Z"(i32 %count)
to label %try.cont unwind label %catch.dispatch
@@ -41,14 +41,14 @@ catch.dispatch: ; preds = %entry
%tmp = catchswitch within none [label %catch] unwind to caller
catch: ; preds = %catch.dispatch
- %tmp1 = catchpad within %tmp [i8* null, i32 64, i8* null]
- %tmp2 = load i32, i32* @"?len@@3IA", align 4
+ %tmp1 = catchpad within %tmp [ptr null, i32 64, ptr null]
+ %tmp2 = load i32, ptr @"?len@@3IA", align 4
%conv = zext i32 %tmp2 to i64
- call void @llvm.memcpy.p0i8.p0i8.i64(
- i8* getelementptr inbounds ([200 x i8], [200 x i8]* @"?msg@@3PADA", i64 0, i64 0),
- i8* getelementptr inbounds ([18 x i8], [18 x i8]* @"??_C at _0BC@CABPINND at Exception?5caught?$AA?$AA@", i64 0, i64 0),
+ call void @llvm.memcpy.p0.p0.i64(
+ ptr @"?msg@@3PADA",
+ ptr @"??_C at _0BC@CABPINND at Exception?5caught?$AA?$AA@",
i64 %conv, i1 false)
- call void @_CxxThrowException(i8* null, %eh.ThrowInfo* null) #3 [ "funclet"(token %tmp1) ]
+ call void @_CxxThrowException(ptr null, ptr null) #3 [ "funclet"(token %tmp1) ]
unreachable
try.cont: ; preds = %entry
@@ -66,5 +66,5 @@ try.cont: ; preds = %entry
declare dso_local void @"?may_throw@@YAXH at Z"(i32)
declare dso_local i32 @__CxxFrameHandler3(...)
-declare void @llvm.memcpy.p0i8.p0i8.i64(i8*, i8*, i64, i1)
-declare dso_local void @_CxxThrowException(i8*, %eh.ThrowInfo*)
+declare void @llvm.memcpy.p0.p0.i64(ptr, ptr, i64, i1)
+declare dso_local void @_CxxThrowException(ptr, ptr)
diff --git a/llvm/test/Transforms/PGOProfile/memop_size_annotation.ll b/llvm/test/Transforms/PGOProfile/memop_size_annotation.ll
index ebf91715e118d..3ef185a28cc5f 100644
--- a/llvm/test/Transforms/PGOProfile/memop_size_annotation.ll
+++ b/llvm/test/Transforms/PGOProfile/memop_size_annotation.ll
@@ -5,7 +5,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"
-define void @foo(i8* %dst, i8* %src, i32* %a, i32 %n) {
+define void @foo(ptr %dst, ptr %src, ptr %a, i32 %n) {
entry:
br label %for.cond
@@ -20,22 +20,22 @@ for.body:
for.cond1:
%j.0 = phi i32 [ 0, %for.body ], [ %inc, %for.inc ]
%idx.ext = sext i32 %i.0 to i64
- %add.ptr = getelementptr inbounds i32, i32* %a, i64 %idx.ext
- %0 = load i32, i32* %add.ptr, align 4
+ %add.ptr = getelementptr inbounds i32, ptr %a, i64 %idx.ext
+ %0 = load i32, ptr %add.ptr, align 4
%cmp2 = icmp slt i32 %j.0, %0
br i1 %cmp2, label %for.body3, label %for.end
for.body3:
%add = add nsw i32 %i.0, 1
%conv = sext i32 %add to i64
- call void @llvm.memcpy.p0i8.p0i8.i64(i8* %dst, i8* %src, i64 %conv, i1 false)
-; MEMOP_ANNOTATION: call void @llvm.memcpy.p0i8.p0i8.i64(i8* %dst, i8* %src, i64 %conv, i1 false)
+ call void @llvm.memcpy.p0.p0.i64(ptr %dst, ptr %src, i64 %conv, i1 false)
+; MEMOP_ANNOTATION: call void @llvm.memcpy.p0.p0.i64(ptr %dst, ptr %src, i64 %conv, i1 false)
; MEMOP_ANNOTATION-SAME: !prof ![[MEMOP_VALUESITE:[0-9]+]]
- %memcmp = call i32 @memcmp(i8* %dst, i8* %src, i64 %conv)
-; MEMOP_ANNOTATION: call i32 @memcmp(i8* %dst, i8* %src, i64 %conv)
+ %memcmp = call i32 @memcmp(ptr %dst, ptr %src, i64 %conv)
+; MEMOP_ANNOTATION: call i32 @memcmp(ptr %dst, ptr %src, i64 %conv)
; MEMOP_ANNOTATION-SAME: !prof ![[MEMOP_VALUESITE]]
- %bcmp = call i32 @bcmp(i8* %dst, i8* %src, i64 %conv)
-; MEMOP_ANNOTATION: call i32 @bcmp(i8* %dst, i8* %src, i64 %conv)
+ %bcmp = call i32 @bcmp(ptr %dst, ptr %src, i64 %conv)
+; MEMOP_ANNOTATION: call i32 @bcmp(ptr %dst, ptr %src, i64 %conv)
; MEMOP_ANNOTATION-SAME: !prof ![[MEMOP_VALUESITE]]
; MEMOP_ANNOTATION9: ![[MEMOP_VALUESITE]] = !{!"VP", i32 1, i64 556, i64 1, i64 99, i64 2, i64 88, i64 3, i64 77, i64 9, i64 72, i64 4, i64 66, i64 5, i64 55, i64 6, i64 44, i64 7, i64 33, i64 8, i64 22}
; MEMOP_ANNOTATION4: ![[MEMOP_VALUESITE]] = !{!"VP", i32 1, i64 556, i64 1, i64 99, i64 2, i64 88, i64 3, i64 77, i64 9, i64 72}
@@ -56,11 +56,11 @@ for.end6:
ret void
}
-declare void @llvm.lifetime.start(i64, i8* nocapture)
+declare void @llvm.lifetime.start(i64, ptr nocapture)
-declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture writeonly, i8* nocapture readonly, i64, i1)
+declare void @llvm.memcpy.p0.p0.i64(ptr nocapture writeonly, ptr nocapture readonly, i64, i1)
-declare i32 @memcmp(i8*, i8*, i64)
-declare i32 @bcmp(i8*, i8*, i64)
+declare i32 @memcmp(ptr, ptr, i64)
+declare i32 @bcmp(ptr, ptr, i64)
-declare void @llvm.lifetime.end(i64, i8* nocapture)
+declare void @llvm.lifetime.end(i64, ptr nocapture)
diff --git a/llvm/test/Transforms/PGOProfile/memop_size_from_strlen.ll b/llvm/test/Transforms/PGOProfile/memop_size_from_strlen.ll
index 3dd28d2f80479..7e8596fdf30b1 100644
--- a/llvm/test/Transforms/PGOProfile/memop_size_from_strlen.ll
+++ b/llvm/test/Transforms/PGOProfile/memop_size_from_strlen.ll
@@ -1,14 +1,14 @@
; RUN: opt < %s -passes=pgo-instr-gen -S | FileCheck %s
-declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture writeonly, i8* nocapture readonly, i32, i1)
-declare i32 @strlen(i8* nocapture)
+declare void @llvm.memcpy.p0.p0.i32(ptr nocapture writeonly, ptr nocapture readonly, i32, i1)
+declare i32 @strlen(ptr nocapture)
; CHECK-LABEL: test
; CHECK: %1 = zext i32 %c to i64
-; CHECK: call void @llvm.instrprof.value.profile(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @__profn_test, i32 0, i32 0), i64 {{[0-9]+}}, i64 %1, i32 1, i32 0)
+; CHECK: call void @llvm.instrprof.value.profile(ptr @__profn_test, i64 {{[0-9]+}}, i64 %1, i32 1, i32 0)
-define void @test(i8* %a, i8* %p) {
- %c = call i32 @strlen(i8* %p)
- call void @llvm.memcpy.p0i8.p0i8.i32(i8* %a, i8* %p, i32 %c, i1 false)
+define void @test(ptr %a, ptr %p) {
+ %c = call i32 @strlen(ptr %p)
+ call void @llvm.memcpy.p0.p0.i32(ptr %a, ptr %p, i32 %c, i1 false)
ret void
}
diff --git a/llvm/test/Transforms/PGOProfile/memop_size_opt.ll b/llvm/test/Transforms/PGOProfile/memop_size_opt.ll
index 60d1f7ed1bc70..c4f749be747db 100644
--- a/llvm/test/Transforms/PGOProfile/memop_size_opt.ll
+++ b/llvm/test/Transforms/PGOProfile/memop_size_opt.ll
@@ -7,7 +7,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"
-define void @foo(i8* %dst, i8* %src, i8* %dst2, i8* %src2, i32* %a, i32 %n) !prof !27 {
+define void @foo(ptr %dst, ptr %src, ptr %dst2, ptr %src2, ptr %a, i32 %n) !prof !27 {
entry:
br label %for.cond
@@ -22,36 +22,36 @@ for.body:
for.cond1:
%j.0 = phi i32 [ 0, %for.body ], [ %inc, %for.inc ]
%idx.ext = sext i32 %i.0 to i64
- %add.ptr = getelementptr inbounds i32, i32* %a, i64 %idx.ext
- %0 = load i32, i32* %add.ptr, align 4
+ %add.ptr = getelementptr inbounds i32, ptr %a, i64 %idx.ext
+ %0 = load i32, ptr %add.ptr, align 4
%cmp2 = icmp slt i32 %j.0, %0
br i1 %cmp2, label %for.body3, label %for.end, !prof !29
for.body3:
%add = add nsw i32 %i.0, 1
%conv = sext i32 %add to i64
- call void @llvm.memcpy.p0i8.p0i8.i64(i8* %dst, i8* %src, i64 %conv, i1 false), !prof !30
- call void @llvm.memcpy.p0i8.p0i8.i64(i8* %dst2, i8* %src2, i64 %conv, i1 false), !prof !31
+ call void @llvm.memcpy.p0.p0.i64(ptr %dst, ptr %src, i64 %conv, i1 false), !prof !30
+ call void @llvm.memcpy.p0.p0.i64(ptr %dst2, ptr %src2, i64 %conv, i1 false), !prof !31
br label %for.inc
; MEMOP_OPT: switch i64 %conv, label %[[DEFAULT_LABEL:.*]] [
; MEMOP_OPT: i64 0, label %[[CASE_1_LABEL:.*]]
; MEMOP_OPT: ], !prof [[SWITCH_BW:![0-9]+]]
; MEMOP_OPT: [[CASE_1_LABEL]]:
-; MEMOP_OPT: call void @llvm.memcpy.p0i8.p0i8.i64(i8* %dst, i8* %src, i64 0, i1 false)
+; MEMOP_OPT: call void @llvm.memcpy.p0.p0.i64(ptr %dst, ptr %src, i64 0, i1 false)
; MEMOP_OPT: br label %[[MERGE_LABEL:.*]]
; MEMOP_OPT: [[DEFAULT_LABEL]]:
-; MEMOP_OPT: call void @llvm.memcpy.p0i8.p0i8.i64(i8* %dst, i8* %src, i64 %conv, i1 false), !prof [[NEWVP:![0-9]+]]
+; MEMOP_OPT: call void @llvm.memcpy.p0.p0.i64(ptr %dst, ptr %src, i64 %conv, i1 false), !prof [[NEWVP:![0-9]+]]
; MEMOP_OPT: br label %[[MERGE_LABEL]]
; MEMOP_OPT: [[MERGE_LABEL]]:
; MEMOP_OPT: switch i64 %conv, label %[[DEFAULT_LABEL2:.*]] [
; MEMOP_OPT: i64 0, label %[[CASE_1_LABEL2:.*]]
; MEMOP_OPT: ], !prof [[SWITCH_BW:![0-9]+]]
; MEMOP_OPT: [[CASE_1_LABEL2]]:
-; MEMOP_OPT: call void @llvm.memcpy.p0i8.p0i8.i64(i8* %dst2, i8* %src2, i64 0, i1 false)
+; MEMOP_OPT: call void @llvm.memcpy.p0.p0.i64(ptr %dst2, ptr %src2, i64 0, i1 false)
; MEMOP_OPT: br label %[[MERGE_LABEL2:.*]]
; MEMOP_OPT: [[DEFAULT_LABEL2]]:
-; MEMOP_OPT: call void @llvm.memcpy.p0i8.p0i8.i64(i8* %dst2, i8* %src2, i64 %conv, i1 false), !prof [[NEWVP]]
+; MEMOP_OPT: call void @llvm.memcpy.p0.p0.i64(ptr %dst2, ptr %src2, i64 %conv, i1 false), !prof [[NEWVP]]
; MEMOP_OPT: br label %[[MERGE_LABEL2]]
; MEMOP_OPT: [[MERGE_LABEL2]]:
; MEMOP_OPT: br label %for.inc
@@ -73,7 +73,7 @@ for.end6:
declare void @consume(i32 %v1, i32 %v2)
-define void @foo_memcmp_bcmp(i8* %dst, i8* %src, i8* %dst2, i8* %src2, i32* %a, i32 %n) !prof !27 {
+define void @foo_memcmp_bcmp(ptr %dst, ptr %src, ptr %dst2, ptr %src2, ptr %a, i32 %n) !prof !27 {
entry:
br label %for.cond
@@ -88,16 +88,16 @@ for.body:
for.cond1:
%j.0 = phi i32 [ 0, %for.body ], [ %inc, %for.inc ]
%idx.ext = sext i32 %i.0 to i64
- %add.ptr = getelementptr inbounds i32, i32* %a, i64 %idx.ext
- %0 = load i32, i32* %add.ptr, align 4
+ %add.ptr = getelementptr inbounds i32, ptr %a, i64 %idx.ext
+ %0 = load i32, ptr %add.ptr, align 4
%cmp2 = icmp slt i32 %j.0, %0
br i1 %cmp2, label %for.body3, label %for.end, !prof !29
for.body3:
%add = add nsw i32 %i.0, 1
%conv = sext i32 %add to i64
- %memcmp = call i32 @memcmp(i8* %dst, i8* %src, i64 %conv), !prof !30
- %bcmp = call i32 @bcmp(i8* %dst2, i8* %src2, i64 %conv), !prof !31
+ %memcmp = call i32 @memcmp(ptr %dst, ptr %src, i64 %conv), !prof !30
+ %bcmp = call i32 @bcmp(ptr %dst2, ptr %src2, i64 %conv), !prof !31
call void @consume(i32 %memcmp, i32 %bcmp)
br label %for.inc
@@ -105,10 +105,10 @@ for.body3:
; MEMOP_OPT: i64 0, label %[[CASE_1_LABEL:.*]]
; MEMOP_OPT: ], !prof [[SWITCH_BW:![0-9]+]]
; MEMOP_OPT: [[CASE_1_LABEL]]:
-; MEMOP_OPT: %[[RV:.*]] = call i32 @memcmp(i8* %dst, i8* %src, i64 0)
+; MEMOP_OPT: %[[RV:.*]] = call i32 @memcmp(ptr %dst, ptr %src, i64 0)
; MEMOP_OPT: br label %[[MERGE_LABEL:.*]]
; MEMOP_OPT: [[DEFAULT_LABEL]]:
-; MEMOP_OPT: %[[RVD:.*]] = call i32 @memcmp(i8* %dst, i8* %src, i64 %conv), !prof [[NEWVP:![0-9]+]]
+; MEMOP_OPT: %[[RVD:.*]] = call i32 @memcmp(ptr %dst, ptr %src, i64 %conv), !prof [[NEWVP:![0-9]+]]
; MEMOP_OPT: br label %[[MERGE_LABEL]]
; MEMOP_OPT: [[MERGE_LABEL]]:
; MEMOP_OPT: %[[PHI:.*]] = phi i32 [ %[[RVD]], %[[DEFAULT_LABEL]] ], [ %[[RV]], %[[CASE_1_LABEL]] ]
@@ -116,10 +116,10 @@ for.body3:
; MEMOP_OPT: i64 0, label %[[CASE_1_LABEL2:.*]]
; MEMOP_OPT: ], !prof [[SWITCH_BW:![0-9]+]]
; MEMOP_OPT: [[CASE_1_LABEL2]]:
-; MEMOP_OPT: %[[RV2:.*]] = call i32 @bcmp(i8* %dst2, i8* %src2, i64 0)
+; MEMOP_OPT: %[[RV2:.*]] = call i32 @bcmp(ptr %dst2, ptr %src2, i64 0)
; MEMOP_OPT: br label %[[MERGE_LABEL2:.*]]
; MEMOP_OPT: [[DEFAULT_LABEL2]]:
-; MEMOP_OPT: %[[RVD2:.*]] = call i32 @bcmp(i8* %dst2, i8* %src2, i64 %conv), !prof [[NEWVP]]
+; MEMOP_OPT: %[[RVD2:.*]] = call i32 @bcmp(ptr %dst2, ptr %src2, i64 %conv), !prof [[NEWVP]]
; MEMOP_OPT: br label %[[MERGE_LABEL2]]
; MEMOP_OPT: [[MERGE_LABEL2]]:
; MEMOP_OPT: %[[PHI2:.*]] = phi i32 [ %[[RVD2]], %[[DEFAULT_LABEL2]] ], [ %[[RV2]], %[[CASE_1_LABEL2]] ]
@@ -181,14 +181,14 @@ for.end6:
!30 = !{!"VP", i32 1, i64 556, i64 0, i64 99, i64 2, i64 88, i64 3, i64 77, i64 9, i64 72, i64 4, i64 66, i64 5, i64 55, i64 6, i64 44, i64 7, i64 33, i64 8, i64 22}
!31 = !{!"VP", i32 1, i64 556, i64 0, i64 99, i64 2, i64 88, i64 3, i64 77, i64 9, i64 72, i64 4, i64 66, i64 5, i64 55, i64 6, i64 44, i64 7, i64 33, i64 8, i64 22}
-declare void @llvm.lifetime.start(i64, i8* nocapture)
+declare void @llvm.lifetime.start(i64, ptr nocapture)
-declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture writeonly, i8* nocapture readonly, i64, i1)
+declare void @llvm.memcpy.p0.p0.i64(ptr nocapture writeonly, ptr nocapture readonly, i64, i1)
-declare i32 @memcmp(i8*, i8*, i64)
-declare i32 @bcmp(i8*, i8*, i64)
+declare i32 @memcmp(ptr, ptr, i64)
+declare i32 @bcmp(ptr, ptr, i64)
-declare void @llvm.lifetime.end(i64, i8* nocapture)
+declare void @llvm.lifetime.end(i64, ptr nocapture)
; YAML: --- !Passed
; YAML-NEXT: Pass: pgo-memop-opt
diff --git a/llvm/test/Transforms/PGOProfile/memop_size_opt_skip_ranges_promote_three.ll b/llvm/test/Transforms/PGOProfile/memop_size_opt_skip_ranges_promote_three.ll
index f77740d61521d..1ee02a710a61c 100644
--- a/llvm/test/Transforms/PGOProfile/memop_size_opt_skip_ranges_promote_three.ll
+++ b/llvm/test/Transforms/PGOProfile/memop_size_opt_skip_ranges_promote_three.ll
@@ -1,8 +1,8 @@
; RUN: opt < %s -passes=pgo-memop-opt -pgo-memop-count-threshold=100 -pgo-memop-percent-threshold=10 -S | FileCheck %s
-define void @foo(i8* %dst, i8* %src, i8* %dst2, i8* %src2, i64 %n) !prof !27 {
+define void @foo(ptr %dst, ptr %src, ptr %dst2, ptr %src2, i64 %n) !prof !27 {
entry:
- call void @llvm.memcpy.p0i8.p0i8.i64(i8* %dst, i8* %src, i64 %n, i1 false), !prof !28
+ call void @llvm.memcpy.p0.p0.i64(ptr %dst, ptr %src, i64 %n, i1 false), !prof !28
ret void
}
@@ -12,16 +12,16 @@ entry:
; CHECK: i64 2, label %[[CASE_2_LABEL:.*]]
; CHECK: ], !prof [[SWITCH_BW:![0-9]+]]
; CHECK: [[CASE_0_LABEL]]:
-; CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* %dst, i8* %src, i64 0, i1 false)
+; CHECK: call void @llvm.memcpy.p0.p0.i64(ptr %dst, ptr %src, i64 0, i1 false)
; CHECK: br label %[[MERGE_LABEL:.*]]
; CHECK: [[CASE_1_LABEL]]:
-; CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* %dst, i8* %src, i64 1, i1 false)
+; CHECK: call void @llvm.memcpy.p0.p0.i64(ptr %dst, ptr %src, i64 1, i1 false)
; CHECK: br label %[[MERGE_LABEL:.*]]
; CHECK: [[CASE_2_LABEL]]:
-; CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* %dst, i8* %src, i64 2, i1 false)
+; CHECK: call void @llvm.memcpy.p0.p0.i64(ptr %dst, ptr %src, i64 2, i1 false)
; CHECK: br label %[[MERGE_LABEL:.*]]
; CHECK: [[DEFAULT_LABEL]]:
-; CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* %dst, i8* %src, i64 %n, i1 false), !prof [[NEWVP:![0-9]+]]
+; CHECK: call void @llvm.memcpy.p0.p0.i64(ptr %dst, ptr %src, i64 %n, i1 false), !prof [[NEWVP:![0-9]+]]
; CHECK: br label %[[MERGE_LABEL]]
; CHECK: [[MERGE_LABEL]]:
; CHECK: ret void
@@ -31,7 +31,7 @@ entry:
; CHECK: [[SWITCH_BW]] = !{!"branch_weights", i32 524, i32 101, i32 101, i32 101}
; CHECK: [[NEWVP]] = !{!"VP", i32 1, i64 524, i64 9, i64 104, i64 17, i64 103, i64 33, i64 103, i64 65, i64 102, i64 129, i64 102, i64 3, i64 101}
-declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture writeonly, i8* nocapture readonly, i64, i1)
+declare void @llvm.memcpy.p0.p0.i64(ptr nocapture writeonly, ptr nocapture readonly, i64, i1)
!llvm.module.flags = !{!0}
diff --git a/llvm/test/Transforms/PGOProfile/memop_size_opt_zero.ll b/llvm/test/Transforms/PGOProfile/memop_size_opt_zero.ll
index 9e9a23acfdbad..4c7fefd3802bd 100644
--- a/llvm/test/Transforms/PGOProfile/memop_size_opt_zero.ll
+++ b/llvm/test/Transforms/PGOProfile/memop_size_opt_zero.ll
@@ -5,14 +5,14 @@
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"
-define void @foo(i8* %dst, i8* %src, i64 %conv) !prof !0 {
- call void @llvm.memcpy.p0i8.p0i8.i64(i8* %dst, i8* %src, i64 %conv, i1 false), !prof !1
+define void @foo(ptr %dst, ptr %src, i64 %conv) !prof !0 {
+ call void @llvm.memcpy.p0.p0.i64(ptr %dst, ptr %src, i64 %conv, i1 false), !prof !1
ret void
}
-; MEMOP_OPT: call void @llvm.memcpy.p0i8.p0i8.i64(i8* %dst, i8* %src, i64 %conv, i1 false), !prof !1
+; MEMOP_OPT: call void @llvm.memcpy.p0.p0.i64(ptr %dst, ptr %src, i64 %conv, i1 false), !prof !1
!0 = !{!"function_entry_count", i64 1}
!1 = !{!"VP", i32 1, i64 0, i64 1, i64 0, i64 2, i64 0, i64 3, i64 0, i64 9, i64 0, i64 4, i64 0, i64 5, i64 0, i64 6, i64 0, i64 7, i64 0, i64 8, i64 0}
-declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture writeonly, i8* nocapture readonly, i64, i1)
+declare void @llvm.memcpy.p0.p0.i64(ptr nocapture writeonly, ptr nocapture readonly, i64, i1)
diff --git a/llvm/test/Transforms/PGOProfile/misexpect-branch-correct.ll b/llvm/test/Transforms/PGOProfile/misexpect-branch-correct.ll
index 63060d39e8ee5..f187d41028fc1 100644
--- a/llvm/test/Transforms/PGOProfile/misexpect-branch-correct.ll
+++ b/llvm/test/Transforms/PGOProfile/misexpect-branch-correct.ll
@@ -23,15 +23,13 @@ define i32 @bar() #0 {
entry:
%rando = alloca i32, align 4
%x = alloca i32, align 4
- %0 = bitcast i32* %rando to i8*
- call void @llvm.lifetime.start.p0i8(i64 4, i8* %0) #4
+ call void @llvm.lifetime.start.p0(i64 4, ptr %rando) #4
%call = call i32 (...) @buzz()
- store i32 %call, i32* %rando, align 4, !tbaa !3
- %1 = bitcast i32* %x to i8*
- call void @llvm.lifetime.start.p0i8(i64 4, i8* %1) #4
- store i32 0, i32* %x, align 4, !tbaa !3
- %2 = load i32, i32* %rando, align 4, !tbaa !3
- %rem = srem i32 %2, 200000
+ store i32 %call, ptr %rando, align 4, !tbaa !3
+ call void @llvm.lifetime.start.p0(i64 4, ptr %x) #4
+ store i32 0, ptr %x, align 4, !tbaa !3
+ %0 = load i32, ptr %rando, align 4, !tbaa !3
+ %rem = srem i32 %0, 200000
%cmp = icmp eq i32 %rem, 0
%lnot = xor i1 %cmp, true
%lnot1 = xor i1 %lnot, true
@@ -42,27 +40,25 @@ entry:
br i1 %tobool, label %if.then, label %if.else
if.then: ; preds = %entry
- %3 = load i32, i32* %rando, align 4, !tbaa !3
- %call2 = call i32 @baz(i32 %3)
- store i32 %call2, i32* %x, align 4, !tbaa !3
+ %1 = load i32, ptr %rando, align 4, !tbaa !3
+ %call2 = call i32 @baz(i32 %1)
+ store i32 %call2, ptr %x, align 4, !tbaa !3
br label %if.end
if.else: ; preds = %entry
%call3 = call i32 @foo(i32 50)
- store i32 %call3, i32* %x, align 4, !tbaa !3
+ store i32 %call3, ptr %x, align 4, !tbaa !3
br label %if.end
if.end: ; preds = %if.else, %if.then
- %4 = load i32, i32* %x, align 4, !tbaa !3
- %5 = bitcast i32* %x to i8*
- call void @llvm.lifetime.end.p0i8(i64 4, i8* %5) #4
- %6 = bitcast i32* %rando to i8*
- call void @llvm.lifetime.end.p0i8(i64 4, i8* %6) #4
- ret i32 %4
+ %2 = load i32, ptr %x, align 4, !tbaa !3
+ call void @llvm.lifetime.end.p0(i64 4, ptr %x) #4
+ call void @llvm.lifetime.end.p0(i64 4, ptr %rando) #4
+ ret i32 %2
}
; Function Attrs: argmemonly nounwind willreturn
-declare void @llvm.lifetime.start.p0i8(i64 immarg, i8* nocapture) #1
+declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
declare i32 @buzz(...) #2
@@ -74,7 +70,7 @@ declare i32 @baz(i32) #2
declare i32 @foo(i32) #2
; Function Attrs: argmemonly nounwind willreturn
-declare void @llvm.lifetime.end.p0i8(i64 immarg, i8* nocapture) #1
+declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nounwind "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-features"="+cx8,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #1 = { argmemonly nounwind willreturn }
diff --git a/llvm/test/Transforms/PGOProfile/misexpect-branch-overflow.ll b/llvm/test/Transforms/PGOProfile/misexpect-branch-overflow.ll
index 7279f1ab3d60f..146ad44b38918 100644
--- a/llvm/test/Transforms/PGOProfile/misexpect-branch-overflow.ll
+++ b/llvm/test/Transforms/PGOProfile/misexpect-branch-overflow.ll
@@ -20,15 +20,13 @@ define i32 @bar() #0 !dbg !6 {
entry:
%rando = alloca i32, align 4
%x = alloca i32, align 4
- %0 = bitcast i32* %rando to i8*, !dbg !9
- call void @llvm.lifetime.start.p0i8(i64 4, i8* %0) #4, !dbg !9
+ call void @llvm.lifetime.start.p0(i64 4, ptr %rando) #4, !dbg !9
%call = call i32 (...) @buzz(), !dbg !9
- store i32 %call, i32* %rando, align 4, !dbg !9, !tbaa !10
- %1 = bitcast i32* %x to i8*, !dbg !14
- call void @llvm.lifetime.start.p0i8(i64 4, i8* %1) #4, !dbg !14
- store i32 0, i32* %x, align 4, !dbg !14, !tbaa !10
- %2 = load i32, i32* %rando, align 4, !dbg !15, !tbaa !10
- %rem = srem i32 %2, 200000, !dbg !15
+ store i32 %call, ptr %rando, align 4, !dbg !9, !tbaa !10
+ call void @llvm.lifetime.start.p0(i64 4, ptr %x) #4, !dbg !14
+ store i32 0, ptr %x, align 4, !dbg !14, !tbaa !10
+ %0 = load i32, ptr %rando, align 4, !dbg !15, !tbaa !10
+ %rem = srem i32 %0, 200000, !dbg !15
%cmp = icmp eq i32 %rem, 0, !dbg !15
%lnot = xor i1 %cmp, true, !dbg !15
%lnot1 = xor i1 %lnot, true, !dbg !15
@@ -39,27 +37,25 @@ entry:
br i1 %tobool, label %if.then, label %if.else, !dbg !15
if.then: ; preds = %entry
- %3 = load i32, i32* %rando, align 4, !dbg !16, !tbaa !10
- %call2 = call i32 @baz(i32 %3), !dbg !16
- store i32 %call2, i32* %x, align 4, !dbg !16, !tbaa !10
+ %1 = load i32, ptr %rando, align 4, !dbg !16, !tbaa !10
+ %call2 = call i32 @baz(i32 %1), !dbg !16
+ store i32 %call2, ptr %x, align 4, !dbg !16, !tbaa !10
br label %if.end, !dbg !17
if.else: ; preds = %entry
%call3 = call i32 @foo(i32 50), !dbg !18
- store i32 %call3, i32* %x, align 4, !dbg !18, !tbaa !10
+ store i32 %call3, ptr %x, align 4, !dbg !18, !tbaa !10
br label %if.end
if.end: ; preds = %if.else, %if.then
- %4 = load i32, i32* %x, align 4, !dbg !19, !tbaa !10
- %5 = bitcast i32* %x to i8*, !dbg !20
- call void @llvm.lifetime.end.p0i8(i64 4, i8* %5) #4, !dbg !20
- %6 = bitcast i32* %rando to i8*, !dbg !20
- call void @llvm.lifetime.end.p0i8(i64 4, i8* %6) #4, !dbg !20
- ret i32 %4, !dbg !19
+ %2 = load i32, ptr %x, align 4, !dbg !19, !tbaa !10
+ call void @llvm.lifetime.end.p0(i64 4, ptr %x) #4, !dbg !20
+ call void @llvm.lifetime.end.p0(i64 4, ptr %rando) #4, !dbg !20
+ ret i32 %2, !dbg !19
}
; Function Attrs: argmemonly nounwind willreturn
-declare void @llvm.lifetime.start.p0i8(i64 immarg, i8* nocapture) #1
+declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
declare i32 @buzz(...) #2
@@ -71,7 +67,7 @@ declare i32 @baz(i32) #2
declare i32 @foo(i32) #2
; Function Attrs: argmemonly nounwind willreturn
-declare void @llvm.lifetime.end.p0i8(i64 immarg, i8* nocapture) #1
+declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nounwind "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-features"="+cx8,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #1 = { argmemonly nounwind willreturn }
diff --git a/llvm/test/Transforms/PGOProfile/misexpect-branch-stripped.ll b/llvm/test/Transforms/PGOProfile/misexpect-branch-stripped.ll
index 63f3bd7183f70..18677b720f36b 100644
--- a/llvm/test/Transforms/PGOProfile/misexpect-branch-stripped.ll
+++ b/llvm/test/Transforms/PGOProfile/misexpect-branch-stripped.ll
@@ -33,15 +33,13 @@ define i32 @bar() #0 {
entry:
%rando = alloca i32, align 4
%x = alloca i32, align 4
- %0 = bitcast i32* %rando to i8*
- call void @llvm.lifetime.start.p0i8(i64 4, i8* %0) #4
+ call void @llvm.lifetime.start.p0(i64 4, ptr %rando) #4
%call = call i32 (...) @buzz()
- store i32 %call, i32* %rando, align 4, !tbaa !3
- %1 = bitcast i32* %x to i8*
- call void @llvm.lifetime.start.p0i8(i64 4, i8* %1) #4
- store i32 0, i32* %x, align 4, !tbaa !3
- %2 = load i32, i32* %rando, align 4, !tbaa !3
- %rem = srem i32 %2, 200000
+ store i32 %call, ptr %rando, align 4, !tbaa !3
+ call void @llvm.lifetime.start.p0(i64 4, ptr %x) #4
+ store i32 0, ptr %x, align 4, !tbaa !3
+ %0 = load i32, ptr %rando, align 4, !tbaa !3
+ %rem = srem i32 %0, 200000
%cmp = icmp eq i32 %rem, 0
%lnot = xor i1 %cmp, true
%lnot1 = xor i1 %lnot, true
@@ -52,27 +50,25 @@ entry:
br i1 %tobool, label %if.then, label %if.else
if.then: ; preds = %entry
- %3 = load i32, i32* %rando, align 4, !tbaa !3
- %call2 = call i32 @baz(i32 %3)
- store i32 %call2, i32* %x, align 4, !tbaa !3
+ %1 = load i32, ptr %rando, align 4, !tbaa !3
+ %call2 = call i32 @baz(i32 %1)
+ store i32 %call2, ptr %x, align 4, !tbaa !3
br label %if.end
if.else: ; preds = %entry
%call3 = call i32 @foo(i32 50)
- store i32 %call3, i32* %x, align 4, !tbaa !3
+ store i32 %call3, ptr %x, align 4, !tbaa !3
br label %if.end
if.end: ; preds = %if.else, %if.then
- %4 = load i32, i32* %x, align 4, !tbaa !3
- %5 = bitcast i32* %x to i8*
- call void @llvm.lifetime.end.p0i8(i64 4, i8* %5) #4
- %6 = bitcast i32* %rando to i8*
- call void @llvm.lifetime.end.p0i8(i64 4, i8* %6) #4
- ret i32 %4
+ %2 = load i32, ptr %x, align 4, !tbaa !3
+ call void @llvm.lifetime.end.p0(i64 4, ptr %x) #4
+ call void @llvm.lifetime.end.p0(i64 4, ptr %rando) #4
+ ret i32 %2
}
; Function Attrs: argmemonly nounwind willreturn
-declare void @llvm.lifetime.start.p0i8(i64 immarg, i8* nocapture) #1
+declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
declare i32 @buzz(...) #2
@@ -84,7 +80,7 @@ declare i32 @baz(i32) #2
declare i32 @foo(i32) #2
; Function Attrs: argmemonly nounwind willreturn
-declare void @llvm.lifetime.end.p0i8(i64 immarg, i8* nocapture) #1
+declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nounwind "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-features"="+cx8,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #1 = { argmemonly nounwind willreturn }
diff --git a/llvm/test/Transforms/PGOProfile/misexpect-branch-unpredictable.ll b/llvm/test/Transforms/PGOProfile/misexpect-branch-unpredictable.ll
index 21905ce60b3a5..1e7e8c1ab418a 100644
--- a/llvm/test/Transforms/PGOProfile/misexpect-branch-unpredictable.ll
+++ b/llvm/test/Transforms/PGOProfile/misexpect-branch-unpredictable.ll
@@ -21,15 +21,13 @@ define i32 @bar() #0 {
entry:
%rando = alloca i32, align 4
%x = alloca i32, align 4
- %0 = bitcast i32* %rando to i8*
- call void @llvm.lifetime.start.p0i8(i64 4, i8* %0) #3
+ call void @llvm.lifetime.start.p0(i64 4, ptr %rando) #3
%call = call i32 (...) @buzz()
- store i32 %call, i32* %rando, align 4, !tbaa !2
- %1 = bitcast i32* %x to i8*
- call void @llvm.lifetime.start.p0i8(i64 4, i8* %1) #3
- store i32 0, i32* %x, align 4, !tbaa !2
- %2 = load i32, i32* %rando, align 4, !tbaa !2
- %rem = srem i32 %2, 200000
+ store i32 %call, ptr %rando, align 4, !tbaa !2
+ call void @llvm.lifetime.start.p0(i64 4, ptr %x) #3
+ store i32 0, ptr %x, align 4, !tbaa !2
+ %0 = load i32, ptr %rando, align 4, !tbaa !2
+ %rem = srem i32 %0, 200000
%cmp = icmp eq i32 %rem, 0
%lnot = xor i1 %cmp, true
%lnot1 = xor i1 %lnot, true
@@ -39,27 +37,25 @@ entry:
br i1 %tobool, label %if.then, label %if.else, !unpredictable !6
if.then: ; preds = %entry
- %3 = load i32, i32* %rando, align 4, !tbaa !2
- %call2 = call i32 @baz(i32 %3)
- store i32 %call2, i32* %x, align 4, !tbaa !2
+ %1 = load i32, ptr %rando, align 4, !tbaa !2
+ %call2 = call i32 @baz(i32 %1)
+ store i32 %call2, ptr %x, align 4, !tbaa !2
br label %if.end
if.else: ; preds = %entry
%call3 = call i32 @foo(i32 50)
- store i32 %call3, i32* %x, align 4, !tbaa !2
+ store i32 %call3, ptr %x, align 4, !tbaa !2
br label %if.end
if.end: ; preds = %if.else, %if.then
- %4 = load i32, i32* %x, align 4, !tbaa !2
- %5 = bitcast i32* %x to i8*
- call void @llvm.lifetime.end.p0i8(i64 4, i8* %5) #3
- %6 = bitcast i32* %rando to i8*
- call void @llvm.lifetime.end.p0i8(i64 4, i8* %6) #3
- ret i32 %4
+ %2 = load i32, ptr %x, align 4, !tbaa !2
+ call void @llvm.lifetime.end.p0(i64 4, ptr %x) #3
+ call void @llvm.lifetime.end.p0(i64 4, ptr %rando) #3
+ ret i32 %2
}
; Function Attrs: argmemonly nounwind willreturn
-declare void @llvm.lifetime.start.p0i8(i64 immarg, i8* nocapture) #1
+declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
declare i32 @buzz(...) #2
@@ -68,7 +64,7 @@ declare i32 @baz(i32) #2
declare i32 @foo(i32) #2
; Function Attrs: argmemonly nounwind willreturn
-declare void @llvm.lifetime.end.p0i8(i64 immarg, i8* nocapture) #1
+declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nounwind "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-features"="+cx8,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #1 = { argmemonly nounwind willreturn }
diff --git a/llvm/test/Transforms/PGOProfile/misexpect-branch.ll b/llvm/test/Transforms/PGOProfile/misexpect-branch.ll
index 655785c0d6077..10c37182d4c5c 100644
--- a/llvm/test/Transforms/PGOProfile/misexpect-branch.ll
+++ b/llvm/test/Transforms/PGOProfile/misexpect-branch.ll
@@ -37,15 +37,13 @@ define i32 @bar() #0 !dbg !6 {
entry:
%rando = alloca i32, align 4
%x = alloca i32, align 4
- %0 = bitcast i32* %rando to i8*, !dbg !9
- call void @llvm.lifetime.start.p0i8(i64 4, i8* %0) #4, !dbg !9
+ call void @llvm.lifetime.start.p0(i64 4, ptr %rando) #4, !dbg !9
%call = call i32 (...) @buzz(), !dbg !9
- store i32 %call, i32* %rando, align 4, !dbg !9, !tbaa !10
- %1 = bitcast i32* %x to i8*, !dbg !14
- call void @llvm.lifetime.start.p0i8(i64 4, i8* %1) #4, !dbg !14
- store i32 0, i32* %x, align 4, !dbg !14, !tbaa !10
- %2 = load i32, i32* %rando, align 4, !dbg !15, !tbaa !10
- %rem = srem i32 %2, 200000, !dbg !15
+ store i32 %call, ptr %rando, align 4, !dbg !9, !tbaa !10
+ call void @llvm.lifetime.start.p0(i64 4, ptr %x) #4, !dbg !14
+ store i32 0, ptr %x, align 4, !dbg !14, !tbaa !10
+ %0 = load i32, ptr %rando, align 4, !dbg !15, !tbaa !10
+ %rem = srem i32 %0, 200000, !dbg !15
%cmp = icmp eq i32 %rem, 0, !dbg !15
%lnot = xor i1 %cmp, true, !dbg !15
%lnot1 = xor i1 %lnot, true, !dbg !15
@@ -56,27 +54,25 @@ entry:
br i1 %tobool, label %if.then, label %if.else, !dbg !15
if.then: ; preds = %entry
- %3 = load i32, i32* %rando, align 4, !dbg !16, !tbaa !10
- %call2 = call i32 @baz(i32 %3), !dbg !16
- store i32 %call2, i32* %x, align 4, !dbg !16, !tbaa !10
+ %1 = load i32, ptr %rando, align 4, !dbg !16, !tbaa !10
+ %call2 = call i32 @baz(i32 %1), !dbg !16
+ store i32 %call2, ptr %x, align 4, !dbg !16, !tbaa !10
br label %if.end, !dbg !17
if.else: ; preds = %entry
%call3 = call i32 @foo(i32 50), !dbg !18
- store i32 %call3, i32* %x, align 4, !dbg !18, !tbaa !10
+ store i32 %call3, ptr %x, align 4, !dbg !18, !tbaa !10
br label %if.end
if.end: ; preds = %if.else, %if.then
- %4 = load i32, i32* %x, align 4, !dbg !19, !tbaa !10
- %5 = bitcast i32* %x to i8*, !dbg !20
- call void @llvm.lifetime.end.p0i8(i64 4, i8* %5) #4, !dbg !20
- %6 = bitcast i32* %rando to i8*, !dbg !20
- call void @llvm.lifetime.end.p0i8(i64 4, i8* %6) #4, !dbg !20
- ret i32 %4, !dbg !19
+ %2 = load i32, ptr %x, align 4, !dbg !19, !tbaa !10
+ call void @llvm.lifetime.end.p0(i64 4, ptr %x) #4, !dbg !20
+ call void @llvm.lifetime.end.p0(i64 4, ptr %rando) #4, !dbg !20
+ ret i32 %2, !dbg !19
}
; Function Attrs: argmemonly nounwind willreturn
-declare void @llvm.lifetime.start.p0i8(i64 immarg, i8* nocapture) #1
+declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
declare i32 @buzz(...) #2
@@ -88,7 +84,7 @@ declare i32 @baz(i32) #2
declare i32 @foo(i32) #2
; Function Attrs: argmemonly nounwind willreturn
-declare void @llvm.lifetime.end.p0i8(i64 immarg, i8* nocapture) #1
+declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nounwind "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-features"="+cx8,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #1 = { argmemonly nounwind willreturn }
diff --git a/llvm/test/Transforms/PGOProfile/misexpect-switch-default.ll b/llvm/test/Transforms/PGOProfile/misexpect-switch-default.ll
index dc2c426f1b2ce..6e21c083b91aa 100644
--- a/llvm/test/Transforms/PGOProfile/misexpect-switch-default.ll
+++ b/llvm/test/Transforms/PGOProfile/misexpect-switch-default.ll
@@ -40,39 +40,37 @@ target triple = "x86_64-unknown-linux-gnu"
define dso_local void @init_arry() #0 {
entry:
%i = alloca i32, align 4
- %0 = bitcast i32* %i to i8*
- call void @llvm.lifetime.start.p0i8(i64 4, i8* %0) #6
- store i32 0, i32* %i, align 4, !tbaa !4
+ call void @llvm.lifetime.start.p0(i64 4, ptr %i) #6
+ store i32 0, ptr %i, align 4, !tbaa !4
br label %for.cond
for.cond: ; preds = %for.inc, %entry
- %1 = load i32, i32* %i, align 4, !tbaa !4
- %cmp = icmp slt i32 %1, 25
+ %0 = load i32, ptr %i, align 4, !tbaa !4
+ %cmp = icmp slt i32 %0, 25
br i1 %cmp, label %for.body, label %for.end
for.body: ; preds = %for.cond
%call = call i32 @rand() #6
%rem = srem i32 %call, 10
- %2 = load i32, i32* %i, align 4, !tbaa !4
- %idxprom = sext i32 %2 to i64
- %arrayidx = getelementptr inbounds [25 x i32], [25 x i32]* @arry, i64 0, i64 %idxprom
- store i32 %rem, i32* %arrayidx, align 4, !tbaa !4
+ %1 = load i32, ptr %i, align 4, !tbaa !4
+ %idxprom = sext i32 %1 to i64
+ %arrayidx = getelementptr inbounds [25 x i32], ptr @arry, i64 0, i64 %idxprom
+ store i32 %rem, ptr %arrayidx, align 4, !tbaa !4
br label %for.inc
for.inc: ; preds = %for.body
- %3 = load i32, i32* %i, align 4, !tbaa !4
- %inc = add nsw i32 %3, 1
- store i32 %inc, i32* %i, align 4, !tbaa !4
+ %2 = load i32, ptr %i, align 4, !tbaa !4
+ %inc = add nsw i32 %2, 1
+ store i32 %inc, ptr %i, align 4, !tbaa !4
br label %for.cond
for.end: ; preds = %for.cond
- %4 = bitcast i32* %i to i8*
- call void @llvm.lifetime.end.p0i8(i64 4, i8* %4) #6
+ call void @llvm.lifetime.end.p0(i64 4, ptr %i) #6
ret void
}
; Function Attrs: argmemonly nounwind willreturn
-declare void @llvm.lifetime.start.p0i8(i64 immarg, i8* nocapture) #1
+declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nounwind readnone speculatable willreturn
declare void @llvm.dbg.declare(metadata, metadata, metadata) #2
@@ -81,7 +79,7 @@ declare void @llvm.dbg.declare(metadata, metadata, metadata) #2
declare dso_local i32 @rand() #3
; Function Attrs: argmemonly nounwind willreturn
-declare void @llvm.lifetime.end.p0i8(i64 immarg, i8* nocapture) #1
+declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nounwind uwtable
define dso_local i32 @main() #0 {
@@ -90,29 +88,26 @@ entry:
%val = alloca i32, align 4
%j = alloca i32, align 4
%condition = alloca i32, align 4
- store i32 0, i32* %retval, align 4
+ store i32 0, ptr %retval, align 4
call void @init_arry()
- %0 = bitcast i32* %val to i8*
- call void @llvm.lifetime.start.p0i8(i64 4, i8* %0) #6
- store i32 0, i32* %val, align 4, !tbaa !4
- %1 = bitcast i32* %j to i8*
- call void @llvm.lifetime.start.p0i8(i64 4, i8* %1) #6
- store i32 0, i32* %j, align 4, !tbaa !4
+ call void @llvm.lifetime.start.p0(i64 4, ptr %val) #6
+ store i32 0, ptr %val, align 4, !tbaa !4
+ call void @llvm.lifetime.start.p0(i64 4, ptr %j) #6
+ store i32 0, ptr %j, align 4, !tbaa !4
br label %for.cond
for.cond: ; preds = %for.inc, %entry
- %2 = load i32, i32* %j, align 4, !tbaa !4
- %cmp = icmp slt i32 %2, 20000
+ %0 = load i32, ptr %j, align 4, !tbaa !4
+ %cmp = icmp slt i32 %0, 20000
br i1 %cmp, label %for.body, label %for.end
for.body: ; preds = %for.cond
- %3 = bitcast i32* %condition to i8*
- call void @llvm.lifetime.start.p0i8(i64 4, i8* %3) #6
+ call void @llvm.lifetime.start.p0(i64 4, ptr %condition) #6
%call = call i32 @rand() #6
%rem = srem i32 %call, 5
- store i32 %rem, i32* %condition, align 4, !tbaa !4
- %4 = load i32, i32* %condition, align 4, !tbaa !4
- %conv = zext i32 %4 to i64
+ store i32 %rem, ptr %condition, align 4, !tbaa !4
+ %1 = load i32, ptr %condition, align 4, !tbaa !4
+ %conv = zext i32 %1 to i64
%expval = call i64 @llvm.expect.i64(i64 %conv, i64 6)
switch i64 %expval, label %sw.default [
i64 0, label %sw.bb
@@ -123,50 +118,47 @@ for.body: ; preds = %for.cond
]
sw.bb: ; preds = %for.body
- %call1 = call i32 @sum(i32* getelementptr inbounds ([25 x i32], [25 x i32]* @arry, i64 0, i64 0), i32 25)
- %5 = load i32, i32* %val, align 4, !tbaa !4
- %add = add nsw i32 %5, %call1
- store i32 %add, i32* %val, align 4, !tbaa !4
+ %call1 = call i32 @sum(ptr @arry, i32 25)
+ %2 = load i32, ptr %val, align 4, !tbaa !4
+ %add = add nsw i32 %2, %call1
+ store i32 %add, ptr %val, align 4, !tbaa !4
br label %sw.epilog
sw.bb2: ; preds = %for.body, %for.body, %for.body
br label %sw.epilog
sw.bb3: ; preds = %for.body
- %call4 = call i32 @random_sample(i32* getelementptr inbounds ([25 x i32], [25 x i32]* @arry, i64 0, i64 0), i32 25)
- %6 = load i32, i32* %val, align 4, !tbaa !4
- %add5 = add nsw i32 %6, %call4
- store i32 %add5, i32* %val, align 4, !tbaa !4
+ %call4 = call i32 @random_sample(ptr @arry, i32 25)
+ %3 = load i32, ptr %val, align 4, !tbaa !4
+ %add5 = add nsw i32 %3, %call4
+ store i32 %add5, ptr %val, align 4, !tbaa !4
br label %sw.epilog
sw.default: ; preds = %for.body
unreachable
sw.epilog: ; preds = %sw.bb3, %sw.bb2, %sw.bb
- %7 = bitcast i32* %condition to i8*
- call void @llvm.lifetime.end.p0i8(i64 4, i8* %7) #6
+ call void @llvm.lifetime.end.p0(i64 4, ptr %condition) #6
br label %for.inc
for.inc: ; preds = %sw.epilog
- %8 = load i32, i32* %j, align 4, !tbaa !4
- %inc = add nsw i32 %8, 1
- store i32 %inc, i32* %j, align 4, !tbaa !4
+ %4 = load i32, ptr %j, align 4, !tbaa !4
+ %inc = add nsw i32 %4, 1
+ store i32 %inc, ptr %j, align 4, !tbaa !4
br label %for.cond
for.end: ; preds = %for.cond
- %9 = bitcast i32* %j to i8*
- call void @llvm.lifetime.end.p0i8(i64 4, i8* %9) #6
- %10 = bitcast i32* %val to i8*
- call void @llvm.lifetime.end.p0i8(i64 4, i8* %10) #6
+ call void @llvm.lifetime.end.p0(i64 4, ptr %j) #6
+ call void @llvm.lifetime.end.p0(i64 4, ptr %val) #6
ret i32 0
}
; Function Attrs: nounwind readnone willreturn
declare i64 @llvm.expect.i64(i64, i64) #4
-declare dso_local i32 @sum(i32*, i32) #5
+declare dso_local i32 @sum(ptr, i32) #5
-declare dso_local i32 @random_sample(i32*, i32) #5
+declare dso_local i32 @random_sample(ptr, i32) #5
attributes #0 = { nounwind 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" }
attributes #1 = { argmemonly nounwind willreturn }
diff --git a/llvm/test/Transforms/PGOProfile/misexpect-switch.ll b/llvm/test/Transforms/PGOProfile/misexpect-switch.ll
index 3fa4c894ee0b3..ebecee178b820 100644
--- a/llvm/test/Transforms/PGOProfile/misexpect-switch.ll
+++ b/llvm/test/Transforms/PGOProfile/misexpect-switch.ll
@@ -43,40 +43,38 @@ target triple = "x86_64-unknown-linux-gnu"
define dso_local void @init_arry() #0 !dbg !21 {
entry:
%i = alloca i32, align 4
- %0 = bitcast i32* %i to i8*, !dbg !26
- call void @llvm.lifetime.start.p0i8(i64 4, i8* %0) #6, !dbg !26
- call void @llvm.dbg.declare(metadata i32* %i, metadata !25, metadata !DIExpression()), !dbg !27
- store i32 0, i32* %i, align 4, !dbg !28, !tbaa !30
+ call void @llvm.lifetime.start.p0(i64 4, ptr %i) #6, !dbg !26
+ call void @llvm.dbg.declare(metadata ptr %i, metadata !25, metadata !DIExpression()), !dbg !27
+ store i32 0, ptr %i, align 4, !dbg !28, !tbaa !30
br label %for.cond, !dbg !34
for.cond: ; preds = %for.inc, %entry
- %1 = load i32, i32* %i, align 4, !dbg !35, !tbaa !30
- %cmp = icmp slt i32 %1, 25, !dbg !37
+ %0 = load i32, ptr %i, align 4, !dbg !35, !tbaa !30
+ %cmp = icmp slt i32 %0, 25, !dbg !37
br i1 %cmp, label %for.body, label %for.end, !dbg !38
for.body: ; preds = %for.cond
%call = call i32 @rand() #6, !dbg !39
%rem = srem i32 %call, 10, !dbg !41
- %2 = load i32, i32* %i, align 4, !dbg !42, !tbaa !30
- %idxprom = sext i32 %2 to i64, !dbg !43
- %arrayidx = getelementptr inbounds [25 x i32], [25 x i32]* @arry, i64 0, i64 %idxprom, !dbg !43
- store i32 %rem, i32* %arrayidx, align 4, !dbg !44, !tbaa !30
+ %1 = load i32, ptr %i, align 4, !dbg !42, !tbaa !30
+ %idxprom = sext i32 %1 to i64, !dbg !43
+ %arrayidx = getelementptr inbounds [25 x i32], ptr @arry, i64 0, i64 %idxprom, !dbg !43
+ store i32 %rem, ptr %arrayidx, align 4, !dbg !44, !tbaa !30
br label %for.inc, !dbg !45
for.inc: ; preds = %for.body
- %3 = load i32, i32* %i, align 4, !dbg !46, !tbaa !30
- %inc = add nsw i32 %3, 1, !dbg !46
- store i32 %inc, i32* %i, align 4, !dbg !46, !tbaa !30
+ %2 = load i32, ptr %i, align 4, !dbg !46, !tbaa !30
+ %inc = add nsw i32 %2, 1, !dbg !46
+ store i32 %inc, ptr %i, align 4, !dbg !46, !tbaa !30
br label %for.cond, !dbg !47, !llvm.loop !48
for.end: ; preds = %for.cond
- %4 = bitcast i32* %i to i8*, !dbg !50
- call void @llvm.lifetime.end.p0i8(i64 4, i8* %4) #6, !dbg !50
+ call void @llvm.lifetime.end.p0(i64 4, ptr %i) #6, !dbg !50
ret void, !dbg !50
}
; Function Attrs: argmemonly nounwind willreturn
-declare void @llvm.lifetime.start.p0i8(i64 immarg, i8* nocapture) #1
+declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nounwind readnone speculatable willreturn
declare void @llvm.dbg.declare(metadata, metadata, metadata) #2
@@ -85,7 +83,7 @@ declare void @llvm.dbg.declare(metadata, metadata, metadata) #2
declare dso_local i32 @rand() #3
; Function Attrs: argmemonly nounwind willreturn
-declare void @llvm.lifetime.end.p0i8(i64 immarg, i8* nocapture) #1
+declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nounwind uwtable
define dso_local i32 @main() #0 !dbg !51 {
@@ -94,32 +92,29 @@ entry:
%val = alloca i32, align 4
%j = alloca i32, align 4
%condition = alloca i32, align 4
- store i32 0, i32* %retval, align 4
+ store i32 0, ptr %retval, align 4
call void @init_arry(), !dbg !62
- %0 = bitcast i32* %val to i8*, !dbg !63
- call void @llvm.lifetime.start.p0i8(i64 4, i8* %0) #6, !dbg !63
- call void @llvm.dbg.declare(metadata i32* %val, metadata !55, metadata !DIExpression()), !dbg !64
- store i32 0, i32* %val, align 4, !dbg !64, !tbaa !30
- %1 = bitcast i32* %j to i8*, !dbg !65
- call void @llvm.lifetime.start.p0i8(i64 4, i8* %1) #6, !dbg !65
- call void @llvm.dbg.declare(metadata i32* %j, metadata !56, metadata !DIExpression()), !dbg !66
- store i32 0, i32* %j, align 4, !dbg !67, !tbaa !30
+ call void @llvm.lifetime.start.p0(i64 4, ptr %val) #6, !dbg !63
+ call void @llvm.dbg.declare(metadata ptr %val, metadata !55, metadata !DIExpression()), !dbg !64
+ store i32 0, ptr %val, align 4, !dbg !64, !tbaa !30
+ call void @llvm.lifetime.start.p0(i64 4, ptr %j) #6, !dbg !65
+ call void @llvm.dbg.declare(metadata ptr %j, metadata !56, metadata !DIExpression()), !dbg !66
+ store i32 0, ptr %j, align 4, !dbg !67, !tbaa !30
br label %for.cond, !dbg !68
for.cond: ; preds = %for.inc, %entry
- %2 = load i32, i32* %j, align 4, !dbg !69, !tbaa !30
- %cmp = icmp slt i32 %2, 20000, !dbg !70
+ %0 = load i32, ptr %j, align 4, !dbg !69, !tbaa !30
+ %cmp = icmp slt i32 %0, 20000, !dbg !70
br i1 %cmp, label %for.body, label %for.end, !dbg !71
for.body: ; preds = %for.cond
- %3 = bitcast i32* %condition to i8*, !dbg !72
- call void @llvm.lifetime.start.p0i8(i64 4, i8* %3) #6, !dbg !72
- call void @llvm.dbg.declare(metadata i32* %condition, metadata !57, metadata !DIExpression()), !dbg !73
+ call void @llvm.lifetime.start.p0(i64 4, ptr %condition) #6, !dbg !72
+ call void @llvm.dbg.declare(metadata ptr %condition, metadata !57, metadata !DIExpression()), !dbg !73
%call = call i32 @rand() #6, !dbg !74
%rem = srem i32 %call, 5, !dbg !75
- store i32 %rem, i32* %condition, align 4, !dbg !73, !tbaa !30
- %4 = load i32, i32* %condition, align 4, !dbg !76, !tbaa !30
- %conv = zext i32 %4 to i64, !dbg !76
+ store i32 %rem, ptr %condition, align 4, !dbg !73, !tbaa !30
+ %1 = load i32, ptr %condition, align 4, !dbg !76, !tbaa !30
+ %conv = zext i32 %1 to i64, !dbg !76
%expval = call i64 @llvm.expect.i64(i64 %conv, i64 0), !dbg !77
switch i64 %expval, label %sw.default [
i64 0, label %sw.bb
@@ -130,50 +125,47 @@ for.body: ; preds = %for.cond
], !dbg !78
sw.bb: ; preds = %for.body
- %call1 = call i32 @sum(i32* getelementptr inbounds ([25 x i32], [25 x i32]* @arry, i64 0, i64 0), i32 25), !dbg !79
- %5 = load i32, i32* %val, align 4, !dbg !81, !tbaa !30
- %add = add nsw i32 %5, %call1, !dbg !81
- store i32 %add, i32* %val, align 4, !dbg !81, !tbaa !30
+ %call1 = call i32 @sum(ptr @arry, i32 25), !dbg !79
+ %2 = load i32, ptr %val, align 4, !dbg !81, !tbaa !30
+ %add = add nsw i32 %2, %call1, !dbg !81
+ store i32 %add, ptr %val, align 4, !dbg !81, !tbaa !30
br label %sw.epilog, !dbg !82
sw.bb2: ; preds = %for.body, %for.body, %for.body
br label %sw.epilog, !dbg !83
sw.bb3: ; preds = %for.body
- %call4 = call i32 @random_sample(i32* getelementptr inbounds ([25 x i32], [25 x i32]* @arry, i64 0, i64 0), i32 25), !dbg !84
- %6 = load i32, i32* %val, align 4, !dbg !85, !tbaa !30
- %add5 = add nsw i32 %6, %call4, !dbg !85
- store i32 %add5, i32* %val, align 4, !dbg !85, !tbaa !30
+ %call4 = call i32 @random_sample(ptr @arry, i32 25), !dbg !84
+ %3 = load i32, ptr %val, align 4, !dbg !85, !tbaa !30
+ %add5 = add nsw i32 %3, %call4, !dbg !85
+ store i32 %add5, ptr %val, align 4, !dbg !85, !tbaa !30
br label %sw.epilog, !dbg !86
sw.default: ; preds = %for.body
unreachable, !dbg !87
sw.epilog: ; preds = %sw.bb3, %sw.bb2, %sw.bb
- %7 = bitcast i32* %condition to i8*, !dbg !88
- call void @llvm.lifetime.end.p0i8(i64 4, i8* %7) #6, !dbg !88
+ call void @llvm.lifetime.end.p0(i64 4, ptr %condition) #6, !dbg !88
br label %for.inc, !dbg !89
for.inc: ; preds = %sw.epilog
- %8 = load i32, i32* %j, align 4, !dbg !90, !tbaa !30
- %inc = add nsw i32 %8, 1, !dbg !90
- store i32 %inc, i32* %j, align 4, !dbg !90, !tbaa !30
+ %4 = load i32, ptr %j, align 4, !dbg !90, !tbaa !30
+ %inc = add nsw i32 %4, 1, !dbg !90
+ store i32 %inc, ptr %j, align 4, !dbg !90, !tbaa !30
br label %for.cond, !dbg !91, !llvm.loop !92
for.end: ; preds = %for.cond
- %9 = bitcast i32* %j to i8*, !dbg !94
- call void @llvm.lifetime.end.p0i8(i64 4, i8* %9) #6, !dbg !94
- %10 = bitcast i32* %val to i8*, !dbg !94
- call void @llvm.lifetime.end.p0i8(i64 4, i8* %10) #6, !dbg !94
+ call void @llvm.lifetime.end.p0(i64 4, ptr %j) #6, !dbg !94
+ call void @llvm.lifetime.end.p0(i64 4, ptr %val) #6, !dbg !94
ret i32 0, !dbg !95
}
; Function Attrs: nounwind readnone willreturn
declare i64 @llvm.expect.i64(i64, i64) #4
-declare dso_local i32 @sum(i32*, i32) #5
+declare dso_local i32 @sum(ptr, i32) #5
-declare dso_local i32 @random_sample(i32*, i32) #5
+declare dso_local i32 @random_sample(ptr, i32) #5
attributes #0 = { nounwind 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" }
attributes #1 = { argmemonly nounwind willreturn }
diff --git a/llvm/test/Transforms/PGOProfile/multiple_hash_profile.ll b/llvm/test/Transforms/PGOProfile/multiple_hash_profile.ll
index d2e28db0e2dc4..6a7838080b1dc 100644
--- a/llvm/test/Transforms/PGOProfile/multiple_hash_profile.ll
+++ b/llvm/test/Transforms/PGOProfile/multiple_hash_profile.ll
@@ -6,7 +6,7 @@ target triple = "x86_64-unknown-linux-gnu"
$_Z3fooi = comdat any
- at g2 = local_unnamed_addr global i32 (i32)* null, align 8
+ at g2 = local_unnamed_addr global ptr null, align 8
define i32 @_Z3bari(i32 %i) {
entry:
@@ -18,7 +18,7 @@ entry:
define void @_Z4m2f1v() {
entry:
- store i32 (i32)* @_Z3fooi, i32 (i32)** @g2, align 8
+ store ptr @_Z3fooi, ptr @g2, align 8
ret void
}
diff --git a/llvm/test/Transforms/PGOProfile/noprofile.ll b/llvm/test/Transforms/PGOProfile/noprofile.ll
index 151720d00d6de..c8bdb673c1936 100644
--- a/llvm/test/Transforms/PGOProfile/noprofile.ll
+++ b/llvm/test/Transforms/PGOProfile/noprofile.ll
@@ -8,7 +8,7 @@ target triple = "x86_64-unknown-linux-gnu"
define i32 @test1() {
entry:
; CHECK: call void @llvm.instrprof.increment
- %0 = load i32, i32* @i, align 4
+ %0 = load i32, ptr @i, align 4
%add = add i32 %0, 1
ret i32 %add
}
@@ -16,7 +16,7 @@ entry:
define i32 @test2() #0 {
entry:
; CHECK-NOT: call void @llvm.instrprof.increment
- %0 = load i32, i32* @i, align 4
+ %0 = load i32, ptr @i, align 4
%sub = sub i32 %0, 1
ret i32 %sub
}
diff --git a/llvm/test/Transforms/PGOProfile/not_promote_ret_exit.ll b/llvm/test/Transforms/PGOProfile/not_promote_ret_exit.ll
index 8481f067e7a14..83beba45f04d6 100644
--- a/llvm/test/Transforms/PGOProfile/not_promote_ret_exit.ll
+++ b/llvm/test/Transforms/PGOProfile/not_promote_ret_exit.ll
@@ -9,19 +9,19 @@ $__llvm_profile_raw_version = comdat any
define dso_local void @foo(i32 %n) {
entry:
- call void @llvm.instrprof.increment(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__profn_foo, i32 0, i32 0), i64 29212902728, i32 2, i32 1)
+ call void @llvm.instrprof.increment(ptr @__profn_foo, i64 29212902728, i32 2, i32 1)
br label %for.cond
for.cond:
%i.0 = phi i32 [ 0, %entry ], [ %inc, %if.end ]
%cmp = icmp slt i32 %i.0, %n
- %0 = load i32, i32* @bar, align 4
+ %0 = load i32, ptr @bar, align 4
%tobool.not = icmp eq i32 %0, 0
%or.cond = and i1 %cmp, %tobool.not
br i1 %or.cond, label %if.end, label %cleanup
if.end:
- call void @llvm.instrprof.increment(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__profn_foo, i32 0, i32 0), i64 29212902728, i32 2, i32 0)
+ call void @llvm.instrprof.increment(ptr @__profn_foo, i64 29212902728, i32 2, i32 0)
call void (...) @bar2()
%inc = add nuw nsw i32 %i.0, 1
br label %for.cond
@@ -35,4 +35,4 @@ cleanup:
declare dso_local void @bar2(...)
-declare void @llvm.instrprof.increment(i8*, i64, i32, i32)
+declare void @llvm.instrprof.increment(ptr, i64, i32, i32)
diff --git a/llvm/test/Transforms/PGOProfile/ppc-prevent-mma-types.ll b/llvm/test/Transforms/PGOProfile/ppc-prevent-mma-types.ll
index 4da06244b247e..2cfeb2e8faf52 100644
--- a/llvm/test/Transforms/PGOProfile/ppc-prevent-mma-types.ll
+++ b/llvm/test/Transforms/PGOProfile/ppc-prevent-mma-types.ll
@@ -11,21 +11,21 @@
; within the IR.
%0 = type <{ double }>
-%1 = type <{ [1 x %0]*, i8, i8, i8, i8, i32, i32, i32, [1 x i32], [1 x i32], [1 x i32], [24 x i8] }>
-declare i8* @__malloc()
+%1 = type <{ ptr, i8, i8, i8, i8, i32, i32, i32, [1 x i32], [1 x i32], [1 x i32], [24 x i8] }>
+declare ptr @__malloc()
; CHECK-NOT: <256 x i1>
; CHECK-NOT: <512 x i1>
-define dso_local void @test([0 x %0]* %arg, i32* %arg1, i32* %arg2, i32* %arg3, i32* %arg4) {
- %i = alloca [0 x %0]*, align 4
- store [0 x %0]* %arg, [0 x %0]** %i, align 4
- %i7 = alloca i32*, align 4
- store i32* %arg1, i32** %i7, align 4
- %i9 = alloca i32*, align 4
- store i32* %arg2, i32** %i9, align 4
- %i10 = alloca i32*, align 4
- store i32* %arg3, i32** %i10, align 4
- %i11 = alloca i32*, align 4
- store i32* %arg4, i32** %i11, align 4
+define dso_local void @test(ptr %arg, ptr %arg1, ptr %arg2, ptr %arg3, ptr %arg4) {
+ %i = alloca ptr, align 4
+ store ptr %arg, ptr %i, align 4
+ %i7 = alloca ptr, align 4
+ store ptr %arg1, ptr %i7, align 4
+ %i9 = alloca ptr, align 4
+ store ptr %arg2, ptr %i9, align 4
+ %i10 = alloca ptr, align 4
+ store ptr %arg3, ptr %i10, align 4
+ %i11 = alloca ptr, align 4
+ store ptr %arg4, ptr %i11, align 4
%i14 = alloca %1, align 4
%i15 = alloca i32, align 4
%i16 = alloca i32, align 4
@@ -36,169 +36,143 @@ define dso_local void @test([0 x %0]* %arg, i32* %arg1, i32* %arg2, i32* %arg3,
%i22 = alloca i32, align 4
%i23 = alloca i32, align 4
%i25 = alloca double, align 8
- %i26 = load i32*, i32** %i9, align 4
- %i27 = load i32, i32* %i26, align 4
+ %i26 = load ptr, ptr %i9, align 4
+ %i27 = load i32, ptr %i26, align 4
%i28 = select i1 false, i32 0, i32 %i27
- store i32 %i28, i32* %i15, align 4
- %i29 = load i32*, i32** %i7, align 4
- %i30 = load i32, i32* %i29, align 4
+ store i32 %i28, ptr %i15, align 4
+ %i29 = load ptr, ptr %i7, align 4
+ %i30 = load i32, ptr %i29, align 4
%i31 = select i1 false, i32 0, i32 %i30
- store i32 %i31, i32* %i16, align 4
- %i32 = load i32, i32* %i15, align 4
+ store i32 %i31, ptr %i16, align 4
+ %i32 = load i32, ptr %i15, align 4
%i33 = mul i32 8, %i32
- store i32 %i33, i32* %i17, align 4
- %i34 = load i32, i32* %i17, align 4
- %i35 = load i32, i32* %i16, align 4
+ store i32 %i33, ptr %i17, align 4
+ %i34 = load i32, ptr %i17, align 4
+ %i35 = load i32, ptr %i16, align 4
%i36 = mul i32 %i34, %i35
- store i32 %i36, i32* %i18, align 4
- %i37 = load i32*, i32** %i9, align 4
- %i38 = load i32, i32* %i37, align 4
+ store i32 %i36, ptr %i18, align 4
+ %i37 = load ptr, ptr %i9, align 4
+ %i38 = load i32, ptr %i37, align 4
%i39 = select i1 false, i32 0, i32 %i38
- store i32 %i39, i32* %i22, align 4
- %i40 = load i32*, i32** %i10, align 4
- %i41 = load i32, i32* %i40, align 4
+ store i32 %i39, ptr %i22, align 4
+ %i40 = load ptr, ptr %i10, align 4
+ %i41 = load i32, ptr %i40, align 4
%i42 = select i1 false, i32 0, i32 %i41
- store i32 %i42, i32* %i23, align 4
- %i43 = getelementptr inbounds %1, %1* %i14, i32 0, i32 10
- %i44 = bitcast [1 x i32]* %i43 to i8*
- %i45 = getelementptr i8, i8* %i44, i32 -12
- %i46 = getelementptr inbounds i8, i8* %i45, i32 12
- %i47 = bitcast i8* %i46 to i32*
- %i48 = load i32, i32* %i23, align 4
+ store i32 %i42, ptr %i23, align 4
+ %i43 = getelementptr inbounds %1, ptr %i14, i32 0, i32 10
+ %i45 = getelementptr i8, ptr %i43, i32 -12
+ %i46 = getelementptr inbounds i8, ptr %i45, i32 12
+ %i48 = load i32, ptr %i23, align 4
%i49 = select i1 false, i32 0, i32 %i48
- %i50 = load i32, i32* %i22, align 4
+ %i50 = load i32, ptr %i22, align 4
%i51 = select i1 false, i32 0, i32 %i50
%i52 = mul i32 %i51, 8
%i53 = mul i32 %i49, %i52
- store i32 %i53, i32* %i47, align 4
- %i54 = getelementptr inbounds %1, %1* %i14, i32 0, i32 10
- %i55 = bitcast [1 x i32]* %i54 to i8*
- %i56 = getelementptr i8, i8* %i55, i32 -12
- %i57 = getelementptr inbounds i8, i8* %i56, i32 36
- %i58 = bitcast i8* %i57 to i32*
- store i32 8, i32* %i58, align 4
- %i60 = getelementptr inbounds %1, %1* %i14, i32 0, i32 0
- %i61 = call i8* @__malloc()
- %i62 = bitcast [1 x %0]** %i60 to i8**
- store i8* %i61, i8** %i62, align 4
+ store i32 %i53, ptr %i46, align 4
+ %i54 = getelementptr inbounds %1, ptr %i14, i32 0, i32 10
+ %i56 = getelementptr i8, ptr %i54, i32 -12
+ %i57 = getelementptr inbounds i8, ptr %i56, i32 36
+ store i32 8, ptr %i57, align 4
+ %i61 = call ptr @__malloc()
+ store ptr %i61, ptr %i14, align 4
br label %bb63
bb63: ; preds = %bb66, %bb
- %i64 = load i32*, i32** %i11, align 4
- %i65 = load i32, i32* %i64, align 4
+ %i64 = load ptr, ptr %i11, align 4
+ %i65 = load i32, ptr %i64, align 4
br label %bb66
bb66: ; preds = %bb165, %bb63
- %i67 = load i32, i32* %i21, align 4
+ %i67 = load i32, ptr %i21, align 4
%i68 = icmp sle i32 %i67, %i65
br i1 %i68, label %bb69, label %bb63
bb69: ; preds = %bb66
- store i32 1, i32* %i20, align 4
+ store i32 1, ptr %i20, align 4
br label %bb70
bb70: ; preds = %bb163, %bb69
- %i71 = load i32, i32* %i20, align 4
+ %i71 = load i32, ptr %i20, align 4
%i72 = icmp sle i32 %i71, 11
br i1 %i72, label %bb73, label %bb165
bb73: ; preds = %bb70
- %i74 = load i32, i32* %i21, align 4
+ %i74 = load i32, ptr %i21, align 4
%i76 = mul i32 %i74, 8
- %i77 = getelementptr inbounds i8, i8* null, i32 %i76
- %i78 = bitcast i8* %i77 to double*
- %i79 = load double, double* %i78, align 8
+ %i77 = getelementptr inbounds i8, ptr null, i32 %i76
+ %i79 = load double, ptr %i77, align 8
%i80 = fcmp fast olt double %i79, 0.000000e+00
%i81 = zext i1 %i80 to i32
%i82 = trunc i32 %i81 to i1
br i1 %i82, label %bb83, label %bb102
bb83: ; preds = %bb73
- %i84 = getelementptr inbounds %1, %1* %i14, i32 0, i32 0
- %i85 = load [1 x %0]*, [1 x %0]** %i84, align 4
- %i86 = bitcast [1 x %0]* %i85 to i8*
- %i87 = getelementptr i8, i8* %i86, i32 0
- %i88 = load i32, i32* %i20, align 4
- %i89 = getelementptr inbounds %1, %1* %i14, i32 0, i32 10
- %i90 = getelementptr inbounds [1 x i32], [1 x i32]* %i89, i32 0, i32 0
- %i91 = load i32, i32* %i90, align 4
+ %i85 = load ptr, ptr %i14, align 4
+ %i88 = load i32, ptr %i20, align 4
+ %i89 = getelementptr inbounds %1, ptr %i14, i32 0, i32 10
+ %i91 = load i32, ptr %i89, align 4
%i92 = mul i32 %i88, %i91
- %i93 = getelementptr inbounds i8, i8* %i87, i32 %i92
- %i94 = getelementptr inbounds i8, i8* %i93, i32 0
- %i95 = load i32, i32* %i21, align 4
- %i96 = getelementptr inbounds %1, %1* %i14, i32 0, i32 10
- %i97 = getelementptr inbounds [1 x i32], [1 x i32]* %i96, i32 0, i32 6
- %i98 = load i32, i32* %i97, align 4
+ %i93 = getelementptr inbounds i8, ptr %i85, i32 %i92
+ %i95 = load i32, ptr %i21, align 4
+ %i96 = getelementptr inbounds %1, ptr %i14, i32 0, i32 10
+ %i97 = getelementptr inbounds [1 x i32], ptr %i96, i32 0, i32 6
+ %i98 = load i32, ptr %i97, align 4
%i99 = mul i32 %i95, %i98
- %i100 = getelementptr inbounds i8, i8* %i94, i32 %i99
- %i101 = bitcast i8* %i100 to double*
- store double 0.000000e+00, double* %i101, align 8
+ %i100 = getelementptr inbounds i8, ptr %i93, i32 %i99
+ store double 0.000000e+00, ptr %i100, align 8
br label %bb163
bb102: ; preds = %bb73
- %i103 = getelementptr i8, i8* null, i32 -8
- %i104 = getelementptr inbounds i8, i8* %i103, i32 undef
- %i105 = bitcast i8* %i104 to double*
- %i106 = load double, double* %i105, align 8
- %i107 = load [0 x %0]*, [0 x %0]** %i, align 4
- %i108 = bitcast [0 x %0]* %i107 to i8*
- %i109 = getelementptr i8, i8* %i108, i32 -8
- %i110 = getelementptr inbounds i8, i8* %i109, i32 undef
- %i111 = bitcast i8* %i110 to double*
- %i112 = load double, double* %i111, align 8
+ %i103 = getelementptr i8, ptr null, i32 -8
+ %i104 = getelementptr inbounds i8, ptr %i103, i32 undef
+ %i106 = load double, ptr %i104, align 8
+ %i107 = load ptr, ptr %i, align 4
+ %i109 = getelementptr i8, ptr %i107, i32 -8
+ %i110 = getelementptr inbounds i8, ptr %i109, i32 undef
+ %i112 = load double, ptr %i110, align 8
%i113 = fmul fast double %i106, %i112
%i114 = fcmp fast ogt double 0.000000e+00, %i113
%i115 = zext i1 %i114 to i32
%i116 = trunc i32 %i115 to i1
br i1 %i116, label %bb117, label %bb136
bb117: ; preds = %bb102
- %i118 = getelementptr inbounds %1, %1* %i14, i32 0, i32 0
- %i119 = load [1 x %0]*, [1 x %0]** %i118, align 4
- %i120 = bitcast [1 x %0]* %i119 to i8*
- %i121 = getelementptr i8, i8* %i120, i32 0
- %i122 = load i32, i32* %i20, align 4
- %i123 = getelementptr inbounds %1, %1* %i14, i32 0, i32 10
- %i124 = getelementptr inbounds [1 x i32], [1 x i32]* %i123, i32 0, i32 0
- %i125 = load i32, i32* %i124, align 4
+ %i119 = load ptr, ptr %i14, align 4
+ %i122 = load i32, ptr %i20, align 4
+ %i123 = getelementptr inbounds %1, ptr %i14, i32 0, i32 10
+ %i125 = load i32, ptr %i123, align 4
%i126 = mul i32 %i122, %i125
- %i127 = getelementptr inbounds i8, i8* %i121, i32 %i126
- %i128 = getelementptr inbounds i8, i8* %i127, i32 0
- %i129 = load i32, i32* %i21, align 4
- %i130 = getelementptr inbounds %1, %1* %i14, i32 0, i32 10
- %i131 = getelementptr inbounds [1 x i32], [1 x i32]* %i130, i32 0, i32 6
- %i132 = load i32, i32* %i131, align 4
+ %i127 = getelementptr inbounds i8, ptr %i119, i32 %i126
+ %i129 = load i32, ptr %i21, align 4
+ %i130 = getelementptr inbounds %1, ptr %i14, i32 0, i32 10
+ %i131 = getelementptr inbounds [1 x i32], ptr %i130, i32 0, i32 6
+ %i132 = load i32, ptr %i131, align 4
%i133 = mul i32 %i129, %i132
- %i134 = getelementptr inbounds i8, i8* %i128, i32 %i133
- %i135 = bitcast i8* %i134 to double*
- store double 0.000000e+00, double* %i135, align 8
+ %i134 = getelementptr inbounds i8, ptr %i127, i32 %i133
+ store double 0.000000e+00, ptr %i134, align 8
br label %bb163
bb136: ; preds = %bb102
- %i137 = load double, double* null, align 8
- %i138 = load double, double* null, align 8
+ %i137 = load double, ptr null, align 8
+ %i138 = load double, ptr null, align 8
%i139 = fmul fast double %i137, %i138
%i140 = fsub fast double 0.000000e+00, %i139
- store double %i140, double* %i25, align 8
- %i141 = load i32, i32* %i21, align 4
- %i143 = getelementptr inbounds [1 x i32], [1 x i32]* null, i32 0, i32 6
- %i144 = load i32, i32* %i143, align 4
+ store double %i140, ptr %i25, align 8
+ %i141 = load i32, ptr %i21, align 4
+ %i143 = getelementptr inbounds [1 x i32], ptr null, i32 0, i32 6
+ %i144 = load i32, ptr %i143, align 4
%i145 = mul i32 %i141, %i144
- %i146 = getelementptr inbounds i8, i8* null, i32 %i145
- %i147 = bitcast i8* %i146 to double*
- %i148 = load i32, i32* %i20, align 4
- %i149 = load i32, i32* %i18, align 4
+ %i146 = getelementptr inbounds i8, ptr null, i32 %i145
+ %i148 = load i32, ptr %i20, align 4
+ %i149 = load i32, ptr %i18, align 4
%i151 = mul i32 %i148, %i149
- %i152 = getelementptr i8, i8* null, i32 %i151
- %i153 = getelementptr i8, i8* %i152, i32 0
- %i154 = getelementptr inbounds i8, i8* %i153, i32 0
- %i155 = bitcast i8* %i154 to double*
- %i156 = load double, double* %i155, align 8
- %i157 = load double, double* %i25, align 8
+ %i152 = getelementptr i8, ptr null, i32 %i151
+ %i156 = load double, ptr %i152, align 8
+ %i157 = load double, ptr %i25, align 8
%i158 = fmul fast double %i156, %i157
%i159 = fadd fast double 0.000000e+00, %i158
- %i160 = load double, double* %i25, align 8
+ %i160 = load double, ptr %i25, align 8
%i161 = fadd fast double 0.000000e+00, %i160
%i162 = fdiv fast double %i159, %i161
- store double %i162, double* %i147, align 8
+ store double %i162, ptr %i146, align 8
br label %bb163
bb163: ; preds = %bb136, %bb117, %bb83
%i164 = add nsw i32 %i71, 1
- store i32 %i164, i32* %i20, align 4
+ store i32 %i164, ptr %i20, align 4
br label %bb70
bb165: ; preds = %bb70
%i166 = add nsw i32 %i67, 1
- store i32 %i166, i32* %i21, align 4
+ store i32 %i166, ptr %i21, align 4
br label %bb66
}
diff --git a/llvm/test/Transforms/PGOProfile/select_hash_conflict.ll b/llvm/test/Transforms/PGOProfile/select_hash_conflict.ll
index 6505254568a53..755389b806a30 100644
--- a/llvm/test/Transforms/PGOProfile/select_hash_conflict.ll
+++ b/llvm/test/Transforms/PGOProfile/select_hash_conflict.ll
@@ -24,70 +24,70 @@ target triple = "x86_64-unknown-linux-gnu"
define i32 @foo(i32 %n) {
entry:
- %0 = load i8, i8* @c0, align 1
+ %0 = load i8, ptr @c0, align 1
%tobool = icmp eq i8 %0, 0
%cond = select i1 %tobool, i32 2, i32 1
- store i32 %cond, i32* getelementptr inbounds ([16 x i32], [16 x i32]* @a, i64 0, i64 0), align 16
- %1 = load i8, i8* @c1, align 1
+ store i32 %cond, ptr @a, align 16
+ %1 = load i8, ptr @c1, align 1
%tobool2 = icmp eq i8 %1, 0
%cond3 = select i1 %tobool2, i32 2, i32 1
- store i32 %cond3, i32* getelementptr inbounds ([16 x i32], [16 x i32]* @a, i64 0, i64 1), align 4
- %2 = load i8, i8* @c2, align 1
+ store i32 %cond3, ptr getelementptr inbounds ([16 x i32], ptr @a, i64 0, i64 1), align 4
+ %2 = load i8, ptr @c2, align 1
%tobool5 = icmp eq i8 %2, 0
%cond6 = select i1 %tobool5, i32 2, i32 1
- store i32 %cond6, i32* getelementptr inbounds ([16 x i32], [16 x i32]* @a, i64 0, i64 2), align 8
- %3 = load i8, i8* @c3, align 1
+ store i32 %cond6, ptr getelementptr inbounds ([16 x i32], ptr @a, i64 0, i64 2), align 8
+ %3 = load i8, ptr @c3, align 1
%tobool8 = icmp eq i8 %3, 0
%cond9 = select i1 %tobool8, i32 2, i32 1
- store i32 %cond9, i32* getelementptr inbounds ([16 x i32], [16 x i32]* @a, i64 0, i64 3), align 4
- %4 = load i8, i8* @c4, align 1
+ store i32 %cond9, ptr getelementptr inbounds ([16 x i32], ptr @a, i64 0, i64 3), align 4
+ %4 = load i8, ptr @c4, align 1
%tobool11 = icmp eq i8 %4, 0
%cond12 = select i1 %tobool11, i32 2, i32 1
- store i32 %cond12, i32* getelementptr inbounds ([16 x i32], [16 x i32]* @a, i64 0, i64 4), align 16
- %5 = load i8, i8* @c5, align 1
+ store i32 %cond12, ptr getelementptr inbounds ([16 x i32], ptr @a, i64 0, i64 4), align 16
+ %5 = load i8, ptr @c5, align 1
%tobool14 = icmp eq i8 %5, 0
%cond15 = select i1 %tobool14, i32 2, i32 1
- store i32 %cond15, i32* getelementptr inbounds ([16 x i32], [16 x i32]* @a, i64 0, i64 5), align 4
- %6 = load i8, i8* @c6, align 1
+ store i32 %cond15, ptr getelementptr inbounds ([16 x i32], ptr @a, i64 0, i64 5), align 4
+ %6 = load i8, ptr @c6, align 1
%tobool17 = icmp eq i8 %6, 0
%cond18 = select i1 %tobool17, i32 2, i32 1
- store i32 %cond18, i32* getelementptr inbounds ([16 x i32], [16 x i32]* @a, i64 0, i64 6), align 8
- %7 = load i8, i8* @c7, align 1
+ store i32 %cond18, ptr getelementptr inbounds ([16 x i32], ptr @a, i64 0, i64 6), align 8
+ %7 = load i8, ptr @c7, align 1
%tobool20 = icmp eq i8 %7, 0
%cond21 = select i1 %tobool20, i32 2, i32 1
- store i32 %cond21, i32* getelementptr inbounds ([16 x i32], [16 x i32]* @a, i64 0, i64 7), align 4
- %8 = load i8, i8* @c8, align 1
+ store i32 %cond21, ptr getelementptr inbounds ([16 x i32], ptr @a, i64 0, i64 7), align 4
+ %8 = load i8, ptr @c8, align 1
%tobool23 = icmp eq i8 %8, 0
%cond24 = select i1 %tobool23, i32 2, i32 1
- store i32 %cond24, i32* getelementptr inbounds ([16 x i32], [16 x i32]* @a, i64 0, i64 8), align 16
- %9 = load i8, i8* @c9, align 1
+ store i32 %cond24, ptr getelementptr inbounds ([16 x i32], ptr @a, i64 0, i64 8), align 16
+ %9 = load i8, ptr @c9, align 1
%tobool26 = icmp eq i8 %9, 0
%cond27 = select i1 %tobool26, i32 2, i32 1
- store i32 %cond27, i32* getelementptr inbounds ([16 x i32], [16 x i32]* @a, i64 0, i64 9), align 4
- %10 = load i8, i8* @c10, align 1
+ store i32 %cond27, ptr getelementptr inbounds ([16 x i32], ptr @a, i64 0, i64 9), align 4
+ %10 = load i8, ptr @c10, align 1
%tobool29 = icmp eq i8 %10, 0
%cond30 = select i1 %tobool29, i32 2, i32 1
- store i32 %cond30, i32* getelementptr inbounds ([16 x i32], [16 x i32]* @a, i64 0, i64 10), align 8
- %11 = load i8, i8* @c11, align 1
+ store i32 %cond30, ptr getelementptr inbounds ([16 x i32], ptr @a, i64 0, i64 10), align 8
+ %11 = load i8, ptr @c11, align 1
%tobool32 = icmp eq i8 %11, 0
%cond33 = select i1 %tobool32, i32 2, i32 1
- store i32 %cond33, i32* getelementptr inbounds ([16 x i32], [16 x i32]* @a, i64 0, i64 11), align 4
- %12 = load i8, i8* @c12, align 1
+ store i32 %cond33, ptr getelementptr inbounds ([16 x i32], ptr @a, i64 0, i64 11), align 4
+ %12 = load i8, ptr @c12, align 1
%tobool35 = icmp eq i8 %12, 0
%cond36 = select i1 %tobool35, i32 2, i32 1
- store i32 %cond36, i32* getelementptr inbounds ([16 x i32], [16 x i32]* @a, i64 0, i64 12), align 16
- %13 = load i8, i8* @c13, align 1
+ store i32 %cond36, ptr getelementptr inbounds ([16 x i32], ptr @a, i64 0, i64 12), align 16
+ %13 = load i8, ptr @c13, align 1
%tobool38 = icmp eq i8 %13, 0
%cond39 = select i1 %tobool38, i32 2, i32 1
- store i32 %cond39, i32* getelementptr inbounds ([16 x i32], [16 x i32]* @a, i64 0, i64 13), align 4
- %14 = load i8, i8* @c14, align 1
+ store i32 %cond39, ptr getelementptr inbounds ([16 x i32], ptr @a, i64 0, i64 13), align 4
+ %14 = load i8, ptr @c14, align 1
%tobool41 = icmp eq i8 %14, 0
%cond42 = select i1 %tobool41, i32 2, i32 1
- store i32 %cond42, i32* getelementptr inbounds ([16 x i32], [16 x i32]* @a, i64 0, i64 14), align 8
- %15 = load i8, i8* @c15, align 1
+ store i32 %cond42, ptr getelementptr inbounds ([16 x i32], ptr @a, i64 0, i64 14), align 8
+ %15 = load i8, ptr @c15, align 1
%tobool44 = icmp eq i8 %15, 0
%cond45 = select i1 %tobool44, i32 2, i32 1
- store i32 %cond45, i32* getelementptr inbounds ([16 x i32], [16 x i32]* @a, i64 0, i64 15), align 4
+ store i32 %cond45, ptr getelementptr inbounds ([16 x i32], ptr @a, i64 0, i64 15), align 4
ret i32 %n
}
; CHECK-LABEL: define i32 @foo(i32 %n)
diff --git a/llvm/test/Transforms/PGOProfile/split-indirectbr-critical-edges.ll b/llvm/test/Transforms/PGOProfile/split-indirectbr-critical-edges.ll
index 0b29013b267f0..8b92f8ccb51fb 100644
--- a/llvm/test/Transforms/PGOProfile/split-indirectbr-critical-edges.ll
+++ b/llvm/test/Transforms/PGOProfile/split-indirectbr-critical-edges.ll
@@ -8,18 +8,18 @@ entry:
}
; Function Attrs: norecurse nounwind readonly uwtable
-define i32 @foo(i8* nocapture readonly %p) #1 {
+define i32 @foo(ptr nocapture readonly %p) #1 {
entry:
- %targets = alloca [256 x i8*], align 16
- %arrayidx1 = getelementptr inbounds [256 x i8*], [256 x i8*]* %targets, i64 0, i64 93
- store i8* blockaddress(@foo, %if.end), i8** %arrayidx1, align 8
+ %targets = alloca [256 x ptr], align 16
+ %arrayidx1 = getelementptr inbounds [256 x ptr], ptr %targets, i64 0, i64 93
+ store ptr blockaddress(@foo, %if.end), ptr %arrayidx1, align 8
br label %for.cond2
for.cond2: ; preds = %if.end, %for.cond2, %entry
; CHECK: for.cond2: ; preds = %.split1
- %p.addr.0 = phi i8* [ %p, %entry ], [ %incdec.ptr5, %if.end ], [ %incdec.ptr, %for.cond2 ]
- %incdec.ptr = getelementptr inbounds i8, i8* %p.addr.0, i64 1
- %0 = load i8, i8* %p.addr.0, align 1
+ %p.addr.0 = phi ptr [ %p, %entry ], [ %incdec.ptr5, %if.end ], [ %incdec.ptr, %for.cond2 ]
+ %incdec.ptr = getelementptr inbounds i8, ptr %p.addr.0, i64 1
+ %0 = load i8, ptr %p.addr.0, align 1
%cond = icmp eq i8 %0, 93
br i1 %cond, label %if.end.preheader, label %for.cond2
@@ -28,14 +28,14 @@ if.end.preheader: ; preds = %for.cond2
if.end: ; preds = %if.end.preheader, %if.end
; CHECK: if.end: ; preds = %.split1
- %p.addr.1 = phi i8* [ %incdec.ptr5, %if.end ], [ %incdec.ptr, %if.end.preheader ]
- %incdec.ptr5 = getelementptr inbounds i8, i8* %p.addr.1, i64 1
- %1 = load i8, i8* %p.addr.1, align 1
+ %p.addr.1 = phi ptr [ %incdec.ptr5, %if.end ], [ %incdec.ptr, %if.end.preheader ]
+ %incdec.ptr5 = getelementptr inbounds i8, ptr %p.addr.1, i64 1
+ %1 = load i8, ptr %p.addr.1, align 1
%idxprom6 = zext i8 %1 to i64
- %arrayidx7 = getelementptr inbounds [256 x i8*], [256 x i8*]* %targets, i64 0, i64 %idxprom6
- %2 = load i8*, i8** %arrayidx7, align 8
- indirectbr i8* %2, [label %for.cond2, label %if.end]
-; CHECK: indirectbr i8* %2, [label %for.cond2, label %if.end]
+ %arrayidx7 = getelementptr inbounds [256 x ptr], ptr %targets, i64 0, i64 %idxprom6
+ %2 = load ptr, ptr %arrayidx7, align 8
+ indirectbr ptr %2, [label %for.cond2, label %if.end]
+; CHECK: indirectbr ptr %2, [label %for.cond2, label %if.end]
}
;; If an indirectbr critical edge cannot be split, ignore it.
@@ -47,24 +47,24 @@ if.end: ; preds = %if.end.preheader, %
; CHECK-NOT: call void @llvm.instrprof.increment
; CHECK: indirect2:
; CHECK-NEXT: call void @llvm.instrprof.increment
-define i32 @cannot_split(i8* nocapture readonly %p) {
+define i32 @cannot_split(ptr nocapture readonly %p) {
entry:
- %targets = alloca <2 x i8*>, align 16
- store <2 x i8*> <i8* blockaddress(@cannot_split, %indirect), i8* blockaddress(@cannot_split, %end)>, <2 x i8*>* %targets, align 16
- %arrayidx2 = getelementptr inbounds i8, i8* %p, i64 1
- %0 = load i8, i8* %arrayidx2
+ %targets = alloca <2 x ptr>, align 16
+ store <2 x ptr> <ptr blockaddress(@cannot_split, %indirect), ptr blockaddress(@cannot_split, %end)>, ptr %targets, align 16
+ %arrayidx2 = getelementptr inbounds i8, ptr %p, i64 1
+ %0 = load i8, ptr %arrayidx2
%idxprom = sext i8 %0 to i64
- %arrayidx3 = getelementptr inbounds <2 x i8*>, <2 x i8*>* %targets, i64 0, i64 %idxprom
- %1 = load i8*, i8** %arrayidx3, align 8
+ %arrayidx3 = getelementptr inbounds <2 x ptr>, ptr %targets, i64 0, i64 %idxprom
+ %1 = load ptr, ptr %arrayidx3, align 8
br label %indirect
indirect: ; preds = %entry, %indirect
- indirectbr i8* %1, [label %indirect, label %end, label %indirect2]
+ indirectbr ptr %1, [label %indirect, label %end, label %indirect2]
indirect2:
; For this test we do not want critical edges split. Adding a 2nd `indirectbr`
; does the trick.
- indirectbr i8* %1, [label %indirect, label %end]
+ indirectbr ptr %1, [label %indirect, label %end]
end: ; preds = %indirect
ret i32 0
diff --git a/llvm/test/Transforms/PGOProfile/thinlto_samplepgo_icp.ll b/llvm/test/Transforms/PGOProfile/thinlto_samplepgo_icp.ll
index 80f792c0634b5..52c545fb98386 100644
--- a/llvm/test/Transforms/PGOProfile/thinlto_samplepgo_icp.ll
+++ b/llvm/test/Transforms/PGOProfile/thinlto_samplepgo_icp.ll
@@ -12,12 +12,12 @@
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 fptr = local_unnamed_addr global void ()* null, align 8
+ at fptr = local_unnamed_addr global ptr null, align 8
; Function Attrs: norecurse uwtable
define i32 @main() local_unnamed_addr #0 !prof !34 {
entry:
- %0 = load void ()*, void ()** @fptr, align 8
+ %0 = load ptr, ptr @fptr, align 8
; ICALL-PROM: br i1 %{{[0-9]+}}, label %if.true.direct_targ, label %if.false.orig_indirect
tail call void %0(), !prof !40
ret i32 0
diff --git a/llvm/test/Transforms/PGOProfile/thinlto_samplepgo_icp3.ll b/llvm/test/Transforms/PGOProfile/thinlto_samplepgo_icp3.ll
index eb457973be0ca..f509ab907b7fc 100644
--- a/llvm/test/Transforms/PGOProfile/thinlto_samplepgo_icp3.ll
+++ b/llvm/test/Transforms/PGOProfile/thinlto_samplepgo_icp3.ll
@@ -19,12 +19,12 @@
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 fptr = local_unnamed_addr global void ()* null, align 8
+ at fptr = local_unnamed_addr global ptr null, align 8
; Function Attrs: norecurse uwtable
define i32 @main() local_unnamed_addr #0 !prof !34 {
entry:
- %0 = load void ()*, void ()** @fptr, align 8
+ %0 = load ptr, ptr @fptr, align 8
tail call void %0(), !prof !40
ret i32 0
}
diff --git a/llvm/test/Transforms/PGOProfile/thinlto_samplepgo_icp_droppeddead.ll b/llvm/test/Transforms/PGOProfile/thinlto_samplepgo_icp_droppeddead.ll
index df93826a7b7ce..fcaf8da0857bf 100644
--- a/llvm/test/Transforms/PGOProfile/thinlto_samplepgo_icp_droppeddead.ll
+++ b/llvm/test/Transforms/PGOProfile/thinlto_samplepgo_icp_droppeddead.ll
@@ -15,7 +15,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 fptr = local_unnamed_addr global void ()* null, align 8
+ at fptr = local_unnamed_addr global ptr null, align 8
define void @_ZL3foov() #1 {
entry:
@@ -24,7 +24,7 @@ entry:
define i32 @main() local_unnamed_addr #0 !prof !34 {
entry:
- %0 = load void ()*, void ()** @fptr, align 8
+ %0 = load ptr, ptr @fptr, align 8
; OPT-NOT: label %if.false.orig_indirect
; OPT-NODEAD: br i1 %{{[0-9]+}}, label %if.end.icp, label %if.false.orig_indirect
tail call void %0(), !prof !40
More information about the llvm-commits
mailing list