The patch presents the implementation of the "FAKE USE" concept I presented in my lightning talk "Debugging of optimized code: Extending the lifetime of local variables" at the October 2017 LLVM developers' conference. Since the concept is not universally supported, the purpose of this review is to make the patch available to interested parties, and perhaps to restart the discussion.
There is a review for the corresponding clang patch, which implements the -fextend-lifetime and -fextend-this-ptr options. These options make clang generate fake uses of local variables. I will add the URL here as soon as I have posted it.
Regarding the implementation, it is a relatively straightforward addition of the intrinsic and machine opcode. Some optimizations had to be suppressed for FAKE_USE operands because they would have affected debuggability. Note also that fake uses are not cloned during inlining, which does reduce their utility somewhat, but doing so led to a larger than acceptable performance degradation. There are probably ways to improve on this.
This is an interesting heuristic...
Putting the code here isn't great; IIRC some code outside the inliner uses this codepath.