Page MenuHomePhabricator

aprantl (Adrian Prantl)
User

Projects

User Details

User Since
Mar 2 2013, 8:12 AM (333 w, 1 d)

Recent Activity

Tue, Jul 2

aprantl added inline comments to D64036: [Bitcode] Update CHECK-DAG usage in tests.
Tue, Jul 2, 9:46 AM · Restricted Project
aprantl added a comment to D64006: [Support] Support 64-bit offsets in DataExtractor..

Thank you for demonstrating this! I agree that the patch also introduces lots of opportunities for subtle bugs. It also increases the memory footprint in places where it likely won't be needed any time soon, such as 64-bit DWARF parsing support. This patch looks much more palatable to me now and I'd be okay with taking it if @dblaikie is okay with it. Is there danger in using the same function name or should we call the 64-bit variants something more explicit?

Tue, Jul 2, 9:42 AM · Restricted Project
aprantl added a comment to D64059: [DO NOT SUBMIT] Switch DataExtractor to 64-bit offsets.

In a few cases it may be beneficial to reorder struct elements such that groups of 32-bit or smaller elements aren't interrupted by a 64-bit element for better packing.

Tue, Jul 2, 9:34 AM

Mon, Jul 1

aprantl added inline comments to D64006: [Support] Support 64-bit offsets in DataExtractor..
Mon, Jul 1, 1:42 PM · Restricted Project
aprantl added inline comments to D58042: [LiveDebugValues] Emit parameter's entry value.
Mon, Jul 1, 10:10 AM · Restricted Project, debug-info
aprantl added inline comments to D64006: [Support] Support 64-bit offsets in DataExtractor..
Mon, Jul 1, 10:06 AM · Restricted Project

Sat, Jun 29

aprantl committed rG6293cd05045c: Replace tabs with spaces. (authored by aprantl).
Replace tabs with spaces.
Sat, Jun 29, 11:33 AM

Fri, Jun 28

aprantl added a reviewer for D63828: Add FileWriter to GSYM and encode/decode functions to AddressRange and AddressRanges: vsk.
Fri, Jun 28, 4:32 PM · Restricted Project
aprantl requested changes to D63828: Add FileWriter to GSYM and encode/decode functions to AddressRange and AddressRanges.

We need to come up with a better error handling strategy before this can be landed.

Fri, Jun 28, 4:32 PM · Restricted Project

Thu, Jun 27

aprantl committed rG559c6e17cd88: Make nrvo-string test more robust. (authored by aprantl).
Make nrvo-string test more robust.
Thu, Jun 27, 1:39 PM
aprantl added a comment to D63828: Add FileWriter to GSYM and encode/decode functions to AddressRange and AddressRanges.

