Page MenuHomePhabricator

[CodeExtractor] Do not lift lifetime.end markers for region inputs
ClosedPublic

Authored by vsk on Feb 14 2019, 2:04 PM.

Details

Summary

If a lifetime.end marker occurs along one path through the extraction
region, but not another, then it's still incorrect to lift the marker,
because there is some path through the extracted function which would
ordinarily not reach the marker. If the call to the extracted function
is in a loop, unrolling can cause inputs to the function to become
optimized out as undef after the first iteration.

To prevent incorrect stack slot merging in the calling function, it
should be sufficient to lift lifetime.start markers for region inputs.
I've tested this theory out by doing a stage2 check-all with randomized
splitting enabled.

This is a follow-up to r353973, and there's additional context for this
change in https://reviews.llvm.org/D57834.

rdar://47896986

Diff Detail

Repository
rL LLVM

Event Timeline

vsk created this revision.Feb 14 2019, 2:04 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 14 2019, 2:04 PM
This revision is now accepted and ready to land.Feb 15 2019, 7:23 AM
This revision was automatically updated to reflect the committed changes.