This is an archive of the discontinued LLVM Phabricator instance.

[StackSafety] Add "Must Live" logic
ClosedPublic

Authored by vitalybuka on Jun 18 2020, 1:35 PM.

Details

Summary

Extend StackLifetime with option to calculate liveliness
where alloca is only considered alive on basic block entry
if all non-dead predecessors had it alive at terminators.

Depends on D82043.

Diff Detail

Event Timeline

vitalybuka created this revision.Jun 18 2020, 1:35 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 18 2020, 1:35 PM
eugenis added inline comments.Jun 18 2020, 1:57 PM
llvm/test/Analysis/StackSafetyAnalysis/lifetime.ll
2

It would be nicer to make it a parametrized pass, something like this:

-passes=stack-lifetime<must-live> or stack-lifetime<may-live>

And turn the bool argument into an enum with named options.

vitalybuka marked an inline comment as done.Jun 18 2020, 4:32 PM
eugenis accepted this revision.Jun 18 2020, 4:36 PM

LGTM

This revision is now accepted and ready to land.Jun 18 2020, 4:36 PM
This revision was automatically updated to reflect the committed changes.