[PATCH] D25742: Remove debug location from common tail when tail-merging

Adrian Prantl via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 18 16:06:15 PDT 2016

aprantl added a comment.

In https://reviews.llvm.org/D25742#573401, @probinson wrote:

> In https://reviews.llvm.org/D25742#573352, @aprantl wrote:
> > This approach seems generally fine, but I have one question:
> >
> > If the code were on a single line, and both locations share a common ancestor scope, it seems make sense to create a new location using the common ancestor scope and line and only remove the column information.
> That would collapse the if-then-else into (effectively) a single statement.  That probably works okay for a debugger but not profiling, which still wants to treat the then/else as distinct.  And, after the tail merging, the tails are no longer distinct.

I'm not sure I understand your point. How is having an orphaned add instruction preferable over having it associated with the collapsed if-then-else statement? Wouldn't I want that instruction to be counted towards the line?


More information about the llvm-commits mailing list