Index: llvm/bindings/go/llvm/dibuilder.go =================================================================== --- llvm/bindings/go/llvm/dibuilder.go +++ llvm/bindings/go/llvm/dibuilder.go @@ -54,7 +54,6 @@ FlagVector FlagStaticMember FlagIndirectVariable - FlagArgumentNotModified ) type DwarfLang uint32 Index: llvm/docs/LangRef.rst =================================================================== --- llvm/docs/LangRef.rst +++ llvm/docs/LangRef.rst @@ -4843,13 +4843,6 @@ These flags encode various properties of DINodes. -The `ArgumentNotModified` flag marks a function argument whose value -is not modified throughout of a function. This flag is used to decide -whether a DW_OP_LLVM_entry_value can be used in a location description -after the function prologue. The language frontend is expected to compute -this property for each DILocalVariable. The flag should be used -only in optimized code. - The `ExportSymbols` flag marks a class, struct or union whose members may be referenced as if they were defined in the containing class or union. This flag is used to decide whether the DW_AT_export_symbols can Index: llvm/include/llvm/IR/DebugInfoFlags.def =================================================================== --- llvm/include/llvm/IR/DebugInfoFlags.def +++ llvm/include/llvm/IR/DebugInfoFlags.def @@ -49,7 +49,6 @@ HANDLE_DI_FLAG((1 << 18), IntroducedVirtual) HANDLE_DI_FLAG((1 << 19), BitField) HANDLE_DI_FLAG((1 << 20), NoReturn) -HANDLE_DI_FLAG((1 << 21), ArgumentNotModified) HANDLE_DI_FLAG((1 << 22), TypePassByValue) HANDLE_DI_FLAG((1 << 23), TypePassByReference) HANDLE_DI_FLAG((1 << 24), EnumClass) Index: llvm/include/llvm/IR/DebugInfoMetadata.h =================================================================== --- llvm/include/llvm/IR/DebugInfoMetadata.h +++ llvm/include/llvm/IR/DebugInfoMetadata.h @@ -2810,11 +2810,6 @@ bool isArtificial() const { return getFlags() & FlagArtificial; } bool isObjectPointer() const { return getFlags() & FlagObjectPointer; } - /// Check that an argument is unmodified. - bool isNotModified() const { return getFlags() & FlagArgumentNotModified; } - /// Set the flag if an argument is unmodified. - void setIsNotModified() { Flags |= FlagArgumentNotModified; } - /// Check that a location is valid for this variable. /// /// Check that \c DL exists, is in the same subprogram, and has the same Index: llvm/lib/CodeGen/LiveDebugValues.cpp =================================================================== --- llvm/lib/CodeGen/LiveDebugValues.cpp +++ llvm/lib/CodeGen/LiveDebugValues.cpp @@ -1265,15 +1265,6 @@ std::greater> Pending; - // Besides parameter's modification, check whether a DBG_VALUE is inlined - // in order to deduce whether the variable that it tracks comes from - // a different function. If that is the case we can't track its entry value. - auto IsUnmodifiedFuncParam = [&](const MachineInstr &MI) { - auto *DIVar = MI.getDebugVariable(); - return DIVar->isParameter() && DIVar->isNotModified() && - !MI.getDebugLoc()->getInlinedAt(); - }; - const TargetLowering *TLI = MF.getSubtarget().getTargetLowering(); unsigned SP = TLI->getStackPointerRegisterToSaveRestore(); Register FP = TRI->getFrameRegister(MF); @@ -1297,7 +1288,7 @@ // TODO: Add support for local variables that are expressed in terms of // parameters entry values. for (auto &MI : First_MBB) - if (MI.isDebugValue() && IsUnmodifiedFuncParam(MI) && + if (MI.isDebugValue() && !MI.getDebugLoc()->getInlinedAt() && !MI.isIndirectDebugValue() && IsRegOtherThanSPAndFP(MI.getOperand(0)) && !DebugEntryVals.count(MI.getDebugVariable()) && MI.getDebugExpression()->getNumElements() == 0) Index: llvm/test/Assembler/debug-info.ll =================================================================== --- llvm/test/Assembler/debug-info.ll +++ llvm/test/Assembler/debug-info.ll @@ -1,8 +1,8 @@ ; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s ; RUN: verify-uselistorder %s -; CHECK: !named = !{!0, !0, !1, !2, !3, !4, !5, !6, !7, !8, !8, !9, !10, !11, !12, !13, !14, !15, !16, !17, !18, !19, !20, !21, !22, !23, !24, !25, !26, !27, !27, !28, !29, !30, !31, !32, !33, !34, !35, !36, !37, !38, !39, !40, !41} -!named = !{!0, !1, !2, !3, !4, !5, !6, !7, !8, !9, !10, !11, !12, !13, !14, !15, !16, !17, !18, !19, !20, !21, !22, !23, !24, !25, !26, !27, !28, !29, !30, !31, !32, !33, !34, !35, !36, !37, !38, !39, !40, !41, !42, !43, !44} +; CHECK: !named = !{!0, !0, !1, !2, !3, !4, !5, !6, !7, !8, !8, !9, !10, !11, !12, !13, !14, !15, !16, !17, !18, !19, !20, !21, !22, !23, !24, !25, !26, !27, !27, !28, !29, !30, !31, !32, !33, !34, !35, !36, !37, !38, !39} +!named = !{!0, !1, !2, !3, !4, !5, !6, !7, !8, !9, !10, !11, !12, !13, !14, !15, !16, !17, !18, !19, !20, !21, !22, !23, !24, !25, !26, !27, !28, !29, !30, !31, !32, !33, !34, !35, !36, !37, !38, !39, !40, !41, !42} ; CHECK: !0 = !DISubrange(count: 3) ; CHECK-NEXT: !1 = !DISubrange(count: 3, lowerBound: 4) @@ -99,8 +99,3 @@ ; CHECK-NEXT: !39 = !DIBasicType(name: "u64.le", size: 64, align: 1, encoding: DW_ATE_unsigned, flags: DIFlagLittleEndian) !41 = !DIBasicType(name: "u64.be", size: 64, align: 1, encoding: DW_ATE_unsigned, flags: DIFlagBigEndian) !42 = !DIBasicType(name: "u64.le", size: 64, align: 1, encoding: DW_ATE_unsigned, flags: DIFlagLittleEndian) - -; CHECK-NEXT: !40 = distinct !DISubprogram(name: "fn", scope: {{.*}}, file: {{.*}}, spFlags: 0) -; CHECK-NEXT: !41 = !DILocalVariable(name: "Name", arg: 1, scope: {{.*}}, file: {{.*}}, line: 13, type: {{.*}}, flags: DIFlagArgumentNotModified) -!43 = distinct !DISubprogram(name: "fn", scope: !12, file: !12, spFlags: 0) -!44 = !DILocalVariable(name: "Name", arg: 1, scope: !43, file: !12, line: 13, type: !7, flags: DIFlagArgumentNotModified) Index: llvm/test/DebugInfo/MIR/Hexagon/live-debug-values-bundled-entry-values.mir =================================================================== --- llvm/test/DebugInfo/MIR/Hexagon/live-debug-values-bundled-entry-values.mir +++ llvm/test/DebugInfo/MIR/Hexagon/live-debug-values-bundled-entry-values.mir @@ -59,13 +59,13 @@ !13 = !DISubroutineType(types: !14) !14 = !{!7, !7} !15 = !{!16} - !16 = !DILocalVariable(name: "arg", arg: 1, scope: !12, file: !1, line: 3, type: !7, flags: DIFlagArgumentNotModified) + !16 = !DILocalVariable(name: "arg", arg: 1, scope: !12, file: !1, line: 3, type: !7) !17 = !DILocation(line: 0, scope: !12) !18 = !DILocation(line: 4, scope: !12) !19 = !DILocation(line: 5, scope: !12) !20 = distinct !DISubprogram(name: "bar", scope: !1, file: !1, line: 8, type: !13, scopeLine: 8, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !21) !21 = !{!22} - !22 = !DILocalVariable(name: "arg", arg: 1, scope: !20, file: !1, line: 8, type: !7, flags: DIFlagArgumentNotModified) + !22 = !DILocalVariable(name: "arg", arg: 1, scope: !20, file: !1, line: 8, type: !7) !23 = !DILocation(line: 0, scope: !20) !24 = !DILocation(line: 9, scope: !20) !25 = !DILocation(line: 9, scope: !26) Index: llvm/test/DebugInfo/MIR/X86/DW_OP_entry_value.mir =================================================================== --- llvm/test/DebugInfo/MIR/X86/DW_OP_entry_value.mir +++ llvm/test/DebugInfo/MIR/X86/DW_OP_entry_value.mir @@ -51,9 +51,9 @@ !12 = !DISubroutineType(types: !13) !13 = !{!6, !6, !6, !6} !14 = !{!15, !16, !17} - !15 = !DILocalVariable(name: "p", arg: 1, scope: !11, file: !3, line: 9, type: !6, flags: DIFlagArgumentNotModified) - !16 = !DILocalVariable(name: "q", arg: 2, scope: !11, file: !3, line: 9, type: !6, flags: DIFlagArgumentNotModified) - !17 = !DILocalVariable(name: "r", arg: 3, scope: !11, file: !3, line: 9, type: !6, flags: DIFlagArgumentNotModified) + !15 = !DILocalVariable(name: "p", arg: 1, scope: !11, file: !3, line: 9, type: !6) + !16 = !DILocalVariable(name: "q", arg: 2, scope: !11, file: !3, line: 9, type: !6) + !17 = !DILocalVariable(name: "r", arg: 3, scope: !11, file: !3, line: 9, type: !6) !18 = !DILocation(line: 9, column: 13, scope: !11) !19 = !{i32 213} Index: llvm/test/DebugInfo/MIR/X86/avoid-single-entry-value-location.mir =================================================================== --- llvm/test/DebugInfo/MIR/X86/avoid-single-entry-value-location.mir +++ llvm/test/DebugInfo/MIR/X86/avoid-single-entry-value-location.mir @@ -45,7 +45,7 @@ !13 = !DISubroutineType(types: !14) !14 = !{null, !7, !7} !15 = !{!16, !17} - !16 = !DILocalVariable(name: "x", arg: 1, scope: !12, file: !1, line: 5, type: !7, flags: DIFlagArgumentNotModified) + !16 = !DILocalVariable(name: "x", arg: 1, scope: !12, file: !1, line: 5, type: !7) !17 = !DILocalVariable(name: "y", scope: !12, file: !1, line: 5, type: !7) !18 = !DILocation(line: 0, scope: !12) Index: llvm/test/DebugInfo/MIR/X86/dbgcall-site-interpretation.mir =================================================================== --- llvm/test/DebugInfo/MIR/X86/dbgcall-site-interpretation.mir +++ llvm/test/DebugInfo/MIR/X86/dbgcall-site-interpretation.mir @@ -104,9 +104,9 @@ !12 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) !13 = !{!14, !15, !16, !17, !18, !19, !20} !14 = !DILocalVariable(name: "arg1", arg: 1, scope: !9, file: !1, line: 10, type: !12) - !15 = !DILocalVariable(name: "arg2", arg: 2, scope: !9, file: !1, line: 10, type: !12, flags: DIFlagArgumentNotModified) + !15 = !DILocalVariable(name: "arg2", arg: 2, scope: !9, file: !1, line: 10, type: !12) !16 = !DILocalVariable(name: "arg3", arg: 3, scope: !9, file: !1, line: 10, type: !12) - !17 = !DILocalVariable(name: "arg4", arg: 4, scope: !9, file: !1, line: 10, type: !12, flags: DIFlagArgumentNotModified) + !17 = !DILocalVariable(name: "arg4", arg: 4, scope: !9, file: !1, line: 10, type: !12) !18 = !DILocalVariable(name: "local1", scope: !9, file: !1, line: 11, type: !12) !19 = !DILocalVariable(name: "local2", scope: !9, file: !1, line: 11, type: !12) !20 = !DILocalVariable(name: "local3", scope: !9, file: !1, line: 11, type: !12) Index: llvm/test/DebugInfo/MIR/X86/dbginfo-entryvals.mir =================================================================== --- llvm/test/DebugInfo/MIR/X86/dbginfo-entryvals.mir +++ llvm/test/DebugInfo/MIR/X86/dbginfo-entryvals.mir @@ -56,10 +56,10 @@ !11 = !{null, !12, !12} !12 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) !13 = !{!14, !15, !16, !17} - !14 = !DILocalVariable(name: "x", arg: 1, scope: !9, file: !1, line: 15, type: !12, flags: DIFlagArgumentNotModified) - !15 = !DILocalVariable(name: "y", arg: 2, scope: !9, file: !1, line: 15, type: !12, flags: DIFlagArgumentNotModified) - !16 = !DILocalVariable(name: "u", scope: !9, file: !1, line: 16, type: !12, flags: DIFlagArgumentNotModified) - !17 = !DILocalVariable(name: "a", scope: !9, file: !1, line: 21, type: !12, flags: DIFlagArgumentNotModified) + !14 = !DILocalVariable(name: "x", arg: 1, scope: !9, file: !1, line: 15, type: !12) + !15 = !DILocalVariable(name: "y", arg: 2, scope: !9, file: !1, line: 15, type: !12) + !16 = !DILocalVariable(name: "u", scope: !9, file: !1, line: 16, type: !12) + !17 = !DILocalVariable(name: "a", scope: !9, file: !1, line: 21, type: !12) !18 = !DILocation(line: 15, column: 10, scope: !9) ... Index: llvm/test/DebugInfo/MIR/X86/debug-call-site-param.mir =================================================================== --- llvm/test/DebugInfo/MIR/X86/debug-call-site-param.mir +++ llvm/test/DebugInfo/MIR/X86/debug-call-site-param.mir @@ -120,9 +120,9 @@ !12 = !{null, !13, !13, !13} !13 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) !14 = !{!15, !16, !17, !18} - !15 = !DILocalVariable(name: "arg1", arg: 1, scope: !10, file: !1, line: 4, type: !13, flags: DIFlagArgumentNotModified) - !16 = !DILocalVariable(name: "arg2", arg: 2, scope: !10, file: !1, line: 4, type: !13, flags: DIFlagArgumentNotModified) - !17 = !DILocalVariable(name: "arg3", arg: 3, scope: !10, file: !1, line: 4, type: !13, flags: DIFlagArgumentNotModified) + !15 = !DILocalVariable(name: "arg1", arg: 1, scope: !10, file: !1, line: 4, type: !13) + !16 = !DILocalVariable(name: "arg2", arg: 2, scope: !10, file: !1, line: 4, type: !13) + !17 = !DILocalVariable(name: "arg3", arg: 3, scope: !10, file: !1, line: 4, type: !13) !18 = !DILocalVariable(name: "local1", scope: !10, file: !1, line: 5, type: !13) !19 = !DILocation(line: 4, column: 14, scope: !10) !20 = !DILocation(line: 4, column: 24, scope: !10) Index: llvm/test/DebugInfo/MIR/X86/multiple-param-dbg-value-entry.mir =================================================================== --- llvm/test/DebugInfo/MIR/X86/multiple-param-dbg-value-entry.mir +++ llvm/test/DebugInfo/MIR/X86/multiple-param-dbg-value-entry.mir @@ -53,9 +53,9 @@ !12 = !DISubroutineType(types: !13) !13 = !{!6, !6, !6, !6} !14 = !{!15, !16, !17} - !15 = !DILocalVariable(name: "p", arg: 1, scope: !11, file: !3, line: 9, type: !6, flags: DIFlagArgumentNotModified) - !16 = !DILocalVariable(name: "q", arg: 2, scope: !11, file: !3, line: 9, type: !6, flags: DIFlagArgumentNotModified) - !17 = !DILocalVariable(name: "r", arg: 3, scope: !11, file: !3, line: 9, type: !6, flags: DIFlagArgumentNotModified) + !15 = !DILocalVariable(name: "p", arg: 1, scope: !11, file: !3, line: 9, type: !6) + !16 = !DILocalVariable(name: "q", arg: 2, scope: !11, file: !3, line: 9, type: !6) + !17 = !DILocalVariable(name: "r", arg: 3, scope: !11, file: !3, line: 9, type: !6) !18 = !DILocation(line: 9, column: 13, scope: !11) !19 = !{i32 213} Index: llvm/test/DebugInfo/Mips/entry-value-non-empty-expr.ll =================================================================== --- llvm/test/DebugInfo/Mips/entry-value-non-empty-expr.ll +++ llvm/test/DebugInfo/Mips/entry-value-non-empty-expr.ll @@ -75,6 +75,6 @@ !17 = !{null, !18} !18 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !7, size: 32) !19 = !{!20} -!20 = !DILocalVariable(name: "p", arg: 1, scope: !15, file: !1, line: 5, type: !18, flags: DIFlagArgumentNotModified) +!20 = !DILocalVariable(name: "p", arg: 1, scope: !15, file: !1, line: 5, type: !18) !21 = !DILocation(line: 0, scope: !15) !22 = !DILocation(line: 5, scope: !15) Index: llvm/test/tools/llvm-dwarfdump/X86/locstats.ll =================================================================== --- llvm/test/tools/llvm-dwarfdump/X86/locstats.ll +++ llvm/test/tools/llvm-dwarfdump/X86/locstats.ll @@ -191,8 +191,8 @@ !17 = !DISubroutineType(types: !18) !18 = !{null, !7, !7} !19 = !{!20, !21, !22, !23} -!20 = !DILocalVariable(name: "x", arg: 1, scope: !16, file: !1, line: 6, type: !7, flags: DIFlagArgumentNotModified) -!21 = !DILocalVariable(name: "y", arg: 2, scope: !16, file: !1, line: 6, type: !7, flags: DIFlagArgumentNotModified) +!20 = !DILocalVariable(name: "x", arg: 1, scope: !16, file: !1, line: 6, type: !7) +!21 = !DILocalVariable(name: "y", arg: 2, scope: !16, file: !1, line: 6, type: !7) !22 = !DILocalVariable(name: "u", scope: !16, file: !1, line: 8, type: !7) !23 = !DILocalVariable(name: "a", scope: !16, file: !1, line: 18, type: !7) !24 = !DILocation(line: 0, scope: !16) Index: llvm/test/tools/llvm-dwarfdump/X86/stats-dbg-callsite-info.ll =================================================================== --- llvm/test/tools/llvm-dwarfdump/X86/stats-dbg-callsite-info.ll +++ llvm/test/tools/llvm-dwarfdump/X86/stats-dbg-callsite-info.ll @@ -64,9 +64,9 @@ !12 = !{null, !13, !13, !13} !13 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) !14 = !{!15, !16, !17, !18} -!15 = !DILocalVariable(name: "arg1", arg: 1, scope: !10, file: !1, line: 4, type: !13, flags: DIFlagArgumentNotModified) -!16 = !DILocalVariable(name: "arg2", arg: 2, scope: !10, file: !1, line: 4, type: !13, flags: DIFlagArgumentNotModified) -!17 = !DILocalVariable(name: "arg3", arg: 3, scope: !10, file: !1, line: 4, type: !13, flags: DIFlagArgumentNotModified) +!15 = !DILocalVariable(name: "arg1", arg: 1, scope: !10, file: !1, line: 4, type: !13) +!16 = !DILocalVariable(name: "arg2", arg: 2, scope: !10, file: !1, line: 4, type: !13) +!17 = !DILocalVariable(name: "arg3", arg: 3, scope: !10, file: !1, line: 4, type: !13) !18 = !DILocalVariable(name: "local1", scope: !10, file: !1, line: 5, type: !13) !19 = !DILocation(line: 4, column: 14, scope: !10) !20 = !DILocation(line: 4, column: 24, scope: !10) Index: llvm/test/tools/llvm-dwarfdump/X86/valid-call-site-GNU-extensions.ll =================================================================== --- llvm/test/tools/llvm-dwarfdump/X86/valid-call-site-GNU-extensions.ll +++ llvm/test/tools/llvm-dwarfdump/X86/valid-call-site-GNU-extensions.ll @@ -90,7 +90,7 @@ !17 = !{null, !18} !18 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !7, size: 64) !19 = !{!20, !21} -!20 = !DILocalVariable(name: "arg", arg: 1, scope: !15, file: !1, line: 6, type: !18, flags: DIFlagArgumentNotModified) +!20 = !DILocalVariable(name: "arg", arg: 1, scope: !15, file: !1, line: 6, type: !18) !21 = !DILocalVariable(name: "a", scope: !15, file: !1, line: 7, type: !7) !22 = !DILocation(line: 0, scope: !15) !23 = !DILocation(line: 7, column: 11, scope: !15)