Index: include/llvm/CodeGen/SelectionDAGNodes.h =================================================================== --- include/llvm/CodeGen/SelectionDAGNodes.h +++ include/llvm/CodeGen/SelectionDAGNodes.h @@ -1498,9 +1498,8 @@ const ConstantInt *Value; - ConstantSDNode(bool isTarget, bool isOpaque, const ConstantInt *val, - const DebugLoc &DL, EVT VT) - : SDNode(isTarget ? ISD::TargetConstant : ISD::Constant, 0, DL, + ConstantSDNode(bool isTarget, bool isOpaque, const ConstantInt *val, EVT VT) + : SDNode(isTarget ? ISD::TargetConstant : ISD::Constant, 0, DebugLoc(), getSDVTList(VT)), Value(val) { ConstantSDNodeBits.IsOpaque = isOpaque; @@ -1536,10 +1535,9 @@ const ConstantFP *Value; - ConstantFPSDNode(bool isTarget, const ConstantFP *val, const DebugLoc &DL, - EVT VT) - : SDNode(isTarget ? ISD::TargetConstantFP : ISD::ConstantFP, 0, DL, - getSDVTList(VT)), + ConstantFPSDNode(bool isTarget, const ConstantFP *val, EVT VT) + : SDNode(isTarget ? ISD::TargetConstantFP : ISD::ConstantFP, 0, + DebugLoc(), getSDVTList(VT)), Value(val) {} public: Index: lib/CodeGen/SelectionDAG/SelectionDAG.cpp =================================================================== --- lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -1243,7 +1243,7 @@ return SDValue(N, 0); if (!N) { - N = newSDNode(isT, isO, Elt, DL.getDebugLoc(), EltVT); + N = newSDNode(isT, isO, Elt, EltVT); CSEMap.InsertNode(N, IP); InsertNode(N); NewSDValueDbgMsg(SDValue(N, 0), "Creating constant: ", this); @@ -1286,7 +1286,7 @@ return SDValue(N, 0); if (!N) { - N = newSDNode(isTarget, &V, DL.getDebugLoc(), EltVT); + N = newSDNode(isTarget, &V, EltVT); CSEMap.InsertNode(N, IP); InsertNode(N); } Index: test/CodeGen/AArch64/machine-outliner-remarks.ll =================================================================== --- test/CodeGen/AArch64/machine-outliner-remarks.ll +++ test/CodeGen/AArch64/machine-outliner-remarks.ll @@ -1,18 +1,17 @@ ; RUN: llc %s -enable-machine-outliner -mtriple=aarch64-unknown-unknown -pass-remarks=machine-outliner -pass-remarks-missed=machine-outliner -o /dev/null 2>&1 | FileCheck %s -; CHECK: machine-outliner-remarks.ll:5:9: +; CHECK: :0:0: ; CHECK-SAME: Did not outline 2 instructions from 2 locations. ; CHECK-SAME: Bytes from outlining all occurrences (36) >= ; CHECK-SAME: Unoutlined instruction bytes (16) -; CHECK-SAME: (Also found at: machine-outliner-remarks.ll:13:9) +; CHECK-SAME: (Also found at: ) ; CHECK: remark: :0:0: Saved 20 bytes by outlining 12 instructions -; CHECK-SAME: from 2 locations. (Found at: machine-outliner-remarks.ll:36:1, -; CHECK-SAME: machine-outliner-remarks.ll:27:9) +; CHECK-SAME: from 2 locations. (Found at: , +; CHECK-SAME: ) ; RUN: llc %s -enable-machine-outliner -mtriple=aarch64-unknown-unknown -o /dev/null -pass-remarks-missed=machine-outliner -pass-remarks-output=%t.yaml ; RUN: cat %t.yaml | FileCheck %s -check-prefix=YAML ; YAML: --- !Missed ; YAML-NEXT: Pass: machine-outliner ; YAML-NEXT: Name: NotOutliningCheaper -; YAML-NEXT: DebugLoc: { File: machine-outliner-remarks.ll, Line: 5, Column: 9 } ; YAML-NEXT: Function: dog ; YAML-NEXT: Args: ; YAML-NEXT: - String: 'Did not outline ' @@ -28,8 +27,7 @@ ; YAML-NEXT: - NotOutliningCost: '16' ; YAML-NEXT: - String: ')' ; YAML-NEXT: - String: ' (Also found at: ' -; YAML-NEXT: - OtherStartLoc1: 'machine-outliner-remarks.ll:13:9' -; YAML-NEXT: DebugLoc: { File: machine-outliner-remarks.ll, Line: 13, Column: 9 } +; YAML-NEXT: - OtherStartLoc1: '' ; YAML-NEXT: - String: ')' ; YAML: --- !Passed ; YAML-NEXT: Pass: machine-outliner @@ -46,11 +44,9 @@ ; YAML-NEXT: - NumOccurrences: '2' ; YAML-NEXT: - String: ' locations. ' ; YAML-NEXT: - String: '(Found at: ' -; YAML-NEXT: - StartLoc0: 'machine-outliner-remarks.ll:36:1' -; YAML-NEXT: DebugLoc: { File: machine-outliner-remarks.ll, Line: 36, Column: 1 } +; YAML-NEXT: - StartLoc0: '' ; YAML-NEXT: - String: ', ' -; YAML-NEXT: - StartLoc1: 'machine-outliner-remarks.ll:27:9' -; YAML-NEXT: DebugLoc: { File: machine-outliner-remarks.ll, Line: 27, Column: 9 } +; YAML-NEXT: - StartLoc1: '' ; YAML-NEXT: - String: ')' define void @dog() #0 !dbg !8 { Index: test/DebugInfo/ARM/single-constant-use-preserves-dbgloc.ll =================================================================== --- test/DebugInfo/ARM/single-constant-use-preserves-dbgloc.ll +++ test/DebugInfo/ARM/single-constant-use-preserves-dbgloc.ll @@ -9,9 +9,6 @@ ; return -1; ; } -; CHECK: .loc 1 6 7 -; CHECK: mvn - target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64" target triple = "armv7--linux-gnueabihf" @@ -33,7 +30,17 @@ br label %return, !dbg !18 if.end: ; preds = %entry +; Materialize the constant. +; CHECK: .loc 1 0 +; CHECK-NEXT: mvn r0, #0 + +; The backend performs the store to %retval first, for some reason. +; CHECK-NEXT: .loc 1 7 5 +; CHECK-NEXT: str r0, [sp, #4] store i32 -1, i32* %x, align 4, !dbg !19 + +; CHECK-NEXT: .loc 1 6 7 +; CHECK-NEXT: str r0, [sp] store i32 -1, i32* %retval, !dbg !20 br label %return, !dbg !20 Index: test/DebugInfo/Generic/constant-sdnodes-have-dbg-location.ll =================================================================== --- test/DebugInfo/Generic/constant-sdnodes-have-dbg-location.ll +++ /dev/null @@ -1,25 +0,0 @@ -; RUN: llc -debug -dag-dump-verbose < %s 2>&1 | FileCheck %s -; REQUIRES: asserts - -; CHECK: t{{[0-9]+}}: i32 = Constant<-1>test.c:4:5 - -define i32 @main() !dbg !4 { -entry: - %retval = alloca i32, align 4 - store i32 0, i32* %retval - ret i32 -1, !dbg !10 -} - -!llvm.dbg.cu = !{!0} -!llvm.module.flags = !{!8, !9} - -!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "", isOptimized: false, emissionKind: FullDebug) -!1 = !DIFile(filename: "test.c", directory: "/home/user/clang-llvm/build") -!2 = !{} -!4 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 2, type: !5, isLocal: false, isDefinition: true, scopeLine: 3, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !2) -!5 = !DISubroutineType(types: !6) -!6 = !{!7} -!7 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed) -!8 = !{i32 2, !"Dwarf Version", i32 4} -!9 = !{i32 2, !"Debug Info Version", i32 3} -!10 = !DILocation(line: 4, column: 5, scope: !4) Index: test/DebugInfo/Generic/constantfp-sdnodes-have-dbg-location.ll =================================================================== --- test/DebugInfo/Generic/constantfp-sdnodes-have-dbg-location.ll +++ /dev/null @@ -1,23 +0,0 @@ -; RUN: llc -debug -dag-dump-verbose < %s 2>&1 | FileCheck %s -; REQUIRES: asserts - -; CHECK: t{{[0-9]+}}: f64 = ConstantFP<1.500000e+00>test.c:3:5 - -define double @f() !dbg !4 { -entry: - ret double 1.500000e+00, !dbg !10 -} - -!llvm.dbg.cu = !{!0} -!llvm.module.flags = !{!8, !9} - -!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "", isOptimized: false, emissionKind: FullDebug) -!1 = !DIFile(filename: "test.c", directory: "/home/user/clang-llvm/build") -!2 = !{} -!4 = distinct !DISubprogram(name: "f", scope: !1, file: !1, line: 1, type: !5, isLocal: false, isDefinition: true, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !2) -!5 = !DISubroutineType(types: !6) -!6 = !{!7} -!7 = !DIBasicType(name: "double", size: 64, align: 64, encoding: DW_ATE_float) -!8 = !{i32 2, !"Dwarf Version", i32 4} -!9 = !{i32 2, !"Debug Info Version", i32 3} -!10 = !DILocation(line: 3, column: 5, scope: !4) Index: test/tools/llvm-objdump/AMDGPU/source-lines.ll =================================================================== --- test/tools/llvm-objdump/AMDGPU/source-lines.ll +++ test/tools/llvm-objdump/AMDGPU/source-lines.ll @@ -7,10 +7,10 @@ ; LINE: source_lines_test: ; LINE-NEXT: ; {{.*}}source-lines.cl:1 ; Kernel. -; LINE: ; {{.*}}source-lines.cl:2 ; LINE: v_mov_b32_e32 v{{[0-9]+}}, 0x777 -; LINE: ; {{.*}}source-lines.cl:3 +; LINE: ; {{.*}}source-lines.cl:2 ; LINE: v_mov_b32_e32 v{{[0-9]+}}, 0x888 +; LINE: ; {{.*}}source-lines.cl:3 ; LINE: ; {{.*}}source-lines.cl:4 ; LINE: v_add_u32_e32 ; LINE: ; {{.*}}source-lines.cl:5 @@ -23,10 +23,10 @@ ; SOURCE: source_lines_test: ; SOURCE-NEXT: ; kernel void source_lines_test(global int *Out) { ; Kernel. -; SOURCE: ; int var0 = 0x777; ; SOURCE: v_mov_b32_e32 v{{[0-9]+}}, 0x777 -; SOURCE: ; int var1 = 0x888; +; SOURCE: ; int var0 = 0x777; ; SOURCE: v_mov_b32_e32 v{{[0-9]+}}, 0x888 +; SOURCE: ; int var1 = 0x888; ; SOURCE: ; int var2 = var0 + var1; ; SOURCE: v_add_u32_e32 ; SOURCE: ; *Out = var2;