[PATCH] D45425: [DebugInfo] Sink related dbg users when sinking in InstCombine

Bjorn Pettersson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 18 09:49:30 PDT 2018


bjope added a subscriber: dexonsmith.
bjope added a comment.

In https://reviews.llvm.org/D45425#1069936, @vsk wrote:

> Thanks, lgtm.
>
> One possible follow-up would be to check for debug info use-before-defs in the verifier, if we aren't already.


The verifier does not catch that today.
There is even a test case verifying that it is OK to have use-before-def, test/Transforms/Inline/local-as-metadata-undominated-use.ll, and it has a comment like this:

  ; Make sure the inliner doesn't crash when a metadata-bridged SSA operand is an
  ; undominated use.
  ;
  ; If we ever add a verifier check to prevent the scenario in this file, it's
  ; fine to delete this testcase.  However, we would need a bitcode upgrade since
  ; such historical IR exists in practice.

There is also a PR27273 (indicating that there have been some attempts in the past by @dexonsmith to enable this kind of verification):  https://bugs.llvm.org/show_bug.cgi?id=27273

So I don't know how big the problem is. I think that it would be nice to at least have an option to turn on the check in the verifier, to make it easier to track down this kind of problems.


Repository:
  rL LLVM

https://reviews.llvm.org/D45425





More information about the llvm-commits mailing list