Changeset View
Changeset View
Standalone View
Standalone View
llvm/test/CodeGen/AMDGPU/call-constexpr.ll
Show First 20 Lines • Show All 59 Lines • ▼ Show 20 Lines | define amdgpu_kernel void @test_bitcast_argument_and_return_types() #0 { | ||||
%val = call float bitcast (i32(i32)* @ident_i32 to float(float)*)(float 2.0) | %val = call float bitcast (i32(i32)* @ident_i32 to float(float)*)(float 2.0) | ||||
%op = fadd float %val, 1.0 | %op = fadd float %val, 1.0 | ||||
store volatile float %op, float addrspace(1)* undef | store volatile float %op, float addrspace(1)* undef | ||||
ret void | ret void | ||||
} | } | ||||
; GCN-LABEL: {{^}}use_workitem_id_x: | ; GCN-LABEL: {{^}}use_workitem_id_x: | ||||
; GCN: s_waitcnt | ; GCN: s_waitcnt | ||||
; GCN-NEXT: v_and_b32_e32 v1, 0x3ff, v1 | ; GCN-NEXT: v_and_b32_e32 v1, 0x3ff, v31 | ||||
; GCN-NEXT: v_add_i32_e32 v0, vcc, v1, v0 | ; GCN-NEXT: v_add_i32_e32 v0, vcc, v1, v0 | ||||
; GCN-NEXT: s_setpc_b64 | ; GCN-NEXT: s_setpc_b64 | ||||
define hidden i32 @use_workitem_id_x(i32 %arg0) #0 { | define hidden i32 @use_workitem_id_x(i32 %arg0) #0 { | ||||
%id = call i32 @llvm.amdgcn.workitem.id.x() | %id = call i32 @llvm.amdgcn.workitem.id.x() | ||||
%op = add i32 %id, %arg0 | %op = add i32 %id, %arg0 | ||||
ret i32 %op | ret i32 %op | ||||
} | } | ||||
; GCN-LABEL: {{^}}test_bitcast_use_workitem_id_x: | ; GCN-LABEL: {{^}}test_bitcast_use_workitem_id_x: | ||||
; GCN: v_mov_b32_e32 v1, v0 | |||||
; GCN: s_getpc_b64 | ; GCN: s_getpc_b64 | ||||
; GCN: s_add_u32 s{{[0-9]+}}, s{{[0-9]+}}, use_workitem_id_x@rel32@lo+4 | ; GCN: s_add_u32 s{{[0-9]+}}, s{{[0-9]+}}, use_workitem_id_x@rel32@lo+4 | ||||
; GCN: s_addc_u32 s{{[0-9]+}}, s{{[0-9]+}}, use_workitem_id_x@rel32@hi+12 | ; GCN: s_addc_u32 s{{[0-9]+}}, s{{[0-9]+}}, use_workitem_id_x@rel32@hi+12 | ||||
; GCN: v_mov_b32_e32 v0, 9 | ; GCN: v_mov_b32_e32 v0, 9 | ||||
; GCN: s_swappc_b64 | ; GCN: s_swappc_b64 | ||||
; GCN: v_add_f32_e32 | ; GCN: v_add_f32_e32 | ||||
; OPT-LABEL: @use_workitem_id_x( | ; OPT-LABEL: @use_workitem_id_x( | ||||
; OPT: %val = call i32 @use_workitem_id_x(i32 9) | ; OPT: %val = call i32 @use_workitem_id_x(i32 9) | ||||
▲ Show 20 Lines • Show All 55 Lines • Show Last 20 Lines |