[CodeExtractor] Emit lifetime markers around reloads of outputs
authorVedant Kumar <vsk@apple.com>
Sat, 19 Jan 2019 02:37:59 +0000 (02:37 +0000)
committerVedant Kumar <vsk@apple.com>
Sat, 19 Jan 2019 02:37:59 +0000 (02:37 +0000)
commit17d9f14bffc28d200a3ccef75b9409cd0e6bba86
tree518b1133d0c0882d6a555a68ea870b7f9dfa3d8d
parentc089fbbaf28698d340e3a958e4e9cee9e519a68c
[CodeExtractor] Emit lifetime markers around reloads of outputs

CodeExtractor permits extracting a region of blocks from a function even
when values defined within the region are used outside of it.

This is typically done by creating an alloca in the original function
and reloading the alloca after a call to the extracted function.

Wrap the reload in lifetime start/end markers to promote stack coloring.

Suggested by Sergei Kachkov!

Differential Revision: https://reviews.llvm.org/D56045

llvm-svn: 351621
llvm/lib/Transforms/Utils/CodeExtractor.cpp
llvm/test/Transforms/CodeExtractor/PartialInlineDebug.ll
llvm/test/Transforms/CodeExtractor/PartialInlineInvokeProducesOutVal.ll
llvm/test/Transforms/CodeExtractor/PartialInlineVarArgsDebug.ll
llvm/test/Transforms/HotColdSplit/duplicate-phi-preds-crash.ll
llvm/test/Transforms/HotColdSplit/lifetime-markers-on-inputs.ll
llvm/test/Transforms/HotColdSplit/split-phis-in-exit-blocks.ll