[PATCH] D26256: [InstCombine] Don't set debug location when folding through a phi node

Paul Robinson via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 2 14:28:01 PDT 2016


probinson added a comment.

In https://reviews.llvm.org/D26256#586247, @danielcdh wrote:

> I'm not sure if I understand why you want to add a discriminator here. Basically we should only add a discriminator in the AddDiscriminators.cpp, or when there is code duplication that we want to record.
>
> Dehao


DWARF specifies the discriminator as a way to distinguish instructions in different blocks that are attributed to the same source location.  We are hypothetically starting with two instructions in different blocks with the same source location, so those two instructions ought to have two different discriminators already.  We are then creating a new instruction in a third block, and if that instruction preserves the original source location, it ought to have a third discriminator value.

Normally, the two original instructions will have different source locations, in which case erasing the source attribution on the new instruction is the only really viable solution (because we can't attribute the source correctly).


https://reviews.llvm.org/D26256





More information about the llvm-commits mailing list