[PATCH] D68633: [utils] InlineFunction: fix for debug info affecting optimizations

Vedant Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 15 10:01:36 PDT 2019


vsk added a comment.

Hey @yechunliang, thanks for working on this.

This part of the inliner looks like it has two issues: 1) it's not fully aware of debug instructions, and 2) it erroneously extends the lifetimes of inlined variables. The current iteration of your patch might address the first issue, but it's not DRY, and it doesn't solve the second.

Here are a few suggestions.

- Please split out the logic for moving callee allocas into a helper function. This should simplify review.
- Use the filtering iterator to skip debug instructions. I understand that you had some trouble with this. Here's a patch based on an older version of your diff:

F10275020: inlinefunc.diff <https://reviews.llvm.org/F10275020>

- Moving the dbg.declares along with the callee's allocas to the entry block erroneously extends the lifetimes of all those allocas to the whole function. This makes frame inspection in the debugger really confusing. To fix this, I think you should just not move the dbg.declares. The easiest way to do that is to stop batch-splicing, as @bjope pointed out.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D68633/new/

https://reviews.llvm.org/D68633





More information about the llvm-commits mailing list