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

Andrea Di Biagio via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 14 09:27:23 PDT 2016


andreadb added a comment.

In https://reviews.llvm.org/D25611#570512, @danielcdh wrote:

> The change in CGP LGTM, but as I am not debug info maintainer, I'll let someone else to sign off the patch.


Thanks Dehao!

> But to fix the debug info problem in the given test case, it's better to fix it the place closest to the problem, which is ISel. (I do not mean that the CGP fix in this patch is wrong, it's worth fixing too)
> 
> In the generated assembly, we did not see the zext instruction, there is only one movl instruction.

<snip>

> Both MOV32rm and SUBREG_TO_REG are attributed to !dbg !8, while MOV32rm should be attributed to !dbg !7 instead. In this way we will not see line 6 attributed to the movl instruction.

That's very interesting. I agree that the problem could have been avoided if only the MOV32rm had the correct line associated. On x86 that SUBREG_TO_REG is effectively a noop copy from GR32 to GR64. I will definitely investigate further to figure out what is going on here.

In the meantime, as you said, I think it is worthy to apply this CGP fix if someone more familiar with debug info can review it.

Thanks,
Andrea


https://reviews.llvm.org/D25611





More information about the llvm-commits mailing list