56 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc -mtriple=amdgcn -mcpu=gfx900 -mattr=+xnack -amdgpu-max-memory-clause=0 < %s | FileCheck -enable-var-scope -check-prefix=GCN %s3 4; Test the behavior of the post-RA soft clause bundler in the presence5; of debug info. The debug info should not interfere with the6; bundling, which could result in an observable codegen change.7 8define amdgpu_kernel void @dbg_clause(ptr addrspace(1) %out, ptr addrspace(1) %aptr) !dbg !4 {9; GCN-LABEL: dbg_clause:10; GCN: ; %bb.0:11; GCN-NEXT: s_load_dwordx4 s[0:3], s[4:5], 0x2412; GCN-NEXT: v_lshlrev_b32_e32 v0, 2, v013; GCN-NEXT: s_waitcnt lgkmcnt(0)14; GCN-NEXT: global_load_dword v1, v0, s[2:3]15; GCN-NEXT: ;DEBUG_VALUE: foo:a <- $vgpr116; GCN-NEXT: global_load_dword v2, v0, s[2:3] offset:3217; GCN-NEXT: ;DEBUG_VALUE: foo:b <- $vgpr218; GCN-NEXT: s_waitcnt vmcnt(0)19; GCN-NEXT: v_add_f32_e32 v1, v1, v220; GCN-NEXT: global_store_dword v0, v1, s[0:1]21; GCN-NEXT: s_endpgm22 %tid = call i32 @llvm.amdgcn.workitem.id.x()23 %out.gep = getelementptr float, ptr addrspace(1) %out, i32 %tid24 %gep0 = getelementptr float, ptr addrspace(1) %aptr, i32 %tid25 %gep1 = getelementptr float, ptr addrspace(1) %gep0, i32 826 %a = load float, ptr addrspace(1) %gep0, align 427 call void @llvm.dbg.value(metadata float %a, metadata !8, metadata !DIExpression()), !dbg !928 %b = load float, ptr addrspace(1) %gep1, align 429 call void @llvm.dbg.value(metadata float %b, metadata !10, metadata !DIExpression()), !dbg !1130 %fadd = fadd float %a, %b31 store float %fadd, ptr addrspace(1) %out.gep, align 432 ret void33}34 35declare i32 @llvm.amdgcn.workitem.id.x() #036declare void @llvm.dbg.value(metadata, metadata, metadata) #137 38attributes #0 = { nounwind readnone speculatable willreturn }39attributes #1 = { nofree nosync nounwind readnone speculatable willreturn }40 41!llvm.dbg.cu = !{!0}42!llvm.module.flags = !{!2, !3}43 44!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, isOptimized: true, runtimeVersion: 0, emissionKind: NoDebug)45!1 = !DIFile(filename: "/tmp/foo.cl", directory: "/dev/null")46!2 = !{i32 2, !"Dwarf Version", i32 4}47!3 = !{i32 2, !"Debug Info Version", i32 3}48!4 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 1, type: !5, scopeLine: 2, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0)49!5 = !DISubroutineType(types: !6)50!6 = !{null, !7}51!7 = !DIBasicType(name: "float", size: 32, align: 32)52!8 = !DILocalVariable(name: "a", arg: 1, scope: !4, file: !1, line: 1)53!9 = !DILocation(line: 1, column: 42, scope: !4)54!10 = !DILocalVariable(name: "b", arg: 2, scope: !4, file: !1, line: 2)55!11 = !DILocation(line: 2, column: 42, scope: !4)56