diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index a6ba6e518899f..4cb0a35aa7b25 100644 --- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -16703,7 +16703,7 @@ SDValue DAGCombiner::visitBITCAST(SDNode *N) { } } SDValue Load = - DAG.getLoad(VT, SDLoc(N), LN0->getChain(), LN0->getBasePtr(), + DAG.getLoad(VT, SDLoc(LN0), LN0->getChain(), LN0->getBasePtr(), LN0->getMemOperand()); DAG.ReplaceAllUsesOfValueWith(N0.getValue(1), Load.getValue(1)); return Load; diff --git a/llvm/test/DebugInfo/AMDGPU/combine-conv-load.ll b/llvm/test/DebugInfo/AMDGPU/combine-conv-load.ll new file mode 100644 index 0000000000000..0bb3d383248fb --- /dev/null +++ b/llvm/test/DebugInfo/AMDGPU/combine-conv-load.ll @@ -0,0 +1,25 @@ +; RUN: llc -mtriple=amdgcn -mcpu=gfx942 < %s | FileCheck %s + +; CHECK-LABEL: test: +; CHECK: .loc 1 8 16 prologue_end ; test.py:8:16 +; CHECK-NEXT: s_load_dword + +define void @test(ptr addrspace(1) inreg readonly captures(none) %arg0, ptr addrspace(1) inreg writeonly captures(none) %arg1) local_unnamed_addr !dbg !4 { + %ld = load <1 x float>, ptr addrspace(1) %arg0, align 4, !dbg !8, !amdgpu.noclobber !6 + store <1 x float> %ld, ptr addrspace(1) %arg1, align 4, !dbg !7 + ret void, !dbg !9 +} + +!llvm.dbg.cu = !{!0} +!llvm.module.flags = !{!2, !3} + +!0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "triton", isOptimized: true, runtimeVersion: 0, emissionKind: LineTablesOnly) +!1 = !DIFile(filename: "test.py", directory: "/path") +!2 = !{i32 2, !"Debug Info Version", i32 3} +!3 = !{i32 1, !"amdhsa_code_object_version", i32 500} +!4 = distinct !DISubprogram(name: "test", linkageName: "test", scope: !1, file: !1, line: 7, type: !5, scopeLine: 7, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0) +!5 = !DISubroutineType(cc: DW_CC_normal, types: !6) +!6 = !{} +!7 = !DILocation(line: 9, column: 20, scope: !4) +!8 = !DILocation(line: 8, column: 16, scope: !4) +!9 = !DILocation(line: 9, column: 4, scope: !4)