[PATCH] D127488: [GlobalISel][DebugInfo] Remove debug info with zero line from constants inserted at entry block

Vladislav Dzhidzhoev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 8 07:38:17 PDT 2022


dzhidzhoev added a comment.

In D127488#3633395 <https://reviews.llvm.org/D127488#3633395>, @dblaikie wrote:

> Presumably the zero line on these was added for a reason to begin with (though maybe with hindsight we decide that reason is insufficient/doesn't apply here/etc) - could you check version history/see if there's some back story to this? (perhaps it was added incidentally while addressing some other issue, perhaps not)

Previously constants generated at entry block had taken the same debug location as instruction being translated (https://reviews.llvm.org/D63286). It might cause jumpy debugger behavior.

In D127488#3633395 <https://reviews.llvm.org/D127488#3633395>, @dblaikie wrote:

> One thing that is important is that line zero is used at the start of basic blocks if the instructions don't otherwise have a location - because otherwise sample profiles can be mislead (because the line location from the previous basic block will cover the unassigned locations and then a sample could incorrectly conclude that a source line was executed when it was not). I don't know if that's related to this case - doesn't /look/ like it, but figured I'd mention it jus tin case.

If an instruction at the start of basic block has no debug location, AsmPrinter emits zero line location for it.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D127488/new/

https://reviews.llvm.org/D127488



More information about the llvm-commits mailing list