1; Test that DAG->DAG ISel is able to pick up the S_LOAD_DWORDX4_SGPR instruction that fetches the offset 2; from a register. 3 4; RUN: llc -march=amdgcn -verify-machineinstrs -stop-after=amdgpu-isel -o - %s | FileCheck -check-prefix=GCN %s 5; RUN: llc -march=amdgcn -global-isel -verify-machineinstrs -stop-after=amdgpu-isel -o - %s | FileCheck -check-prefix=GISEL %s 6 7; GCN: %[[OFFSET:[0-9]+]]:sreg_32 = S_MOV_B32 target-flags(amdgpu-abs32-lo) @DescriptorBuffer 8; GCN: %{{[0-9]+}}:sgpr_128 = S_LOAD_DWORDX4_SGPR killed %{{[0-9]+}}, killed %[[OFFSET]], 0 :: (invariant load (s128) from %ir.13, addrspace 4) 9 10; GISEL: $[[OFFSET:.*]] = S_MOV_B32 target-flags(amdgpu-abs32-lo) @DescriptorBuffer 11; GISEL: S_LOAD_DWORDX4_SGPR killed renamable {{.*}}, killed renamable $[[OFFSET]], 0 :: (invariant load (<4 x s32>) from {{.*}}, addrspace 4) 12 13define amdgpu_cs void @test_load_zext(i32 inreg %0, i32 inreg %1, i32 inreg %resNode0, i32 inreg %resNode1, <3 x i32> inreg %2, i32 inreg %3, <3 x i32> %4) local_unnamed_addr #2 { 14.entry: 15 %5 = call i64 @llvm.amdgcn.s.getpc() #3 16 %6 = bitcast i64 %5 to <2 x i32> 17 %7 = insertelement <2 x i32> %6, i32 %resNode0, i32 0 18 %8 = bitcast <2 x i32> %7 to i64 19 %9 = inttoptr i64 %8 to [4294967295 x i8] addrspace(4)* 20 %10 = call i32 @llvm.amdgcn.reloc.constant(metadata !4) 21 %11 = zext i32 %10 to i64 22 %12 = getelementptr [4294967295 x i8], [4294967295 x i8] addrspace(4)* %9, i64 0, i64 %11 23 %13 = bitcast i8 addrspace(4)* %12 to <4 x i32> addrspace(4)*, !amdgpu.uniform !5 24 %14 = load <4 x i32>, <4 x i32> addrspace(4)* %13, align 16, !invariant.load !5 25 %15 = call <4 x i32> @llvm.amdgcn.s.buffer.load.v4i32(<4 x i32> %14, i32 0, i32 0) 26 call void @llvm.amdgcn.raw.buffer.store.v4i32(<4 x i32> %15, <4 x i32> %14, i32 0, i32 0, i32 0) 27 ret void 28} 29 30declare void @llvm.amdgcn.raw.buffer.store.v4i32(<4 x i32>, <4 x i32>, i32, i32, i32 immarg) #1 31 32; Function Attrs: nounwind readnone speculatable 33declare i32 @llvm.amdgcn.reloc.constant(metadata) #3 34 35; Function Attrs: nounwind readnone speculatable 36declare i64 @llvm.amdgcn.s.getpc() #3 37 38; Function Attrs: nounwind readnone 39declare <4 x i32> @llvm.amdgcn.s.buffer.load.v4i32(<4 x i32>, i32, i32 immarg) #1 40 41attributes #0 = { argmemonly nounwind willreturn } 42attributes #1 = { nounwind readnone } 43attributes #2 = { nounwind "amdgpu-unroll-threshold"="700" } 44attributes #3 = { nounwind readnone speculatable } 45attributes #4 = { nounwind writeonly } 46 47!llpc.compute.mode = !{!0} 48!llpc.options = !{!1} 49!llpc.options.CS = !{!2} 50!llpc.user.data.nodes = !{!3, !4, !5, !6} 51!amdgpu.pal.metadata.msgpack = !{!7} 52 53!0 = !{i32 2, i32 3, i32 1} 54!1 = !{i32 245227952, i32 996822128, i32 2024708198, i32 497230408} 55!2 = !{i32 1381820427, i32 1742110173, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 64} 56!3 = !{!"DescriptorTableVaPtr", i32 0, i32 1, i32 1} 57!4 = !{!"DescriptorBuffer", i32 4, i32 8, i32 0, i32 0} 58!5 = !{!"DescriptorTableVaPtr", i32 1, i32 1, i32 1} 59!6 = !{!"DescriptorBuffer", i32 4, i32 8, i32 1, i32 0} 60!7 = !{!"\82\B0amdpal.pipelines\91\88\A4.api\A6Vulkan\B0.hardware_stages\81\A3.cs\82\AB.sgpr_limith\AB.vgpr_limit\CD\01\00\B7.internal_pipeline_hash\92\CF;jLp\0E\9D\E1\B0\CF\1D\A3\22Hx\AE\98f\AA.registers\88\CD.\07\02\CD.\08\03\CD.\09\01\CD.\12\CE\00,\00\00\CD.\13\CD\0F\88\CD.@\CE\10\00\00\00\CD.B\00\CD.C\01\A8.shaders\81\A8.compute\82\B0.api_shader_hash\92\CFg\D6}\DDR\\\E8\0B\00\B1.hardware_mapping\91\A3.cs\B0.spill_threshold\CE\FF\FF\FF\FF\A5.type\A2Cs\B0.user_data_limit\02\AEamdpal.version\92\02\03"} 61!8 = !{i32 5} 62!9 = !{!"doff_0_0_b"} 63!10 = !{} 64!11 = !{!"doff_1_0_b"} 65