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

Dehao Chen via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 9 10:26:07 PST 2016


danielcdh added a comment.

SGTM

As Adrian mentioned, for lambda, there is nothing that can be done (or very difficult) here to address the lexical scope issue.

Assuming this only applies to ternary case, it should not affect the debugging for the following case:

#1 v = cond ? stmt1: stmt2;

Because though the debug info for stmt1&2 are removed, as they are in the same line with cond, debugger will still stop at this line as it need to execute "cond".

The debugging experience for the following code will be affected:

#1 v = cond ?
#2     stmt1: stmt2;

Without the patch, the debugger will first stop at line #1, and then step to line #2. With the patch, #2 does not exist any more in debug info, so it will be skipped after line #1. But this does not seem important as stopping at line #2 does not help much during debugging process.

But for the following case:

#1 v = cond ?
#2     stmt1:
#3     stmt2;

This patch will definitely improve debugging experience by avoiding stopping at incorrect location.

Comments?


https://reviews.llvm.org/D26256





More information about the llvm-commits mailing list