[PATCH] D46599: [DbgInfo] Attempt to fix bug 37149

Robert Lougher via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 9 10:52:56 PDT 2018


rob.lougher added a comment.

Have you ran the LLVM regression tests?  In particular, does the test added in https://reviews.llvm.org/D35953 (test/DebugInfo/X86/live-debug-variables.ll) still work as expected?

There is a pass called LexicalScopes.  This computes the lexical scope for a debug location, consisting of a series of instruction ranges.  The code added in https://reviews.llvm.org/D35953 made sure the computed intervals were within the debug location's lexical scope.  If it wasn't it was trimmed to the lexical scope.

Looking at PR37149, you are saying that the locations are wrong due to the trimming.  In this patch you are remembering the original untrimmed start index, and using that instead of the trimmed one.  On the surface this appears to (partially) undo https://reviews.llvm.org/D35953.  However, I can see why the test added in https://reviews.llvm.org/D35953 may still pass (this is why I want you to confirm whether you ran the tests).  https://reviews.llvm.org/D35953 was concerned with the case where a live interval could be incorrectly split during register allocation.  Effectively, this change means we use the trimmed intervals during register allocation, but reinstate the untrimmed starts (not the ends) when re-inserting the debug values (the call to emitDebugValues() actually occurs during the Virtual Register Rewriter).

My main concern is ensuring that https://reviews.llvm.org/D35953 still passes.  However, I am worried that for the trimmed locations to be wrong, the lexical scopes must also be wrong.  I'll be interested to see what the lexical scopes are for your testcase in PR37149.


Repository:
  rL LLVM

https://reviews.llvm.org/D46599





More information about the llvm-commits mailing list