[PATCH] D105162: Avoid misleading line table when Localizer sinks an instruction to another basic block

Vedant Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 1 17:46:33 PDT 2021


vsk added a comment.

In D105162#2854369 <https://reviews.llvm.org/D105162#2854369>, @aprantl wrote:

> In D105162#2850394 <https://reviews.llvm.org/D105162#2850394>, @vsk wrote:
>
>> Is this a case where the guidance (as-written) suggests dropping the location instead?
>
> Yes. And I wonder if we should update the guidance. Literally dropping the location would result in the last instruction's location being carried forward. We don't want the inserted instruction to keep its location from the other basic block, but associating it with the previous instruction's location would also be wrong since we are inserting it on behalf of the next instruction (the insertion point). Maybe this isn't so much sinking an instruction but expanding an existing instruction?

Applying UseMI's location also seems wrong in some sense: the only right one would be the original, but it can't be kept. It'd also be awkward if UseMI is moved by some subsequent transform while LocalizedMI isn't.


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

https://reviews.llvm.org/D105162



More information about the llvm-commits mailing list