[all-commits] [llvm/llvm-project] 7c6ca1: [globalisel] Allow backends to report an issue wit...

Daniel Sanders via All-commits all-commits at lists.llvm.org
Thu Apr 16 10:44:10 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 7c6ca18fffdcf935b3b38ffc8697180d60511ffe
      https://github.com/llvm/llvm-project/commit/7c6ca18fffdcf935b3b38ffc8697180d60511ffe
  Author: Daniel Sanders <daniel_l_sanders at apple.com>
  Date:   2020-04-16 (Thu, 16 Apr 2020)

  Changed paths:
    M llvm/include/llvm/CodeGen/GlobalISel/Utils.h
    M llvm/lib/CodeGen/GlobalISel/Utils.cpp

  Log Message:
  -----------
  [globalisel] Allow backends to report an issue without triggering fallback. NFC

Summary:
This will allow us to fix the issue where the lost locations
verifier causes CodeGen changes on lost locations because it
falls back on DAGISel

Reviewers: qcolombet, bogner, aprantl, vsk, paquette

Subscribers: rovka, hiraditya, volkan, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D78261


  Commit: d9085f65db0b39fa53d31fc0533c77e91f2f4a1c
      https://github.com/llvm/llvm-project/commit/d9085f65db0b39fa53d31fc0533c77e91f2f4a1c
  Author: Daniel Sanders <daniel_l_sanders at apple.com>
  Date:   2020-04-16 (Thu, 16 Apr 2020)

  Changed paths:
    M llvm/include/llvm/CodeGen/GlobalISel/Legalizer.h
    A llvm/include/llvm/CodeGen/GlobalISel/LostDebugLocObserver.h
    M llvm/lib/CodeGen/GlobalISel/CMakeLists.txt
    M llvm/lib/CodeGen/GlobalISel/Legalizer.cpp
    A llvm/lib/CodeGen/GlobalISel/LostDebugLocObserver.cpp
    M llvm/unittests/CodeGen/GlobalISel/LegalizerTest.cpp

  Log Message:
  -----------
  [globalisel] Add lost debug locations verifier

Summary:
This verifier tries to ensure that DebugLoc's don't just disappear as
we transform the MIR. It observes the instructions created, erased, and
changed and at checkpoints chosen by the client algorithm verifies the
locations affected by those changes.

In particular, it verifies that:
* Every DebugLoc for an erased/changing instruction is still present on
  at least one new/changed instruction
* Failing that, that there is a line-0 location in the new/changed
  instructions. It's not possible to confirm which locations were merged so
  it conservatively assumes all unaccounted for locations are accounted
  for by any line-0 location to avoid false positives.
If that fails, it prints the lost locations in the debug output along with
the instructions that should have accounted for them.

In theory, this is usable by the legalizer, combiner, selector and any other
pass that performs incremental changes to the MIR. However, it has so far
only really been tested on the legalizer (not including the artifact
combiner) where it has caught lots of lost locations, particularly in Custom
legalizations. There's only one example here as my initial testing was on an
out-of-tree target and I haven't done a pass over the in-tree targets yet.

Depends on D77575, D77446

Reviewers: bogner, aprantl, vsk

Subscribers: jvesely, nhaehnle, mgorny, rovka, hiraditya, volkan, kerbowa, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D77576


Compare: https://github.com/llvm/llvm-project/compare/bf60953faf3a...d9085f65db0b


More information about the All-commits mailing list