[PATCH] D93662: [SimplifyCFG] Keep !dgb metadata of moved instruction, if they match.

Vedant Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 5 09:11:43 PST 2021


vsk added a comment.

In D93662#2479383 <https://reviews.llvm.org/D93662#2479383>, @jmorse wrote:

> This improvement looks good and preserves more source locations. Awkwardly, as @vsk says it's quite different from the other documented rules, because it relies on the context of where the instructions are going to be placed.

+1

> In terms of wording, how about adding an additional clause:
>
>   A transformation should preserve the debug location of an instruction [...] if the destination block already contains an instruction with an identical debug location
>
> Which is slightly broader than your wording @fhahn, but IMHO gets across the idea that the location shouldn't be preserved if it's "new" to a block. Opinions?

I think that sounds reasonable. My initial thought was that the broader language might invite folks to consider scanning the destination block for a matching location: there's nothing wrong with doing that in principle, but imho it ought to be discouraged for performance reasons.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D93662



More information about the llvm-commits mailing list