[PATCH] D25611: When moving a zext near to its associated load, do not retain the origial debug location.

Paul Robinson via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 14 10:32:35 PDT 2016


probinson added a comment.

In https://reviews.llvm.org/D25611#570613, @aprantl wrote:

> This feels a bit like a hack; but I'm not sure I have a better solution.
>
> Would it be possible to post source code for this function? If the frontend has assigned an explicit location to the zext instruction, I would probably want that to be preserved (unless the load and the zext are combined I guess). If the zext doesn't appear in the source code, wouldn't it be more appropriate for the frontend to assign an artificial (line 0) location to the instruction?


The source is in comments in the test file.

I think the zext is not the "important" part of the statement.  But currently we put is_stmt=1 on every .loc that has a new source line, and if we start moving individual instructions around, that seriously messes up single-stepping for these unimportant cases.  So yes it's a hack, to workaround the is_stmt hack.

I don't want to be too eager to introduce line 0, as that takes up space in the line table and for something like this it would have no real benefit.


https://reviews.llvm.org/D25611





More information about the llvm-commits mailing list