[PATCH] D57834: [CodeExtractor] Only lift lifetime markers present in the extraction region

Vedant Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 6 11:39:11 PST 2019


vsk created this revision.
vsk added reviewers: kachkov98, davidxl, tejohnson, kuhar.
Herald added a subscriber: hiraditya.

When CodeExtractor finds liftime markers referencing inputs to the
extraction region, it lifts these markers out of the region and inserts
them around the call to the extracted function (see r350420, PR39671).

However, it should *only* lift lifetime markers that are actually
present in the extraction region. I.e., if a start marker is present in
the extraction region but a corresponding end marker isn't (or vice
versa), only the start marker (or end marker, resp.) should be lifted.

This fixes a miscompile in which a lifetime start marker was lifted
inappropriately, causing an argument to the extracted function to
optimized out as undef.

rdar://47802482


https://reviews.llvm.org/D57834

Files:
  llvm/lib/Transforms/Utils/CodeExtractor.cpp
  llvm/test/Transforms/HotColdSplit/lifetime-markers-on-inputs-1.ll
  llvm/test/Transforms/HotColdSplit/lifetime-markers-on-inputs-2.ll
  llvm/test/Transforms/HotColdSplit/lifetime-markers-on-inputs.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D57834.185602.patch
Type: text/x-patch
Size: 11397 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190206/007e8bc7/attachment.bin>


More information about the llvm-commits mailing list