The important part is that the error must be checked (which isn't enforceable through bool returns). Whether it's after each function call or later, you probably have a better idea about.

Thu, Jun 27, 1:20 PM · Restricted Project
aprantl added a comment to D63828: Add FileWriter to GSYM and encode/decode functions to AddressRange and AddressRanges.

JF is currently working on making BitStream error-safe over in https://reviews.llvm.org/D63518. Perhaps there are some patterns that are worth copying.

Thu, Jun 27, 10:31 AM · Restricted Project
aprantl committed rG3b4a667854e0: Add a sanity check to the domain socket tests. (authored by aprantl).
Add a sanity check to the domain socket tests.
Thu, Jun 27, 9:47 AM

Wed, Jun 26

aprantl added inline comments to D63828: Add FileWriter to GSYM and encode/decode functions to AddressRange and AddressRanges.
Wed, Jun 26, 4:58 PM · Restricted Project
aprantl added inline comments to D63828: Add FileWriter to GSYM and encode/decode functions to AddressRange and AddressRanges.
Wed, Jun 26, 2:30 PM · Restricted Project
aprantl added inline comments to D63240: [Core] Generalize ValueObject::IsRuntimeSupportValue.
Wed, Jun 26, 2:23 PM · Restricted Project
aprantl committed rG8ac899c6003c: Make nrvo-string test more robust. (authored by aprantl).
Make nrvo-string test more robust.
Wed, Jun 26, 1:06 PM
aprantl added inline comments to D63240: [Core] Generalize ValueObject::IsRuntimeSupportValue.
Wed, Jun 26, 11:40 AM · Restricted Project
aprantl added inline comments to D63828: Add FileWriter to GSYM and encode/decode functions to AddressRange and AddressRanges.
Wed, Jun 26, 11:36 AM · Restricted Project
aprantl accepted D56151: [DebugInfo] PR40010: Avoid register coalesing altering DBG_VALUE valuations.
Wed, Jun 26, 11:31 AM · Restricted Project

Tue, Jun 25

aprantl added a comment to D56151: [DebugInfo] PR40010: Avoid register coalesing altering DBG_VALUE valuations.

Ping: we should hammer out this review, seeing how the branch date for llvm-9 has been announced. Could I suggest that everyone is happy with the *implementation* of this patch, but that it's not yet agreed that it needs merging?

The patch effectively makes the codegen backend stricter about what DBG_VALUE insts it will accept, i.e. they have to refer to vregs that are alive. If it helps, this is already something that's enforced a few optimisation passes later in LiveDebugVariables [0], this patch just brings that check further forwards, due to the errors that can be introduced (described above). What's unfortunate is that this also prevents occasions where register coalescing re-enlivens DBG_VALUEs with a vreg that has the right value in it, occasions which can be generated due to limitations in SelectionDAG.

This then becomes a trade-off (see immediately preceeding comment) of whether the problem is so bad that we should trade some lost locations for getting rid of placeDbgValues. IMHO: yes, because we're trading definitely-incorrect locations for some more being optimized-out, a net reduction in error, to me. Other opinions most welcome.

[0] https://github.com/llvm/llvm-project/blob/b9f1e7b16ed2341e54b4e2033d111e7a2ca19b9a/llvm/lib/CodeGen/LiveDebugVariables.cpp#L624

Tue, Jun 25, 2:21 PM · Restricted Project
aprantl added inline comments to D63104: Add GSYM utility files along with unit tests..
Tue, Jun 25, 1:59 PM · Restricted Project
aprantl committed rG510f4098ae04: Add a defensive check for nullptr as in the block above. (authored by aprantl).
Add a defensive check for nullptr as in the block above.
Tue, Jun 25, 12:54 PM
aprantl added a comment to D63110: Fix a crash in option parsing..

Thanks!

Tue, Jun 25, 10:50 AM · Restricted Project, Restricted Project
aprantl added inline comments to D63240: [Core] Generalize ValueObject::IsRuntimeSupportValue.
Tue, Jun 25, 10:35 AM · Restricted Project

Mon, Jun 24

aprantl committed rGc8e8b274f1c0: Reapply "Fix a crash in option parsing." (authored by aprantl).
Reapply "Fix a crash in option parsing."
Mon, Jun 24, 5:56 PM
aprantl added inline comments to D63240: [Core] Generalize ValueObject::IsRuntimeSupportValue.
Mon, Jun 24, 4:19 PM · Restricted Project
aprantl added a comment to D61062: Keep call site info valid through the backend.

looks good!

Mon, Jun 24, 4:07 PM · Restricted Project, debug-info
aprantl added a comment to D58042: [LiveDebugValues] Emit parameter's entry value.

A rebase shouldn't affect the spirit of the change :-)

Mon, Jun 24, 4:06 PM · Restricted Project, debug-info

Jun 19 2019

aprantl added a comment to D60831: [DebugInfo@O2][LoopVectorize] pr39024: Vectorized code linenos step through loop even after completion.

Thanks for your help!

Jun 19 2019, 6:26 AM · debug-info, Restricted Project

Jun 18 2019

aprantl committed rGfc5107cde644: Add debug location verification for !llvm.loop attachments. (authored by aprantl).
Add debug location verification for !llvm.loop attachments.
Jun 18 2019, 1:06 PM
aprantl committed rG1db8d4a8660f: Fix broken debug info in in an !llvm.loop attachment in this testcase. (authored by aprantl).
Fix broken debug info in in an !llvm.loop attachment in this testcase.
Jun 18 2019, 1:05 PM
aprantl committed rGacc93d62e048: Revert Add debug location verification for !llvm.loop attachments. (authored by aprantl).
Revert Add debug location verification for !llvm.loop attachments.
Jun 18 2019, 12:52 PM
aprantl committed rG8ff822d61dac: Add debug location verification for !llvm.loop attachments. (authored by aprantl).
Add debug location verification for !llvm.loop attachments.
Jun 18 2019, 12:41 PM
aprantl added a comment to D63361: Pretend NRVO variables are references so they can be found by debug info.

Thanks, this addresses my concern!

Jun 18 2019, 11:03 AM · debug-info, Restricted Project, Restricted Project
aprantl added a comment to D60831: [DebugInfo@O2][LoopVectorize] pr39024: Vectorized code linenos step through loop even after completion.

I put up a Verifier patch at https://reviews.llvm.org/D63499. Once that patch has landed, this patch should be safe to re-apply.

Jun 18 2019, 9:52 AM · debug-info, Restricted Project
aprantl created D63499: Add debug location verification for !llvm.loop attachments.
Jun 18 2019, 9:52 AM · Restricted Project, debug-info

Jun 17 2019

aprantl committed rG2d26cf37d777: llgdb.py: Make sure to clean up the debugger on exit. (authored by aprantl).
llgdb.py: Make sure to clean up the debugger on exit.
Jun 17 2019, 1:04 PM
aprantl added inline comments to D63429: [DebugInfo] Avoid adding too much indirection to pointer-valued variables.
Jun 17 2019, 10:11 AM · Restricted Project
aprantl added a project to D63387: clang: Promote -fdebug-compilation-dir from cc1 flag to driver-level flag: debug-info.
Jun 17 2019, 10:07 AM · debug-info, Restricted Project
aprantl added a comment to D60831: [DebugInfo@O2][LoopVectorize] pr39024: Vectorized code linenos step through loop even after completion.

This seems to be a case of having old, incorrect, metadata baked into the test.
The 'startLoc' (!680) and 'endLoc' (!681) in loop metadta for loop !679 are both
missing an 'inlinedAt' node.

Jun 17 2019, 10:02 AM · debug-info, Restricted Project
aprantl added a comment to D63083: [DebugInfo][Docs] Document that prologue/epilogue variable location changes are ignored.

I think this is good to go.

Jun 17 2019, 9:49 AM · Restricted Project

Jun 14 2019

aprantl requested changes to D63361: Pretend NRVO variables are references so they can be found by debug info.
Jun 14 2019, 4:25 PM · debug-info, Restricted Project, Restricted Project
aprantl added a project to D63361: Pretend NRVO variables are references so they can be found by debug info: debug-info.
Jun 14 2019, 4:21 PM · debug-info, Restricted Project, Restricted Project
aprantl accepted D62743: Add color to the default thread and frame format..
Jun 14 2019, 3:01 PM · Restricted Project, Restricted Project
aprantl added inline comments to D63104: Add GSYM utility files along with unit tests..
Jun 14 2019, 1:16 PM · Restricted Project
aprantl added inline comments to D63322: DWARF: Avoid storing DIERefs in long-lived containers.
Jun 14 2019, 1:13 PM · Restricted Project
aprantl accepted D61062: Keep call site info valid through the backend.
Jun 14 2019, 1:09 PM · Restricted Project, debug-info
aprantl committed rG573ffd88a0e3: Python 3: decode string as utf-8 to avoid type mismatch. (authored by aprantl).
Python 3: decode string as utf-8 to avoid type mismatch.
Jun 14 2019, 8:38 AM
aprantl committed rG38be2c65b629: Make crashlog.py less noisy (authored by aprantl).
Make crashlog.py less noisy
Jun 14 2019, 8:38 AM
aprantl updated the diff for D63311: Python 3: decode string as utf-8 to avoid type mismatch..

Address review feedback.

Jun 14 2019, 8:31 AM · Restricted Project, Restricted Project

Jun 13 2019

aprantl created D63311: Python 3: decode string as utf-8 to avoid type mismatch..
Jun 13 2019, 6:24 PM · Restricted Project, Restricted Project
aprantl created D63310: Make crashlog.py less noisy.
Jun 13 2019, 5:31 PM · Restricted Project, Restricted Project
aprantl added inline comments to D63286: [GlobalISel][IRTranslator] Don't add debug info to constants emitted into the entry block.
Jun 13 2019, 12:49 PM · debug-info, Restricted Project
aprantl accepted D63171: Don't try to parse ObjC method if CU isn't ObjC.

Thanks!

Jun 13 2019, 12:46 PM · Restricted Project
aprantl accepted D63275: [docs][llvm-dwarfdump] Make the --show-parents and --show-children help text and docs more consistent and correct.
Jun 13 2019, 11:20 AM · Restricted Project
aprantl added inline comments to D63286: [GlobalISel][IRTranslator] Don't add debug info to constants emitted into the entry block.
Jun 13 2019, 11:11 AM · debug-info, Restricted Project
aprantl added a reviewer for D63286: [GlobalISel][IRTranslator] Don't add debug info to constants emitted into the entry block: vsk.
Jun 13 2019, 11:11 AM · debug-info, Restricted Project

Jun 12 2019

aprantl accepted D63229: [Reproducers] Include lldb version in the reproducer root.
Jun 12 2019, 3:27 PM · Restricted Project, Restricted Project
aprantl added inline comments to D63229: [Reproducers] Include lldb version in the reproducer root.
Jun 12 2019, 2:44 PM · Restricted Project, Restricted Project
aprantl added a reviewer for D63228: [llvm] Expose DWARFDebugLine::LineTable::getFileNameEntry: JDevlieghere.
Jun 12 2019, 2:40 PM · debug-info, Restricted Project
aprantl committed rG87f75ecd720a: Skip failing test on older versions of clang. (authored by aprantl).
Skip failing test on older versions of clang.
Jun 12 2019, 2:30 PM
aprantl accepted D63213: [DebugInfo] Move Value struct out of DebugLocEntry as DbgValueLoc (NFC).
Jun 12 2019, 9:41 AM · Restricted Project, debug-info
aprantl accepted D62904: [DebugInfo] Honour variable fragments in LiveDebugValues.

One last nit inline. Thanks!

Jun 12 2019, 8:33 AM · Restricted Project
aprantl added a comment to D60831: [DebugInfo@O2][LoopVectorize] pr39024: Vectorized code linenos step through loop even after completion.

Thanks for the quick response! Please let me know if I can help debugging this.

Jun 12 2019, 8:28 AM · debug-info, Restricted Project

Jun 11 2019

aprantl added a comment to D63171: Don't try to parse ObjC method if CU isn't ObjC.

I suppose one could compile Objective-C code on Linux using GCC.

Will GCC not set the language to ObjC or ObjC++?

Jun 11 2019, 5:33 PM · Restricted Project
aprantl added a comment to D60831: [DebugInfo@O2][LoopVectorize] pr39024: Vectorized code linenos step through loop even after completion.

This patch broke our internal CI. You can reproduce the issue by downloading https://gist.github.com/adrian-prantl/ba88912878db855ec96534e6510246e6 (this is AArch64 bitcode for a file in the Swift stdlib) and running

Jun 11 2019, 4:37 PM · debug-info, Restricted Project
aprantl added a comment to D63171: Don't try to parse ObjC method if CU isn't ObjC.

I suppose one could compile Objective-C code on Linux using GCC.

Jun 11 2019, 4:02 PM · Restricted Project
aprantl added a comment to D63119: hwasan: Add a tag_offset DWARF attribute to instrumented stack variables..

Hmm, I'm not sure what else we need aside from the existing isValid() check in Verifier::visitDIExpression.

Jun 11 2019, 2:31 PM · Restricted Project
aprantl added a comment to D62904: [DebugInfo] Honour variable fragments in LiveDebugValues.

I think this is starting to look good!

Jun 11 2019, 2:28 PM · Restricted Project
aprantl committed rGe6130a309094: Fix a crash in option parsing. (authored by aprantl).
Fix a crash in option parsing.
Jun 11 2019, 2:13 PM
aprantl added a comment to D62904: [DebugInfo] Honour variable fragments in LiveDebugValues.

Stylistic nit: unless this will push a lot of lines > 80 columns and kill readability, I would prefer Fragment over Frag.

Jun 11 2019, 9:56 AM · Restricted Project
aprantl added a comment to D63119: hwasan: Add a tag_offset DWARF attribute to instrumented stack variables..

Can you please add this to either LangRef.rst or SourceLevelDebugging.rst and also explain how this operation composes with other DIExpressions? I'm thinking particularly about DW_OP_LLVM_fragment.
This also needs an assembler round-trip-test and probably some checks in Verifier.cpp.

Jun 11 2019, 9:44 AM · Restricted Project
aprantl updated subscribers of D63119: hwasan: Add a tag_offset DWARF attribute to instrumented stack variables..
Jun 11 2019, 9:39 AM · Restricted Project

Jun 10 2019

aprantl added a comment to D63013: [llvm-dwarfdump] Add -o to help text and remove --out-file from documentation.

dwarfdump(-classic) on macOS also supported the --out-file option and on macOS we strive for compatibility with the older tool.

Jun 10 2019, 5:08 PM · Restricted Project
aprantl created D63110: Fix a crash in option parsing..
Jun 10 2019, 4:59 PM · Restricted Project, Restricted Project
aprantl accepted D63013: [llvm-dwarfdump] Add -o to help text and remove --out-file from documentation.

I'm mildly against this change. IIRC, the idea was that --out-file is a long-form option that nobody uses in practice and we wanted people to prefer -o instead, which is what people are most familiar with working with compilers. So if -o shows up in the --help output, I'd leave it at that.

Could we just delete --out-file, if we don't want people to use it?

Jun 10 2019, 4:15 PM · Restricted Project
aprantl added a comment to D62904: [DebugInfo] Honour variable fragments in LiveDebugValues.

It's my belief that that's how SROA works, but I don't think it's a documented guarantee. SROA::splitAlloca certainly seems to completely rewrite dbg.declare's into ones that all use fragments. The verifier doesn't attempt to enforce this rule though.

Jun 10 2019, 4:11 PM · Restricted Project
aprantl added inline comments to rG3027a2999c32: [dsymutil] Support more than 4 architectures.
Jun 10 2019, 1:44 PM

Jun 8 2019

aprantl added a comment to D63013: [llvm-dwarfdump] Add -o to help text and remove --out-file from documentation.

That said, if clang also documents -o as --out-file, I think consistency wins.

Jun 8 2019, 8:59 AM · Restricted Project
aprantl added a comment to D63013: [llvm-dwarfdump] Add -o to help text and remove --out-file from documentation.

I'm mildly against this change. IIRC, the idea was that --out-file is a long-form option that nobody uses in practice and we wanted people to prefer -o instead, which is what people are most familiar with working with compilers. So if -o shows up in the --help output, I'd leave it at that.

Jun 8 2019, 8:58 AM · Restricted Project

Jun 7 2019

aprantl added inline comments to D63005: DWARF: Don't create lldb CompileUnits for DWARF type units.
Jun 7 2019, 2:23 PM · Restricted Project
aprantl added inline comments to D62894: DWARF: Share line tables of type units.
Jun 7 2019, 2:23 PM · Restricted Project
aprantl requested changes to D61062: Keep call site info valid through the backend.

(marking as "request changes", so I don't forget to reply to the question, otherwise this will get lost in my inbox)

Jun 7 2019, 2:16 PM · Restricted Project, debug-info
aprantl added a comment to D61600: [DebugInfo] More precise variable range for stack locations.

Thanks, that looks like an acceptable performance/accuracy tradeoff.

Jun 7 2019, 2:06 PM · Restricted Project, debug-info
aprantl accepted D62684: [X86] Fixup LEAs - Fix inconsistent codegen with/without debug info.
Jun 7 2019, 2:06 PM · Restricted Project

Jun 4 2019

aprantl added a comment to D62650: [DebugInfo] DBG_VALUE instruction generated for loop counter is placed incorrectly..

And thanks for doing the measurements!

Jun 4 2019, 8:58 PM · debug-info, Restricted Project
aprantl added a comment to D60713: [IR] Add DISuprogram and DIE for func decl of an external.

Thanks!

Jun 4 2019, 8:58 PM · Restricted Project, debug-info
aprantl accepted D62650: [DebugInfo] DBG_VALUE instruction generated for loop counter is placed incorrectly..

I'm kind of curious where the performance is gained back, but generally, if the performance is the same, we can tentatively land this. Please be quick to revert if complaints about the performance resurface.

Jun 4 2019, 8:57 PM · debug-info, Restricted Project

Jun 3 2019

aprantl added a comment to D62650: [DebugInfo] DBG_VALUE instruction generated for loop counter is placed incorrectly..

Have you looked at the performance of the example posted in https://bugs.llvm.org/show_bug.cgi?id=33730 ?

Jun 3 2019, 9:25 AM · debug-info, Restricted Project
aprantl added a comment to D62650: [DebugInfo] DBG_VALUE instruction generated for loop counter is placed incorrectly..

Have you looked at the performance of the example posted in https://bugs.llvm.org/show_bug.cgi?id=33730 ?

Jun 3 2019, 9:15 AM · debug-info, Restricted Project
aprantl added a comment to D62743: Add color to the default thread and frame format..

Sorry, I got more comments :-)

Jun 3 2019, 8:59 AM · Restricted Project, Restricted Project
aprantl accepted D61062: Keep call site info valid through the backend.
Jun 3 2019, 8:59 AM · Restricted Project, debug-info
aprantl accepted D61940: [DebugInfo] Don't always extend variable locations when the reg location is unchanging.

The assumption that stack variable locations run to the end of a function, even over the frame destruction, is seen in GCC here [0].

Jun 3 2019, 8:53 AM · Restricted Project
aprantl added inline comments to D62684: [X86] Fixup LEAs - Fix inconsistent codegen with/without debug info.
Jun 3 2019, 8:52 AM · Restricted Project
aprantl added inline comments to D62684: [X86] Fixup LEAs - Fix inconsistent codegen with/without debug info.
Jun 3 2019, 8:52 AM · Restricted Project
aprantl added a comment to D61600: [DebugInfo] More precise variable range for stack locations.

Have you tested the performance when compiling Clang with ASAN enabled to make sure we're not accidentally regressing because of the more thorough single-location check?

I've built LLVM with '-DLLVM_USE_SANITIZER=Address' using downloaded clang binary to produce private clang binary. I've run tests and compiled latest version of gdb with new private binary and I didn't see any regression there. Is that what you meant?

I think that the idea was to see if this patch increases the compilation time when building such a Clang binary.

(Just make sure to use the RelWithDebInfo build type also.)

Jun 3 2019, 8:45 AM · Restricted Project, debug-info
aprantl accepted D62805: [DebugInfo] Fix possible invalid dereference of non-engaged Optional..
Jun 3 2019, 8:41 AM · Restricted Project
aprantl added a comment to D62650: [DebugInfo] DBG_VALUE instruction generated for loop counter is placed incorrectly..

I'm reposting your reply with an easier to read format:

log(before this patch) :

512B bb.2.for.body:

520B renamable $x8 = MOVaddr target-flags(aarch64-page) @array, target-flags(aarch64-pageoff, aarch64-nc) @array, debug-location !54; test_debug_val.cpp:16:17
524B renamable $w9 = MOVi32imm 56, debug-location !54; test_debug_val.cpp:16:17

DBG_VALUE $x19, $noreg, !"i", !DIExpression(), debug-location !51; test_debug_val.cpp:0 line no:14
544B STRWroX killed renamable $w9, killed renamable $x8, renamable $x19, 0, 1, debug-location !54 :: (store 4 into %ir.scevgep, !tbaa !38); test_debug_val.cpp:16:17

!51 = !DILocation(line: 0, scope: !35)
!52 = !DILocation(line: 14, column: 4, scope: !35)
!53 = !DILocation(line: 21, column: 4, scope: !14)
!54 = !DILocation(line: 16, column: 8, scope: !55)

short log :

512B bb.2.for.body:

520B $x8 = MOVaddr scope: !55
524B $w9 = MOVi32imm scope: !55

DBG_VALUE $x19, $noreg, !"i" scope: !35
544B STRWroX killed renamable $w9 scope: !55

i.e. DBG_VALUE was inserted into enclosed scope.

The reason for this is that scope identified by MachineInstr :

LiveDebugVariables.cpp:902

const InsnRange &Range : Scope->getRanges()

using InsnRange = std::pair<const MachineInstr *, const MachineInstr *>;

At the moment when scope was created the very first instruction was STRWroX.
So it become start of range. Start slot index(with type of Slot_Block) for
DBG_VALUE was trimmed to this instruction range. But after Register Allocator
there were inserted new MOV instructions before STRWroX with the same scope as STRWroX.
But Slot indices for DBG_VALUE was not updated and scope boundaries was not updated.

Actually Slot indices for DBG_VALUE looks correct without trimming : 512B,848B.
512B points to start of basic block:

512B bb.2.for.body:

which match with definition of slot index of type Slot_Block:

Basic block boundary. Used for live ranges entering and leaving a
/ block without being live in the layout neighbor. Also used as the
/// def slot of PHI-defs.

i.e. 512B,848B actually match with lexical scope and does not require trimming.

Also, trimming this slot index and leaving it of type Slot_Block is a error. Slot_Block should point to start of basic block.

I.setStartUnchecked(RStart); <<< trimmed I.start() is a Slot_Block

This concrete problem could be solved by avoiding trimming for Slot_Block only.

But it looks like trimming also is not required for the original problem test case : live-debug-variables.ll. With and without trimming it generates the same DBG_VALUE instructions :

DBG_VALUE $ecx, $noreg, !"i4", !DIExpression(), debug-location !14; foo.c:3:35 @[ foo.c:8:10 ] line no:3
DBG_VALUE $ebx, $noreg, !"i4", !DIExpression(), debug-location !14; foo.c:3:35 @[ foo.c:8:10 ] line no:3

So in short :

For the problem from D62650: SlotIndex was trimmed incorrectly. It does not require trimming and has incorrect value for Slot_Block after trimming.
Trimming for testcase from D35953 looks unnecessary. With and without trimming it generates the same DBG_VALUE instructions.
Thus it looks like trimming could be removed at all.

Jun 3 2019, 8:33 AM · debug-info, Restricted Project
aprantl added inline comments to D62650: [DebugInfo] DBG_VALUE instruction generated for loop counter is placed incorrectly..
Jun 3 2019, 8:33 AM · debug-info, Restricted Project