Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would getMergedLocation work better?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would getMergedLocation work better?

I did some experiments:
LN0 loc = test.py:8:16
N loc = test.py:9:20
=>
getMergedLocation(LN0, N) = test.py:0

Is this as expected?

The code is as follows. If there are any mistakes, please point them out to me.
image

However, the test needs to check test.py:8:16.

LN0->getMemOperand());
DAG.ReplaceAllUsesOfValueWith(N0.getValue(1), Load.getValue(1));
return Load;
Expand Down
25 changes: 25 additions & 0 deletions llvm/test/DebugInfo/AMDGPU/combine-conv-load.ll
Original file line number Diff line number Diff line change
@@ -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)
Loading