;
define i32 @testfunc() {
- ret i32* null
+ ret ptr null
}
; This testcase is invalid because we are indexing into a pointer that is
; contained WITHIN a structure.
-define void @test({i32, i32*} * %X) {
- getelementptr {i32, i32*}, {i32, i32*} * %X, i32 0, i32 1, i32 0
+define void @test(ptr %X) {
+ getelementptr {i32, ptr}, ptr %X, i32 0, i32 1, i32 0
ret void
}
%struct_4 = type { i32 }
define void @test() {
- store %struct_4 zeroinitializer, %struct_4* null
+ store %struct_4 zeroinitializer, ptr null
unreachable
}
; CHECK: llvm intrinsics cannot be defined
; PR1047
-define void @llvm.memcpy.p0i8.p0i8.i32(i8*, i8*, i32, i1) {
+define void @llvm.memcpy.p0.p0.i32(ptr, ptr, i32, i1) {
entry:
ret void
}
; RUN: not llvm-as < %s > /dev/null 2>&1
-declare void @foo(i8*)
+declare void @foo(ptr)
define void @bar() {
- invoke void @foo(i8* signext null)
+ invoke void @foo(ptr signext null)
to label %r unwind label %r
r:
ret void
declare void @foo(...)
define void @bar() {
- call void (...) @foo(%struct* sret(%struct) null )
+ call void (...) @foo(ptr sret(%struct) null )
ret void
}
ret i64 %result
}
-declare i32 @llvm.amdgcn.atomic.inc.i32.p3i32(i32 addrspace(3)* nocapture, i32, i32, i32, i1)
-define amdgpu_kernel void @invalid_atomic_inc(i32 addrspace(1)* %out, i32 addrspace(3)* %ptr, i32 %var, i1 %bool) {
+declare i32 @llvm.amdgcn.atomic.inc.i32.p3(ptr addrspace(3) nocapture, i32, i32, i32, i1)
+define amdgpu_kernel void @invalid_atomic_inc(ptr addrspace(1) %out, ptr addrspace(3) %ptr, i32 %var, i1 %bool) {
; CHECK: immarg operand has non-immediate parameter
; CHECK-NEXT: i32 %var
- ; CHECK-NEXT: %result0 = call i32 @llvm.amdgcn.atomic.inc.i32.p3i32(i32 addrspace(3)* %ptr, i32 42, i32 %var, i32 0, i1 false)
- %result0 = call i32 @llvm.amdgcn.atomic.inc.i32.p3i32(i32 addrspace(3)* %ptr, i32 42, i32 %var, i32 0, i1 false)
+ ; CHECK-NEXT: %result0 = call i32 @llvm.amdgcn.atomic.inc.i32.p3(ptr addrspace(3) %ptr, i32 42, i32 %var, i32 0, i1 false)
+ %result0 = call i32 @llvm.amdgcn.atomic.inc.i32.p3(ptr addrspace(3) %ptr, i32 42, i32 %var, i32 0, i1 false)
; CHECK: immarg operand has non-immediate parameter
; CHECK-NEXT: i32 %var
- ; CHECK-NEXT: %result1 = call i32 @llvm.amdgcn.atomic.inc.i32.p3i32(i32 addrspace(3)* %ptr, i32 42, i32 0, i32 %var, i1 false)
- %result1 = call i32 @llvm.amdgcn.atomic.inc.i32.p3i32(i32 addrspace(3)* %ptr, i32 42, i32 0, i32 %var, i1 false)
+ ; CHECK-NEXT: %result1 = call i32 @llvm.amdgcn.atomic.inc.i32.p3(ptr addrspace(3) %ptr, i32 42, i32 0, i32 %var, i1 false)
+ %result1 = call i32 @llvm.amdgcn.atomic.inc.i32.p3(ptr addrspace(3) %ptr, i32 42, i32 0, i32 %var, i1 false)
; CHECK: immarg operand has non-immediate parameter
; CHECK-NEXT: i1 %bool
- ; CHECK-NEXT: %result2 = call i32 @llvm.amdgcn.atomic.inc.i32.p3i32(i32 addrspace(3)* %ptr, i32 42, i32 0, i32 0, i1 %bool)
- %result2 = call i32 @llvm.amdgcn.atomic.inc.i32.p3i32(i32 addrspace(3)* %ptr, i32 42, i32 0, i32 0, i1 %bool)
+ ; CHECK-NEXT: %result2 = call i32 @llvm.amdgcn.atomic.inc.i32.p3(ptr addrspace(3) %ptr, i32 42, i32 0, i32 0, i1 %bool)
+ %result2 = call i32 @llvm.amdgcn.atomic.inc.i32.p3(ptr addrspace(3) %ptr, i32 42, i32 0, i32 0, i1 %bool)
ret void
}
-declare i32 @llvm.amdgcn.atomic.dec.i32.p3i32(i32 addrspace(3)* nocapture, i32, i32, i32, i1)
-define amdgpu_kernel void @invalid_atomic_dec(i32 addrspace(1)* %out, i32 addrspace(3)* %ptr, i32 %var, i1 %bool) {
+declare i32 @llvm.amdgcn.atomic.dec.i32.p3(ptr addrspace(3) nocapture, i32, i32, i32, i1)
+define amdgpu_kernel void @invalid_atomic_dec(ptr addrspace(1) %out, ptr addrspace(3) %ptr, i32 %var, i1 %bool) {
; CHECK: immarg operand has non-immediate parameter
; CHECK-NEXT: i32 %var
- ; CHECK-NEXT: %result0 = call i32 @llvm.amdgcn.atomic.dec.i32.p3i32(i32 addrspace(3)* %ptr, i32 42, i32 %var, i32 0, i1 false)
- %result0 = call i32 @llvm.amdgcn.atomic.dec.i32.p3i32(i32 addrspace(3)* %ptr, i32 42, i32 %var, i32 0, i1 false)
+ ; CHECK-NEXT: %result0 = call i32 @llvm.amdgcn.atomic.dec.i32.p3(ptr addrspace(3) %ptr, i32 42, i32 %var, i32 0, i1 false)
+ %result0 = call i32 @llvm.amdgcn.atomic.dec.i32.p3(ptr addrspace(3) %ptr, i32 42, i32 %var, i32 0, i1 false)
; CHECK: immarg operand has non-immediate parameter
; CHECK-NEXT: i32 %var
- ; CHECK-NEXT: %result1 = call i32 @llvm.amdgcn.atomic.dec.i32.p3i32(i32 addrspace(3)* %ptr, i32 42, i32 0, i32 %var, i1 false)
- %result1 = call i32 @llvm.amdgcn.atomic.dec.i32.p3i32(i32 addrspace(3)* %ptr, i32 42, i32 0, i32 %var, i1 false)
+ ; CHECK-NEXT: %result1 = call i32 @llvm.amdgcn.atomic.dec.i32.p3(ptr addrspace(3) %ptr, i32 42, i32 0, i32 %var, i1 false)
+ %result1 = call i32 @llvm.amdgcn.atomic.dec.i32.p3(ptr addrspace(3) %ptr, i32 42, i32 0, i32 %var, i1 false)
; CHECK: immarg operand has non-immediate parameter
; CHECK-NEXT: i1 %bool
- ; CHECK-NEXT: %result2 = call i32 @llvm.amdgcn.atomic.dec.i32.p3i32(i32 addrspace(3)* %ptr, i32 42, i32 0, i32 0, i1 %bool)
- %result2 = call i32 @llvm.amdgcn.atomic.dec.i32.p3i32(i32 addrspace(3)* %ptr, i32 42, i32 0, i32 0, i1 %bool)
+ ; CHECK-NEXT: %result2 = call i32 @llvm.amdgcn.atomic.dec.i32.p3(ptr addrspace(3) %ptr, i32 42, i32 0, i32 0, i1 %bool)
+ %result2 = call i32 @llvm.amdgcn.atomic.dec.i32.p3(ptr addrspace(3) %ptr, i32 42, i32 0, i32 0, i1 %bool)
ret void
}
declare { float, i1 } @llvm.amdgcn.div.scale.f32(float, float, i1)
-define amdgpu_kernel void @test_div_scale_f32_val_undef_undef(float addrspace(1)* %out) {
+define amdgpu_kernel void @test_div_scale_f32_val_undef_undef(ptr addrspace(1) %out) {
; CHECK: immarg operand has non-immediate parameter
; CHECK: i1 undef
; CHECK: %result = call { float, i1 } @llvm.amdgcn.div.scale.f32(float 8.000000e+00, float undef, i1 undef)
%result = call { float, i1 } @llvm.amdgcn.div.scale.f32(float 8.0, float undef, i1 undef)
%result0 = extractvalue { float, i1 } %result, 0
- store float %result0, float addrspace(1)* %out, align 4
+ store float %result0, ptr addrspace(1) %out, align 4
ret void
}
ret void
}
-declare i32 @llvm.amdgcn.ds.ordered.add(i32 addrspace(2)* nocapture, i32, i32, i32, i1, i32, i1, i1)
-define amdgpu_kernel void @ds_ordered_add(i32 addrspace(2)* %gds, i32 addrspace(1)* %out, i32 %var, i1 %bool) {
+declare i32 @llvm.amdgcn.ds.ordered.add(ptr addrspace(2) nocapture, i32, i32, i32, i1, i32, i1, i1)
+define amdgpu_kernel void @ds_ordered_add(ptr addrspace(2) %gds, ptr addrspace(1) %out, i32 %var, i1 %bool) {
; CHECK: immarg operand has non-immediate parameter
; CHECK-NEXT: i32 %var
- ; CHECK-NEXT: %val0 = call i32 @llvm.amdgcn.ds.ordered.add(i32 addrspace(2)* %gds, i32 31, i32 %var, i32 0, i1 false, i32 1, i1 true, i1 true)
- %val0 = call i32 @llvm.amdgcn.ds.ordered.add(i32 addrspace(2)* %gds, i32 31, i32 %var, i32 0, i1 false, i32 1, i1 true, i1 true)
+ ; CHECK-NEXT: %val0 = call i32 @llvm.amdgcn.ds.ordered.add(ptr addrspace(2) %gds, i32 31, i32 %var, i32 0, i1 false, i32 1, i1 true, i1 true)
+ %val0 = call i32 @llvm.amdgcn.ds.ordered.add(ptr addrspace(2) %gds, i32 31, i32 %var, i32 0, i1 false, i32 1, i1 true, i1 true)
; CHECK: immarg operand has non-immediate parameter
; CHECK-NEXT: i32 %var
- ; CHECK-NEXT: %val1 = call i32 @llvm.amdgcn.ds.ordered.add(i32 addrspace(2)* %gds, i32 31, i32 0, i32 %var, i1 false, i32 1, i1 true, i1 true)
- %val1 = call i32 @llvm.amdgcn.ds.ordered.add(i32 addrspace(2)* %gds, i32 31, i32 0, i32 %var, i1 false, i32 1, i1 true, i1 true)
+ ; CHECK-NEXT: %val1 = call i32 @llvm.amdgcn.ds.ordered.add(ptr addrspace(2) %gds, i32 31, i32 0, i32 %var, i1 false, i32 1, i1 true, i1 true)
+ %val1 = call i32 @llvm.amdgcn.ds.ordered.add(ptr addrspace(2) %gds, i32 31, i32 0, i32 %var, i1 false, i32 1, i1 true, i1 true)
; CHECK: immarg operand has non-immediate parameter
; CHECK-NEXT: i1 %bool
- ; CHECK-NEXT: %val2 = call i32 @llvm.amdgcn.ds.ordered.add(i32 addrspace(2)* %gds, i32 31, i32 0, i32 0, i1 %bool, i32 1, i1 true, i1 true)
- %val2 = call i32 @llvm.amdgcn.ds.ordered.add(i32 addrspace(2)* %gds, i32 31, i32 0, i32 0, i1 %bool, i32 1, i1 true, i1 true)
+ ; CHECK-NEXT: %val2 = call i32 @llvm.amdgcn.ds.ordered.add(ptr addrspace(2) %gds, i32 31, i32 0, i32 0, i1 %bool, i32 1, i1 true, i1 true)
+ %val2 = call i32 @llvm.amdgcn.ds.ordered.add(ptr addrspace(2) %gds, i32 31, i32 0, i32 0, i1 %bool, i32 1, i1 true, i1 true)
; CHECK: immarg operand has non-immediate parameter
; CHECK-NEXT: i32 %var
- ; CHECK-NEXT: %val3 = call i32 @llvm.amdgcn.ds.ordered.add(i32 addrspace(2)* %gds, i32 31, i32 0, i32 0, i1 false, i32 %var, i1 true, i1 true)
- %val3 = call i32 @llvm.amdgcn.ds.ordered.add(i32 addrspace(2)* %gds, i32 31, i32 0, i32 0, i1 false, i32 %var, i1 true, i1 true)
+ ; CHECK-NEXT: %val3 = call i32 @llvm.amdgcn.ds.ordered.add(ptr addrspace(2) %gds, i32 31, i32 0, i32 0, i1 false, i32 %var, i1 true, i1 true)
+ %val3 = call i32 @llvm.amdgcn.ds.ordered.add(ptr addrspace(2) %gds, i32 31, i32 0, i32 0, i1 false, i32 %var, i1 true, i1 true)
; CHECK: immarg operand has non-immediate parameter
; CHECK-NEXT: i1 %bool
- ; CHECK-NEXT: %val4 = call i32 @llvm.amdgcn.ds.ordered.add(i32 addrspace(2)* %gds, i32 31, i32 0, i32 0, i1 false, i32 1, i1 %bool, i1 true)
- %val4 = call i32 @llvm.amdgcn.ds.ordered.add(i32 addrspace(2)* %gds, i32 31, i32 0, i32 0, i1 false, i32 1, i1 %bool, i1 true)
+ ; CHECK-NEXT: %val4 = call i32 @llvm.amdgcn.ds.ordered.add(ptr addrspace(2) %gds, i32 31, i32 0, i32 0, i1 false, i32 1, i1 %bool, i1 true)
+ %val4 = call i32 @llvm.amdgcn.ds.ordered.add(ptr addrspace(2) %gds, i32 31, i32 0, i32 0, i1 false, i32 1, i1 %bool, i1 true)
; CHECK: immarg operand has non-immediate parameter
; CHECK-NEXT: i1 %bool
- ; CHECK-NEXT: %val5 = call i32 @llvm.amdgcn.ds.ordered.add(i32 addrspace(2)* %gds, i32 31, i32 0, i32 0, i1 false, i32 1, i1 true, i1 %bool)
- %val5 = call i32 @llvm.amdgcn.ds.ordered.add(i32 addrspace(2)* %gds, i32 31, i32 0, i32 0, i1 false, i32 1, i1 true, i1 %bool)
+ ; CHECK-NEXT: %val5 = call i32 @llvm.amdgcn.ds.ordered.add(ptr addrspace(2) %gds, i32 31, i32 0, i32 0, i1 false, i32 1, i1 true, i1 %bool)
+ %val5 = call i32 @llvm.amdgcn.ds.ordered.add(ptr addrspace(2) %gds, i32 31, i32 0, i32 0, i1 false, i32 1, i1 true, i1 %bool)
ret void
}
-declare i32 @llvm.amdgcn.ds.ordered.swap(i32 addrspace(2)* nocapture, i32, i32, i32, i1, i32, i1, i1)
-define amdgpu_kernel void @ds_ordered_swap(i32 addrspace(2)* %gds, i32 addrspace(1)* %out, i32 %var, i1 %bool) {
+declare i32 @llvm.amdgcn.ds.ordered.swap(ptr addrspace(2) nocapture, i32, i32, i32, i1, i32, i1, i1)
+define amdgpu_kernel void @ds_ordered_swap(ptr addrspace(2) %gds, ptr addrspace(1) %out, i32 %var, i1 %bool) {
; CHECK: immarg operand has non-immediate parameter
; CHECK-NEXT: i32 %var
- ; CHECK-NEXT: %val0 = call i32 @llvm.amdgcn.ds.ordered.swap(i32 addrspace(2)* %gds, i32 31, i32 %var, i32 0, i1 false, i32 1, i1 true, i1 true)
- %val0 = call i32 @llvm.amdgcn.ds.ordered.swap(i32 addrspace(2)* %gds, i32 31, i32 %var, i32 0, i1 false, i32 1, i1 true, i1 true)
+ ; CHECK-NEXT: %val0 = call i32 @llvm.amdgcn.ds.ordered.swap(ptr addrspace(2) %gds, i32 31, i32 %var, i32 0, i1 false, i32 1, i1 true, i1 true)
+ %val0 = call i32 @llvm.amdgcn.ds.ordered.swap(ptr addrspace(2) %gds, i32 31, i32 %var, i32 0, i1 false, i32 1, i1 true, i1 true)
; CHECK: immarg operand has non-immediate parameter
; CHECK-NEXT: i32 %var
- ; CHECK-NEXT: %val1 = call i32 @llvm.amdgcn.ds.ordered.swap(i32 addrspace(2)* %gds, i32 31, i32 0, i32 %var, i1 false, i32 1, i1 true, i1 true)
- %val1 = call i32 @llvm.amdgcn.ds.ordered.swap(i32 addrspace(2)* %gds, i32 31, i32 0, i32 %var, i1 false, i32 1, i1 true, i1 true)
+ ; CHECK-NEXT: %val1 = call i32 @llvm.amdgcn.ds.ordered.swap(ptr addrspace(2) %gds, i32 31, i32 0, i32 %var, i1 false, i32 1, i1 true, i1 true)
+ %val1 = call i32 @llvm.amdgcn.ds.ordered.swap(ptr addrspace(2) %gds, i32 31, i32 0, i32 %var, i1 false, i32 1, i1 true, i1 true)
; CHECK: immarg operand has non-immediate parameter
; CHECK-NEXT: i1 %bool
- ; CHECK-NEXT: %val2 = call i32 @llvm.amdgcn.ds.ordered.swap(i32 addrspace(2)* %gds, i32 31, i32 0, i32 0, i1 %bool, i32 1, i1 true, i1 true)
- %val2 = call i32 @llvm.amdgcn.ds.ordered.swap(i32 addrspace(2)* %gds, i32 31, i32 0, i32 0, i1 %bool, i32 1, i1 true, i1 true)
+ ; CHECK-NEXT: %val2 = call i32 @llvm.amdgcn.ds.ordered.swap(ptr addrspace(2) %gds, i32 31, i32 0, i32 0, i1 %bool, i32 1, i1 true, i1 true)
+ %val2 = call i32 @llvm.amdgcn.ds.ordered.swap(ptr addrspace(2) %gds, i32 31, i32 0, i32 0, i1 %bool, i32 1, i1 true, i1 true)
; CHECK: immarg operand has non-immediate parameter
; CHECK-NEXT: i32 %var
- ; CHECK-NEXT: %val3 = call i32 @llvm.amdgcn.ds.ordered.swap(i32 addrspace(2)* %gds, i32 31, i32 0, i32 0, i1 false, i32 %var, i1 true, i1 true)
- %val3 = call i32 @llvm.amdgcn.ds.ordered.swap(i32 addrspace(2)* %gds, i32 31, i32 0, i32 0, i1 false, i32 %var, i1 true, i1 true)
+ ; CHECK-NEXT: %val3 = call i32 @llvm.amdgcn.ds.ordered.swap(ptr addrspace(2) %gds, i32 31, i32 0, i32 0, i1 false, i32 %var, i1 true, i1 true)
+ %val3 = call i32 @llvm.amdgcn.ds.ordered.swap(ptr addrspace(2) %gds, i32 31, i32 0, i32 0, i1 false, i32 %var, i1 true, i1 true)
; CHECK: immarg operand has non-immediate parameter
; CHECK-NEXT: i1 %bool
- ; CHECK-NEXT: %val4 = call i32 @llvm.amdgcn.ds.ordered.swap(i32 addrspace(2)* %gds, i32 31, i32 0, i32 0, i1 false, i32 1, i1 %bool, i1 true)
- %val4 = call i32 @llvm.amdgcn.ds.ordered.swap(i32 addrspace(2)* %gds, i32 31, i32 0, i32 0, i1 false, i32 1, i1 %bool, i1 true)
+ ; CHECK-NEXT: %val4 = call i32 @llvm.amdgcn.ds.ordered.swap(ptr addrspace(2) %gds, i32 31, i32 0, i32 0, i1 false, i32 1, i1 %bool, i1 true)
+ %val4 = call i32 @llvm.amdgcn.ds.ordered.swap(ptr addrspace(2) %gds, i32 31, i32 0, i32 0, i1 false, i32 1, i1 %bool, i1 true)
; CHECK: immarg operand has non-immediate parameter
; CHECK-NEXT: i1 %bool
- ; CHECK-NEXT: %val5 = call i32 @llvm.amdgcn.ds.ordered.swap(i32 addrspace(2)* %gds, i32 31, i32 0, i32 0, i1 false, i32 1, i1 true, i1 %bool)
- %val5 = call i32 @llvm.amdgcn.ds.ordered.swap(i32 addrspace(2)* %gds, i32 31, i32 0, i32 0, i1 false, i32 1, i1 true, i1 %bool)
+ ; CHECK-NEXT: %val5 = call i32 @llvm.amdgcn.ds.ordered.swap(ptr addrspace(2) %gds, i32 31, i32 0, i32 0, i1 false, i32 1, i1 true, i1 %bool)
+ %val5 = call i32 @llvm.amdgcn.ds.ordered.swap(ptr addrspace(2) %gds, i32 31, i32 0, i32 0, i1 false, i32 1, i1 true, i1 %bool)
ret void
}
declare i32 @llvm.amdgcn.mov.dpp.i32(i32, i32, i32, i32, i1)
-define amdgpu_kernel void @mov_dpp_test(i32 addrspace(1)* %out, i32 %in1, i32 %var, i1 %bool) {
+define amdgpu_kernel void @mov_dpp_test(ptr addrspace(1) %out, i32 %in1, i32 %var, i1 %bool) {
; CHECK: immarg operand has non-immediate parameter
; CHECK-NEXT: i32 %var
; CHECK-NEXT: %val0 = call i32 @llvm.amdgcn.mov.dpp.i32(i32 %in1, i32 %var, i32 1, i32 1, i1 true)
}
declare i32 @llvm.amdgcn.update.dpp.i32(i32, i32, i32, i32, i32, i1)
-define amdgpu_kernel void @update_dpp_test(i32 addrspace(1)* %out, i32 %in1, i32 %in2, i32 %var, i1 %bool) {
+define amdgpu_kernel void @update_dpp_test(ptr addrspace(1) %out, i32 %in1, i32 %in2, i32 %var, i1 %bool) {
; CHECK: immarg operand has non-immediate parameter
; CHECK-NEXT: i32 %var
; CHECK-NEXT: %val0 = call i32 @llvm.amdgcn.update.dpp.i32(i32 %in1, i32 %in2, i32 %var, i32 1, i32 1, i1 true)
}
declare {<4 x float>,i32} @llvm.amdgcn.image.load.1d.v4f32i32.i32(i32, i32, <8 x i32>, i32, i32)
-define amdgpu_ps void @load_1d_tfe(<8 x i32> inreg %rsrc, i32 addrspace(1)* inreg %out, i32 %s, i32 %val) {
+define amdgpu_ps void @load_1d_tfe(<8 x i32> inreg %rsrc, ptr addrspace(1) inreg %out, i32 %s, i32 %val) {
; CHECK: immarg operand has non-immediate parameter
; CHECK-NEXT: i32 %val
; CHECK-NEXT: %val0 = call { <4 x float>, i32 } @llvm.amdgcn.image.load.1d.sl_v4f32i32s.i32(i32 %val, i32 %s, <8 x i32> %rsrc, i32 1, i32 0)
}
declare {<4 x float>, i32} @llvm.amdgcn.image.sample.1d.v4f32i32.f32(i32, float, <8 x i32>, <4 x i32>, i1, i32, i32)
-define amdgpu_ps void @sample_1d_tfe(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, i32 addrspace(1)* inreg %out, float %s, i32 %var, i1 %bool) {
+define amdgpu_ps void @sample_1d_tfe(<8 x i32> inreg %rsrc, <4 x i32> inreg %samp, ptr addrspace(1) inreg %out, float %s, i32 %var, i1 %bool) {
; CHECK: immarg operand has non-immediate parameter
; CHECK-NEXT: i32 %var
; CHECK-NEXT: %val0 = call { <4 x float>, i32 } @llvm.amdgcn.image.sample.1d.sl_v4f32i32s.f32(i32 %var, float %s, <8 x i32> %rsrc, <4 x i32> %samp, i1 false, i32 1, i32 0)
}
declare i32 @llvm.amdgcn.permlane16(i32, i32, i32, i32, i1, i1)
-define i32 @test_permlane16(i32 addrspace(1)* %out, i32 %arg0, i32 %arg1, i32 %arg2, i1 %arg3, i1 %arg4) {
+define i32 @test_permlane16(ptr addrspace(1) %out, i32 %arg0, i32 %arg1, i32 %arg2, i1 %arg3, i1 %arg4) {
; CHECK: immarg operand has non-immediate parameter
; CHECK-NEXT: i1 %arg3
; CHECK-NEXT: %v1 = call i32 @llvm.amdgcn.permlane16(i32 %arg0, i32 %arg0, i32 %arg1, i32 %arg2, i1 %arg3, i1 false)
}
declare i32 @llvm.amdgcn.permlanex16(i32, i32, i32, i32, i1, i1)
-define i32 @test_permlanex16(i32 addrspace(1)* %out, i32 %arg0, i32 %arg1, i32 %arg2, i1 %arg3, i1 %arg4) {
+define i32 @test_permlanex16(ptr addrspace(1) %out, i32 %arg0, i32 %arg1, i32 %arg2, i1 %arg3, i1 %arg4) {
; CHECK: immarg operand has non-immediate parameter
; CHECK-NEXT: i1 %arg3
; CHECK-NEXT: %v1 = call i32 @llvm.amdgcn.permlanex16(i32 %arg0, i32 %arg0, i32 %arg1, i32 %arg2, i1 %arg3, i1 false)
; CHECK-NEXT: i32 %arg1
; CHECK-NEXT: %val0 = call float @llvm.amdgcn.interp.p1(float %arg0, i32 %arg1, i32 0, i32 0)
%val0 = call float @llvm.amdgcn.interp.p1(float %arg0, i32 %arg1, i32 0, i32 0)
- store volatile float %val0, float addrspace(1)* undef
+ store volatile float %val0, ptr addrspace(1) undef
; CHECK: immarg operand has non-immediate parameter
; CHECK-NEXT: i32 %arg2
; CHECK-NEXT: %val1 = call float @llvm.amdgcn.interp.p1(float %arg0, i32 0, i32 %arg2, i32 0)
%val1 = call float @llvm.amdgcn.interp.p1(float %arg0, i32 0, i32 %arg2, i32 0)
- store volatile float %val1, float addrspace(1)* undef
+ store volatile float %val1, ptr addrspace(1) undef
ret void
}
; CHECK-NEXT: %val0 = call float @llvm.amdgcn.interp.p2(float %arg0, float %arg1, i32 %arg2, i32 0, i32 0)
%val0 = call float @llvm.amdgcn.interp.p2(float %arg0, float %arg1, i32 %arg2, i32 0, i32 0)
- store volatile float %val0, float addrspace(1)* undef
+ store volatile float %val0, ptr addrspace(1) undef
; CHECK: immarg operand has non-immediate parameter
; CHECK-NEXT: i32 %arg3
; CHECK-NEXT: %val1 = call float @llvm.amdgcn.interp.p2(float %arg0, float %arg1, i32 0, i32 %arg3, i32 0)
%val1 = call float @llvm.amdgcn.interp.p2(float %arg0, float %arg1, i32 0, i32 %arg3, i32 0)
- store volatile float %val1, float addrspace(1)* undef
+ store volatile float %val1, ptr addrspace(1) undef
ret void
}
; CHECK-NEXT: i32 %arg0
; CHECK-NEXT: %val0 = call float @llvm.amdgcn.interp.mov(i32 %arg0, i32 0, i32 0, i32 0)
%val0 = call float @llvm.amdgcn.interp.mov(i32 %arg0, i32 0, i32 0, i32 0)
- store volatile float %val0, float addrspace(1)* undef
+ store volatile float %val0, ptr addrspace(1) undef
; CHECK: immarg operand has non-immediate parameter
; CHECK-NEXT: i32 %arg1
; CHECK-NEXT: %val1 = call float @llvm.amdgcn.interp.mov(i32 0, i32 %arg1, i32 0, i32 0)
%val1 = call float @llvm.amdgcn.interp.mov(i32 0, i32 %arg1, i32 0, i32 0)
- store volatile float %val1, float addrspace(1)* undef
+ store volatile float %val1, ptr addrspace(1) undef
; CHECK: immarg operand has non-immediate parameter
; CHECK-NEXT: i32 %arg2
; CHECK-NEXT: %val2 = call float @llvm.amdgcn.interp.mov(i32 0, i32 0, i32 %arg2, i32 0)
%val2 = call float @llvm.amdgcn.interp.mov(i32 0, i32 0, i32 %arg2, i32 0)
- store volatile float %val2, float addrspace(1)* undef
+ store volatile float %val2, ptr addrspace(1) undef
ret void
}
; CHECK-NEXT: i32 %arg1
; CHECK-NEXT:%val0 = call float @llvm.amdgcn.interp.p1.f16(float %arg0, i32 %arg1, i32 2, i1 false, i32 %arg4)
%val0 = call float @llvm.amdgcn.interp.p1.f16(float %arg0, i32 %arg1, i32 2, i1 0, i32 %arg4)
- store volatile float %val0, float addrspace(1)* undef
+ store volatile float %val0, ptr addrspace(1) undef
; CHECK: immarg operand has non-immediate parameter
; CHECK-NEXT:i32 %arg2
; CHECK-NEXT: %val1 = call float @llvm.amdgcn.interp.p1.f16(float %arg0, i32 0, i32 %arg2, i1 false, i32 %arg4)
%val1 = call float @llvm.amdgcn.interp.p1.f16(float %arg0, i32 0, i32 %arg2, i1 0, i32 %arg4)
- store volatile float %val1, float addrspace(1)* undef
+ store volatile float %val1, ptr addrspace(1) undef
; CHECK: immarg operand has non-immediate parameter
; CHECK-NEXT:i1 %arg3
; CHECK-NEXT: %val2 = call float @llvm.amdgcn.interp.p1.f16(float %arg0, i32 0, i32 0, i1 %arg3, i32 %arg4)
%val2 = call float @llvm.amdgcn.interp.p1.f16(float %arg0, i32 0, i32 0, i1 %arg3, i32 %arg4)
- store volatile float %val2, float addrspace(1)* undef
+ store volatile float %val2, ptr addrspace(1) undef
ret void
}
; CHECK-NEXT: i32 %arg2
; CHECK-NEXT: %val0 = call half @llvm.amdgcn.interp.p2.f16(float %arg0, float %arg1, i32 %arg2, i32 2, i1 false, i32 %arg5)
%val0 = call half @llvm.amdgcn.interp.p2.f16(float %arg0, float %arg1, i32 %arg2, i32 2, i1 false, i32 %arg5)
- store volatile half %val0, half addrspace(1)* undef
+ store volatile half %val0, ptr addrspace(1) undef
; CHECK: immarg operand has non-immediate parameter
; CHECK-NEXT: i32 %arg3
; CHECK-NEXT: %val1 = call half @llvm.amdgcn.interp.p2.f16(float %arg0, float %arg1, i32 0, i32 %arg3, i1 false, i32 %arg5)
%val1 = call half @llvm.amdgcn.interp.p2.f16(float %arg0, float %arg1, i32 0, i32 %arg3, i1 false, i32 %arg5)
- store volatile half %val1, half addrspace(1)* undef
+ store volatile half %val1, ptr addrspace(1) undef
; CHECK: immarg operand has non-immediate parameter
; CHECK-NEXT: i1 %arg4
; CHECK-NEXT: %val2 = call half @llvm.amdgcn.interp.p2.f16(float %arg0, float %arg1, i32 0, i32 0, i1 %arg4, i32 %arg5)
%val2 = call half @llvm.amdgcn.interp.p2.f16(float %arg0, float %arg1, i32 0, i32 0, i1 %arg4, i32 %arg5)
- store volatile half %val2, half addrspace(1)* undef
+ store volatile half %val2, ptr addrspace(1) undef
ret void
}
; CHECK-NEXT: i32 %arg3
; CHECK-NEXT: %val0 = call <32 x i32> @llvm.amdgcn.mfma.f32.32x32x1f32(float %arg0, float %arg1, <32 x i32> %arg2, i32 %arg3, i32 2, i32 3)
%val0 = call <32 x i32> @llvm.amdgcn.mfma.f32.32x32x1f32(float %arg0, float %arg1, <32 x i32> %arg2, i32 %arg3, i32 2, i32 3)
- store volatile <32 x i32> %val0, <32 x i32> addrspace(1)* undef
+ store volatile <32 x i32> %val0, ptr addrspace(1) undef
; CHECK: immarg operand has non-immediate parameter
; CHECK-NEXT: i32 %arg4
; CHECK-NEXT: %val1 = call <32 x i32> @llvm.amdgcn.mfma.f32.32x32x1f32(float %arg0, float %arg1, <32 x i32> %arg2, i32 1, i32 %arg4, i32 3)
%val1 = call <32 x i32> @llvm.amdgcn.mfma.f32.32x32x1f32(float %arg0, float %arg1, <32 x i32> %arg2, i32 1, i32 %arg4, i32 3)
- store volatile <32 x i32> %val1, <32 x i32> addrspace(1)* undef
+ store volatile <32 x i32> %val1, ptr addrspace(1) undef
; CHECK: immarg operand has non-immediate parameter
; CHECK-NEXT: i32 %arg5
; CHECK-NEXT: %val2 = call <32 x i32> @llvm.amdgcn.mfma.f32.32x32x1f32(float %arg0, float %arg1, <32 x i32> %arg2, i32 1, i32 2, i32 %arg5)
%val2 = call <32 x i32> @llvm.amdgcn.mfma.f32.32x32x1f32(float %arg0, float %arg1, <32 x i32> %arg2, i32 1, i32 2, i32 %arg5)
- store volatile <32 x i32> %val2, <32 x i32> addrspace(1)* undef
+ store volatile <32 x i32> %val2, ptr addrspace(1) undef
ret void
}
define void @cdp(i32 %a) #0 {
; CHECK: immarg operand has non-immediate parameter
- ; CHECK-NEXT: %load = load i32, i32* %a.addr, align 4
+ ; CHECK-NEXT: %load = load i32, ptr %a.addr, align 4
; CHECK-NEXT: call void @llvm.arm.cdp(i32 %load, i32 2, i32 3, i32 4, i32 5, i32 6)
%a.addr = alloca i32, align 4
- store i32 %a, i32* %a.addr, align 4
- %load = load i32, i32* %a.addr, align 4
+ store i32 %a, ptr %a.addr, align 4
+ %load = load i32, ptr %a.addr, align 4
call void @llvm.arm.cdp(i32 %load, i32 2, i32 3, i32 4, i32 5, i32 6)
ret void
}
declare void @llvm.arm.cdp2(i32, i32, i32, i32, i32, i32) nounwind
define void @cdp2(i32 %a) #0 {
; CHECK: immarg operand has non-immediate parameter
- ; CHECK-NEXT: %load = load i32, i32* %a.addr, align 4
+ ; CHECK-NEXT: %load = load i32, ptr %a.addr, align 4
; CHECK-NEXT: call void @llvm.arm.cdp2(i32 %load, i32 2, i32 3, i32 4, i32 5, i32 6)
%a.addr = alloca i32, align 4
- store i32 %a, i32* %a.addr, align 4
- %load = load i32, i32* %a.addr, align 4
+ store i32 %a, ptr %a.addr, align 4
+ %load = load i32, ptr %a.addr, align 4
call void @llvm.arm.cdp2(i32 %load, i32 2, i32 3, i32 4, i32 5, i32 6)
ret void
}
ret { <4 x i32>, i32 } %res
}
-declare i32 @llvm.s390.lcbb(i8 *, i32)
-define i32 @test_lcbb(i8* %a, i32 %b) {
+declare i32 @llvm.s390.lcbb(ptr, i32)
+define i32 @test_lcbb(ptr %a, i32 %b) {
; CHECK: immarg operand has non-immediate parameter
; CHECK-NEXT: i32 %b
- ; CHECK-NEXT: %res = call i32 @llvm.s390.lcbb(i8* %a, i32 %b)
- %res = call i32 @llvm.s390.lcbb(i8* %a, i32 %b)
+ ; CHECK-NEXT: %res = call i32 @llvm.s390.lcbb(ptr %a, i32 %b)
+ %res = call i32 @llvm.s390.lcbb(ptr %a, i32 %b)
ret i32 %res
}
-declare <16 x i8> @llvm.s390.vlbb(i8 *, i32)
-define <16 x i8> @test_vlbb(i8* %a, i32 %b) {
+declare <16 x i8> @llvm.s390.vlbb(ptr, i32)
+define <16 x i8> @test_vlbb(ptr %a, i32 %b) {
; CHECK: immarg operand has non-immediate parameter
; CHECK-NEXT: i32 %b
- ; CHECK-NEXT: %res = call <16 x i8> @llvm.s390.vlbb(i8* %a, i32 %b)
- %res = call <16 x i8> @llvm.s390.vlbb(i8* %a, i32 %b)
+ ; CHECK-NEXT: %res = call <16 x i8> @llvm.s390.vlbb(ptr %a, i32 %b)
+ %res = call <16 x i8> @llvm.s390.vlbb(ptr %a, i32 %b)
ret <16 x i8> %res
}
; RUN: not opt -passes=verify -S < %s 2>&1 | FileCheck %s
-define void @f(i32* %p) {
+define void @f(ptr %p) {
; CHECK: Intrinsic requires elementtype attribute on first argument
- %a = call i64 @llvm.aarch64.ldxr.p0i32(i32* %p)
+ %a = call i64 @llvm.aarch64.ldxr.p0(ptr %p)
; CHECK: Intrinsic requires elementtype attribute on second argument
- %c = call i32 @llvm.aarch64.stxr.p0i32(i64 0, i32* %p)
+ %c = call i32 @llvm.aarch64.stxr.p0(i64 0, ptr %p)
; CHECK: Intrinsic requires elementtype attribute on first argument
- %a2 = call i64 @llvm.aarch64.ldaxr.p0i32(i32* %p)
+ %a2 = call i64 @llvm.aarch64.ldaxr.p0(ptr %p)
; CHECK: Intrinsic requires elementtype attribute on second argument
- %c2 = call i32 @llvm.aarch64.stlxr.p0i32(i64 0, i32* %p)
+ %c2 = call i32 @llvm.aarch64.stlxr.p0(i64 0, ptr %p)
ret void
}
-declare i64 @llvm.aarch64.ldxr.p0i32(i32*)
-declare i64 @llvm.aarch64.ldaxr.p0i32(i32*)
-declare i32 @llvm.aarch64.stxr.p0i32(i64, i32*)
-declare i32 @llvm.aarch64.stlxr.p0i32(i64, i32*)
+declare i64 @llvm.aarch64.ldxr.p0(ptr)
+declare i64 @llvm.aarch64.ldaxr.p0(ptr)
+declare i32 @llvm.aarch64.stxr.p0(i64, ptr)
+declare i32 @llvm.aarch64.stlxr.p0(i64, ptr)
; RUN: not llvm-as < %s -o /dev/null 2>&1 | FileCheck %s
-define void @test(i8* %p) {
+define void @test(ptr %p) {
; CHECK: Access scope list contains invalid access scope
- load i8, i8* %p, !llvm.access.group !1
+ load i8, ptr %p, !llvm.access.group !1
; CHECK: Access scope list must consist of MDNodes
- load i8, i8* %p, !llvm.access.group !2
+ load i8, ptr %p, !llvm.access.group !2
; CHECK-NOT: Access scope
- load i8, i8* %p, !llvm.access.group !3
- load i8, i8* %p, !llvm.access.group !4
+ load i8, ptr %p, !llvm.access.group !3
+ load i8, ptr %p, !llvm.access.group !4
ret void
}
; RUN: not llvm-as %s -o /dev/null 2>&1 | FileCheck %s
-define void @test(i8* %p) {
- load i8, i8* %p, !noalias !0
- load i8, i8* %p, !noalias !1
- load i8, i8* %p, !noalias !3
- load i8, i8* %p, !noalias !5
- load i8, i8* %p, !noalias !7
- load i8, i8* %p, !noalias !9
- load i8, i8* %p, !noalias !11
- load i8, i8* %p, !noalias !14
- load i8, i8* %p, !alias.scope !17
+define void @test(ptr %p) {
+ load i8, ptr %p, !noalias !0
+ load i8, ptr %p, !noalias !1
+ load i8, ptr %p, !noalias !3
+ load i8, ptr %p, !noalias !5
+ load i8, ptr %p, !noalias !7
+ load i8, ptr %p, !noalias !9
+ load i8, ptr %p, !noalias !11
+ load i8, ptr %p, !noalias !14
+ load i8, ptr %p, !alias.scope !17
call void @llvm.experimental.noalias.scope.decl(metadata !20)
ret void
}
declare void @f()
-@fa = alias void (), void ()* @f
+@fa = alias void (), ptr @f
; CHECK: Alias must point to a definition
; CHECK-NEXT: @fa
@g = external global i32
-@ga = alias i32, i32* @g
+@ga = alias i32, ptr @g
; CHECK: Alias must point to a definition
; CHECK-NEXT: @ga
define available_externally void @f2() {
ret void
}
-@fa2 = alias void(), void()* @f2
+@fa2 = alias void(), ptr @f2
; CHECK: Alias must point to a definition
; CHECK-NEXT: @fa2
-@test2_a = alias i32, i32* @test2_b
-@test2_b = alias i32, i32* @test2_a
+@test2_a = alias i32, ptr @test2_b
+@test2_b = alias i32, ptr @test2_a
; CHECK: Aliases cannot form a cycle
-; CHECK-NEXT: i32* @test2_a
+; CHECK-NEXT: ptr @test2_a
; CHECK-NEXT: Aliases cannot form a cycle
-; CHECK-NEXT: i32* @test2_b
+; CHECK-NEXT: ptr @test2_b
@test3_a = global i32 42
-@test3_b = weak alias i32, i32* @test3_a
-@test3_c = alias i32, i32* @test3_b
+@test3_b = weak alias i32, ptr @test3_a
+@test3_c = alias i32, ptr @test3_b
; CHECK: Alias cannot point to an interposable alias
-; CHECK-NEXT: i32* @test3_c
+; CHECK-NEXT: ptr @test3_c
@test4_a = available_externally global i32 42
-@test4_b = available_externally alias i32, i32* @test4_a
-@test4_c = available_externally alias void(), void()* @f2
-@test4_d = available_externally alias i32, i32* @test4_b
+@test4_b = available_externally alias i32, ptr @test4_a
+@test4_c = available_externally alias void(), ptr @f2
+@test4_d = available_externally alias i32, ptr @test4_b
-@test4_e = available_externally alias i32, i32* @test3_a
-@test4_f = available_externally alias i32, inttoptr (i64 sub (i64 ptrtoint (i32* @test4_a to i64), i64 ptrtoint (i32* @test4_a to i64)) to i32*)
+@test4_e = available_externally alias i32, ptr @test3_a
+@test4_f = available_externally alias i32, inttoptr (i64 sub (i64 ptrtoint (ptr @test4_a to i64), i64 ptrtoint (ptr @test4_a to i64)) to ptr)
; CHECK: available_externally alias must point to available_externally global value
-; CHECK-NEXT: i32* @test4_e
+; CHECK-NEXT: ptr @test4_e
; CHECK: available_externally alias must point to available_externally global value
-; CHECK-NEXT: i32* @test4_f
+; CHECK-NEXT: ptr @test4_f
; RUN: not llvm-as < %s -o /dev/null 2>&1 | FileCheck %s
-declare i8* @foo()
+declare ptr @foo()
define void @f1() {
entry:
- call i8* @foo(), !align !{i64 2}
+ call ptr @foo(), !align !{i64 2}
ret void
}
; CHECK: align applies only to load instructions
-; CHECK-NEXT: call i8* @foo()
+; CHECK-NEXT: call ptr @foo()
-define i8 @f2(i8* %x) {
+define i8 @f2(ptr %x) {
entry:
- %y = load i8, i8* %x, !align !{i64 2}
+ %y = load i8, ptr %x, !align !{i64 2}
ret i8 %y
}
; CHECK: align applies only to pointer types
-; CHECK-NEXT: load i8, i8* %x
+; CHECK-NEXT: load i8, ptr %x
-define i8* @f3(i8** %x) {
+define ptr @f3(ptr %x) {
entry:
- %y = load i8*, i8** %x, !align !{}
- ret i8* %y
+ %y = load ptr, ptr %x, !align !{}
+ ret ptr %y
}
; CHECK: align takes one operand
-; CHECK-NEXT: load i8*, i8** %x
+; CHECK-NEXT: load ptr, ptr %x
-define i8* @f4(i8** %x) {
+define ptr @f4(ptr %x) {
entry:
- %y = load i8*, i8** %x, !align !{!"str"}
- ret i8* %y
+ %y = load ptr, ptr %x, !align !{!"str"}
+ ret ptr %y
}
; CHECK: align metadata value must be an i64!
-; CHECK-NEXT: load i8*, i8** %x
+; CHECK-NEXT: load ptr, ptr %x
-define i8* @f5(i8** %x) {
+define ptr @f5(ptr %x) {
entry:
- %y = load i8*, i8** %x, !align !{i32 2}
- ret i8* %y
+ %y = load ptr, ptr %x, !align !{i32 2}
+ ret ptr %y
}
; CHECK: align metadata value must be an i64!
-; CHECK-NEXT: load i8*, i8** %x
+; CHECK-NEXT: load ptr, ptr %x
-define i8* @f6(i8** %x) {
+define ptr @f6(ptr %x) {
entry:
- %y = load i8*, i8** %x, !align !{i64 3}
- ret i8* %y
+ %y = load ptr, ptr %x, !align !{i64 3}
+ ret ptr %y
}
; CHECK: align metadata value must be a power of 2!
-; CHECK-NEXT: load i8*, i8** %x
+; CHECK-NEXT: load ptr, ptr %x
-define i8* @f7(i8** %x) {
+define ptr @f7(ptr %x) {
entry:
- %y = load i8*, i8** %x, !align !{i64 8589934592}
- ret i8* %y
+ %y = load ptr, ptr %x, !align !{i64 8589934592}
+ ret ptr %y
}
; CHECK: alignment is larger that implementation defined limit
-; CHECK-NEXT: load i8*, i8** %x
+; CHECK-NEXT: load ptr, ptr %x
; verifier. So, a seperate test is needed.
; CHECK: 'allocsize' indices can't refer to the same parameter
-declare i8* @a(i32, i32) allocsize(0, 0)
+declare ptr @a(i32, i32) allocsize(0, 0)
; RUN: not llvm-as %s -o /dev/null 2>&1 | FileCheck %s
; CHECK: 'allockind()' requires exactly one of alloc, realloc, and free
-declare i8* @a(i32) allockind("aligned")
+declare ptr @a(i32) allockind("aligned")
; CHECK: 'allockind()' requires exactly one of alloc, realloc, and free
-declare i8* @b(i32*) allockind("free,realloc")
+declare ptr @b(ptr) allockind("free,realloc")
; CHECK: 'allockind("free")' doesn't allow uninitialized, zeroed, or aligned modifiers.
-declare i8* @c(i32) allockind("free,zeroed")
+declare ptr @c(i32) allockind("free,zeroed")
; CHECK: 'allockind()' can't be both zeroed and uninitialized
-declare i8* @d(i32, i32*) allockind("realloc,uninitialized,zeroed")
+declare ptr @d(i32, ptr) allockind("realloc,uninitialized,zeroed")
; CHECK: 'allockind()' requires exactly one of alloc, realloc, and free
-declare i8* @e(i32, i32) allockind("alloc,free")
+declare ptr @e(i32, i32) allockind("alloc,free")
; RUN: not llvm-as %s -o /dev/null 2>&1 | FileCheck %s
; CHECK: 'allocsize' element size argument is out of bounds
-declare i8* @a(i32) allocsize(1)
+declare ptr @a(i32) allocsize(1)
; CHECK: 'allocsize' element size argument must refer to an integer parameter
-declare i8* @b(i32*) allocsize(0)
+declare ptr @b(ptr) allocsize(0)
; CHECK: 'allocsize' number of elements argument is out of bounds
-declare i8* @c(i32) allocsize(0, 1)
+declare ptr @c(i32) allocsize(0, 1)
; CHECK: 'allocsize' number of elements argument must refer to an integer parameter
-declare i8* @d(i32, i32*) allocsize(0, 1)
+declare ptr @d(i32, ptr) allocsize(0, 1)
; CHECK: 'allocsize' number of elements argument is out of bounds
-declare i8* @e(i32, i32) allocsize(1, 2)
+declare ptr @e(i32, i32) allocsize(1, 2)
target datalayout = "A5"
; CHECK: Calling convention requires void return type
-; CHECK-NEXT: i32 ()* @nonvoid_cc_amdgpu_kernel
+; CHECK-NEXT: ptr @nonvoid_cc_amdgpu_kernel
define amdgpu_kernel i32 @nonvoid_cc_amdgpu_kernel() {
ret i32 0
}
; CHECK: Calling convention does not support varargs or perfect forwarding!
-; CHECK-NEXT: void (...)* @varargs_amdgpu_kernel
+; CHECK-NEXT: ptr @varargs_amdgpu_kernel
define amdgpu_kernel void @varargs_amdgpu_kernel(...) {
ret void
}
; CHECK: Calling convention does not allow sret
-; CHECK-NEXT: void (i32*)* @sret_cc_amdgpu_kernel_as0
-define amdgpu_kernel void @sret_cc_amdgpu_kernel_as0(i32* sret(i32) %ptr) {
+; CHECK-NEXT: ptr @sret_cc_amdgpu_kernel_as0
+define amdgpu_kernel void @sret_cc_amdgpu_kernel_as0(ptr sret(i32) %ptr) {
ret void
}
; CHECK: Calling convention does not allow sret
-; CHECK-NEXT: void (i32 addrspace(5)*)* @sret_cc_amdgpu_kernel
-define amdgpu_kernel void @sret_cc_amdgpu_kernel(i32 addrspace(5)* sret(i32) %ptr) {
+; CHECK-NEXT: ptr @sret_cc_amdgpu_kernel
+define amdgpu_kernel void @sret_cc_amdgpu_kernel(ptr addrspace(5) sret(i32) %ptr) {
ret void
}
; CHECK: Calling convention does not support varargs or perfect forwarding!
-; CHECK-NEXT: void (...)* @varargs_amdgpu_vs
+; CHECK-NEXT: ptr @varargs_amdgpu_vs
define amdgpu_vs void @varargs_amdgpu_vs(...) {
ret void
}
; CHECK: Calling convention does not support varargs or perfect forwarding!
-; CHECK-NEXT: void (...)* @varargs_amdgpu_gs
+; CHECK-NEXT: ptr @varargs_amdgpu_gs
define amdgpu_gs void @varargs_amdgpu_gs(...) {
ret void
}
; CHECK: Calling convention does not support varargs or perfect forwarding!
-; CHECK-NEXT: void (...)* @varargs_amdgpu_ps
+; CHECK-NEXT: ptr @varargs_amdgpu_ps
define amdgpu_ps void @varargs_amdgpu_ps(...) {
ret void
}
; CHECK: Calling convention does not support varargs or perfect forwarding!
-; CHECK-NEXT: void (...)* @varargs_amdgpu_cs
+; CHECK-NEXT: ptr @varargs_amdgpu_cs
define amdgpu_cs void @varargs_amdgpu_cs(...) {
ret void
}
; CHECK: Calling convention requires void return type
-; CHECK-NEXT: i32 ()* @nonvoid_cc_spir_kernel
+; CHECK-NEXT: ptr @nonvoid_cc_spir_kernel
define spir_kernel i32 @nonvoid_cc_spir_kernel() {
ret i32 0
}
; CHECK: Calling convention does not support varargs or perfect forwarding!
-; CHECK-NEXT: void (...)* @varargs_spir_kernel
+; CHECK-NEXT: ptr @varargs_spir_kernel
define spir_kernel void @varargs_spir_kernel(...) {
ret void
}
; CHECK: Calling convention disallows byval
-; CHECK-NEXT: void (i32 addrspace(5)*)* @byval_cc_amdgpu_kernel
-define amdgpu_kernel void @byval_cc_amdgpu_kernel(i32 addrspace(5)* byval(i32) %ptr) {
+; CHECK-NEXT: ptr @byval_cc_amdgpu_kernel
+define amdgpu_kernel void @byval_cc_amdgpu_kernel(ptr addrspace(5) byval(i32) %ptr) {
ret void
}
; CHECK: Calling convention disallows byval
-; CHECK-NEXT: void (i32 addrspace(1)*)* @byval_as1_cc_amdgpu_kernel
-define amdgpu_kernel void @byval_as1_cc_amdgpu_kernel(i32 addrspace(1)* byval(i32) %ptr) {
+; CHECK-NEXT: ptr @byval_as1_cc_amdgpu_kernel
+define amdgpu_kernel void @byval_as1_cc_amdgpu_kernel(ptr addrspace(1) byval(i32) %ptr) {
ret void
}
; CHECK: Calling convention disallows byval
-; CHECK-NEXT: void (i32*)* @byval_as0_cc_amdgpu_kernel
-define amdgpu_kernel void @byval_as0_cc_amdgpu_kernel(i32* byval(i32) %ptr) {
+; CHECK-NEXT: ptr @byval_as0_cc_amdgpu_kernel
+define amdgpu_kernel void @byval_as0_cc_amdgpu_kernel(ptr byval(i32) %ptr) {
ret void
}
; CHECK: Calling convention disallows byval
-; CHECK-NEXT: void (i32 addrspace(5)*)* @byval_cc_amdgpu_vs
-define amdgpu_vs void @byval_cc_amdgpu_vs(i32 addrspace(5)* byval(i32) %ptr) {
+; CHECK-NEXT: ptr @byval_cc_amdgpu_vs
+define amdgpu_vs void @byval_cc_amdgpu_vs(ptr addrspace(5) byval(i32) %ptr) {
ret void
}
; CHECK: Calling convention disallows byval
-; CHECK-NEXT: void (i32 addrspace(5)*)* @byval_cc_amdgpu_hs
-define amdgpu_hs void @byval_cc_amdgpu_hs(i32 addrspace(5)* byval(i32) %ptr) {
+; CHECK-NEXT: ptr @byval_cc_amdgpu_hs
+define amdgpu_hs void @byval_cc_amdgpu_hs(ptr addrspace(5) byval(i32) %ptr) {
ret void
}
; CHECK: Calling convention disallows byval
-; CHECK-NEXT: void (i32 addrspace(5)*)* @byval_cc_amdgpu_gs
-define amdgpu_gs void @byval_cc_amdgpu_gs(i32 addrspace(5)* byval(i32) %ptr) {
+; CHECK-NEXT: ptr @byval_cc_amdgpu_gs
+define amdgpu_gs void @byval_cc_amdgpu_gs(ptr addrspace(5) byval(i32) %ptr) {
ret void
}
; CHECK: Calling convention disallows byval
-; CHECK-NEXT: void (i32 addrspace(5)*)* @byval_cc_amdgpu_ps
-define amdgpu_ps void @byval_cc_amdgpu_ps(i32 addrspace(5)* byval(i32) %ptr) {
+; CHECK-NEXT: ptr @byval_cc_amdgpu_ps
+define amdgpu_ps void @byval_cc_amdgpu_ps(ptr addrspace(5) byval(i32) %ptr) {
ret void
}
; CHECK: Calling convention disallows byval
-; CHECK-NEXT: void (i32 addrspace(5)*)* @byval_cc_amdgpu_cs
-define amdgpu_cs void @byval_cc_amdgpu_cs(i32 addrspace(5)* byval(i32) %ptr) {
+; CHECK-NEXT: ptr @byval_cc_amdgpu_cs
+define amdgpu_cs void @byval_cc_amdgpu_cs(ptr addrspace(5) byval(i32) %ptr) {
ret void
}
; CHECK: Calling convention disallows preallocated
-; CHECK-NEXT: void (i32*)* @preallocated_as0_cc_amdgpu_kernel
-define amdgpu_kernel void @preallocated_as0_cc_amdgpu_kernel(i32* preallocated(i32) %ptr) {
+; CHECK-NEXT: ptr @preallocated_as0_cc_amdgpu_kernel
+define amdgpu_kernel void @preallocated_as0_cc_amdgpu_kernel(ptr preallocated(i32) %ptr) {
ret void
}
; CHECK: Calling convention disallows inalloca
-; CHECK-NEXT: void (i32*)* @inalloca_as0_cc_amdgpu_kernel
-define amdgpu_kernel void @inalloca_as0_cc_amdgpu_kernel(i32* inalloca(i32) %ptr) {
+; CHECK-NEXT: ptr @inalloca_as0_cc_amdgpu_kernel
+define amdgpu_kernel void @inalloca_as0_cc_amdgpu_kernel(ptr inalloca(i32) %ptr) {
ret void
}
; CHECK: Calling convention disallows stack byref
-; CHECK-NEXT: void (i32 addrspace(5)*)* @byref_as5_cc_amdgpu_kernel
-define amdgpu_kernel void @byref_as5_cc_amdgpu_kernel(i32 addrspace(5)* byref(i32) %ptr) {
+; CHECK-NEXT: ptr @byref_as5_cc_amdgpu_kernel
+define amdgpu_kernel void @byref_as5_cc_amdgpu_kernel(ptr addrspace(5) byref(i32) %ptr) {
ret void
}
; RUN: not llvm-as -disable-output < %s -o /dev/null 2>&1 | FileCheck %s
-define void @test1(float* %a) {
+define void @test1(ptr %a) {
entry:
; CHECK: annotation must have at least one operand
- %a.addr = alloca float*, align 8, !annotation !0
+ %a.addr = alloca ptr, align 8, !annotation !0
; CHECK-NEXT: operands must be strings
ret void, !annotation !1
; RUN: not opt -passes=verify -S < %s 2>&1 | FileCheck %s
-define void @f(i32* %p) {
+define void @f(ptr %p) {
; CHECK: Intrinsic requires elementtype attribute on first argument
- %a = call i32 @llvm.arm.ldrex.p0i32(i32* %p)
+ %a = call i32 @llvm.arm.ldrex.p0(ptr %p)
; CHECK: Intrinsic requires elementtype attribute on second argument
- %c = call i32 @llvm.arm.strex.p0i32(i32 0, i32* %p)
+ %c = call i32 @llvm.arm.strex.p0(i32 0, ptr %p)
; CHECK: Intrinsic requires elementtype attribute on first argument
- %a2 = call i32 @llvm.arm.ldaex.p0i32(i32* %p)
+ %a2 = call i32 @llvm.arm.ldaex.p0(ptr %p)
; CHECK: Intrinsic requires elementtype attribute on second argument
- %c2 = call i32 @llvm.arm.stlex.p0i32(i32 0, i32* %p)
+ %c2 = call i32 @llvm.arm.stlex.p0(i32 0, ptr %p)
ret void
}
-declare i32 @llvm.arm.ldrex.p0i32(i32*)
-declare i32 @llvm.arm.ldaex.p0i32(i32*)
-declare i32 @llvm.arm.stlex.p0i32(i32, i32*)
-declare i32 @llvm.arm.strex.p0i32(i32, i32*)
\ No newline at end of file
+declare i32 @llvm.arm.ldrex.p0(ptr)
+declare i32 @llvm.arm.ldaex.p0(ptr)
+declare i32 @llvm.arm.stlex.p0(i32, ptr)
+declare i32 @llvm.arm.strex.p0(i32, ptr)
\ No newline at end of file
declare void @llvm.assume(i1)
-define void @func(i32* %P, i32 %P1, i32* %P2, i32* %P3) {
+define void @func(ptr %P, i32 %P1, ptr %P2, ptr %P3) {
; CHECK: tags must be valid attribute names
; CHECK: "adazdazd"
call void @llvm.assume(i1 true) ["adazdazd"()]
; CHECK: the second argument should be a constant integral value
- call void @llvm.assume(i1 true) ["dereferenceable"(i32* %P, i32 %P1)]
+ call void @llvm.assume(i1 true) ["dereferenceable"(ptr %P, i32 %P1)]
; CHECK: too many arguments
- call void @llvm.assume(i1 true) ["dereferenceable"(i32* %P, i32 8, i32 8)]
+ call void @llvm.assume(i1 true) ["dereferenceable"(ptr %P, i32 8, i32 8)]
; CHECK: this attribute should have 2 arguments
- call void @llvm.assume(i1 true) ["dereferenceable"(i32* %P)]
+ call void @llvm.assume(i1 true) ["dereferenceable"(ptr %P)]
; CHECK: this attribute has no argument
- call void @llvm.assume(i1 true) ["dereferenceable"(i32* %P, i32 4), "cold"(i32* %P)]
+ call void @llvm.assume(i1 true) ["dereferenceable"(ptr %P, i32 4), "cold"(ptr %P)]
; CHECK: this attribute should have one argument
call void @llvm.assume(i1 true) ["noalias"()]
- call void @llvm.assume(i1 true) ["align"(i32* %P, i32 %P1, i32 4)]
+ call void @llvm.assume(i1 true) ["align"(ptr %P, i32 %P1, i32 4)]
; CHECK: alignment assumptions should have 2 or 3 arguments
- call void @llvm.assume(i1 true) ["align"(i32* %P, i32 %P1, i32 4, i32 4)]
+ call void @llvm.assume(i1 true) ["align"(ptr %P, i32 %P1, i32 4, i32 4)]
; CHECK: second argument should be an integer
- call void @llvm.assume(i1 true) ["align"(i32* %P, i32* %P2)]
+ call void @llvm.assume(i1 true) ["align"(ptr %P, ptr %P2)]
; CHECK: third argument should be an integer if present
- call void @llvm.assume(i1 true) ["align"(i32* %P, i32 %P1, i32* %P2)]
+ call void @llvm.assume(i1 true) ["align"(ptr %P, i32 %P1, ptr %P2)]
; CHECK: separate_storage assumptions should have 2 arguments
- call void @llvm.assume(i1 true) ["separate_storage"(i32* %P)]
+ call void @llvm.assume(i1 true) ["separate_storage"(ptr %P)]
; CHECK: arguments to separate_storage assumptions should be pointers
- call void @llvm.assume(i1 true) ["separate_storage"(i32* %P, i32 123)]
+ call void @llvm.assume(i1 true) ["separate_storage"(ptr %P, i32 123)]
ret void
}
; CHECK: atomic store operand must have integer, pointer, or floating point type!
; CHECK: atomic load operand must have integer, pointer, or floating point type!
-define void @foo(x86_mmx* %P, x86_mmx %v) {
- store atomic x86_mmx %v, x86_mmx* %P unordered, align 8
+define void @foo(ptr %P, x86_mmx %v) {
+ store atomic x86_mmx %v, ptr %P unordered, align 8
ret void
}
-define x86_mmx @bar(x86_mmx* %P) {
- %v = load atomic x86_mmx, x86_mmx* %P unordered, align 8
+define x86_mmx @bar(ptr %P) {
+ %v = load atomic x86_mmx, ptr %P unordered, align 8
ret x86_mmx %v
}
; RUN: not llvm-as -disable-output %s 2>&1 | FileCheck %s
-; CHECK: error: invalid cast opcode for cast from 'i32 addrspace(2)*' to 'i32 addrspace(3)*'
+; CHECK: error: invalid cast opcode for cast from 'ptr addrspace(2)' to 'ptr addrspace(3)'
target datalayout = "e-p:32:32:32-p1:16:16:16-p2:8:8:8-p3:8:8:8-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:32:64-v128:32:128-a0:0:32-n8:16:32"
-%struct.Foo1 = type { i32 addrspace(1)* }
+%struct.Foo1 = type { ptr addrspace(1) }
@as2_array = addrspace(2) global [32 x i32] zeroinitializer
; gep -> legal bitcast (2 -> 3) -> gep -> illegal bitcast (3 -> 1)
@bitcast_after_gep_bitcast_gep =
- global %struct.Foo1 { i32 addrspace(1)* bitcast
- (i32 addrspace(3)* getelementptr
- (i32, i32 addrspace(3)* bitcast
- (i32 addrspace(2)* getelementptr
- ([32 x i32], [32 x i32] addrspace(2)* @as2_array, i32 0, i32 8) to i32 addrspace(3)*), i32 3) to i32 addrspace(1)*) }
+ global %struct.Foo1 { ptr addrspace(1) bitcast
+ (ptr addrspace(3) getelementptr
+ (i32, ptr addrspace(3) bitcast
+ (ptr addrspace(2) getelementptr
+ ([32 x i32], ptr addrspace(2) @as2_array, i32 0, i32 8) to ptr addrspace(3)), i32 3) to ptr addrspace(1)) }
target datalayout = "e-p:32:32:32-p1:16:16:16-p2:8:8:8-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:32:64-v128:32:128-a0:0:32-n8:16:32"
-; CHECK: error: invalid cast opcode for cast from 'i32 addrspace(1)*' to 'i32 addrspace(2)*'
-define i32 addrspace(2)* @illegal_bitcast_as_1_to_2_inttoptr() {
- %cast = bitcast i32 addrspace(1)* inttoptr (i32 5 to i32 addrspace(1)*) to i32 addrspace(2)*
- ret i32 addrspace(2)* %cast
+; CHECK: error: invalid cast opcode for cast from 'ptr addrspace(1)' to 'ptr addrspace(2)'
+define ptr addrspace(2) @illegal_bitcast_as_1_to_2_inttoptr() {
+ %cast = bitcast ptr addrspace(1) inttoptr (i32 5 to ptr addrspace(1)) to ptr addrspace(2)
+ ret ptr addrspace(2) %cast
}
target datalayout = "e-p:32:32:32-p1:16:16:16-p2:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:32:64-v128:32:128-a0:0:32-n8:16:32"
-; CHECK: error: invalid cast opcode for cast from '<4 x i32 addrspace(1)*>' to '<2 x i32 addrspace(2)*>'
+; CHECK: error: invalid cast opcode for cast from '<4 x ptr addrspace(1)>' to '<2 x ptr addrspace(2)>'
; The pointer in addrspace 1 of the size 16 while pointer in addrspace 2 of the size 32.
; Converting 4 element array of pointers from addrspace 2 to 2 element array in addrspace 2
; has the same total bit length but bitcast still does not allow conversion into
; different addrspace.
-define <2 x i32 addrspace(2)*> @vector_illegal_bitcast_as_1_to_2(<4 x i32 addrspace(1)*> %p) {
- %cast = bitcast <4 x i32 addrspace(1)*> %p to <2 x i32 addrspace(2)*>
- ret <2 x i32 addrspace(2)*> %cast
+define <2 x ptr addrspace(2)> @vector_illegal_bitcast_as_1_to_2(<4 x ptr addrspace(1)> %p) {
+ %cast = bitcast <4 x ptr addrspace(1)> %p to <2 x ptr addrspace(2)>
+ ret <2 x ptr addrspace(2)> %cast
}
target datalayout = "e-p:32:32:32-p1:16:16:16-p2:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:32:64-v128:32:128-a0:0:32-n8:16:32"
-; CHECK: error: invalid cast opcode for cast from '<4 x i32*>' to '<4 x i32 addrspace(1)*>'
+; CHECK: error: invalid cast opcode for cast from '<4 x ptr>' to '<4 x ptr addrspace(1)>'
-define <4 x i32 addrspace(1)*> @vector_illegal_bitcast_as_0_to_1(<4 x i32 addrspace(0)*> %p) {
- %cast = bitcast <4 x i32 addrspace(0)*> %p to <4 x i32 addrspace(1)*>
- ret <4 x i32 addrspace(1)*> %cast
+define <4 x ptr addrspace(1)> @vector_illegal_bitcast_as_0_to_1(<4 x ptr addrspace(0)> %p) {
+ %cast = bitcast <4 x ptr addrspace(0)> %p to <4 x ptr addrspace(1)>
+ ret <4 x ptr addrspace(1)> %cast
}
target datalayout = "e-p:32:32:32-p1:16:16:16-p2:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:32:64-v128:32:128-a0:0:32-n8:16:32"
-; CHECK: error: invalid cast opcode for cast from '<2 x i32*>' to 'i64*'
+; CHECK: error: invalid cast opcode for cast from '<2 x ptr>' to 'ptr'
-define i64* @illegal_bitcast_vector_of_pointers_to_pointer(<2 x i32*> %a) {
- %b = bitcast <2 x i32*> %a to i64*
- ret i64* %b
+define ptr @illegal_bitcast_vector_of_pointers_to_pointer(<2 x ptr> %a) {
+ %b = bitcast <2 x ptr> %a to ptr
+ ret ptr %b
}
define void @foo() {
entry:
%s = alloca i32
- call void @llvm.dbg.declare(metadata i32* %s, metadata !2, metadata !DIExpression()), !dbg !DILocation(scope: !1)
+ call void @llvm.dbg.declare(metadata ptr %s, metadata !2, metadata !DIExpression()), !dbg !DILocation(scope: !1)
ret void
}
; RUN: llvm-as %s -o /dev/null
%struct.foo = type { i64 }
-declare void @h(%struct.foo* byval(%struct.foo) %num)
+declare void @h(ptr byval(%struct.foo) %num)
define void @f() {
%1 = alloca <6 x float>, align 32
- call void @llvm.dbg.declare(metadata <6 x float>* %1, metadata !10, metadata !DIExpression()), !dbg !18
+ call void @llvm.dbg.declare(metadata ptr %1, metadata !10, metadata !DIExpression()), !dbg !18
ret void
}
ret void
not_ok:
- %0 = landingpad { i8*, i32 }
- filter [0 x i8*] zeroinitializer
+ %0 = landingpad { ptr, i32 }
+ filter [0 x ptr] zeroinitializer
ret void
}
; RUN: llvm-as < %s -o /dev/null
-define i8* @f_0(i8 %val) {
- %ptr = inttoptr i8 %val to i8*, !dereferenceable_or_null !{i64 2}
- ret i8* %ptr
+define ptr @f_0(i8 %val) {
+ %ptr = inttoptr i8 %val to ptr, !dereferenceable_or_null !{i64 2}
+ ret ptr %ptr
}
; RUN: not llvm-as < %s -o /dev/null 2>&1 | FileCheck %s
-declare i8* @foo()
+declare ptr @foo()
define void @f1() {
entry:
- call i8* @foo(), !dereferenceable !{i64 2}
+ call ptr @foo(), !dereferenceable !{i64 2}
ret void
}
; CHECK: dereferenceable, dereferenceable_or_null apply only to load and inttoptr instructions, use attributes for calls or invokes
-; CHECK-NEXT: call i8* @foo()
+; CHECK-NEXT: call ptr @foo()
define void @f2() {
entry:
- call i8* @foo(), !dereferenceable_or_null !{i64 2}
+ call ptr @foo(), !dereferenceable_or_null !{i64 2}
ret void
}
; CHECK: dereferenceable, dereferenceable_or_null apply only to load and inttoptr instructions, use attributes for calls or invokes
-; CHECK-NEXT: call i8* @foo()
+; CHECK-NEXT: call ptr @foo()
-define i8 @f3(i8* %x) {
+define i8 @f3(ptr %x) {
entry:
- %y = load i8, i8* %x, !dereferenceable !{i64 2}
+ %y = load i8, ptr %x, !dereferenceable !{i64 2}
ret i8 %y
}
; CHECK: dereferenceable, dereferenceable_or_null apply only to pointer types
-; CHECK-NEXT: load i8, i8* %x
+; CHECK-NEXT: load i8, ptr %x
-define i8 @f4(i8* %x) {
+define i8 @f4(ptr %x) {
entry:
- %y = load i8, i8* %x, !dereferenceable_or_null !{i64 2}
+ %y = load i8, ptr %x, !dereferenceable_or_null !{i64 2}
ret i8 %y
}
; CHECK: dereferenceable, dereferenceable_or_null apply only to pointer types
-; CHECK-NEXT: load i8, i8* %x
+; CHECK-NEXT: load i8, ptr %x
-define i8* @f5(i8** %x) {
+define ptr @f5(ptr %x) {
entry:
- %y = load i8*, i8** %x, !dereferenceable !{}
- ret i8* %y
+ %y = load ptr, ptr %x, !dereferenceable !{}
+ ret ptr %y
}
; CHECK: dereferenceable, dereferenceable_or_null take one operand
-; CHECK-NEXT: load i8*, i8** %x
+; CHECK-NEXT: load ptr, ptr %x
-define i8* @f6(i8** %x) {
+define ptr @f6(ptr %x) {
entry:
- %y = load i8*, i8** %x, !dereferenceable_or_null !{}
- ret i8* %y
+ %y = load ptr, ptr %x, !dereferenceable_or_null !{}
+ ret ptr %y
}
; CHECK: dereferenceable, dereferenceable_or_null take one operand
-; CHECK-NEXT: load i8*, i8** %x
+; CHECK-NEXT: load ptr, ptr %x
-define i8* @f7(i8** %x) {
+define ptr @f7(ptr %x) {
entry:
- %y = load i8*, i8** %x, !dereferenceable !{!"str"}
- ret i8* %y
+ %y = load ptr, ptr %x, !dereferenceable !{!"str"}
+ ret ptr %y
}
; CHECK: dereferenceable, dereferenceable_or_null metadata value must be an i64!
-; CHECK-NEXT: load i8*, i8** %x
+; CHECK-NEXT: load ptr, ptr %x
-define i8* @f8(i8** %x) {
+define ptr @f8(ptr %x) {
entry:
- %y = load i8*, i8** %x, !dereferenceable_or_null !{!"str"}
- ret i8* %y
+ %y = load ptr, ptr %x, !dereferenceable_or_null !{!"str"}
+ ret ptr %y
}
; CHECK: dereferenceable, dereferenceable_or_null metadata value must be an i64!
-; CHECK-NEXT: load i8*, i8** %x
+; CHECK-NEXT: load ptr, ptr %x
-define i8* @f9(i8** %x) {
+define ptr @f9(ptr %x) {
entry:
- %y = load i8*, i8** %x, !dereferenceable !{i32 2}
- ret i8* %y
+ %y = load ptr, ptr %x, !dereferenceable !{i32 2}
+ ret ptr %y
}
; CHECK: dereferenceable, dereferenceable_or_null metadata value must be an i64!
-; CHECK-NEXT: load i8*, i8** %x
+; CHECK-NEXT: load ptr, ptr %x
-define i8* @f10(i8** %x) {
+define ptr @f10(ptr %x) {
entry:
- %y = load i8*, i8** %x, !dereferenceable_or_null !{i32 2}
- ret i8* %y
+ %y = load ptr, ptr %x, !dereferenceable_or_null !{i32 2}
+ ret ptr %y
}
; CHECK: dereferenceable, dereferenceable_or_null metadata value must be an i64!
-; CHECK-NEXT: load i8*, i8** %x
+; CHECK-NEXT: load ptr, ptr %x
-define i8* @f_11(i8 %val) {
- %ptr = inttoptr i8 %val to i8*, !dereferenceable !{i32 2}
- ret i8* %ptr
+define ptr @f_11(i8 %val) {
+ %ptr = inttoptr i8 %val to ptr, !dereferenceable !{i32 2}
+ ret ptr %ptr
}
; CHECK: dereferenceable, dereferenceable_or_null metadata value must be an i64!
-; CHECK-NEXT: %ptr = inttoptr i8 %val to i8*, !dereferenceable !3
+; CHECK-NEXT: %ptr = inttoptr i8 %val to ptr, !dereferenceable !3
-define i8* @f_12(i8 %val) {
- %ptr = inttoptr i8 %val to i8*, !dereferenceable_or_null !{i32 2}
- ret i8* %ptr
+define ptr @f_12(i8 %val) {
+ %ptr = inttoptr i8 %val to ptr, !dereferenceable_or_null !{i32 2}
+ ret ptr %ptr
}
; CHECK: dereferenceable, dereferenceable_or_null metadata value must be an i64!
-; CHECK-NEXT: %ptr = inttoptr i8 %val to i8*, !dereferenceable_or_null !3
+; CHECK-NEXT: %ptr = inttoptr i8 %val to ptr, !dereferenceable_or_null !3
-define i8* @f_13(i8 %val) {
- %ptr = inttoptr i8 %val to i8*, !dereferenceable !{}
- ret i8* %ptr
+define ptr @f_13(i8 %val) {
+ %ptr = inttoptr i8 %val to ptr, !dereferenceable !{}
+ ret ptr %ptr
}
; CHECK: dereferenceable, dereferenceable_or_null take one operand
-; CHECK-NEXT: %ptr = inttoptr i8 %val to i8*, !dereferenceable !1
+; CHECK-NEXT: %ptr = inttoptr i8 %val to ptr, !dereferenceable !1
-define i8* @f_14(i8 %val) {
- %ptr = inttoptr i8 %val to i8*, !dereferenceable_or_null !{}
- ret i8* %ptr
+define ptr @f_14(i8 %val) {
+ %ptr = inttoptr i8 %val to ptr, !dereferenceable_or_null !{}
+ ret ptr %ptr
}
; CHECK: dereferenceable, dereferenceable_or_null take one operand
-; CHECK-NEXT: %ptr = inttoptr i8 %val to i8*, !dereferenceable_or_null !1
+; CHECK-NEXT: %ptr = inttoptr i8 %val to ptr, !dereferenceable_or_null !1
-define i8* @f_15(i8 %val) {
- %ptr = inttoptr i8 %val to i8*, !dereferenceable !{!"str"}
- ret i8* %ptr
+define ptr @f_15(i8 %val) {
+ %ptr = inttoptr i8 %val to ptr, !dereferenceable !{!"str"}
+ ret ptr %ptr
}
; CHECK: dereferenceable, dereferenceable_or_null metadata value must be an i64!
-; CHECK-NEXT: %ptr = inttoptr i8 %val to i8*, !dereferenceable !2
+; CHECK-NEXT: %ptr = inttoptr i8 %val to ptr, !dereferenceable !2
-define i8* @f_16(i8 %val) {
- %ptr = inttoptr i8 %val to i8*, !dereferenceable_or_null !{!"str"}
- ret i8* %ptr
+define ptr @f_16(i8 %val) {
+ %ptr = inttoptr i8 %val to ptr, !dereferenceable_or_null !{!"str"}
+ ret ptr %ptr
}
; CHECK: dereferenceable, dereferenceable_or_null metadata value must be an i64!
-; CHECK-NEXT: %ptr = inttoptr i8 %val to i8*, !dereferenceable_or_null !2
+; CHECK-NEXT: %ptr = inttoptr i8 %val to ptr, !dereferenceable_or_null !2
%timespec.0.1.2.3.0.1.2 = type { i64, i64 }
-define internal i64 @init_vdso_clock_gettime(i32, %timespec.0.1.2.3.0.1.2* nonnull) unnamed_addr !dbg !142 {
- call void @llvm.dbg.value(metadata i64 (i32, %timespec.0.1.2.3.0.1.2*)* null, metadata !162, metadata !DIExpression()), !dbg !167
+define internal i64 @init_vdso_clock_gettime(i32, ptr nonnull) unnamed_addr !dbg !142 {
+ call void @llvm.dbg.value(metadata ptr null, metadata !162, metadata !DIExpression()), !dbg !167
ret i64 -38, !dbg !168
}
declare void @llvm.dbg.value(metadata, metadata, metadata) #0
}
declare i32 @g()
-define void @f2(i32 %x) personality i32 ()* @g {
+define void @f2(i32 %x) personality ptr @g {
bb0:
%y1 = invoke i32 @g() to label %bb1 unwind label %bb2
bb1:
; CHECK-NEXT: %y2 = phi i32 [ %y1, %bb0 ]
}
-define void @f3(i32 %x) personality i32 ()* @g {
+define void @f3(i32 %x) personality ptr @g {
bb0:
%y1 = invoke i32 @g() to label %bb1 unwind label %bb2
bb1:
; RUN: not opt -passes=verify < %s 2>&1 | FileCheck %s
-define void @test_memcpy(i8* %P, i8* %Q, i32 %A, i32 %E) {
+define void @test_memcpy(ptr %P, ptr %Q, i32 %A, i32 %E) {
; CHECK: immarg operand has non-immediate parameter
; CHECK: i32 %E
- ; CHECK-NEXT: call void @llvm.memcpy.element.unordered.atomic.p0i8.p0i8.i32(i8* align 4 %P, i8* align 4 %Q, i32 1, i32 %E)
- call void @llvm.memcpy.element.unordered.atomic.p0i8.p0i8.i32(i8* align 4 %P, i8* align 4 %Q, i32 1, i32 %E)
+ ; CHECK-NEXT: call void @llvm.memcpy.element.unordered.atomic.p0.p0.i32(ptr align 4 %P, ptr align 4 %Q, i32 1, i32 %E)
+ call void @llvm.memcpy.element.unordered.atomic.p0.p0.i32(ptr align 4 %P, ptr align 4 %Q, i32 1, i32 %E)
; CHECK: element size of the element-wise atomic memory intrinsic must be a power of 2
- call void @llvm.memcpy.element.unordered.atomic.p0i8.p0i8.i32(i8* align 4 %P, i8* align 4 %Q, i32 1, i32 3)
+ call void @llvm.memcpy.element.unordered.atomic.p0.p0.i32(ptr align 4 %P, ptr align 4 %Q, i32 1, i32 3)
- call void @llvm.memcpy.element.unordered.atomic.p0i8.p0i8.i32(i8* align 4 %P, i8* align 4 %Q, i32 7, i32 4)
+ call void @llvm.memcpy.element.unordered.atomic.p0.p0.i32(ptr align 4 %P, ptr align 4 %Q, i32 7, i32 4)
; CHECK: incorrect alignment of the destination argument
- call void @llvm.memcpy.element.unordered.atomic.p0i8.p0i8.i32(i8* %P, i8* align 4 %Q, i32 1, i32 1)
+ call void @llvm.memcpy.element.unordered.atomic.p0.p0.i32(ptr %P, ptr align 4 %Q, i32 1, i32 1)
; CHECK: incorrect alignment of the destination argument
- call void @llvm.memcpy.element.unordered.atomic.p0i8.p0i8.i32(i8* align 1 %P, i8* align 4 %Q, i32 4, i32 4)
+ call void @llvm.memcpy.element.unordered.atomic.p0.p0.i32(ptr align 1 %P, ptr align 4 %Q, i32 4, i32 4)
; CHECK: incorrect alignment of the source argument
- call void @llvm.memcpy.element.unordered.atomic.p0i8.p0i8.i32(i8* align 4 %P, i8* %Q, i32 1, i32 1)
+ call void @llvm.memcpy.element.unordered.atomic.p0.p0.i32(ptr align 4 %P, ptr %Q, i32 1, i32 1)
; CHECK: incorrect alignment of the source argument
- call void @llvm.memcpy.element.unordered.atomic.p0i8.p0i8.i32(i8* align 4 %P, i8* align 1 %Q, i32 4, i32 4)
+ call void @llvm.memcpy.element.unordered.atomic.p0.p0.i32(ptr align 4 %P, ptr align 1 %Q, i32 4, i32 4)
ret void
}
-declare void @llvm.memcpy.element.unordered.atomic.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i32) nounwind
+declare void @llvm.memcpy.element.unordered.atomic.p0.p0.i32(ptr nocapture, ptr nocapture, i32, i32) nounwind
-define void @test_memmove(i8* %P, i8* %Q, i32 %A, i32 %E) {
+define void @test_memmove(ptr %P, ptr %Q, i32 %A, i32 %E) {
; CHECK: immarg operand has non-immediate parameter
; CHECK-NEXT: i32 %E
- ; CHECK-NEXT: call void @llvm.memmove.element.unordered.atomic.p0i8.p0i8.i32(i8* align 4 %P, i8* align 4 %Q, i32 1, i32 %E)
- call void @llvm.memmove.element.unordered.atomic.p0i8.p0i8.i32(i8* align 4 %P, i8* align 4 %Q, i32 1, i32 %E)
+ ; CHECK-NEXT: call void @llvm.memmove.element.unordered.atomic.p0.p0.i32(ptr align 4 %P, ptr align 4 %Q, i32 1, i32 %E)
+ call void @llvm.memmove.element.unordered.atomic.p0.p0.i32(ptr align 4 %P, ptr align 4 %Q, i32 1, i32 %E)
; CHECK: element size of the element-wise atomic memory intrinsic must be a power of 2
- call void @llvm.memmove.element.unordered.atomic.p0i8.p0i8.i32(i8* align 4 %P, i8* align 4 %Q, i32 1, i32 3)
+ call void @llvm.memmove.element.unordered.atomic.p0.p0.i32(ptr align 4 %P, ptr align 4 %Q, i32 1, i32 3)
- call void @llvm.memmove.element.unordered.atomic.p0i8.p0i8.i32(i8* align 4 %P, i8* align 4 %Q, i32 7, i32 4)
+ call void @llvm.memmove.element.unordered.atomic.p0.p0.i32(ptr align 4 %P, ptr align 4 %Q, i32 7, i32 4)
; CHECK: incorrect alignment of the destination argument
- call void @llvm.memmove.element.unordered.atomic.p0i8.p0i8.i32(i8* %P, i8* align 4 %Q, i32 1, i32 1)
+ call void @llvm.memmove.element.unordered.atomic.p0.p0.i32(ptr %P, ptr align 4 %Q, i32 1, i32 1)
; CHECK: incorrect alignment of the destination argument
- call void @llvm.memmove.element.unordered.atomic.p0i8.p0i8.i32(i8* align 1 %P, i8* align 4 %Q, i32 4, i32 4)
+ call void @llvm.memmove.element.unordered.atomic.p0.p0.i32(ptr align 1 %P, ptr align 4 %Q, i32 4, i32 4)
; CHECK: incorrect alignment of the source argument
- call void @llvm.memmove.element.unordered.atomic.p0i8.p0i8.i32(i8* align 4 %P, i8* %Q, i32 1, i32 1)
+ call void @llvm.memmove.element.unordered.atomic.p0.p0.i32(ptr align 4 %P, ptr %Q, i32 1, i32 1)
; CHECK: incorrect alignment of the source argument
- call void @llvm.memmove.element.unordered.atomic.p0i8.p0i8.i32(i8* align 4 %P, i8* align 1 %Q, i32 4, i32 4)
+ call void @llvm.memmove.element.unordered.atomic.p0.p0.i32(ptr align 4 %P, ptr align 1 %Q, i32 4, i32 4)
ret void
}
-declare void @llvm.memmove.element.unordered.atomic.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i32) nounwind
+declare void @llvm.memmove.element.unordered.atomic.p0.p0.i32(ptr nocapture, ptr nocapture, i32, i32) nounwind
-define void @test_memset(i8* %P, i8 %V, i32 %A, i32 %E) {
+define void @test_memset(ptr %P, i8 %V, i32 %A, i32 %E) {
; CHECK: immarg operand has non-immediate parameter
; CHECK: i32 %E
- ; CHECK: call void @llvm.memset.element.unordered.atomic.p0i8.i32(i8* align 4 %P, i8 %V, i32 1, i32 %E)
- call void @llvm.memset.element.unordered.atomic.p0i8.i32(i8* align 4 %P, i8 %V, i32 1, i32 %E)
+ ; CHECK: call void @llvm.memset.element.unordered.atomic.p0.i32(ptr align 4 %P, i8 %V, i32 1, i32 %E)
+ call void @llvm.memset.element.unordered.atomic.p0.i32(ptr align 4 %P, i8 %V, i32 1, i32 %E)
; CHECK: element size of the element-wise atomic memory intrinsic must be a power of 2
- call void @llvm.memset.element.unordered.atomic.p0i8.i32(i8* align 4 %P, i8 %V, i32 1, i32 3)
+ call void @llvm.memset.element.unordered.atomic.p0.i32(ptr align 4 %P, i8 %V, i32 1, i32 3)
- call void @llvm.memset.element.unordered.atomic.p0i8.i32(i8* align 4 %P, i8 %V, i32 7, i32 4)
+ call void @llvm.memset.element.unordered.atomic.p0.i32(ptr align 4 %P, i8 %V, i32 7, i32 4)
; CHECK: incorrect alignment of the destination argument
- call void @llvm.memset.element.unordered.atomic.p0i8.i32(i8* %P, i8 %V, i32 1, i32 1)
+ call void @llvm.memset.element.unordered.atomic.p0.i32(ptr %P, i8 %V, i32 1, i32 1)
; CHECK: incorrect alignment of the destination argument
- call void @llvm.memset.element.unordered.atomic.p0i8.i32(i8* align 1 %P, i8 %V, i32 4, i32 4)
+ call void @llvm.memset.element.unordered.atomic.p0.i32(ptr align 1 %P, i8 %V, i32 4, i32 4)
ret void
}
-declare void @llvm.memset.element.unordered.atomic.p0i8.i32(i8* nocapture, i8, i32, i32) nounwind
+declare void @llvm.memset.element.unordered.atomic.p0.i32(ptr nocapture, i8, i32, i32) nounwind
; CHECK: input module is broken!
%a = alloca i32
; CHECK: conflicting debug info for argument
call void @llvm.dbg.value(metadata i32 0, i64 0, metadata !3, metadata !DIExpression()), !dbg !6
- call void @llvm.dbg.declare(metadata i32* %a, metadata !4, metadata !DIExpression()), !dbg !6
+ call void @llvm.dbg.declare(metadata ptr %a, metadata !4, metadata !DIExpression()), !dbg !6
ret void, !dbg !6
}
; RUN: not llvm-as %s -o /dev/null 2>&1 | FileCheck %s
declare void @llvm.localescape(...)
-declare i8* @llvm.localrecover(i8*, i8*, i32)
+declare ptr @llvm.localrecover(ptr, ptr, i32)
define internal void @f() {
%a = alloca i8
- call void (...) @llvm.localescape(i8* %a)
- call void (...) @llvm.localescape(i8* %a)
+ call void (...) @llvm.localescape(ptr %a)
+ call void (...) @llvm.localescape(ptr %a)
ret void
}
; CHECK: multiple calls to llvm.localescape in one function
%a = alloca i8
br label %not_entry
not_entry:
- call void (...) @llvm.localescape(i8* %a)
+ call void (...) @llvm.localescape(ptr %a)
ret void
}
; CHECK: llvm.localescape used outside of entry block
define internal void @h() {
- call i8* @llvm.localrecover(i8* null, i8* null, i32 0)
+ call ptr @llvm.localrecover(ptr null, ptr null, i32 0)
ret void
}
; CHECK: llvm.localrecover first argument must be function defined in this module
declare void @declaration()
define internal void @i() {
- call i8* @llvm.localrecover(i8* @global, i8* null, i32 0)
+ call ptr @llvm.localrecover(ptr @global, ptr null, i32 0)
ret void
}
; CHECK: llvm.localrecover first argument must be function defined in this module
define internal void @j() {
- call i8* @llvm.localrecover(i8* bitcast(void()* @declaration to i8*), i8* null, i32 0)
+ call ptr @llvm.localrecover(ptr @declaration, ptr null, i32 0)
ret void
}
; CHECK: llvm.localrecover first argument must be function defined in this module
define internal void @k(i32 %n) {
- call i8* @llvm.localrecover(i8* bitcast(void()* @f to i8*), i8* null, i32 %n)
+ call ptr @llvm.localrecover(ptr @f, ptr null, i32 %n)
ret void
}
; CHECK: immarg operand has non-immediate parameter
; CHECK-NEXT: i32 %n
-; CHECK-NEXT: %1 = call i8* @llvm.localrecover(i8* bitcast (void ()* @f to i8*), i8* null, i32 %n)
+; CHECK-NEXT: %1 = call ptr @llvm.localrecover(ptr @f, ptr null, i32 %n)
-define internal void @l(i8* %b) {
+define internal void @l(ptr %b) {
%a = alloca i8
- call void (...) @llvm.localescape(i8* %a, i8* %b)
+ call void (...) @llvm.localescape(ptr %a, ptr %b)
ret void
}
; CHECK: llvm.localescape only accepts static allocas
define internal void @m() {
%a = alloca i8
- call void (...) @llvm.localescape(i8* %a)
+ call void (...) @llvm.localescape(ptr %a)
ret void
}
-define internal void @n(i8* %fp) {
- call i8* @llvm.localrecover(i8* bitcast(void ()* @m to i8*), i8* %fp, i32 1)
+define internal void @n(ptr %fp) {
+ call ptr @llvm.localrecover(ptr @m, ptr %fp, i32 1)
ret void
}
; CHECK: all indices passed to llvm.localrecover must be less than the number of arguments passed to llvm.localescape in the parent function
; address space with the relocated value.
; CHECK: gc.relocate: relocating a pointer shouldn't change its address space
-; CHECK-NEXT: %obj.relocated = call coldcc i8* @llvm.experimental.gc.relocate.p0i8(token %safepoint_token, i32 7, i32 7) ;
+; CHECK-NEXT: %obj.relocated = call coldcc ptr @llvm.experimental.gc.relocate.p0(token %safepoint_token, i32 7, i32 7) ;
declare void @foo()
; Function Attrs: nounwind
-declare token @llvm.experimental.gc.statepoint.p0f_isVoidf(i64, i32, void ()*, i32, i32, ...) #0
+declare token @llvm.experimental.gc.statepoint.p0(i64, i32, ptr, i32, i32, ...) #0
-define void @test1(i64 addrspace(1)* %obj) gc "statepoint-example" {
+define void @test1(ptr addrspace(1) %obj) gc "statepoint-example" {
entry:
- %safepoint_token = call token (i64, i32, void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 0, i32 0, void ()* @foo, i32 0, i32 0, i32 0, i32 0, i64 addrspace(1)* %obj)
- %obj.relocated = call coldcc i8* @llvm.experimental.gc.relocate.p0i8(token %safepoint_token, i32 7, i32 7) ; (%obj, %obj)
+ %safepoint_token = call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 0, i32 0, ptr @foo, i32 0, i32 0, i32 0, i32 0, ptr addrspace(1) %obj)
+ %obj.relocated = call coldcc ptr @llvm.experimental.gc.relocate.p0(token %safepoint_token, i32 7, i32 7) ; (%obj, %obj)
ret void
}
; Function Attrs: nounwind
-declare i8* @llvm.experimental.gc.relocate.p0i8(token, i32, i32) #0
+declare ptr @llvm.experimental.gc.relocate.p0(token, i32, i32) #0
attributes #0 = { nounwind }
declare void @foo()
-declare token @llvm.experimental.gc.statepoint.p0f_isVoidf(i64, i32, void ()*, i32, i32, ...)
+declare token @llvm.experimental.gc.statepoint.p0(i64, i32, ptr, i32, i32, ...)
define void @test1(i64 %obj) gc "statepoint-example" {
entry:
- %safepoint_token = call token (i64, i32, void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 0, i32 0, void ()* @foo, i32 0, i32 0, i32 0, i32 0, i64 %obj)
- %obj.relocated = call coldcc i8 addrspace(1)* @llvm.experimental.gc.relocate.p1i8(token %safepoint_token, i32 7, i32 7) ; (%obj, %obj)
+ %safepoint_token = call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 0, i32 0, ptr @foo, i32 0, i32 0, i32 0, i32 0, i64 %obj)
+ %obj.relocated = call coldcc ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token %safepoint_token, i32 7, i32 7) ; (%obj, %obj)
ret void
}
; Function Attrs: nounwind
-declare i8 addrspace(1)* @llvm.experimental.gc.relocate.p1i8(token, i32, i32) #0
+declare ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token, i32, i32) #0
attributes #0 = { nounwind }
declare void @foo()
-declare token @llvm.experimental.gc.statepoint.p0f_isVoidf(i64, i32, void ()*, i32, i32, ...)
+declare token @llvm.experimental.gc.statepoint.p0(i64, i32, ptr, i32, i32, ...)
-define void @test1(<2 x i32 addrspace(1)*> addrspace(1)* %obj) gc "statepoint-example" {
+define void @test1(ptr addrspace(1) %obj) gc "statepoint-example" {
entry:
- %safepoint_token = call token (i64, i32, void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 0, i32 0, void ()* @foo, i32 0, i32 0, i32 0, i32 0, <2 x i32 addrspace(1)*> addrspace(1)* %obj)
+ %safepoint_token = call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 0, i32 0, ptr @foo, i32 0, i32 0, i32 0, i32 0, ptr addrspace(1) %obj)
%obj.relocated = call coldcc i8 @llvm.experimental.gc.relocate.i8(token %safepoint_token, i32 7, i32 7) ; (%obj, %obj)
ret void
}
; RUN: not llvm-as < %s > /dev/null 2>&1
; PR1633
-%meta = type { i8* }
-%obj = type { %meta* }
+%meta = type { ptr }
+%obj = type { ptr }
-declare %obj* @llvm.gcread(%obj*, %obj*)
+declare ptr @llvm.gcread(ptr, ptr)
-define %obj* @f() {
+define ptr @f() {
entry:
- %x = call %obj* @llvm.gcread(%obj* null, %obj* null)
- ret %obj* %x
+ %x = call ptr @llvm.gcread(ptr null, ptr null)
+ ret ptr %x
}
; RUN: not llvm-as < %s > /dev/null 2>&1
; PR1633
-%meta = type { i8* }
-%obj = type { %meta* }
+%meta = type { ptr }
+%obj = type { ptr }
-declare void @llvm.gcwrite(%obj*, %obj*, %obj*)
+declare void @llvm.gcwrite(ptr, ptr, ptr)
define void @f() {
entry:
- call void @llvm.gcwrite(%obj* null, %obj* null, %obj* null)
+ call void @llvm.gcwrite(ptr null, ptr null, ptr null)
ret void
}
; RUN: not llvm-as %s -o /dev/null 2>&1 | FileCheck %s
-@llvm.global_ctors = appending global [1 x { i32, void()*, i8 } ] [
- { i32, void()*, i8 } { i32 65535, void ()* null, i8 0 }
+@llvm.global_ctors = appending global [1 x { i32, ptr, i8 } ] [
+ { i32, ptr, i8 } { i32 65535, ptr null, i8 0 }
]
; CHECK: wrong type for intrinsic global variable
-@llvm.global_dtors = appending global [1 x { i32, void()*, i8*, i8 } ] [
- { i32, void()*, i8*, i8 } { i32 65535, void ()* null, i8* null, i8 0}
+@llvm.global_dtors = appending global [1 x { i32, ptr, ptr, i8 } ] [
+ { i32, ptr, ptr, i8 } { i32 65535, ptr null, ptr null, i8 0}
]
; CHECK: wrong type for intrinsic global variable
ret void
not_ok:
- %0 = landingpad { i8*, i32 }
- filter [0 x i8*] zeroinitializer
+ %0 = landingpad { ptr, i32 }
+ filter [0 x ptr] zeroinitializer
ret void
}
call void @llvm.test.immarg.intrinsic.i32(i32 %arg)
; CHECK: immarg operand has non-immediate parameter
- ; CHECK-NEXT: i32 ptrtoint (i32* @gv to i32)
- ; CHECK-NEXT: call void @llvm.test.immarg.intrinsic.i32(i32 ptrtoint (i32* @gv to i32))
- call void @llvm.test.immarg.intrinsic.i32(i32 ptrtoint (i32* @gv to i32))
+ ; CHECK-NEXT: i32 ptrtoint (ptr @gv to i32)
+ ; CHECK-NEXT: call void @llvm.test.immarg.intrinsic.i32(i32 ptrtoint (ptr @gv to i32))
+ call void @llvm.test.immarg.intrinsic.i32(i32 ptrtoint (ptr @gv to i32))
ret void
}
}
; CHECK: immarg attribute only applies to intrinsics
-; CHECK-NEXT: void (i32)* @not_an_intrinsic
+; CHECK-NEXT: ptr @not_an_intrinsic
declare void @not_an_intrinsic(i32 immarg)
declare void @llvm.test.intrinsic(i32)
}
; CHECK: immarg attribute only applies to intrinsics
-; CHECK: void (i32)* @on_function_definition
+; CHECK: ptr @on_function_definition
define void @on_function_definition(i32 immarg %arg) {
ret void
}
declare void @h(i32, ...)
define void @i() {
%args = alloca inalloca i32
- call void (i32, ...) @h(i32 1, i32* inalloca(i32) %args, i32 3)
+ call void (i32, ...) @h(i32 1, ptr inalloca(i32) %args, i32 3)
; CHECK: inalloca isn't on the last argument!
ret void
}
; doesn't reject it.
; RUN: llvm-as %s -o /dev/null
-declare void @doit(i64* inalloca(i64) %a)
+declare void @doit(ptr inalloca(i64) %a)
define void @a() {
entry:
%a = alloca inalloca [2 x i32]
- %b = bitcast [2 x i32]* %a to i64*
- call void @doit(i64* inalloca(i64) %b)
+ call void @doit(ptr inalloca(i64) %a)
ret void
}
define void @b() {
entry:
%a = alloca inalloca i64
- call void @doit(i64* inalloca(i64) %a)
- call void @doit(i64* inalloca(i64) %a)
+ call void @doit(ptr inalloca(i64) %a)
+ call void @doit(ptr inalloca(i64) %a)
ret void
}
br label %call
call:
- %args = phi i64* [ %a, %if ], [ %b, %else ]
- call void @doit(i64* inalloca(i64) %args)
+ %args = phi ptr [ %a, %if ], [ %b, %else ]
+ call void @doit(ptr inalloca(i64) %args)
ret void
}
; RUN: not llvm-as %s -o /dev/null 2>&1 | FileCheck %s
-declare void @doit(i64* inalloca(i64) %a)
+declare void @doit(ptr inalloca(i64) %a)
define void @a() {
entry:
%a = alloca [2 x i32]
- %b = bitcast [2 x i32]* %a to i64*
- call void @doit(i64* inalloca(i64) %b)
+ call void @doit(ptr inalloca(i64) %a)
; CHECK: inalloca argument for call has mismatched alloca
ret void
}
declare i32 @llvm.my.custom.intrinsic()
; CHECK: Invalid user of intrinsic instruction!
-@g1 = global i32(i32, i32)* @llvm.umax.i32
+@g1 = global ptr @llvm.umax.i32
; CHECK: Invalid user of intrinsic instruction!
-@g2 = global i32()* @llvm.my.custom.intrinsic
+@g2 = global ptr @llvm.my.custom.intrinsic
; CHECK: Intrinsic has incorrect return type
; CHECK-NEXT: llvm.aarch64.neon.ld2.v4i32
-define { <4 x i64>, <4 x i32> } @test_ld2_ret(<4 x i32>* %ptr) {
- %res = call { <4 x i64>, <4 x i32> } @llvm.aarch64.neon.ld2.v4i32(<4 x i32>* %ptr)
+define { <4 x i64>, <4 x i32> } @test_ld2_ret(ptr %ptr) {
+ %res = call { <4 x i64>, <4 x i32> } @llvm.aarch64.neon.ld2.v4i32(ptr %ptr)
ret{ <4 x i64>, <4 x i32> } %res
}
-declare { <4 x i64>, <4 x i32> } @llvm.aarch64.neon.ld2.v4i32(<4 x i32>* %ptr)
+declare { <4 x i64>, <4 x i32> } @llvm.aarch64.neon.ld2.v4i32(ptr %ptr)
; CHECK: Intrinsic has incorrect return type
; CHECK-NEXT: llvm.aarch64.neon.ld2lane.v4i64
-define { <4 x i64>, <4 x i32> } @test_ld2lane_ret(i8* %ptr, <4 x i64> %a, <4 x i64> %b) {
- %res = call { <4 x i64>, <4 x i32> } @llvm.aarch64.neon.ld2lane.v4i64(<4 x i64> %a, <4 x i64> %b, i64 0, i8* %ptr)
+define { <4 x i64>, <4 x i32> } @test_ld2lane_ret(ptr %ptr, <4 x i64> %a, <4 x i64> %b) {
+ %res = call { <4 x i64>, <4 x i32> } @llvm.aarch64.neon.ld2lane.v4i64(<4 x i64> %a, <4 x i64> %b, i64 0, ptr %ptr)
ret{ <4 x i64>, <4 x i32> } %res
}
-declare { <4 x i64>, <4 x i32> } @llvm.aarch64.neon.ld2lane.v4i64(<4 x i64>, <4 x i64>, i64, i8*)
+declare { <4 x i64>, <4 x i32> } @llvm.aarch64.neon.ld2lane.v4i64(<4 x i64>, <4 x i64>, i64, ptr)
; CHECK: Intrinsic has incorrect argument type
; CHECK-NEXT: llvm.aarch64.neon.ld2lane.v4i32
-define { <4 x i32>, <4 x i32> } @test_ld2lane_arg(i8* %ptr, <4 x i64> %a, <4 x i32> %b) {
- %res = call { <4 x i32>, <4 x i32> } @llvm.aarch64.neon.ld2lane.v4i32(<4 x i64> %a, <4 x i32> %b, i64 0, i8* %ptr)
+define { <4 x i32>, <4 x i32> } @test_ld2lane_arg(ptr %ptr, <4 x i64> %a, <4 x i32> %b) {
+ %res = call { <4 x i32>, <4 x i32> } @llvm.aarch64.neon.ld2lane.v4i32(<4 x i64> %a, <4 x i32> %b, i64 0, ptr %ptr)
ret{ <4 x i32>, <4 x i32> } %res
}
-declare { <4 x i32>, <4 x i32> } @llvm.aarch64.neon.ld2lane.v4i32(<4 x i64>, <4 x i32>, i64, i8*)
+declare { <4 x i32>, <4 x i32> } @llvm.aarch64.neon.ld2lane.v4i32(<4 x i64>, <4 x i32>, i64, ptr)
; LD3 and LD3LANE
; CHECK: Intrinsic has incorrect return type
; CHECK-NEXT: llvm.aarch64.neon.ld3.v4i32
-define { <4 x i32>, <4 x i64>, <4 x i32> } @test_ld3_ret(<4 x i32>* %ptr) {
- %res = call { <4 x i32>, <4 x i64>, <4 x i32> } @llvm.aarch64.neon.ld3.v4i32(<4 x i32>* %ptr)
+define { <4 x i32>, <4 x i64>, <4 x i32> } @test_ld3_ret(ptr %ptr) {
+ %res = call { <4 x i32>, <4 x i64>, <4 x i32> } @llvm.aarch64.neon.ld3.v4i32(ptr %ptr)
ret{ <4 x i32>, <4 x i64>, <4 x i32> } %res
}
-declare { <4 x i32>, <4 x i64>, <4 x i32> } @llvm.aarch64.neon.ld3.v4i32(<4 x i32>* %ptr)
+declare { <4 x i32>, <4 x i64>, <4 x i32> } @llvm.aarch64.neon.ld3.v4i32(ptr %ptr)
; CHECK: Intrinsic has incorrect return type
; CHECK-NEXT: llvm.aarch64.neon.ld3lane.v4i64
-define { <4 x i64>, <4 x i32>, <4 x i64> } @test_ld3lane_ret(i8* %ptr, <4 x i64> %a, <4 x i64> %b, <4 x i64> %c) {
- %res = call { <4 x i64>, <4 x i32>, <4 x i64> } @llvm.aarch64.neon.ld3lane.v4i64(<4 x i64> %a, <4 x i64> %b, <4 x i64> %c, i64 0, i8* %ptr)
+define { <4 x i64>, <4 x i32>, <4 x i64> } @test_ld3lane_ret(ptr %ptr, <4 x i64> %a, <4 x i64> %b, <4 x i64> %c) {
+ %res = call { <4 x i64>, <4 x i32>, <4 x i64> } @llvm.aarch64.neon.ld3lane.v4i64(<4 x i64> %a, <4 x i64> %b, <4 x i64> %c, i64 0, ptr %ptr)
ret{ <4 x i64>, <4 x i32>, <4 x i64> } %res
}
-declare { <4 x i64>, <4 x i32>, <4 x i64> } @llvm.aarch64.neon.ld3lane.v4i64(<4 x i64>, <4 x i64>, <4 x i64>, i64, i8*)
+declare { <4 x i64>, <4 x i32>, <4 x i64> } @llvm.aarch64.neon.ld3lane.v4i64(<4 x i64>, <4 x i64>, <4 x i64>, i64, ptr)
; CHECK: Intrinsic has incorrect argument type
; CHECK-NEXT: llvm.aarch64.neon.ld3lane.v4i32
-define { <4 x i32>, <4 x i32>, <4 x i32> } @test_ld3lane_arg(i8* %ptr, <4 x i64> %a, <4 x i32> %b, <4 x i32> %c) {
- %res = call { <4 x i32>, <4 x i32>, <4 x i32> } @llvm.aarch64.neon.ld3lane.v4i32(<4 x i64> %a, <4 x i32> %b, <4 x i32> %c, i64 0, i8* %ptr)
+define { <4 x i32>, <4 x i32>, <4 x i32> } @test_ld3lane_arg(ptr %ptr, <4 x i64> %a, <4 x i32> %b, <4 x i32> %c) {
+ %res = call { <4 x i32>, <4 x i32>, <4 x i32> } @llvm.aarch64.neon.ld3lane.v4i32(<4 x i64> %a, <4 x i32> %b, <4 x i32> %c, i64 0, ptr %ptr)
ret{ <4 x i32>, <4 x i32>, <4 x i32> } %res
}
-declare { <4 x i32>, <4 x i32>, <4 x i32> } @llvm.aarch64.neon.ld3lane.v4i32(<4 x i64>, <4 x i32>, <4 x i32>, i64, i8*)
+declare { <4 x i32>, <4 x i32>, <4 x i32> } @llvm.aarch64.neon.ld3lane.v4i32(<4 x i64>, <4 x i32>, <4 x i32>, i64, ptr)
; LD4 and LD4LANE
; CHECK: Intrinsic has incorrect return type
; CHECK-NEXT: llvm.aarch64.neon.ld4.v4i32
-define { <4 x i32>, <4 x i32>, <4 x i64>, <4 x i32> } @test_ld4_ret(<4 x i32>* %ptr) {
- %res = call { <4 x i32>, <4 x i32>, <4 x i64>, <4 x i32> } @llvm.aarch64.neon.ld4.v4i32(<4 x i32>* %ptr)
+define { <4 x i32>, <4 x i32>, <4 x i64>, <4 x i32> } @test_ld4_ret(ptr %ptr) {
+ %res = call { <4 x i32>, <4 x i32>, <4 x i64>, <4 x i32> } @llvm.aarch64.neon.ld4.v4i32(ptr %ptr)
ret{ <4 x i32>, <4 x i32>, <4 x i64>, <4 x i32> } %res
}
-declare { <4 x i32>, <4 x i32>, <4 x i64>, <4 x i32> } @llvm.aarch64.neon.ld4.v4i32(<4 x i32>* %ptr)
+declare { <4 x i32>, <4 x i32>, <4 x i64>, <4 x i32> } @llvm.aarch64.neon.ld4.v4i32(ptr %ptr)
; CHECK: Intrinsic has incorrect return type
; CHECK-NEXT: llvm.aarch64.neon.ld4lane.v4i64
-define { <4 x i64>, <4 x i64>, <4 x i32>, <4 x i64> } @test_ld4lane_ret(i8* %ptr, <4 x i64> %a, <4 x i64> %b, <4 x i64> %c, <4 x i64> %d) {
- %res = call { <4 x i64>, <4 x i64>, <4 x i32>, <4 x i64> } @llvm.aarch64.neon.ld4lane.v4i64(<4 x i64> %a, <4 x i64> %b, <4 x i64> %c, <4 x i64> %d, i64 0, i8* %ptr)
+define { <4 x i64>, <4 x i64>, <4 x i32>, <4 x i64> } @test_ld4lane_ret(ptr %ptr, <4 x i64> %a, <4 x i64> %b, <4 x i64> %c, <4 x i64> %d) {
+ %res = call { <4 x i64>, <4 x i64>, <4 x i32>, <4 x i64> } @llvm.aarch64.neon.ld4lane.v4i64(<4 x i64> %a, <4 x i64> %b, <4 x i64> %c, <4 x i64> %d, i64 0, ptr %ptr)
ret{ <4 x i64>, <4 x i64>, <4 x i32>, <4 x i64> } %res
}
-declare { <4 x i64>, <4 x i64>, <4 x i32>, <4 x i64> } @llvm.aarch64.neon.ld4lane.v4i64(<4 x i64>, <4 x i64>, <4 x i64>, <4 x i64>, i64, i8*)
+declare { <4 x i64>, <4 x i64>, <4 x i32>, <4 x i64> } @llvm.aarch64.neon.ld4lane.v4i64(<4 x i64>, <4 x i64>, <4 x i64>, <4 x i64>, i64, ptr)
; CHECK: Intrinsic has incorrect argument type
; CHECK-NEXT: llvm.aarch64.neon.ld4lane.v4i32
-define { <4 x i32>, <4 x i32>, <4 x i32>, <4 x i32> } @test_ld4lane_arg(i8* %ptr, <4 x i64> %a, <4 x i32> %b, <4 x i32> %c, <4 x i32> %d) {
- %res = call { <4 x i32>, <4 x i32>, <4 x i32>, <4 x i32> } @llvm.aarch64.neon.ld4lane.v4i32(<4 x i64> %a, <4 x i32> %b, <4 x i32> %c, <4 x i32> %d, i64 0, i8* %ptr)
+define { <4 x i32>, <4 x i32>, <4 x i32>, <4 x i32> } @test_ld4lane_arg(ptr %ptr, <4 x i64> %a, <4 x i32> %b, <4 x i32> %c, <4 x i32> %d) {
+ %res = call { <4 x i32>, <4 x i32>, <4 x i32>, <4 x i32> } @llvm.aarch64.neon.ld4lane.v4i32(<4 x i64> %a, <4 x i32> %b, <4 x i32> %c, <4 x i32> %d, i64 0, ptr %ptr)
ret{ <4 x i32>, <4 x i32>, <4 x i32>, <4 x i32> } %res
}
-declare { <4 x i32>, <4 x i32>, <4 x i32>, <4 x i32> } @llvm.aarch64.neon.ld4lane.v4i32(<4 x i64>, <4 x i32>, <4 x i32>, <4 x i32>, i64, i8*)
+declare { <4 x i32>, <4 x i32>, <4 x i32>, <4 x i32> } @llvm.aarch64.neon.ld4lane.v4i32(<4 x i64>, <4 x i32>, <4 x i32>, <4 x i32>, i64, ptr)
; RUN: not opt -S -passes=verify 2>&1 < %s | FileCheck %s
; CHECK: Intrinsic has incorrect argument type!
-; CHECK-NEXT: <vscale x 4 x i32> (<vscale x 4 x i32>*, i32, <4 x i1>, <vscale x 4 x i32>)* @llvm.masked.load.nxv4i32.p0nxv4i32
+; CHECK-NEXT: ptr @llvm.masked.load.nxv4i32.p0
-define <vscale x 4 x i32> @masked_load(<vscale x 4 x i32>* %addr, <4 x i1> %mask, <vscale x 4 x i32> %dst) {
- %res = call <vscale x 4 x i32> @llvm.masked.load.nxv4i32.p0nxv4i32(<vscale x 4 x i32>* %addr, i32 4, <4 x i1> %mask, <vscale x 4 x i32> %dst)
+define <vscale x 4 x i32> @masked_load(ptr %addr, <4 x i1> %mask, <vscale x 4 x i32> %dst) {
+ %res = call <vscale x 4 x i32> @llvm.masked.load.nxv4i32.p0(ptr %addr, i32 4, <4 x i1> %mask, <vscale x 4 x i32> %dst)
ret <vscale x 4 x i32> %res
}
-declare <vscale x 4 x i32> @llvm.masked.load.nxv4i32.p0nxv4i32(<vscale x 4 x i32>*, i32, <4 x i1>, <vscale x 4 x i32>)
+declare <vscale x 4 x i32> @llvm.masked.load.nxv4i32.p0(ptr, i32, <4 x i1>, <vscale x 4 x i32>)
; CHECK: Parent pad must be catchpad/cleanuppad/catchswitch
; CHECK-NEXT: cleanupret from undef unwind label %bb2
-define void @test() personality i32 (...)* undef {
+define void @test() personality ptr undef {
br label %bb1
bb1:
entry:
%0 = zext i32 %n to i64
%vla = alloca i32, i64 %0, align 16
- call void @llvm.dbg.declare(metadata i32* %vla, metadata !19, metadata !12), !dbg !18
+ call void @llvm.dbg.declare(metadata ptr %vla, metadata !19, metadata !12), !dbg !18
ret void
}
;T4: ; CHECK4: CleanupReturnInst needs to be provided a CleanupPad
;T4: }
-;T5: define void @f() personality void ()* @g {
+;T5: define void @f() personality ptr @g {
;T5: entry:
;T5: ret void
;T5: switch:
;T5: unreachable
;T5: }
-;T6: define void @f() personality void ()* @g {
+;T6: define void @f() personality ptr @g {
;T6: entry:
;T6: ret void
;T6: switch1:
;T6: unreachable
;T6: }
-;T7: define void @f() personality void ()* @g {
+;T7: define void @f() personality ptr @g {
;T7: entry:
;T7: ret void
;T7: switch1:
;T7: unreachable
;T7: }
-;T8: define void @f() personality void ()* @g {
+;T8: define void @f() personality ptr @g {
;T8: entry:
;T8: ret void
;T8: switch1:
;T8: ; CHECK8: CatchSwitchInst handlers must be catchpads
;T8: }
-;T9: define void @f() personality void ()* @g {
+;T9: define void @f() personality ptr @g {
;T9: entry:
;T9: ret void
;T9: cleanup:
;T9: ret void
;T9: }
-;T10: define void @f() personality void ()* @g {
+;T10: define void @f() personality ptr @g {
;T10: entry:
;T10: ret void
;T10: cleanup1:
;T10: ; CHECK10-NEXT: cleanupret from %cp3 unwind label %switch
;T10: }
-;T11: define void @f() personality void ()* @g {
+;T11: define void @f() personality ptr @g {
;T11: entry:
;T11: ret void
;T11: cleanup1:
;T11: unreachable
;T11: }
-;T12: define void @f() personality void ()* @g {
+;T12: define void @f() personality ptr @g {
;T12: entry:
;T12: ret void
;T12: cleanup:
;T12: unreachable
;T12: }
-;T13: define void @f() personality void ()* @g {
+;T13: define void @f() personality ptr @g {
;T13: entry:
;T13: ret void
;T13: switch:
;T13: unreachable
;T13: }
-;T14: define void @f() personality void ()* @g {
+;T14: define void @f() personality ptr @g {
;T14: entry:
;T14: ret void
;T14: cleanup:
;T14: unreachable
;T14: }
-;T15: define void @f() personality void ()* @g {
+;T15: define void @f() personality ptr @g {
;T15: entry:
;T15: ret void
;T15: switch:
;T15: ; CHECK15-NEXT: to label %unreachable unwind label %target1
;T15: }
-;T16: define void @f() personality void ()* @g {
+;T16: define void @f() personality ptr @g {
;T16: entry:
;T16: ret void
;T16: switch:
;T16: unreachable
;T16: }
-;T17: define void @f() personality void ()* @g {
+;T17: define void @f() personality ptr @g {
;T17: entry:
;T17: ret void
;T17: switch:
;T17: unreachable
;T17: }
-;T18: define void @f() personality void ()* @g {
+;T18: define void @f() personality ptr @g {
;T18: entry:
;T18: invoke void @g()
;T18: to label %invoke.cont unwind label %left
;T18: unreachable
;T18: }
-;T19: define void @f() personality void ()* @g {
+;T19: define void @f() personality ptr @g {
;T19: entry:
;T19: ret void
;T19: red:
;T19: unreachable
;T19: }
-;T20: define void @f() personality void ()* @g {
+;T20: define void @f() personality ptr @g {
;T20: entry:
;T20: ret void
;T20: switch:
;T20: unreachable
;T20: }
-;T21: define void @f() personality void ()* @g {
+;T21: define void @f() personality ptr @g {
;T21: entry:
;T21: ret void
;T21: switch:
;T21: unreachable
;T21: }
-;T22: define void @f() personality void ()* @g {
+;T22: define void @f() personality ptr @g {
;T22: invoke void @g()
;T22: to label %merge unwind label %cleanup
;T22:
;T22: unreachable
;T22: }
-;T23: define void @f() personality void ()* @g {
+;T23: define void @f() personality ptr @g {
;T23: invoke void @g()
;T23: to label %exit unwind label %pad
;T23:
;T23: unreachable
;T23: }
-;T24: define void @f() personality void ()* @g {
+;T24: define void @f() personality ptr @g {
;T24: invoke void @g()
;T24: to label %exit unwind label %pad
;T24: ; CHECK24: A single unwind edge may only enter one EH pad
;T24: unreachable
;T24: }
-;T25: define void @f() personality void ()* @g {
+;T25: define void @f() personality ptr @g {
;T25: entry:
;T25: unreachable
;T25:
;T25: ; CHECK25: %cs = catchswitch within %cp2 [label %catch] unwind label %ehcleanup
;T25:
;T25: catch:
-;T25: %cp2 = catchpad within %cs [i8* null, i32 64, i8* null]
+;T25: %cp2 = catchpad within %cs [ptr null, i32 64, ptr null]
;T25: unreachable
;T25:
;T25: ehcleanup:
;T25: cleanupret from %cp3 unwind to caller
;T25: }
-;T26: define void @f() personality void ()* @g {
+;T26: define void @f() personality ptr @g {
;T26: entry:
;T26: ret void
;T26:
; CHECK-NEXT: ret void
define void @f() {
%a = alloca i32, !invariant.group !0
- %b = load i32, i32* %a, !invariant.group !0
- store i32 43, i32* %a, !invariant.group !0
+ %b = load i32, ptr %a, !invariant.group !0
+ store i32 43, ptr %a, !invariant.group !0
ret void, !invariant.group !0
}
declare void @llvm.donothing()
declare void @llvm.trap()
declare i8 @llvm.expect.i8(i8,i8)
-declare i32 @fn(i8 (i8, i8)*)
+declare i32 @fn(ptr)
-define void @f1() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
+define void @f1() personality ptr @__gxx_personality_v0 {
entry:
; OK
invoke void @llvm.donothing()
ret void
contb:
- %0 = landingpad { i8*, i32 }
- filter [0 x i8*] zeroinitializer
+ %0 = landingpad { ptr, i32 }
+ filter [0 x ptr] zeroinitializer
ret void
}
-define i8 @f2() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
+define i8 @f2() personality ptr @__gxx_personality_v0 {
entry:
; CHECK: Cannot invoke an intrinsic other than donothing, patchpoint, statepoint, coro_resume, coro_destroy or clang.arc.attachedcall
invoke void @llvm.trap()
ret i8 3
lpad:
- %0 = landingpad { i8*, i32 }
- filter [0 x i8*] zeroinitializer
+ %0 = landingpad { ptr, i32 }
+ filter [0 x ptr] zeroinitializer
ret i8 2
}
define i32 @f3() {
entry:
; CHECK: Cannot take the address of an intrinsic
- %call = call i32 @fn(i8 (i8, i8)* @llvm.expect.i8)
+ %call = call i32 @fn(ptr @llvm.expect.i8)
ret i32 %call
}
-define void @f4() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
+define void @f4() personality ptr @__gxx_personality_v0 {
entry:
invoke void @llvm.donothing()
to label %cont unwind label %cont
cont:
; CHECK: Block containing LandingPadInst must be jumped to only by the unwind edge of an invoke.
- %0 = landingpad { i8*, i32 }
- filter [0 x i8*] zeroinitializer
+ %0 = landingpad { ptr, i32 }
+ filter [0 x ptr] zeroinitializer
ret void
}
; RUN: not opt -passes=verify < %s 2>&1 | FileCheck %s
-define void @test_kcfi_bundle(i64 %arg0, i32 %arg1, void()* %arg2) {
+define void @test_kcfi_bundle(i64 %arg0, i32 %arg1, ptr %arg2) {
; CHECK: Multiple kcfi operand bundles
; CHECK-NEXT: call void %arg2() [ "kcfi"(i32 42), "kcfi"(i32 42) ]
call void %arg2() [ "kcfi"(i32 42), "kcfi"(i32 42) ]
define void @foo(i32 %a) {
entry:
%s = alloca i32
- call void @llvm.dbg.declare(metadata i32* %s, metadata !DILocalVariable(scope: !1), metadata !"")
+ call void @llvm.dbg.declare(metadata ptr %s, metadata !DILocalVariable(scope: !1), metadata !"")
ret void
}
define void @foo(i32 %a) {
entry:
%s = alloca i32
- call void @llvm.dbg.declare(metadata i32* %s, metadata !"", metadata !DIExpression()), !dbg !DILocation(scope: !1)
+ call void @llvm.dbg.declare(metadata ptr %s, metadata !"", metadata !DIExpression()), !dbg !DILocation(scope: !1)
ret void
}
define void @foo() {
entry:
call void @llvm.dbg.value(
- metadata i8* undef,
+ metadata ptr undef,
metadata !DILocalVariable(scope: !1),
metadata !DIExpression())
; CHECK-LABEL: llvm.dbg.value intrinsic requires a !dbg attachment
; CHECK-NEXT: call void @llvm.dbg.value({{.*}})
; CHECK-NEXT: label %entry
-; CHECK-NEXT: void ()* @foo
+; CHECK-NEXT: ptr @foo
call void @llvm.dbg.declare(
- metadata i8* undef,
+ metadata ptr undef,
metadata !DILocalVariable(scope: !1),
metadata !DIExpression())
; CHECK-LABEL: llvm.dbg.declare intrinsic requires a !dbg attachment
; CHECK-NEXT: call void @llvm.dbg.declare({{.*}})
; CHECK-NEXT: label %entry
-; CHECK-NEXT: void ()* @foo
+; CHECK-NEXT: ptr @foo
call void @llvm.dbg.value(
- metadata i8* undef,
+ metadata ptr undef,
metadata !DILocalVariable(scope: !1),
metadata !DIExpression()),
!dbg !DILocation(scope: !2)
; CHECK-LABEL: mismatched subprogram between llvm.dbg.value variable and !dbg attachment
; CHECK-NEXT: call void @llvm.dbg.value({{[^,]+}}, metadata ![[VAR:[0-9]+]], {{[^,]+}}), !dbg ![[LOC:[0-9]+]]
; CHECK-NEXT: label %entry
-; CHECK-NEXT: void ()* @foo
+; CHECK-NEXT: ptr @foo
; CHECK-NEXT: ![[VAR]] = !DILocalVariable({{.*}}scope: ![[VARSP:[0-9]+]]
; CHECK-NEXT: ![[VARSP]] = distinct !DISubprogram(
; CHECK-NEXT: ![[LOC]] = !DILocation({{.*}}scope: ![[LOCSP:[0-9]+]]
; CHECK-NEXT: ![[LOCSP]] = distinct !DISubprogram(
call void @llvm.dbg.declare(
- metadata i8* undef,
+ metadata ptr undef,
metadata !DILocalVariable(scope: !1),
metadata !DIExpression()),
!dbg !DILocation(scope: !2)
; CHECK-LABEL: mismatched subprogram between llvm.dbg.declare variable and !dbg attachment
; CHECK-NEXT: call void @llvm.dbg.declare({{[^,]+}}, metadata ![[VAR:[0-9]+]], {{.*[^,]+}}), !dbg ![[LOC:[0-9]+]]
; CHECK-NEXT: label %entry
-; CHECK-NEXT: void ()* @foo
+; CHECK-NEXT: ptr @foo
; CHECK-NEXT: ![[VAR]] = !DILocalVariable({{.*}}scope: ![[VARSP:[0-9]+]]
; CHECK-NEXT: ![[VARSP]] = distinct !DISubprogram(
; CHECK-NEXT: ![[LOC]] = !DILocation({{.*}}scope: ![[LOCSP:[0-9]+]]
define void @foo(i32 %a) {
entry:
%s = alloca i32
- call void @llvm.dbg.value(metadata i32* %s, i64 0, metadata !DILocalVariable(scope: !1), metadata !""), !dbg !DILocation(scope: !1)
+ call void @llvm.dbg.value(metadata ptr %s, i64 0, metadata !DILocalVariable(scope: !1), metadata !""), !dbg !DILocation(scope: !1)
ret void
}
define void @foo(i32 %a) {
entry:
%s = alloca i32
- call void @llvm.dbg.value(metadata i32* %s, i64 0, metadata !"", metadata !DIExpression()), !dbg !DILocation(scope: !1)
+ call void @llvm.dbg.value(metadata ptr %s, i64 0, metadata !"", metadata !DIExpression()), !dbg !DILocation(scope: !1)
ret void
}
; RUN: not llvm-as < %s -o /dev/null 2>&1 | FileCheck %s
-@llvm.used = appending global [1 x i8*] zeroinitializer, section "llvm.metadata"
+@llvm.used = appending global [1 x ptr] zeroinitializer, section "llvm.metadata"
; CHECK: wrong initalizer for intrinsic global variable
-; CHECK-NEXT: [1 x i8*] zeroinitializer
+; CHECK-NEXT: [1 x ptr] zeroinitializer
; RUN: not llvm-as < %s -o /dev/null 2>&1 | FileCheck %s
@a = global i8 42
-@llvm.used = appending global [2 x i8*] [i8* @a, i8* null], section "llvm.metadata"
-@llvm.compiler.used = appending global [2 x i8*] [i8* @a, i8* null], section "llvm.metadata"
+@llvm.used = appending global [2 x ptr] [ptr @a, ptr null], section "llvm.metadata"
+@llvm.compiler.used = appending global [2 x ptr] [ptr @a, ptr null], section "llvm.metadata"
; CHECK: invalid llvm.used member
-; CHECK-NEXT: i8* null
+; CHECK-NEXT: ptr null
; CHECK: invalid llvm.compiler.used member
-; CHECK-NEXT: i8* null
+; CHECK-NEXT: ptr null
; RUN: llvm-as < %s -o /dev/null
@a = global i32 42
-@llvm.used = appending global [1 x i32*] [i32* @a], section "llvm.metadata"
+@llvm.used = appending global [1 x ptr] [ptr @a], section "llvm.metadata"
; RUN: not llvm-as < %s -o /dev/null 2>&1 | FileCheck %s
-declare <2 x double> @llvm.masked.load.v2f64.p0v2f64(<2 x double>*, i32, <2 x i1>, <2 x double>)
+declare <2 x double> @llvm.masked.load.v2f64.p0(ptr, i32, <2 x i1>, <2 x double>)
-define <2 x double> @masked_load(<2 x i1> %mask, <2 x double>* %addr, <2 x double> %dst) {
+define <2 x double> @masked_load(<2 x i1> %mask, ptr %addr, <2 x double> %dst) {
; CHECK: masked_load: alignment must be a power of 2
- ; CHECK-NEXT: %res = call <2 x double> @llvm.masked.load.v2f64.p0v2f64(<2 x double>* %addr, i32 3, <2 x i1> %mask, <2 x double> %dst)
- %res = call <2 x double> @llvm.masked.load.v2f64.p0v2f64(<2 x double>* %addr, i32 3, <2 x i1>%mask, <2 x double> %dst)
+ ; CHECK-NEXT: %res = call <2 x double> @llvm.masked.load.v2f64.p0(ptr %addr, i32 3, <2 x i1> %mask, <2 x double> %dst)
+ %res = call <2 x double> @llvm.masked.load.v2f64.p0(ptr %addr, i32 3, <2 x i1>%mask, <2 x double> %dst)
ret <2 x double> %res
}
; RUN: not llvm-as < %s -o /dev/null 2>&1 | FileCheck %s
-declare void @llvm.masked.store.v4i32.p0v4i32(<4 x i32>, <4 x i32>*, i32, <4 x i1>)
+declare void @llvm.masked.store.v4i32.p0(<4 x i32>, ptr, i32, <4 x i1>)
-define void @masked_store(<4 x i1> %mask, <4 x i32>* %addr, <4 x i32> %val) {
+define void @masked_store(<4 x i1> %mask, ptr %addr, <4 x i32> %val) {
; CHECK: masked_store: alignment must be a power of 2
- ; CHECK-NEXT: call void @llvm.masked.store.v4i32.p0v4i32(<4 x i32> %val, <4 x i32>* %addr, i32 3, <4 x i1> %mask)
- call void @llvm.masked.store.v4i32.p0v4i32(<4 x i32> %val, <4 x i32>* %addr, i32 3, <4 x i1> %mask)
+ ; CHECK-NEXT: call void @llvm.masked.store.v4i32.p0(<4 x i32> %val, ptr %addr, i32 3, <4 x i1> %mask)
+ call void @llvm.masked.store.v4i32.p0(<4 x i32> %val, ptr %addr, i32 3, <4 x i1> %mask)
ret void
}
; CHECK: alignment is not a power of two
-define void @foo(i8* %P, i8* %Q) {
- call void @llvm.memcpy.inline.p0i8.p0i8.i32(i8* align 3 %P, i8* %Q, i32 4, i1 false)
+define void @foo(ptr %P, ptr %Q) {
+ call void @llvm.memcpy.inline.p0.p0.i32(ptr align 3 %P, ptr %Q, i32 4, i1 false)
ret void
}
-declare void @llvm.memcpy.inline.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i1) nounwind
+declare void @llvm.memcpy.inline.p0.p0.i32(ptr nocapture, ptr nocapture, i32, i1) nounwind
; CHECK: alignment is not a power of two
-define void @foo(i8* %P, i8* %Q) {
- call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 3 %P, i8* %Q, i32 4, i1 false)
+define void @foo(ptr %P, ptr %Q) {
+ call void @llvm.memcpy.p0.p0.i32(ptr align 3 %P, ptr %Q, i32 4, i1 false)
ret void
}
-declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i1) nounwind
+declare void @llvm.memcpy.p0.p0.i32(ptr nocapture, ptr nocapture, i32, i1) nounwind
; Test that incorrect memprof and callsite metadata fail verification.
; RUN: not llvm-as -disable-output < %s 2>&1 | FileCheck %s
-define i32* @test1() {
+define ptr @test1() {
entry:
- %call1 = call noalias dereferenceable_or_null(40) i8* @malloc(i64 noundef 40), !memprof !0
- %call2 = call noalias dereferenceable_or_null(40) i8* @malloc(i64 noundef 40), !memprof !1
- %call3 = call noalias dereferenceable_or_null(40) i8* @malloc(i64 noundef 40), !memprof !3
- %call4 = call noalias dereferenceable_or_null(40) i8* @malloc(i64 noundef 40), !memprof !5
- %call5 = call noalias dereferenceable_or_null(40) i8* @malloc(i64 noundef 40), !memprof !7, !callsite !9
- %0 = bitcast i8* %call5 to i32*
- ret i32* %0
+ %call1 = call noalias dereferenceable_or_null(40) ptr @malloc(i64 noundef 40), !memprof !0
+ %call2 = call noalias dereferenceable_or_null(40) ptr @malloc(i64 noundef 40), !memprof !1
+ %call3 = call noalias dereferenceable_or_null(40) ptr @malloc(i64 noundef 40), !memprof !3
+ %call4 = call noalias dereferenceable_or_null(40) ptr @malloc(i64 noundef 40), !memprof !5
+ %call5 = call noalias dereferenceable_or_null(40) ptr @malloc(i64 noundef 40), !memprof !7, !callsite !9
+ ret ptr %call5
}
-define i32* @test2() {
+define ptr @test2() {
entry:
- %call = call noundef i32* @test1(), !callsite !10
- ret i32* %call
+ %call = call noundef ptr @test1(), !callsite !10
+ ret ptr %call
}
-define i32* @test3() {
+define ptr @test3() {
entry:
- %call = call noundef i32* @test2(), !callsite !11
- ret i32* %call
+ %call = call noundef ptr @test2(), !callsite !11
+ ret ptr %call
}
define void @wronginsttype() {
ret void
}
-declare dso_local noalias noundef i8* @malloc(i64 noundef)
+declare dso_local noalias noundef ptr @malloc(i64 noundef)
; CHECK: !memprof annotations should have at least 1 metadata operand (MemInfoBlock)
!0 = !{}
; Test that well-formed memprof and callsite metadata pass verification.
; RUN: llvm-as -disable-output < %s 2>&1
-define i32* @test1() {
+define ptr @test1() {
entry:
- %call = call noalias dereferenceable_or_null(40) i8* @malloc(i64 noundef 40), !memprof !0, !callsite !5
- %0 = bitcast i8* %call to i32*
- ret i32* %0
+ %call = call noalias dereferenceable_or_null(40) ptr @malloc(i64 noundef 40), !memprof !0, !callsite !5
+ ret ptr %call
}
-define i32* @test2() {
+define ptr @test2() {
entry:
- %call = call noundef i32* @test1(), !callsite !6
- ret i32* %call
+ %call = call noundef ptr @test1(), !callsite !6
+ ret ptr %call
}
-define i32* @test3() {
+define ptr @test3() {
entry:
- %call = call noundef i32* @test1(), !callsite !7
- ret i32* %call
+ %call = call noundef ptr @test1(), !callsite !7
+ ret ptr %call
}
-declare dso_local noalias noundef i8* @malloc(i64 noundef)
+declare dso_local noalias noundef ptr @malloc(i64 noundef)
!0 = !{!1, !3}
; !memprof metadata should be able to support an arbitrary list of string tags.
; CHECK: alignment is not a power of two
-define void @foo(i8* %P, i8 %value) {
- call void @llvm.memset.inline.p0i8.i32(i8* align 3 %P, i8 %value, i32 4, i1 false)
+define void @foo(ptr %P, i8 %value) {
+ call void @llvm.memset.inline.p0.i32(ptr align 3 %P, i8 %value, i32 4, i1 false)
ret void
}
-declare void @llvm.memset.inline.p0i8.i32(i8* nocapture, i8, i32, i1) nounwind
+declare void @llvm.memset.inline.p0.i32(ptr nocapture, i8, i32, i1) nounwind
!0 = !{i32 5, !"CG Profile", !1}
!1 = !{!2, !"", !3, !4, !5, !6, !7, !8}
-!2 = !{void ()* @a, void ()* @b, i64 32}
-!3 = !{void ()* @a, void ()* @b}
-!4 = !{void ()* @a, void ()* @b, i64 32, i64 32}
-!5 = !{!"a", void ()* @b, i64 32}
-!6 = !{void ()* @a, !"b", i64 32}
-!7 = !{void ()* @a, void ()* @b, !""}
-!8 = !{void ()* @a, void ()* @b, null}
+!2 = !{ptr @a, ptr @b, i64 32}
+!3 = !{ptr @a, ptr @b}
+!4 = !{ptr @a, ptr @b, i64 32, i64 32}
+!5 = !{!"a", ptr @b, i64 32}
+!6 = !{ptr @a, !"b", i64 32}
+!7 = !{ptr @a, ptr @b, !""}
+!8 = !{ptr @a, ptr @b, null}
; CHECK: expected a MDNode triple
; CHECK: !""
; CHECK: expected a MDNode triple
-; CHECK: !3 = !{void ()* @a, void ()* @b}
+; CHECK: !3 = !{ptr @a, ptr @b}
; CHECK: expected a MDNode triple
-; CHECK: !4 = !{void ()* @a, void ()* @b, i64 32, i64 32}
+; CHECK: !4 = !{ptr @a, ptr @b, i64 32, i64 32}
; CHECK: expected a Function or null
; CHECK: !"a"
; CHECK: expected a Function or null
ret void
}
-declare void @mismatched_vararg_callee(i8*, ...)
-define void @mismatched_vararg(i8*) {
+declare void @mismatched_vararg_callee(ptr, ...)
+define void @mismatched_vararg(ptr) {
; CHECK: mismatched varargs
- musttail call void (i8*, ...) @mismatched_vararg_callee(i8* null)
+ musttail call void (ptr, ...) @mismatched_vararg_callee(ptr null)
ret void
}
ret void
}
-declare void @mismatched_byval_callee({ i32 }*)
-define void @mismatched_byval({ i32 }* byval({ i32 }) %a) {
+declare void @mismatched_byval_callee(ptr)
+define void @mismatched_byval(ptr byval({ i32 }) %a) {
; CHECK: mismatched ABI impacting function attributes
- musttail call void @mismatched_byval_callee({ i32 }* %a)
+ musttail call void @mismatched_byval_callee(ptr %a)
ret void
}
ret void
}
-declare void @mismatched_sret_callee(i32* sret(i32))
-define void @mismatched_sret(i32* %a) {
+declare void @mismatched_sret_callee(ptr sret(i32))
+define void @mismatched_sret(ptr %a) {
; CHECK: mismatched ABI impacting function attributes
- musttail call void @mismatched_sret_callee(i32* sret(i32) %a)
+ musttail call void @mismatched_sret_callee(ptr sret(i32) %a)
ret void
}
-declare void @mismatched_alignment_callee(i32* byval(i32) align 8)
-define void @mismatched_alignment(i32* byval(i32) align 4 %a) {
+declare void @mismatched_alignment_callee(ptr byval(i32) align 8)
+define void @mismatched_alignment(ptr byval(i32) align 4 %a) {
; CHECK: mismatched ABI impacting function attributes
- musttail call void @mismatched_alignment_callee(i32* byval(i32) align 8 %a)
+ musttail call void @mismatched_alignment_callee(ptr byval(i32) align 8 %a)
ret void
}
; Should assemble without error.
-declare void @similar_param_ptrty_callee(i8*)
-define void @similar_param_ptrty(i32*) {
- musttail call void @similar_param_ptrty_callee(i8* null)
+declare void @similar_param_ptrty_callee(ptr)
+define void @similar_param_ptrty(ptr) {
+ musttail call void @similar_param_ptrty_callee(ptr null)
ret void
}
-declare i8* @similar_ret_ptrty_callee()
-define i32* @similar_ret_ptrty() {
- %v = musttail call i8* @similar_ret_ptrty_callee()
- %w = bitcast i8* %v to i32*
- ret i32* %w
+declare ptr @similar_ret_ptrty_callee()
+define ptr @similar_ret_ptrty() {
+ %v = musttail call ptr @similar_ret_ptrty_callee()
+ ret ptr %v
}
-declare x86_thiscallcc void @varargs_thiscall(i8*, ...)
-define x86_thiscallcc void @varargs_thiscall_thunk(i8* %this, ...) {
- musttail call x86_thiscallcc void (i8*, ...) @varargs_thiscall(i8* %this, ...)
+declare x86_thiscallcc void @varargs_thiscall(ptr, ...)
+define x86_thiscallcc void @varargs_thiscall_thunk(ptr %this, ...) {
+ musttail call x86_thiscallcc void (ptr, ...) @varargs_thiscall(ptr %this, ...)
ret void
}
-declare x86_fastcallcc void @varargs_fastcall(i8*, ...)
-define x86_fastcallcc void @varargs_fastcall_thunk(i8* %this, ...) {
- musttail call x86_fastcallcc void (i8*, ...) @varargs_fastcall(i8* %this, ...)
+declare x86_fastcallcc void @varargs_fastcall(ptr, ...)
+define x86_fastcallcc void @varargs_fastcall_thunk(ptr %this, ...) {
+ musttail call x86_fastcallcc void (ptr, ...) @varargs_fastcall(ptr %this, ...)
ret void
}
-define x86_thiscallcc void @varargs_thiscall_unreachable(i8* %this, ...) {
+define x86_thiscallcc void @varargs_thiscall_unreachable(ptr %this, ...) {
unreachable
}
-define x86_thiscallcc void @varargs_thiscall_ret_unreachable(i8* %this, ...) {
- musttail call x86_thiscallcc void (i8*, ...) @varargs_thiscall(i8* %this, ...)
+define x86_thiscallcc void @varargs_thiscall_ret_unreachable(ptr %this, ...) {
+ musttail call x86_thiscallcc void (ptr, ...) @varargs_thiscall(ptr %this, ...)
ret void
bb1:
ret void
target datalayout = "e-ni:4:6"
-define i64 @f_0(i8 addrspace(4)* %ptr) {
+define i64 @f_0(ptr addrspace(4) %ptr) {
; CHECK-LABEL: @f_0(
-; CHECK-NEXT: [[VAL:%.*]] = ptrtoint i8 addrspace(4)* [[PTR:%.*]] to i64
+; CHECK-NEXT: [[VAL:%.*]] = ptrtoint ptr addrspace(4) [[PTR:%.*]] to i64
; CHECK-NEXT: ret i64 [[VAL]]
;
%val = ptrtoint i8 addrspace(4)* %ptr to i64
ret i64 %val
}
-define <4 x i64> @f_1(<4 x i8 addrspace(4)*> %ptr) {
+define <4 x i64> @f_1(<4 x ptr addrspace(4)> %ptr) {
; CHECK-LABEL: @f_1(
-; CHECK-NEXT: [[VAL:%.*]] = ptrtoint <4 x i8 addrspace(4)*> [[PTR:%.*]] to <4 x i64>
+; CHECK-NEXT: [[VAL:%.*]] = ptrtoint <4 x ptr addrspace(4)> [[PTR:%.*]] to <4 x i64>
; CHECK-NEXT: ret <4 x i64> [[VAL]]
;
%val = ptrtoint <4 x i8 addrspace(4)*> %ptr to <4 x i64>
ret <4 x i64> %val
}
-define i64 @f_2(i8 addrspace(3)* %ptr) {
+define i64 @f_2(ptr addrspace(3) %ptr) {
; CHECK-LABEL: @f_2(
-; CHECK-NEXT: [[VAL:%.*]] = ptrtoint i8 addrspace(3)* [[PTR:%.*]] to i64
+; CHECK-NEXT: [[VAL:%.*]] = ptrtoint ptr addrspace(3) [[PTR:%.*]] to i64
; CHECK-NEXT: ret i64 [[VAL]]
;
%val = ptrtoint i8 addrspace(3)* %ptr to i64
ret i64 %val
}
-define i8 addrspace(4)* @f_3(i64 %integer) {
+define ptr addrspace(4) @f_3(i64 %integer) {
; CHECK-LABEL: @f_3(
-; CHECK-NEXT: [[VAL:%.*]] = inttoptr i64 [[INTEGER:%.*]] to i8 addrspace(4)*
-; CHECK-NEXT: ret i8 addrspace(4)* [[VAL]]
+; CHECK-NEXT: [[VAL:%.*]] = inttoptr i64 [[INTEGER:%.*]] to ptr addrspace(4)
+; CHECK-NEXT: ret ptr addrspace(4) [[VAL]]
;
%val = inttoptr i64 %integer to i8 addrspace(4)*
- ret i8 addrspace(4)* %val
+ ret ptr addrspace(4) %val
}
-define <4 x i8 addrspace(4)*> @f_4(<4 x i64> %integer) {
+define <4 x ptr addrspace(4)> @f_4(<4 x i64> %integer) {
; CHECK-LABEL: @f_4(
-; CHECK-NEXT: [[VAL:%.*]] = inttoptr <4 x i64> [[INTEGER:%.*]] to <4 x i8 addrspace(4)*>
-; CHECK-NEXT: ret <4 x i8 addrspace(4)*> [[VAL]]
+; CHECK-NEXT: [[VAL:%.*]] = inttoptr <4 x i64> [[INTEGER:%.*]] to <4 x ptr addrspace(4)>
+; CHECK-NEXT: ret <4 x ptr addrspace(4)> [[VAL]]
;
%val = inttoptr <4 x i64> %integer to <4 x i8 addrspace(4)*>
- ret <4 x i8 addrspace(4)*> %val
+ ret <4 x ptr addrspace(4)> %val
}
-define i8 addrspace(3)* @f_5(i64 %integer) {
+define ptr addrspace(3) @f_5(i64 %integer) {
; CHECK-LABEL: @f_5(
-; CHECK-NEXT: [[VAL:%.*]] = inttoptr i64 [[INTEGER:%.*]] to i8 addrspace(3)*
-; CHECK-NEXT: ret i8 addrspace(3)* [[VAL]]
+; CHECK-NEXT: [[VAL:%.*]] = inttoptr i64 [[INTEGER:%.*]] to ptr addrspace(3)
+; CHECK-NEXT: ret ptr addrspace(3) [[VAL]]
;
%val = inttoptr i64 %integer to i8 addrspace(3)*
- ret i8 addrspace(3)* %val
+ ret ptr addrspace(3) %val
}
-define i64 @f_6(i8 addrspace(6)* %ptr) {
+define i64 @f_6(ptr addrspace(6) %ptr) {
; CHECK-LABEL: @f_6(
-; CHECK-NEXT: [[VAL:%.*]] = ptrtoint i8 addrspace(6)* [[PTR:%.*]] to i64
+; CHECK-NEXT: [[VAL:%.*]] = ptrtoint ptr addrspace(6) [[PTR:%.*]] to i64
; CHECK-NEXT: ret i64 [[VAL]]
;
%val = ptrtoint i8 addrspace(6)* %ptr to i64
ret i64 %val
}
-define i8 addrspace(4)* @f_7() {
+define ptr addrspace(4) @f_7() {
; CHECK-LABEL: @f_7(
-; CHECK-NEXT: ret i8 addrspace(4)* inttoptr (i64 50 to i8 addrspace(4)*)
+; CHECK-NEXT: ret ptr addrspace(4) inttoptr (i64 50 to ptr addrspace(4))
;
ret i8 addrspace(4)* inttoptr (i64 50 to i8 addrspace(4)*)
}
define i64 @f_8() {
; CHECK-LABEL: @f_8(
-; CHECK-NEXT: ret i64 ptrtoint (i8 addrspace(4)* @global0 to i64)
+; CHECK-NEXT: ret i64 ptrtoint (ptr addrspace(4) @global0 to i64)
;
ret i64 ptrtoint (i8 addrspace(4)* @global0 to i64)
}
-define i8 addrspace(4)* @f_9() {
+define ptr addrspace(4) @f_9() {
; CHECK-LABEL: @f_9(
-; CHECK-NEXT: ret i8 addrspace(4)* getelementptr (i8, i8 addrspace(4)* inttoptr (i64 55 to i8 addrspace(4)*), i32 100)
+; CHECK-NEXT: ret ptr addrspace(4) getelementptr (i8, ptr addrspace(4) inttoptr (i64 55 to ptr addrspace(4)), i32 100)
;
ret i8 addrspace(4)* getelementptr (i8, i8 addrspace(4)* inttoptr (i64 55 to i8 addrspace(4)*), i32 100)
}
@global1 = addrspace(4) constant i8 42
-define i8 addrspace(4)* @f_10() {
+define ptr addrspace(4) @f_10() {
; CHECK-LABEL: @f_10(
-; CHECK-NEXT: ret i8 addrspace(4)* getelementptr (i8, i8 addrspace(4)* @global0, i64 ptrtoint (i8 addrspace(4)* @global1 to i64))
+; CHECK-NEXT: ret ptr addrspace(4) getelementptr (i8, ptr addrspace(4) @global0, i64 ptrtoint (ptr addrspace(4) @global1 to i64))
;
ret i8 addrspace(4)* getelementptr (i8, i8 addrspace(4)* @global0, i64 ptrtoint (i8 addrspace(4)* @global1 to i64))
}
-@cycle_0 = addrspace(4) constant i64 ptrtoint (i64 addrspace(4)* addrspace(4)* @cycle_1 to i64)
-@cycle_1 = addrspace(4) constant i64 addrspace(4) * @cycle_0
+@cycle_0 = addrspace(4) constant i64 ptrtoint (ptr addrspace(4) @cycle_1 to i64)
+@cycle_1 = addrspace(4) constant ptr addrspace(4) @cycle_0
-define i64 addrspace(4)* addrspace(4)* @f_11() {
+define ptr addrspace(4) @f_11() {
; CHECK-LABEL: @f_11(
-; CHECK-NEXT: ret i64 addrspace(4)* addrspace(4)* @cycle_1
+; CHECK-NEXT: ret ptr addrspace(4) @cycle_1
;
ret i64 addrspace(4)* addrspace(4)* @cycle_1
}
-@cycle_self = addrspace(4) constant i64 ptrtoint (i64 addrspace(4)* @cycle_self to i64)
+@cycle_self = addrspace(4) constant i64 ptrtoint (ptr addrspace(4) @cycle_self to i64)
-define i64 addrspace(4)* @f_12() {
+define ptr addrspace(4) @f_12() {
; CHECK-LABEL: @f_12(
-; CHECK-NEXT: ret i64 addrspace(4)* @cycle_self
+; CHECK-NEXT: ret ptr addrspace(4) @cycle_self
;
ret i64 addrspace(4)* @cycle_self
}
%0 = type opaque
declare void @g()
-declare %0* @foo0()
+declare ptr @foo0()
declare i8 @foo1()
declare void @noreturn_func()
; Operand bundles uses are like regular uses, and need to be dominated
; by their defs.
-define void @f0(i32* %ptr) {
+define void @f0(ptr %ptr) {
; CHECK: Instruction does not dominate all uses!
; CHECK-NEXT: %x = add i32 42, 1
; CHECK-NEXT: call void @g() [ "foo"(i32 42, i64 100, i32 %x), "bar"(float 0.000000e+00, i64 100, i32 %l) ]
entry:
- %l = load i32, i32* %ptr
+ %l = load i32, ptr %ptr
call void @g() [ "foo"(i32 42, i64 100, i32 %x), "bar"(float 0.0, i64 100, i32 %l) ]
%x = add i32 42, 1
ret void
}
-define void @f1(i32* %ptr) personality i8 3 {
+define void @f1(ptr %ptr) personality i8 3 {
; CHECK: Instruction does not dominate all uses!
; CHECK-NEXT: %x = add i32 42, 1
; CHECK-NEXT: invoke void @g() [ "foo"(i32 42, i64 100, i32 %x), "bar"(float 0.000000e+00, i64 100, i32 %l) ]
entry:
- %l = load i32, i32* %ptr
+ %l = load i32, ptr %ptr
invoke void @g() [ "foo"(i32 42, i64 100, i32 %x), "bar"(float 0.0, i64 100, i32 %l) ] to label %normal unwind label %exception
exception:
ret void
}
-define void @f_deopt(i32* %ptr) {
+define void @f_deopt(ptr %ptr) {
; CHECK: Multiple deopt operand bundles
; CHECK-NEXT: call void @g() [ "deopt"(i32 42, i64 100, i32 %x), "deopt"(float 0.000000e+00, i64 100, i32 %l) ]
; CHECK-NOT: call void @g() [ "deopt"(i32 42, i64 120, i32 %x) ]
entry:
- %l = load i32, i32* %ptr
+ %l = load i32, ptr %ptr
call void @g() [ "deopt"(i32 42, i64 100, i32 %x), "deopt"(float 0.0, i64 100, i32 %l) ]
call void @g() [ "deopt"(i32 42, i64 120) ] ;; The verifier should not complain about this one
%x = add i32 42, 1
ret void
}
-define void @f_gc_transition(i32* %ptr) {
+define void @f_gc_transition(ptr %ptr) {
; CHECK: Multiple gc-transition operand bundles
; CHECK-NEXT: call void @g() [ "gc-transition"(i32 42, i64 100, i32 %x), "gc-transition"(float 0.000000e+00, i64 100, i32 %l) ]
; CHECK-NOT: call void @g() [ "gc-transition"(i32 42, i64 120, i32 %x) ]
entry:
- %l = load i32, i32* %ptr
+ %l = load i32, ptr %ptr
call void @g() [ "gc-transition"(i32 42, i64 100, i32 %x), "gc-transition"(float 0.0, i64 100, i32 %l) ]
call void @g() [ "gc-transition"(i32 42, i64 120) ] ;; The verifier should not complain about this one
%x = add i32 42, 1
define void @f_clang_arc_attachedcall() {
; CHECK: requires one function as an argument
-; CHECK-NEXT: call %0* @foo0() [ "clang.arc.attachedcall"() ]
+; CHECK-NEXT: call ptr @foo0() [ "clang.arc.attachedcall"() ]
; CHECK-NEXT: Multiple "clang.arc.attachedcall" operand bundles
-; CHECK-NEXT: call %0* @foo0() [ "clang.arc.attachedcall"(i8* (i8*)* @llvm.objc.retainAutoreleasedReturnValue), "clang.arc.attachedcall"(i8* (i8*)* @llvm.objc.retainAutoreleasedReturnValue) ]
+; CHECK-NEXT: call ptr @foo0() [ "clang.arc.attachedcall"(ptr @llvm.objc.retainAutoreleasedReturnValue), "clang.arc.attachedcall"(ptr @llvm.objc.retainAutoreleasedReturnValue) ]
; CHECK-NEXT: must call a function returning a pointer
-; CHECK-NEXT: call i8 @foo1() [ "clang.arc.attachedcall"(i8* (i8*)* @llvm.objc.retainAutoreleasedReturnValue) ]
+; CHECK-NEXT: call i8 @foo1() [ "clang.arc.attachedcall"(ptr @llvm.objc.retainAutoreleasedReturnValue) ]
; CHECK-NEXT: or a non-returning function
-; CHECK-NEXT: call void @g() [ "clang.arc.attachedcall"(i8* (i8*)* @llvm.objc.retainAutoreleasedReturnValue) ]
+; CHECK-NEXT: call void @g() [ "clang.arc.attachedcall"(ptr @llvm.objc.retainAutoreleasedReturnValue) ]
; CHECK-NEXT: requires one function as an argument
-; CHECK-NEXT: call %0* @foo0() [ "clang.arc.attachedcall"(i8* (i8*)* null) ]
+; CHECK-NEXT: call ptr @foo0() [ "clang.arc.attachedcall"(ptr null) ]
; CHECK-NEXT: requires one function as an argument
-; CHECK-NEXT: call %0* @foo0() [ "clang.arc.attachedcall"(i64 0) ]
+; CHECK-NEXT: call ptr @foo0() [ "clang.arc.attachedcall"(i64 0) ]
; CHECK-NEXT: invalid function argument
-; CHECK-NEXT: call %0* @foo0() [ "clang.arc.attachedcall"(i8 ()* @foo1) ]
+; CHECK-NEXT: call ptr @foo0() [ "clang.arc.attachedcall"(ptr @foo1) ]
; CHECK-NEXT: invalid function argument
-; CHECK-NEXT: call %0* @foo0() [ "clang.arc.attachedcall"(void (i1)* @llvm.assume) ]
-
- call %0* @foo0() [ "clang.arc.attachedcall"(i8* (i8*)* @llvm.objc.retainAutoreleasedReturnValue) ]
- call %0* @foo0() [ "clang.arc.attachedcall"(i8* (i8*)* @llvm.objc.unsafeClaimAutoreleasedReturnValue) ]
- call %0* @foo0() [ "clang.arc.attachedcall"(i8* (i8*)* @objc_retainAutoreleasedReturnValue) ]
- call %0* @foo0() [ "clang.arc.attachedcall"(i8* (i8*)* @objc_unsafeClaimAutoreleasedReturnValue) ]
- call %0* @foo0() [ "clang.arc.attachedcall"() ]
- call %0* @foo0() [ "clang.arc.attachedcall"(i8* (i8*)* @llvm.objc.retainAutoreleasedReturnValue), "clang.arc.attachedcall"(i8* (i8*)* @llvm.objc.retainAutoreleasedReturnValue) ]
- call i8 @foo1() [ "clang.arc.attachedcall"(i8* (i8*)* @llvm.objc.retainAutoreleasedReturnValue) ]
- call void @noreturn_func() #0 [ "clang.arc.attachedcall"(i8* (i8*)* @llvm.objc.retainAutoreleasedReturnValue) ]
- call void @g() [ "clang.arc.attachedcall"(i8* (i8*)* @llvm.objc.retainAutoreleasedReturnValue) ]
- call %0* @foo0() [ "clang.arc.attachedcall"(i8* (i8*)* null) ]
- call %0* @foo0() [ "clang.arc.attachedcall"(i64 0) ]
- call %0* @foo0() [ "clang.arc.attachedcall"(i8 ()* @foo1) ]
- call %0* @foo0() [ "clang.arc.attachedcall"(void (i1)* @llvm.assume) ]
+; CHECK-NEXT: call ptr @foo0() [ "clang.arc.attachedcall"(ptr @llvm.assume) ]
+
+ call ptr @foo0() [ "clang.arc.attachedcall"(ptr @llvm.objc.retainAutoreleasedReturnValue) ]
+ call ptr @foo0() [ "clang.arc.attachedcall"(ptr @llvm.objc.unsafeClaimAutoreleasedReturnValue) ]
+ call ptr @foo0() [ "clang.arc.attachedcall"(ptr @objc_retainAutoreleasedReturnValue) ]
+ call ptr @foo0() [ "clang.arc.attachedcall"(ptr @objc_unsafeClaimAutoreleasedReturnValue) ]
+ call ptr @foo0() [ "clang.arc.attachedcall"() ]
+ call ptr @foo0() [ "clang.arc.attachedcall"(ptr @llvm.objc.retainAutoreleasedReturnValue), "clang.arc.attachedcall"(ptr @llvm.objc.retainAutoreleasedReturnValue) ]
+ call i8 @foo1() [ "clang.arc.attachedcall"(ptr @llvm.objc.retainAutoreleasedReturnValue) ]
+ call void @noreturn_func() #0 [ "clang.arc.attachedcall"(ptr @llvm.objc.retainAutoreleasedReturnValue) ]
+ call void @g() [ "clang.arc.attachedcall"(ptr @llvm.objc.retainAutoreleasedReturnValue) ]
+ call ptr @foo0() [ "clang.arc.attachedcall"(ptr null) ]
+ call ptr @foo0() [ "clang.arc.attachedcall"(i64 0) ]
+ call ptr @foo0() [ "clang.arc.attachedcall"(ptr @foo1) ]
+ call ptr @foo0() [ "clang.arc.attachedcall"(ptr @llvm.assume) ]
ret void
}
-declare i8* @llvm.objc.retainAutoreleasedReturnValue(i8*)
-declare i8* @llvm.objc.unsafeClaimAutoreleasedReturnValue(i8*)
-declare i8* @objc_retainAutoreleasedReturnValue(i8*)
-declare i8* @objc_unsafeClaimAutoreleasedReturnValue(i8*)
+declare ptr @llvm.objc.retainAutoreleasedReturnValue(ptr)
+declare ptr @llvm.objc.unsafeClaimAutoreleasedReturnValue(ptr)
+declare ptr @objc_retainAutoreleasedReturnValue(ptr)
+declare ptr @objc_unsafeClaimAutoreleasedReturnValue(ptr)
declare void @llvm.assume(i1)
attributes #0 = { noreturn }
; RUN: not llvm-as < %s 2>&1 | FileCheck %s
; CHECK: Attribute 'align' exceed the max size 2^14
-define dso_local void @foo(i8* %p) {
+define dso_local void @foo(ptr %p) {
entry:
- %p1 = bitcast i8* %p to <8 x float>*
- call void @bar(<8 x float>* noundef byval(<8 x float>) align 32768 %p1)
+ call void @bar(ptr noundef byval(<8 x float>) align 32768 %p)
ret void
}
-declare dso_local void @bar(<8 x float>* %p)
+declare dso_local void @bar(ptr %p)
; RUN: opt -S %s -passes=verify
declare token @llvm.call.preallocated.setup(i32)
-declare i8* @llvm.call.preallocated.arg(token, i32)
+declare ptr @llvm.call.preallocated.arg(token, i32)
declare void @llvm.call.preallocated.teardown(token)
declare i32 @__CxxFrameHandler3(...)
-declare void @foo1(i32* preallocated(i32))
-declare i64 @foo1_i64(i32* preallocated(i32))
-declare void @foo2(i32* preallocated(i32), i32*, i32* preallocated(i32))
+declare void @foo1(ptr preallocated(i32))
+declare i64 @foo1_i64(ptr preallocated(i32))
+declare void @foo2(ptr preallocated(i32), ptr, ptr preallocated(i32))
-declare void @constructor(i32*)
+declare void @constructor(ptr)
define void @preallocated() {
%cs = call token @llvm.call.preallocated.setup(i32 1)
- %x = call i8* @llvm.call.preallocated.arg(token %cs, i32 0) preallocated(i32)
- %y = bitcast i8* %x to i32*
- call void @foo1(i32* preallocated(i32) %y) ["preallocated"(token %cs)]
+ %x = call ptr @llvm.call.preallocated.arg(token %cs, i32 0) preallocated(i32)
+ call void @foo1(ptr preallocated(i32) %x) ["preallocated"(token %cs)]
ret void
}
-define void @preallocated_indirect(void (i32*)* %f) {
+define void @preallocated_indirect(ptr %f) {
%cs = call token @llvm.call.preallocated.setup(i32 1)
- %x = call i8* @llvm.call.preallocated.arg(token %cs, i32 0) preallocated(i32)
- %y = bitcast i8* %x to i32*
- call void %f(i32* preallocated(i32) %y) ["preallocated"(token %cs)]
+ %x = call ptr @llvm.call.preallocated.arg(token %cs, i32 0) preallocated(i32)
+ call void %f(ptr preallocated(i32) %x) ["preallocated"(token %cs)]
ret void
}
define void @preallocated_setup_without_call() {
%cs = call token @llvm.call.preallocated.setup(i32 1)
- %a0 = call i8* @llvm.call.preallocated.arg(token %cs, i32 0) preallocated(i32)
+ %a0 = call ptr @llvm.call.preallocated.arg(token %cs, i32 0) preallocated(i32)
ret void
}
define void @preallocated_num_args() {
%cs = call token @llvm.call.preallocated.setup(i32 2)
- %x = call i8* @llvm.call.preallocated.arg(token %cs, i32 0) preallocated(i32)
- %x1 = bitcast i8* %x to i32*
- %y = call i8* @llvm.call.preallocated.arg(token %cs, i32 1) preallocated(i32)
- %y1 = bitcast i8* %y to i32*
- %a = inttoptr i32 0 to i32*
- call void @foo2(i32* preallocated(i32) %x1, i32* %a, i32* preallocated(i32) %y1) ["preallocated"(token %cs)]
+ %x = call ptr @llvm.call.preallocated.arg(token %cs, i32 0) preallocated(i32)
+ %y = call ptr @llvm.call.preallocated.arg(token %cs, i32 1) preallocated(i32)
+ %a = inttoptr i32 0 to ptr
+ call void @foo2(ptr preallocated(i32) %x, ptr %a, ptr preallocated(i32) %y) ["preallocated"(token %cs)]
ret void
}
-define void @preallocated_musttail(i32* preallocated(i32) %a) {
- musttail call void @foo1(i32* preallocated(i32) %a)
+define void @preallocated_musttail(ptr preallocated(i32) %a) {
+ musttail call void @foo1(ptr preallocated(i32) %a)
ret void
}
-define i64 @preallocated_musttail_i64(i32* preallocated(i32) %a) {
- %r = musttail call i64 @foo1_i64(i32* preallocated(i32) %a)
+define i64 @preallocated_musttail_i64(ptr preallocated(i32) %a) {
+ %r = musttail call i64 @foo1_i64(ptr preallocated(i32) %a)
ret i64 %r
}
ret void
}
-define void @preallocated_teardown_invoke() personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
+define void @preallocated_teardown_invoke() personality ptr @__CxxFrameHandler3 {
%cs = call token @llvm.call.preallocated.setup(i32 1)
- %x = call i8* @llvm.call.preallocated.arg(token %cs, i32 0) preallocated(i32)
- %y = bitcast i8* %x to i32*
- invoke void @constructor(i32* %y) to label %conta unwind label %contb
+ %x = call ptr @llvm.call.preallocated.arg(token %cs, i32 0) preallocated(i32)
+ invoke void @constructor(ptr %x) to label %conta unwind label %contb
conta:
- call void @foo1(i32* preallocated(i32) %y) ["preallocated"(token %cs)]
+ call void @foo1(ptr preallocated(i32) %x) ["preallocated"(token %cs)]
ret void
contb:
%s = catchswitch within none [label %catch] unwind to caller
declare void @g()
-define void @test_ptrauth_bundle(i64 %arg0, i32 %arg1, void()* %arg2) {
+define void @test_ptrauth_bundle(i64 %arg0, i32 %arg1, ptr %arg2) {
; CHECK: Multiple ptrauth operand bundles
; CHECK-NEXT: call void %arg2() [ "ptrauth"(i32 42, i64 100), "ptrauth"(i32 42, i64 %arg0) ]
; RUN: not llvm-as < %s -o /dev/null 2>&1 | FileCheck %s
-define void @f1(i8* %x) {
+define void @f1(ptr %x) {
entry:
- store i8 0, i8* %x, align 1, !range !0
+ store i8 0, ptr %x, align 1, !range !0
ret void
}
!0 = !{i8 0, i8 1}
; CHECK: Ranges are only for loads, calls and invokes!
-; CHECK-NEXT: store i8 0, i8* %x, align 1, !range !0
+; CHECK-NEXT: store i8 0, ptr %x, align 1, !range !0
-define i8 @f2(i8* %x) {
+define i8 @f2(ptr %x) {
entry:
- %y = load i8, i8* %x, align 1, !range !1
+ %y = load i8, ptr %x, align 1, !range !1
ret i8 %y
}
!1 = !{}
; CHECK: It should have at least one range!
-define i8 @f3(i8* %x) {
+define i8 @f3(ptr %x) {
entry:
- %y = load i8, i8* %x, align 1, !range !2
+ %y = load i8, ptr %x, align 1, !range !2
ret i8 %y
}
!2 = !{i8 0}
; CHECK: Unfinished range!
-define i8 @f4(i8* %x) {
+define i8 @f4(ptr %x) {
entry:
- %y = load i8, i8* %x, align 1, !range !3
+ %y = load i8, ptr %x, align 1, !range !3
ret i8 %y
}
!3 = !{double 0.0, i8 0}
; CHECK: The lower limit must be an integer!
-define i8 @f5(i8* %x) {
+define i8 @f5(ptr %x) {
entry:
- %y = load i8, i8* %x, align 1, !range !4
+ %y = load i8, ptr %x, align 1, !range !4
ret i8 %y
}
!4 = !{i8 0, double 0.0}
; CHECK: The upper limit must be an integer!
-define i8 @f6(i8* %x) {
+define i8 @f6(ptr %x) {
entry:
- %y = load i8, i8* %x, align 1, !range !5
+ %y = load i8, ptr %x, align 1, !range !5
ret i8 %y
}
!5 = !{i32 0, i8 0}
; CHECK: Range types must match instruction type!
; CHECK: %y = load
-define i8 @f7(i8* %x) {
+define i8 @f7(ptr %x) {
entry:
- %y = load i8, i8* %x, align 1, !range !6
+ %y = load i8, ptr %x, align 1, !range !6
ret i8 %y
}
!6 = !{i8 0, i32 0}
; CHECK: Range types must match instruction type!
; CHECK: %y = load
-define i8 @f8(i8* %x) {
+define i8 @f8(ptr %x) {
entry:
- %y = load i8, i8* %x, align 1, !range !7
+ %y = load i8, ptr %x, align 1, !range !7
ret i8 %y
}
!7 = !{i32 0, i32 0}
; CHECK: Range types must match instruction type!
; CHECK: %y = load
-define i8 @f9(i8* %x) {
+define i8 @f9(ptr %x) {
entry:
- %y = load i8, i8* %x, align 1, !range !8
+ %y = load i8, ptr %x, align 1, !range !8
ret i8 %y
}
!8 = !{i8 0, i8 0}
; CHECK: Range must not be empty!
-define i8 @f10(i8* %x) {
+define i8 @f10(ptr %x) {
entry:
- %y = load i8, i8* %x, align 1, !range !9
+ %y = load i8, ptr %x, align 1, !range !9
ret i8 %y
}
!9 = !{i8 0, i8 2, i8 1, i8 3}
; CHECK: Intervals are overlapping
-define i8 @f11(i8* %x) {
+define i8 @f11(ptr %x) {
entry:
- %y = load i8, i8* %x, align 1, !range !10
+ %y = load i8, ptr %x, align 1, !range !10
ret i8 %y
}
!10 = !{i8 0, i8 2, i8 2, i8 3}
; CHECK: Intervals are contiguous
-define i8 @f12(i8* %x) {
+define i8 @f12(ptr %x) {
entry:
- %y = load i8, i8* %x, align 1, !range !11
+ %y = load i8, ptr %x, align 1, !range !11
ret i8 %y
}
!11 = !{i8 1, i8 2, i8 -1, i8 0}
; CHECK: Intervals are not in order
-define i8 @f13(i8* %x) {
+define i8 @f13(ptr %x) {
entry:
- %y = load i8, i8* %x, align 1, !range !12
+ %y = load i8, ptr %x, align 1, !range !12
ret i8 %y
}
!12 = !{i8 1, i8 3, i8 5, i8 1}
; CHECK: Intervals are contiguous
-define i8 @f14(i8* %x) {
+define i8 @f14(ptr %x) {
entry:
- %y = load i8, i8* %x, align 1, !range !13
+ %y = load i8, ptr %x, align 1, !range !13
ret i8 %y
}
!13 = !{i8 1, i8 3, i8 5, i8 2}
; CHECK: Intervals are overlapping
-define i8 @f15(i8* %x) {
+define i8 @f15(ptr %x) {
entry:
- %y = load i8, i8* %x, align 1, !range !14
+ %y = load i8, ptr %x, align 1, !range !14
ret i8 %y
}
!14 = !{i8 10, i8 1, i8 12, i8 13}
; CHECK: Intervals are overlapping
-define i8 @f16(i8* %x) {
+define i8 @f16(ptr %x) {
entry:
- %y = load i8, i8* %x, align 1, !range !16
+ %y = load i8, ptr %x, align 1, !range !16
ret i8 %y
}
!16 = !{i8 1, i8 3, i8 4, i8 5, i8 6, i8 2}
; CHECK: Intervals are overlapping
-define i8 @f17(i8* %x) {
+define i8 @f17(ptr %x) {
entry:
- %y = load i8, i8* %x, align 1, !range !17
+ %y = load i8, ptr %x, align 1, !range !17
ret i8 %y
}
!17 = !{i8 1, i8 3, i8 4, i8 5, i8 6, i8 1}
; RUN: llvm-as < %s -o /dev/null
-define i8 @f1(i8* %x) {
+define i8 @f1(ptr %x) {
entry:
- %y = load i8, i8* %x, align 1, !range !0
+ %y = load i8, ptr %x, align 1, !range !0
ret i8 %y
}
!0 = !{i8 0, i8 1}
-define i8 @f2(i8* %x) {
+define i8 @f2(ptr %x) {
entry:
- %y = load i8, i8* %x, align 1, !range !1
+ %y = load i8, ptr %x, align 1, !range !1
ret i8 %y
}
!1 = !{i8 255, i8 1}
-define i8 @f3(i8* %x) {
+define i8 @f3(ptr %x) {
entry:
- %y = load i8, i8* %x, align 1, !range !2
+ %y = load i8, ptr %x, align 1, !range !2
ret i8 %y
}
!2 = !{i8 1, i8 3, i8 5, i8 42}
-define i8 @f4(i8* %x) {
+define i8 @f4(ptr %x) {
entry:
- %y = load i8, i8* %x, align 1, !range !3
+ %y = load i8, ptr %x, align 1, !range !3
ret i8 %y
}
!3 = !{i8 -1, i8 0, i8 1, i8 2}
-define i8 @f5(i8* %x) {
+define i8 @f5(ptr %x) {
entry:
- %y = load i8, i8* %x, align 1, !range !4
+ %y = load i8, ptr %x, align 1, !range !4
ret i8 %y
}
!4 = !{i8 -1, i8 0, i8 1, i8 -2}
; We can annotate the range of the return value of a CALL.
-define void @call_all(i8* %x) {
+define void @call_all(ptr %x) {
entry:
- %v1 = call i8 @f1(i8* %x), !range !0
- %v2 = call i8 @f2(i8* %x), !range !1
- %v3 = call i8 @f3(i8* %x), !range !2
- %v4 = call i8 @f4(i8* %x), !range !3
- %v5 = call i8 @f5(i8* %x), !range !4
+ %v1 = call i8 @f1(ptr %x), !range !0
+ %v2 = call i8 @f2(ptr %x), !range !1
+ %v3 = call i8 @f3(ptr %x), !range !2
+ %v4 = call i8 @f4(ptr %x), !range !3
+ %v5 = call i8 @f5(ptr %x), !range !4
ret void
}
; We can annotate the range of the return value of an INVOKE.
-define void @invoke_all(i8* %x) personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
+define void @invoke_all(ptr %x) personality ptr @__gxx_personality_v0 {
entry:
- %v1 = invoke i8 @f1(i8* %x) to label %cont unwind label %lpad, !range !0
- %v2 = invoke i8 @f2(i8* %x) to label %cont unwind label %lpad, !range !1
- %v3 = invoke i8 @f3(i8* %x) to label %cont unwind label %lpad, !range !2
- %v4 = invoke i8 @f4(i8* %x) to label %cont unwind label %lpad, !range !3
- %v5 = invoke i8 @f5(i8* %x) to label %cont unwind label %lpad, !range !4
+ %v1 = invoke i8 @f1(ptr %x) to label %cont unwind label %lpad, !range !0
+ %v2 = invoke i8 @f2(ptr %x) to label %cont unwind label %lpad, !range !1
+ %v3 = invoke i8 @f3(ptr %x) to label %cont unwind label %lpad, !range !2
+ %v4 = invoke i8 @f4(ptr %x) to label %cont unwind label %lpad, !range !3
+ %v5 = invoke i8 @f5(ptr %x) to label %cont unwind label %lpad, !range !4
cont:
ret void
lpad:
- %4 = landingpad { i8*, i32 }
- filter [0 x i8*] zeroinitializer
+ %4 = landingpad { ptr, i32 }
+ filter [0 x ptr] zeroinitializer
ret void
}
declare i32 @__gxx_personality_v0(...)
@.str = private unnamed_addr constant [13 x i8] c"Hello world\0A\00", align 1
; Function Attrs: nounwind ssp
-define void @test(%struct.__sFILE* %stream, i8* %str) {
- %fputs = call i32 @fputs(i8* %str, %struct.__sFILE* %stream)
+define void @test(ptr %stream, ptr %str) {
+ %fputs = call i32 @fputs(ptr %str, ptr %stream)
ret void
}
; Function Attrs: nounwind
-declare i32 @fputs(i8* nocapture, %struct.__sFILE* nocapture)
+declare i32 @fputs(ptr nocapture, ptr nocapture)
; RUN: llvm-as %s -o /dev/null 2>&1
-%rt2 = type { i32, { i8, %rt2*, i8 }, i32 }
+%rt2 = type { i32, { i8, ptr, i8 }, i32 }
define i32 @main() nounwind {
entry:
%rt2 = type { i32, { i8, %rt2, i8 }, i32 }
-define i32 @f(%rt2* %p) nounwind {
+define i32 @f(ptr %p) nounwind {
entry:
; Check that recursive types trigger an error instead of segfaulting, when
; the recursion isn't through a pointer to the type.
; CHECK: loading unsized types is not allowed
- %0 = load %rt2, %rt2* %p
+ %0 = load %rt2, ptr %p
ret i32 %0
}
%rt2 = type { i32, { i8, %rt2, i8 }, i32 }
-define void @f(%rt2 %r, %rt2 *%p) nounwind {
+define void @f(%rt2 %r, ptr %p) nounwind {
entry:
; Check that recursive types trigger an error instead of segfaulting, when
; the recursion isn't through a pointer to the type.
; CHECK: storing unsized types is not allowed
- store %rt2 %r, %rt2 *%p
+ store %rt2 %r, ptr %p
ret void
}
ret float %r
}
-define i32* @not_pointer_reduce(<4 x i32*> %x) {
+define ptr @not_pointer_reduce(<4 x ptr> %x) {
; CHECK: Intrinsic has incorrect argument type!
- %r = call i32* @llvm.vector.reduce.or.v4p0i32(<4 x i32*> %x)
- ret i32* %r
+ %r = call ptr @llvm.vector.reduce.or.v4p0(<4 x ptr> %x)
+ ret ptr %r
}
define i32 @not_integer_reduce(<4 x i32> %x) {
ret i32 %r
}
-define i32* @not_pointer_reduce2(<4 x i32*> %x) {
+define ptr @not_pointer_reduce2(<4 x ptr> %x) {
; CHECK: Intrinsic has incorrect argument type!
- %r = call i32* @llvm.vector.reduce.fmin.v4p0i32(<4 x i32*> %x)
- ret i32* %r
+ %r = call ptr @llvm.vector.reduce.fmin.v4p0(<4 x ptr> %x)
+ ret ptr %r
}
declare float @llvm.vector.reduce.umin.v4f32(<4 x float>)
-declare i32* @llvm.vector.reduce.or.v4p0i32(<4 x i32*>)
+declare ptr @llvm.vector.reduce.or.v4p0(<4 x ptr>)
declare i32 @llvm.vector.reduce.fadd.v4i32(i32, <4 x i32>)
declare float @llvm.vector.reduce.fadd.v4f32(double, <4 x float>)
-declare i32* @llvm.vector.reduce.fmin.v4p0i32(<4 x i32*>)
+declare ptr @llvm.vector.reduce.fmin.v4p0(<4 x ptr>)
declare float @llvm.vector.reduce.fmax.f32(float)
declare i32 @llvm.vector.reduce.smax.i32(i32)
declare i64 @llvm.vector.reduce.add.v4i32(<4 x i32>)
define void @test1() {
entry:
- resume { i8*, i32 } undef
+ resume { ptr, i32 } undef
; CHECK: ResumeInst needs to be in a function with a personality.
}
;; know the size at compile time.
; CHECK: Globals cannot contain scalable vectors
-; CHECK-NEXT: <vscale x 4 x i32>* @ScalableVecGlobal
+; CHECK-NEXT: ptr @ScalableVecGlobal
@ScalableVecGlobal = global <vscale x 4 x i32> zeroinitializer
; CHECK-NEXT: Globals cannot contain scalable vectors
-; CHECK-NEXT: { i32, <vscale x 4 x i32> }* @ScalableVecStructGlobal
+; CHECK-NEXT: ptr @ScalableVecStructGlobal
@ScalableVecStructGlobal = global { i32, <vscale x 4 x i32> } zeroinitializer
;; Global _pointers_ to scalable vectors are fine
; CHECK-NOT: Globals cannot contain scalable vectors
-@ScalableVecPtr = global <vscale x 8 x i16>* zeroinitializer
+@ScalableVecPtr = global ptr zeroinitializer
; RUN: not opt -S -passes=verify < %s 2>&1 | FileCheck %s
-define <vscale x 1 x i32> @load({ i32, <vscale x 1 x i32> }* %x) {
+define <vscale x 1 x i32> @load(ptr %x) {
; CHECK: error: loading unsized types is not allowed
- %a = load { i32, <vscale x 1 x i32> }, { i32, <vscale x 1 x i32> }* %x
+ %a = load { i32, <vscale x 1 x i32> }, ptr %x
%b = extractvalue { i32, <vscale x 1 x i32> } %a, 1
ret <vscale x 1 x i32> %b
}
; RUN: not opt -S -passes=verify < %s 2>&1 | FileCheck %s
-define void @store({ i32, <vscale x 1 x i32> }* %x, i32 %y, <vscale x 1 x i32> %z) {
+define void @store(ptr %x, i32 %y, <vscale x 1 x i32> %z) {
; CHECK: error: storing unsized types is not allowed
%a = insertvalue { i32, <vscale x 1 x i32> } undef, i32 %y, 0
%b = insertvalue { i32, <vscale x 1 x i32> } %a, <vscale x 1 x i32> %z, 1
- store { i32, <vscale x 1 x i32> } %b, { i32, <vscale x 1 x i32> }* %x
+ store { i32, <vscale x 1 x i32> } %b, ptr %x
ret void
}
br label %second, !dbg !21
second: ; preds = %entry
- call void @llvm.dbg.declare(metadata i64* %as, metadata !22, metadata !DIExpression()), !dbg !25
- call void @llvm.dbg.declare(metadata i64* %bs, metadata !26, metadata !DIExpression()), !dbg !25
- store i64 36028797018972298, i64* %as, align 8, !dbg !28
- store i64 85, i64* %bs, align 8, !dbg !29
+ call void @llvm.dbg.declare(metadata ptr %as, metadata !22, metadata !DIExpression()), !dbg !25
+ call void @llvm.dbg.declare(metadata ptr %bs, metadata !26, metadata !DIExpression()), !dbg !25
+ store i64 36028797018972298, ptr %as, align 8, !dbg !28
+ store i64 85, ptr %bs, align 8, !dbg !29
ret void, !dbg !21
}
@gv = internal unnamed_addr constant i32 0
; CHECK: speculatable attribute may not apply to call sites
-; CHECK-NEXT: %ret = call float bitcast (i32* @gv to float ()*)() #0
+; CHECK-NEXT: %ret = call float @gv() #0
define float @call_bitcast_speculatable() {
- %ret = call float bitcast (i32* @gv to float()*)() #0
+ %ret = call float @gv() #0
ret float %ret
}
}
define float @call_bitcast_speculatable() {
- %ret = call float bitcast (i32()* @speculatable to float()*)() #0
+ %ret = call float @speculatable() #0
ret float %ret
}
; RUN: not llvm-as %s -o /dev/null 2>&1 | FileCheck %s
-declare void @a(i32* sret(i32) %a, i32* sret(i32) %b)
+declare void @a(ptr sret(i32) %a, ptr sret(i32) %b)
; CHECK: Cannot have multiple 'sret' parameters!
-declare void @b(i32* %a, i32* %b, i32* sret(i32) %c)
+declare void @b(ptr %a, ptr %b, ptr sret(i32) %c)
; CHECK: Attribute 'sret' is not on first or second parameter!
; CHECK: Attribute 'sret(i32)' applied to incompatible type!
-; CHECK-NEXT: void (i32)* @not_ptr
+; CHECK-NEXT: ptr @not_ptr
declare void @not_ptr(i32 sret(i32) %x)
; RUN: opt -S %s -passes=verify | FileCheck %s
declare void @use(...)
-declare i8 addrspace(1)* @llvm.experimental.gc.relocate.p1i8(token, i32, i32)
-declare i64 addrspace(1)* @llvm.experimental.gc.relocate.p1i64(token, i32, i32)
-declare token @llvm.experimental.gc.statepoint.p0f_isVoidf(i64, i32, void ()*, i32, i32, ...)
-declare token @llvm.experimental.gc.statepoint.p0f_isVoidp0s_structsf(i64, i32, void (%struct*)*, i32, i32, ...)
+declare ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token, i32, i32)
+declare token @llvm.experimental.gc.statepoint.p0(i64, i32, ptr, i32, i32, ...)
declare i32 @"personality_function"()
;; Basic usage
-define i64 addrspace(1)* @test1(i8 addrspace(1)* %arg) gc "statepoint-example" {
+define ptr addrspace(1) @test1(ptr addrspace(1) %arg) gc "statepoint-example" {
entry:
- %cast = bitcast i8 addrspace(1)* %arg to i64 addrspace(1)*
- %safepoint_token = call token (i64, i32, void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 0, i32 0, void ()* elementtype(void ()) undef, i32 0, i32 0, i32 0, i32 0) ["gc-live" (i8 addrspace(1)* %arg, i64 addrspace(1)* %cast, i8 addrspace(1)* %arg, i8 addrspace(1)* %arg), "deopt" (i32 0, i32 0, i32 0, i32 10, i32 0)]
- %reloc = call i64 addrspace(1)* @llvm.experimental.gc.relocate.p1i64(token %safepoint_token, i32 0, i32 1)
+ %safepoint_token = call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 0, i32 0, ptr elementtype(void ()) undef, i32 0, i32 0, i32 0, i32 0) ["gc-live" (ptr addrspace(1) %arg, ptr addrspace(1) %arg, ptr addrspace(1) %arg, ptr addrspace(1) %arg), "deopt" (i32 0, i32 0, i32 0, i32 10, i32 0)]
+ %reloc = call ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token %safepoint_token, i32 0, i32 1)
;; It is perfectly legal to relocate the same value multiple times...
- %reloc2 = call i64 addrspace(1)* @llvm.experimental.gc.relocate.p1i64(token %safepoint_token, i32 0, i32 1)
- %reloc3 = call i8 addrspace(1)* @llvm.experimental.gc.relocate.p1i8(token %safepoint_token, i32 1, i32 0)
- ret i64 addrspace(1)* %reloc
+ %reloc2 = call ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token %safepoint_token, i32 0, i32 1)
+ %reloc3 = call ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token %safepoint_token, i32 1, i32 0)
+ ret ptr addrspace(1) %reloc
; CHECK-LABEL: test1
; CHECK: statepoint
; CHECK: gc.relocate
; CHECK: gc.relocate
; CHECK: gc.relocate
-; CHECK: ret i64 addrspace(1)* %reloc
+; CHECK: ret ptr addrspace(1) %reloc
}
; This test catches two cases where the verifier was too strict:
; 2) A value can be replaced by one which is known equal. This
; means a potentially derived pointer can be known base and that
; we can't check that derived pointer are never bases.
-define void @test2(i8 addrspace(1)* %arg, i64 addrspace(1)* %arg2) gc "statepoint-example" {
+define void @test2(ptr addrspace(1) %arg, ptr addrspace(1) %arg2) gc "statepoint-example" {
entry:
- %cast = bitcast i8 addrspace(1)* %arg to i64 addrspace(1)*
- %c = icmp eq i64 addrspace(1)* %cast, %arg2
+ %c = icmp eq ptr addrspace(1) %arg, %arg2
br i1 %c, label %equal, label %notequal
notequal:
ret void
equal:
- %safepoint_token = call token (i64, i32, void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 0, i32 0, void ()* elementtype(void ()) undef, i32 0, i32 0, i32 0, i32 0) ["gc-live" (i8 addrspace(1)* %arg, i64 addrspace(1)* %cast, i8 addrspace(1)* %arg, i8 addrspace(1)* %arg), "deopt" (i32 0, i32 0, i32 0, i32 10, i32 0)]
- %reloc = call i64 addrspace(1)* @llvm.experimental.gc.relocate.p1i64(token %safepoint_token, i32 0, i32 0)
- call void undef(i64 addrspace(1)* %reloc)
+ %safepoint_token = call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 0, i32 0, ptr elementtype(void ()) undef, i32 0, i32 0, i32 0, i32 0) ["gc-live" (ptr addrspace(1) %arg, ptr addrspace(1) %arg, ptr addrspace(1) %arg, ptr addrspace(1) %arg), "deopt" (i32 0, i32 0, i32 0, i32 10, i32 0)]
+ %reloc = call ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token %safepoint_token, i32 0, i32 0)
+ call void undef(ptr addrspace(1) %reloc)
ret void
; CHECK-LABEL: test2
; CHECK-LABEL: equal
}
; Basic test for invoke statepoints
-define i8 addrspace(1)* @test3(i8 addrspace(1)* %obj, i8 addrspace(1)* %obj1) gc "statepoint-example" personality i32 ()* @"personality_function" {
+define ptr addrspace(1) @test3(ptr addrspace(1) %obj, ptr addrspace(1) %obj1) gc "statepoint-example" personality ptr @"personality_function" {
; CHECK-LABEL: test3
entry:
; CHECK-LABEL: entry
; CHECK: statepoint
- %0 = invoke token (i64, i32, void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 0, i32 0, void ()* elementtype(void ()) undef, i32 0, i32 0, i32 0, i32 0) ["gc-live" (i8 addrspace(1)* %obj, i8 addrspace(1)* %obj1), "deopt" (i32 0, i32 -1, i32 0, i32 0, i32 0)]
+ %0 = invoke token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 0, i32 0, ptr elementtype(void ()) undef, i32 0, i32 0, i32 0, i32 0) ["gc-live" (ptr addrspace(1) %obj, ptr addrspace(1) %obj1), "deopt" (i32 0, i32 -1, i32 0, i32 0, i32 0)]
to label %normal_dest unwind label %exceptional_return
normal_dest:
; CHECK: gc.relocate
; CHECK: gc.relocate
; CHECK: ret
- %obj.relocated = call coldcc i8 addrspace(1)* @llvm.experimental.gc.relocate.p1i8(token %0, i32 0, i32 0)
- %obj1.relocated = call coldcc i8 addrspace(1)* @llvm.experimental.gc.relocate.p1i8(token %0, i32 1, i32 1)
- ret i8 addrspace(1)* %obj.relocated
+ %obj.relocated = call coldcc ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token %0, i32 0, i32 0)
+ %obj1.relocated = call coldcc ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token %0, i32 1, i32 1)
+ ret ptr addrspace(1) %obj.relocated
exceptional_return:
; CHECK-LABEL: exceptional_return
; CHECK: gc.relocate
%landing_pad = landingpad token
cleanup
- %obj.relocated1 = call coldcc i8 addrspace(1)* @llvm.experimental.gc.relocate.p1i8(token %landing_pad, i32 0, i32 0)
- %obj1.relocated1 = call coldcc i8 addrspace(1)* @llvm.experimental.gc.relocate.p1i8(token %landing_pad, i32 1, i32 1)
- ret i8 addrspace(1)* %obj1.relocated1
+ %obj.relocated1 = call coldcc ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token %landing_pad, i32 0, i32 0)
+ %obj1.relocated1 = call coldcc ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token %landing_pad, i32 1, i32 1)
+ ret ptr addrspace(1) %obj1.relocated1
}
; Test for statepoint with sret attribute.
; This should be allowed as long as the wrapped function is not vararg.
%struct = type { i64, i64, i64 }
-declare void @fn_sret(%struct* sret(%struct))
+declare void @fn_sret(ptr sret(%struct))
define void @test_sret() gc "statepoint-example" {
%x = alloca %struct
- %statepoint_token = call token (i64, i32, void (%struct*)*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidp0s_structsf(i64 0, i32 0, void (%struct*)* elementtype(void (%struct*)) @fn_sret, i32 1, i32 0, %struct* sret(%struct) %x, i32 0, i32 0)
+ %statepoint_token = call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 0, i32 0, ptr elementtype(void (ptr)) @fn_sret, i32 1, i32 0, ptr sret(%struct) %x, i32 0, i32 0)
ret void
; CHECK-LABEL: test_sret
; CHECK: alloca
; RUN: not llvm-as %s -o /dev/null 2>&1 | FileCheck %s
-declare void @a(i32* swiftasync %a, i32* swiftasync %b)
+declare void @a(ptr swiftasync %a, ptr swiftasync %b)
; CHECK: Cannot have multiple 'swiftasync' parameters!
; RUN: not llvm-as %s -o /dev/null 2>&1 | FileCheck %s
; CHECK: this attribute does not apply to return values
-declare swifterror void @c(i32** swifterror %a)
+declare swifterror void @c(ptr swifterror %a)
; RUN: not llvm-as %s -o /dev/null 2>&1 | FileCheck %s
; CHECK: expected type
-declare void @c(swifterror i32* %a)
+declare void @c(swifterror ptr %a)
; RUN: not llvm-as %s -o /dev/null 2>&1 | FileCheck %s
-declare void @a(i32* swiftself %a, i32* swiftself %b)
+declare void @a(ptr swiftself %a, ptr swiftself %b)
; CHECK: Cannot have multiple 'swiftself' parameters!
; RUN: opt -passes=verify %s
-define swifttailcc void @valid_attrs(i64* sret(i64) %ret, i8* byval(i8) %byval, i8* swiftself %self, i8* swiftasync %ctx) {
- musttail call swifttailcc void @valid_attrs(i64* sret(i64) %ret, i8* byval(i8) %byval, i8* swiftself %self, i8* swiftasync %ctx)
+define swifttailcc void @valid_attrs(ptr sret(i64) %ret, ptr byval(i8) %byval, ptr swiftself %self, ptr swiftasync %ctx) {
+ musttail call swifttailcc void @valid_attrs(ptr sret(i64) %ret, ptr byval(i8) %byval, ptr swiftself %self, ptr swiftasync %ctx)
ret void
}
define swifttailcc void @mismatch_parms() {
- musttail call swifttailcc void @valid_attrs(i64* sret(i64) undef, i8* byval(i8) undef, i8* swiftself undef, i8* swiftasync undef)
+ musttail call swifttailcc void @valid_attrs(ptr sret(i64) undef, ptr byval(i8) undef, ptr swiftself undef, ptr swiftasync undef)
ret void
}
declare swifttailcc void @simple()
-define swifttailcc void @inreg(i8* inreg) {
+define swifttailcc void @inreg(ptr inreg) {
; CHECK: inreg attribute not allowed in swifttailcc musttail caller
musttail call swifttailcc void @simple()
ret void
}
-define swifttailcc void @inalloca(i8* inalloca(i8)) {
+define swifttailcc void @inalloca(ptr inalloca(i8)) {
; CHECK: inalloca attribute not allowed in swifttailcc musttail caller
musttail call swifttailcc void @simple()
ret void
}
-define swifttailcc void @swifterror(i8** swifterror) {
+define swifttailcc void @swifterror(ptr swifterror) {
; CHECK: swifterror attribute not allowed in swifttailcc musttail caller
musttail call swifttailcc void @simple()
ret void
}
-define swifttailcc void @preallocated(i8* preallocated(i8)) {
+define swifttailcc void @preallocated(ptr preallocated(i8)) {
; CHECK: preallocated attribute not allowed in swifttailcc musttail caller
musttail call swifttailcc void @simple()
ret void
}
-define swifttailcc void @byref(i8* byref(i8)) {
+define swifttailcc void @byref(ptr byref(i8)) {
; CHECK: byref attribute not allowed in swifttailcc musttail caller
musttail call swifttailcc void @simple()
ret void
define swifttailcc void @call_inreg() {
; CHECK: inreg attribute not allowed in swifttailcc musttail callee
- musttail call swifttailcc void @inreg(i8* inreg undef)
+ musttail call swifttailcc void @inreg(ptr inreg undef)
ret void
}
define swifttailcc void @call_inalloca() {
; CHECK: inalloca attribute not allowed in swifttailcc musttail callee
- musttail call swifttailcc void @inalloca(i8* inalloca(i8) undef)
+ musttail call swifttailcc void @inalloca(ptr inalloca(i8) undef)
ret void
}
define swifttailcc void @call_swifterror() {
; CHECK: swifterror attribute not allowed in swifttailcc musttail callee
- %err = alloca swifterror i8*
- musttail call swifttailcc void @swifterror(i8** swifterror %err)
+ %err = alloca swifterror ptr
+ musttail call swifttailcc void @swifterror(ptr swifterror %err)
ret void
}
define swifttailcc void @call_preallocated() {
; CHECK: preallocated attribute not allowed in swifttailcc musttail callee
- musttail call swifttailcc void @preallocated(i8* preallocated(i8) undef)
+ musttail call swifttailcc void @preallocated(ptr preallocated(i8) undef)
ret void
}
define swifttailcc void @call_byref() {
; CHECK: byref attribute not allowed in swifttailcc musttail callee
- musttail call swifttailcc void @byref(i8* byref(i8) undef)
+ musttail call swifttailcc void @byref(ptr byref(i8) undef)
ret void
}
declare tailcc void @simple()
-define tailcc void @inreg(i8* inreg) {
+define tailcc void @inreg(ptr inreg) {
; CHECK: inreg attribute not allowed in tailcc musttail caller
musttail call tailcc void @simple()
ret void
}
-define tailcc void @inalloca(i8* inalloca(i8)) {
+define tailcc void @inalloca(ptr inalloca(i8)) {
; CHECK: inalloca attribute not allowed in tailcc musttail caller
musttail call tailcc void @simple()
ret void
}
-define tailcc void @swifterror(i8** swifterror) {
+define tailcc void @swifterror(ptr swifterror) {
; CHECK: swifterror attribute not allowed in tailcc musttail caller
musttail call tailcc void @simple()
ret void
}
-define tailcc void @preallocated(i8* preallocated(i8)) {
+define tailcc void @preallocated(ptr preallocated(i8)) {
; CHECK: preallocated attribute not allowed in tailcc musttail caller
musttail call tailcc void @simple()
ret void
}
-define tailcc void @byref(i8* byref(i8)) {
+define tailcc void @byref(ptr byref(i8)) {
; CHECK: byref attribute not allowed in tailcc musttail caller
musttail call tailcc void @simple()
ret void
define tailcc void @call_inreg() {
; CHECK: inreg attribute not allowed in tailcc musttail callee
- musttail call tailcc void @inreg(i8* inreg undef)
+ musttail call tailcc void @inreg(ptr inreg undef)
ret void
}
define tailcc void @call_inalloca() {
; CHECK: inalloca attribute not allowed in tailcc musttail callee
- musttail call tailcc void @inalloca(i8* inalloca(i8) undef)
+ musttail call tailcc void @inalloca(ptr inalloca(i8) undef)
ret void
}
define tailcc void @call_swifterror() {
; CHECK: swifterror attribute not allowed in tailcc musttail callee
- %err = alloca swifterror i8*
- musttail call tailcc void @swifterror(i8** swifterror %err)
+ %err = alloca swifterror ptr
+ musttail call tailcc void @swifterror(ptr swifterror %err)
ret void
}
define tailcc void @call_preallocated() {
; CHECK: preallocated attribute not allowed in tailcc musttail callee
- musttail call tailcc void @preallocated(i8* preallocated(i8) undef)
+ musttail call tailcc void @preallocated(ptr preallocated(i8) undef)
ret void
}
define tailcc void @call_byref() {
; CHECK: byref attribute not allowed in tailcc musttail callee
- musttail call tailcc void @byref(i8* byref(i8) undef)
+ musttail call tailcc void @byref(ptr byref(i8) undef)
ret void
}
; This file contains TBAA metadata that is okay and should pass the verifier.
declare void @callee()
-declare void @llvm.va_start(i8*) nounwind
+declare void @llvm.va_start(ptr) nounwind
-define void @f_0(i8* %ptr, ...) {
+define void @f_0(ptr %ptr, ...) {
%args = alloca i8, align 8
- call void @llvm.va_start(i8* %args)
+ call void @llvm.va_start(ptr %args)
- %old = atomicrmw add i8* %ptr, i8 0 seq_cst, !tbaa !{!1, !1, i64 0}
- %pair = cmpxchg i8* %ptr, i8 0, i8 1 acquire acquire, !tbaa !{!1, !1, i64 0}
- %ld = load i8, i8* %ptr, !tbaa !{!1, !1, i64 0}
- store i8 1, i8* %ptr, !tbaa !{!1, !1, i64 0}
+ %old = atomicrmw add ptr %ptr, i8 0 seq_cst, !tbaa !{!1, !1, i64 0}
+ %pair = cmpxchg ptr %ptr, i8 0, i8 1 acquire acquire, !tbaa !{!1, !1, i64 0}
+ %ld = load i8, ptr %ptr, !tbaa !{!1, !1, i64 0}
+ store i8 1, ptr %ptr, !tbaa !{!1, !1, i64 0}
call void @callee(), !tbaa !{!1, !1, i64 0}
- %argval = va_arg i8* %args, i8, !tbaa !{!1, !1, i64 0}
+ %argval = va_arg ptr %args, i8, !tbaa !{!1, !1, i64 0}
ret void
}
; STRIP-NOT: tbaa
; STRIP: @f_0
; STRIP: Do no strip this
-define void @f_0(i32* %ptr) {
+define void @f_0(ptr %ptr) {
; This part checks for the easy syntactic verifier rules.
; CHECK: Struct tag metadata must have either 3 or 4 operands
-; CHECK-NEXT: store i32 0, i32* %ptr, align 4, !tbaa !{{[0-9]+}}
+; CHECK-NEXT: store i32 0, ptr %ptr, align 4, !tbaa !{{[0-9]+}}
; CHECK: Immutability tag on struct tag metadata must be a constant
-; CHECK-NEXT: store i32 1, i32* %ptr, align 4, !tbaa !{{[0-9]+}}
+; CHECK-NEXT: store i32 1, ptr %ptr, align 4, !tbaa !{{[0-9]+}}
; CHECK: Immutability part of the struct tag metadata must be either 0 or 1
-; CHECK-NEXT: store i32 2, i32* %ptr, align 4, !tbaa !{{[0-9]+}}
+; CHECK-NEXT: store i32 2, ptr %ptr, align 4, !tbaa !{{[0-9]+}}
; CHECK: Offset must be constant integer
-; CHECK-NEXT: store i32 3, i32* %ptr, align 4, !tbaa !{{[0-9]+}}
+; CHECK-NEXT: store i32 3, ptr %ptr, align 4, !tbaa !{{[0-9]+}}
; CHECK: Malformed struct tag metadata: base and access-type should be non-null and point to Metadata nodes
-; CHECK-NEXT: store i32 4, i32* %ptr, align 4, !tbaa !{{[0-9]+}}
+; CHECK-NEXT: store i32 4, ptr %ptr, align 4, !tbaa !{{[0-9]+}}
; CHECK: Access type node must be a valid scalar type
-; CHECK-NEXT: store i32 5, i32* %ptr, align 4, !tbaa !{{[0-9]+}}
+; CHECK-NEXT: store i32 5, ptr %ptr, align 4, !tbaa !{{[0-9]+}}
; CHECK: Access bit-width not the same as description bit-width
-; CHECK-NEXT: store i32 6, i32* %ptr, align 4, !tbaa !{{[0-9]+}}
+; CHECK-NEXT: store i32 6, ptr %ptr, align 4, !tbaa !{{[0-9]+}}
; CHECK: Access type node must be a valid scalar type
-; CHECK-NEXT: store i32 7, i32* %ptr, align 4, !tbaa !{{[0-9]+}}
+; CHECK-NEXT: store i32 7, ptr %ptr, align 4, !tbaa !{{[0-9]+}}
; CHECK: Struct tag nodes have a string as their first operand
; CHECK-NEXT: !{{[0-9]+}} = !{!{{[0-9]+}}, !{{[0-9]+}}, i64 0}
; CHECK: Access type node must be a valid scalar type
-; CHECK-NEXT: store i32 9, i32* %ptr, align 4, !tbaa !{{[0-9]+}}
-
- store i32 0, i32* %ptr, !tbaa !{!3, !2, i64 40, i64 0, i64 1, i64 2}
- store i32 1, i32* %ptr, !tbaa !{!3, !2, i64 40, !"immutable"}
- store i32 2, i32* %ptr, !tbaa !{!3, !2, i64 40, i64 4}
- store i32 3, i32* %ptr, !tbaa !{!3, !2, !"40", i64 0}
- store i32 4, i32* %ptr, !tbaa !{!3, null, !"40", i64 0}
- store i32 5, i32* %ptr, !tbaa !{!3, !3, !"40", i64 0}
- store i32 6, i32* %ptr, !tbaa !{!3, !2, i32 40, i64 0}
- store i32 7, i32* %ptr, !tbaa !{!3, !12, i32 40, i64 0}, !metadata !42
- store i32 8, i32* %ptr, !tbaa !{!13, !1, i64 0}
- store i32 9, i32* %ptr, !tbaa !{!14, !14, i64 0}
+; CHECK-NEXT: store i32 9, ptr %ptr, align 4, !tbaa !{{[0-9]+}}
+
+ store i32 0, ptr %ptr, !tbaa !{!3, !2, i64 40, i64 0, i64 1, i64 2}
+ store i32 1, ptr %ptr, !tbaa !{!3, !2, i64 40, !"immutable"}
+ store i32 2, ptr %ptr, !tbaa !{!3, !2, i64 40, i64 4}
+ store i32 3, ptr %ptr, !tbaa !{!3, !2, !"40", i64 0}
+ store i32 4, ptr %ptr, !tbaa !{!3, null, !"40", i64 0}
+ store i32 5, ptr %ptr, !tbaa !{!3, !3, !"40", i64 0}
+ store i32 6, ptr %ptr, !tbaa !{!3, !2, i32 40, i64 0}
+ store i32 7, ptr %ptr, !tbaa !{!3, !12, i32 40, i64 0}, !metadata !42
+ store i32 8, ptr %ptr, !tbaa !{!13, !1, i64 0}
+ store i32 9, ptr %ptr, !tbaa !{!14, !14, i64 0}
ret void
}
!42 = !{!"Do no strip this!"}
-define void @f_1(i32* %ptr) {
+define void @f_1(ptr %ptr) {
; This part checks for more semantic verifier rules.
; CHECK: Cycle detected in struct path
-; CHECK-NEXT: store i32 0, i32* %ptr, align 4, !tbaa !{{[0-9]+}}
+; CHECK-NEXT: store i32 0, ptr %ptr, align 4, !tbaa !{{[0-9]+}}
; CHECK: Offset not zero at the point of scalar access
-; CHECK-NEXT: store i32 1, i32* %ptr, align 4, !tbaa !{{[0-9]+}}
+; CHECK-NEXT: store i32 1, ptr %ptr, align 4, !tbaa !{{[0-9]+}}
; CHECK: Offset not zero at the point of scalar access
-; CHECK-NEXT: store i32 2, i32* %ptr, align 4, !tbaa !{{[0-9]+}}
+; CHECK-NEXT: store i32 2, ptr %ptr, align 4, !tbaa !{{[0-9]+}}
; CHECK: Could not find TBAA parent in struct type node
-; CHECK-NEXT: store i32 3, i32* %ptr, align 4, !tbaa !{{[0-9]+}}
+; CHECK-NEXT: store i32 3, ptr %ptr, align 4, !tbaa !{{[0-9]+}}
; CHECK: Did not see access type in access path!
-; CHECK-NEXT: store i32 3, i32* %ptr, align 4, !tbaa !{{[0-9]+}}
+; CHECK-NEXT: store i32 3, ptr %ptr, align 4, !tbaa !{{[0-9]+}}
; CHECK: Access type node must be a valid scalar type
-; CHECK-NEXT: store i32 4, i32* %ptr, align 4, !tbaa !{{[0-9]+}}
+; CHECK-NEXT: store i32 4, ptr %ptr, align 4, !tbaa !{{[0-9]+}}
; CHECK: Access type node must be a valid scalar type
-; CHECK-NEXT: store i32 5, i32* %ptr, align 4, !tbaa !{{[0-9]+}}
+; CHECK-NEXT: store i32 5, ptr %ptr, align 4, !tbaa !{{[0-9]+}}
; CHECK: Access type node must be a valid scalar type
-; CHECK-NEXT: store i32 6, i32* %ptr, align 4, !tbaa !{{[0-9]+}}
+; CHECK-NEXT: store i32 6, ptr %ptr, align 4, !tbaa !{{[0-9]+}}
; CHECK: Struct tag nodes must have an odd number of operands!
; CHECK-NEXT:!{{[0-9]+}} = !{!"bad-struct-type-0", !{{[0-9]+}}, i64 40, !{{[0-9]+}}}
; CHECK: Incorrect field entry in struct type node!
-; CHECK-NEXT: store i32 8, i32* %ptr, align 4, !tbaa !{{[0-9]+}}
+; CHECK-NEXT: store i32 8, ptr %ptr, align 4, !tbaa !{{[0-9]+}}
; CHECK: Bitwidth between the offsets and struct type entries must match
-; CHECK-NEXT: store i32 9, i32* %ptr, align 4, !tbaa !{{[0-9]+}}
+; CHECK-NEXT: store i32 9, ptr %ptr, align 4, !tbaa !{{[0-9]+}}
; CHECK: Offsets must be increasing!
-; CHECK-NEXT: store i32 10, i32* %ptr, align 4, !tbaa !{{[0-9]+}}
-
- store i32 0, i32* %ptr, !tbaa !{!4, !2, i64 40}
- store i32 1, i32* %ptr, !tbaa !{!3, !2, i64 45}
- store i32 2, i32* %ptr, !tbaa !{!3, !2, i64 45}
- store i32 3, i32* %ptr, !tbaa !{!3, !2, i64 10}
- store i32 4, i32* %ptr, !tbaa !{!5, !5, i64 0}
- store i32 5, i32* %ptr, !tbaa !{!6, !6, i64 0}
- store i32 6, i32* %ptr, !tbaa !{!7, !7, i64 0}
- store i32 7, i32* %ptr, !tbaa !{!8, !1, i64 40}
- store i32 8, i32* %ptr, !tbaa !{!9, !1, i64 40}
- store i32 9, i32* %ptr, !tbaa !{!10, !1, i64 40}
- store i32 10, i32* %ptr, !tbaa !{!11, !1, i64 40}
+; CHECK-NEXT: store i32 10, ptr %ptr, align 4, !tbaa !{{[0-9]+}}
+
+ store i32 0, ptr %ptr, !tbaa !{!4, !2, i64 40}
+ store i32 1, ptr %ptr, !tbaa !{!3, !2, i64 45}
+ store i32 2, ptr %ptr, !tbaa !{!3, !2, i64 45}
+ store i32 3, ptr %ptr, !tbaa !{!3, !2, i64 10}
+ store i32 4, ptr %ptr, !tbaa !{!5, !5, i64 0}
+ store i32 5, ptr %ptr, !tbaa !{!6, !6, i64 0}
+ store i32 6, ptr %ptr, !tbaa !{!7, !7, i64 0}
+ store i32 7, ptr %ptr, !tbaa !{!8, !1, i64 40}
+ store i32 8, ptr %ptr, !tbaa !{!9, !1, i64 40}
+ store i32 9, ptr %ptr, !tbaa !{!10, !1, i64 40}
+ store i32 10, ptr %ptr, !tbaa !{!11, !1, i64 40}
ret void
}
%X = type opaque
-define void @f_0(%X* %ptr) {
- %t = load %X, %X* %ptr
+define void @f_0(ptr %ptr) {
+ %t = load %X, ptr %ptr
ret void
; CHECK: loading unsized types is not allowed
-; CHECK-NEXT: %t = load %X, %X* %ptr
+; CHECK-NEXT: %t = load %X, ptr %ptr
}
%X = type opaque
-define void @f_1(%X %val, %X* %ptr) {
- store %X %val, %X* %ptr
+define void @f_1(%X %val, ptr %ptr) {
+ store %X %val, ptr %ptr
ret void
; CHECK: storing unsized types is not allowed
-; CHECK-NEXT: store %X %val, %X* %ptr
+; CHECK-NEXT: store %X %val, ptr %ptr
}
ret void
}
-define void @test_vp_conversions(<8 x i32*> %p0, <8 x i32> %i0, <8 x i64> %i1, <8 x float> %f0, <8 x double> %f1, <8 x i1> %mask, i32 %evl) {
+define void @test_vp_conversions(<8 x ptr> %p0, <8 x i32> %i0, <8 x i64> %i1, <8 x float> %f0, <8 x double> %f1, <8 x i1> %mask, i32 %evl) {
%r0 = call <8 x i32> @llvm.vp.fptoui.v8i32.v8f32(<8 x float> %f0, <8 x i1> %mask, i32 %evl)
%r1 = call <8 x i32> @llvm.vp.fptosi.v8i32.v8f32(<8 x float> %f0, <8 x i1> %mask, i32 %evl)
%r2 = call <8 x float> @llvm.vp.uitofp.v8f32.v8i32(<8 x i32> %i0, <8 x i1> %mask, i32 %evl)
%r6 = call <8 x i32> @llvm.vp.trunc.v8i32.v8i64(<8 x i64> %i1, <8 x i1> %mask, i32 %evl)
%r7 = call <8 x i64> @llvm.vp.zext.v8i64.v8i32(<8 x i32> %i0, <8 x i1> %mask, i32 %evl)
%r8 = call <8 x i64> @llvm.vp.sext.v8i64.v8i32(<8 x i32> %i0, <8 x i1> %mask, i32 %evl)
- %r9 = call <8 x i32> @llvm.vp.ptrtoint.v8i32.v8p0i32(<8 x i32*> %p0, <8 x i1> %mask, i32 %evl)
- %r10 = call <8 x i32*> @llvm.vp.inttoptr.v8p0i32.v8i32(<8 x i32> %i0, <8 x i1> %mask, i32 %evl)
+ %r9 = call <8 x i32> @llvm.vp.ptrtoint.v8i32.v8p0(<8 x ptr> %p0, <8 x i1> %mask, i32 %evl)
+ %r10 = call <8 x ptr> @llvm.vp.inttoptr.v8p0.v8i32(<8 x i32> %i0, <8 x i1> %mask, i32 %evl)
ret void
}
declare <8 x i32> @llvm.vp.trunc.v8i32.v8i64(<8 x i64>, <8 x i1>, i32)
declare <8 x i64> @llvm.vp.zext.v8i64.v8i32(<8 x i32>, <8 x i1>, i32)
declare <8 x i64> @llvm.vp.sext.v8i64.v8i32(<8 x i32>, <8 x i1>, i32)
-declare <8 x i32> @llvm.vp.ptrtoint.v8i32.v8p0i32(<8 x i32*>, <8 x i1>, i32)
-declare <8 x i32*> @llvm.vp.inttoptr.v8p0i32.v8i32(<8 x i32>, <8 x i1>, i32)
+declare <8 x i32> @llvm.vp.ptrtoint.v8i32.v8p0(<8 x ptr>, <8 x i1>, i32)
+declare <8 x ptr> @llvm.vp.inttoptr.v8p0.v8i32(<8 x i32>, <8 x i1>, i32)
; compares
declare <8 x i1> @llvm.vp.fcmp.v8f32(<8 x float>, <8 x float>, metadata, <8 x i1>, i32)
declare <8 x i1> @llvm.vp.icmp.v8i32(<8 x i32>, <8 x i32>, metadata, <8 x i1>, i32)
; RUN: not llvm-as %s -o /dev/null 2>&1 | FileCheck %s
; CHECK: 'vscale_range' minimum must be greater than 0
-declare i8* @a(i32*) vscale_range(0, 1)
+declare ptr @a(ptr) vscale_range(0, 1)
; CHECK: 'vscale_range' minimum cannot be greater than maximum
-declare i8* @b(i32*) vscale_range(8, 1)
+declare ptr @b(ptr) vscale_range(8, 1)
@"?var_hook@@3HA" = extern_weak dllimport global i32, align 4
; Function Attrs: noinline optnone uwtable
-define dso_local zeroext i1 @"?foo@@YA_NPEAHH@Z"(i32* %0, i32 %1) #0 {
+define dso_local zeroext i1 @"?foo@@YA_NPEAHH@Z"(ptr %0, i32 %1) #0 {
ret i1 0
}
define dso_local void @test_tile_init(i16 signext %row, i16 signext %col) {
entry:
- tail call void @llvm.x86.tilestored64.internal(i16 %row, i16 %col, i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @buf, i64 0, i64 0), i64 64, x86_amx bitcast (<256 x i32> <i32 1, i32 2, i32 3, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0> to x86_amx))
+ tail call void @llvm.x86.tilestored64.internal(i16 %row, i16 %col, ptr @buf, i64 64, x86_amx bitcast (<256 x i32> <i32 1, i32 2, i32 3, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0> to x86_amx))
ret void
}
; CHECK: const x86_amx is not allowed in argument!
-declare void @llvm.x86.tilestored64.internal(i16, i16, i8*, i64, x86_amx)
+declare void @llvm.x86.tilestored64.internal(i16, i16, ptr, i64, x86_amx)
; RUN: not llvm-as < %s 2>&1 | FileCheck %s
; CHECK: Calling convention parameter requires byval
-; CHECK-NEXT: void (i32)* @non_ptr_arg0
+; CHECK-NEXT: ptr @non_ptr_arg0
define x86_intrcc void @non_ptr_arg0(i32) {
ret void
}
; CHECK: Calling convention parameter requires byval
-; CHECK-NEXT: void (i32*)* @non_byval_ptr_arg0
-define x86_intrcc void @non_byval_ptr_arg0(i32*) {
+; CHECK-NEXT: ptr @non_byval_ptr_arg0
+define x86_intrcc void @non_byval_ptr_arg0(ptr) {
ret void
}
; CHECK: Calling convention parameter requires byval
-; CHECK-NEXT: void (i32)* @non_ptr_arg0_decl
+; CHECK-NEXT: ptr @non_ptr_arg0_decl
declare x86_intrcc void @non_ptr_arg0_decl(i32)
; CHECK: Calling convention parameter requires byval
-; CHECK-NEXT: void (i32*)* @non_byval_ptr_arg0_decl
-declare x86_intrcc void @non_byval_ptr_arg0_decl(i32*)
+; CHECK-NEXT: ptr @non_byval_ptr_arg0_decl
+declare x86_intrcc void @non_byval_ptr_arg0_decl(ptr)