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

Robert Lougher via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 2 13:24:41 PDT 2016


rob.lougher added a comment.

In https://reviews.llvm.org/D26256#586214, @aprantl wrote:

> Shouldn't it only drop the location if the two locations are distinct (and perhaps add a discriminator)?


Sorry, didn't make myself clear in the last comment.  As the two instructions feed into a phi node they are in different basic-blocks, so the two locations must be distinct (they are in different scopes and will have different discriminators).   But in the case where we have an if-then-else all on the same line we could create a new debug location with a different scope/discriminator.


https://reviews.llvm.org/D26256





More information about the llvm-commits mailing list