[llvm] r344841 - DebugInfo: Use base address specifiers more aggressively
David Blaikie via llvm-commits
llvm-commits at lists.llvm.org
Sat Oct 20 02:16:49 PDT 2018
Author: dblaikie
Date: Sat Oct 20 02:16:49 2018
New Revision: 344841
URL: http://llvm.org/viewvc/llvm-project?rev=344841&view=rev
Log:
DebugInfo: Use base address specifiers more aggressively
Using a base address specifier even for a single-element range is a size
win for object files (7 words versus 8 words - more significant savings
if the debug info is compressed (since it's 3 words of uncompressable
reloc + 4 compressable words compared to 6 uncompressable reloc + 2
compressable words) - does trade off executable size increase though.
Modified:
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
llvm/trunk/test/DebugInfo/X86/range_reloc.ll
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=344841&r1=344840&r2=344841&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Sat Oct 20 02:16:49 2018
@@ -2163,7 +2163,7 @@ static void emitRangeList(DwarfDebug &DD
// or optnone where there may be holes in a single CU's section
// contributions.
auto *Base = CUBase;
- if (!Base && P.second.size() > 1 &&
+ if (!Base && (P.second.size() > 1 || DwarfVersion < 5) &&
(UseDwarfRangesBaseAddressSpecifier || DwarfVersion >= 5)) {
BaseIsSet = true;
// FIXME/use care: This may not be a useful base address if it's not
Modified: llvm/trunk/test/DebugInfo/X86/range_reloc.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/X86/range_reloc.ll?rev=344841&r1=344840&r2=344841&view=diff
==============================================================================
--- llvm/trunk/test/DebugInfo/X86/range_reloc.ll (original)
+++ llvm/trunk/test/DebugInfo/X86/range_reloc.ll Sat Oct 20 02:16:49 2018
@@ -16,8 +16,21 @@
; smaller (the growth of debug_ranges itself would be more significant).
; COMMON: {{^.Ldebug_ranges0}}
-; COMMON-NEXT: .quad .Lfunc_begin0
-; COMMON-NEXT: .quad .Lfunc_end0
+; NOBASE-NEXT: .quad .Lfunc_begin0
+; NOBASE-NEXT: .quad .Lfunc_end0
+; NOBASE-NEXT: .quad .Lfunc_begin1
+; NOBASE-NEXT: .quad .Lfunc_end1
+; NOBASE-NEXT: .quad .Lfunc_begin3
+; NOBASE-NEXT: .quad .Lfunc_end3
+; NOBASE-NEXT: .quad .Lfunc_begin4
+; NOBASE-NEXT: .quad .Lfunc_end4
+; NOBASE-NEXT: .quad .Lfunc_begin5
+; NOBASE-NEXT: .quad .Lfunc_end5
+
+; BASE-NEXT: .quad -1
+; BASE-NEXT: .quad .Lfunc_begin0
+; BASE-NEXT: .quad .Lfunc_begin0-.Lfunc_begin0
+; BASE-NEXT: .quad .Lfunc_end0-.Lfunc_begin0
; BASE-NEXT: .quad -1
; BASE-NEXT: .quad .Lfunc_begin1
; BASE-NEXT: .quad .Lfunc_begin1-.Lfunc_begin1
@@ -25,15 +38,13 @@
; BASE-NEXT: .quad .Lfunc_begin3-.Lfunc_begin1
; BASE-NEXT: .quad .Lfunc_end3-.Lfunc_begin1
; BASE-NEXT: .quad -1
-; BASE-NEXT: .quad 0
-; NOBASE-NEXT: .quad .Lfunc_begin1
-; NOBASE-NEXT: .quad .Lfunc_end1
-; NOBASE-NEXT: .quad .Lfunc_begin3
-; NOBASE-NEXT: .quad .Lfunc_end3
-; COMMON-NEXT: .quad .Lfunc_begin4
-; COMMON-NEXT: .quad .Lfunc_end4
-; COMMON-NEXT: .quad .Lfunc_begin5
-; COMMON-NEXT: .quad .Lfunc_end5
+; BASE-NEXT: .quad .Lfunc_begin4
+; BASE-NEXT: .quad .Lfunc_begin4-.Lfunc_begin4
+; BASE-NEXT: .quad .Lfunc_end4-.Lfunc_begin4
+; BASE-NEXT: .quad -1
+; BASE-NEXT: .quad .Lfunc_begin5
+; BASE-NEXT: .quad .Lfunc_begin5-.Lfunc_begin5
+; BASE-NEXT: .quad .Lfunc_end5-.Lfunc_begin5
; COMMON-NEXT: .quad 0
; COMMON-NEXT: .quad 0
More information about the llvm-commits
mailing list