This is an archive of the discontinued LLVM Phabricator instance.

[MustExecute] Add backward exploration for must-be-executed-context
ClosedPublic

Authored by uenoku on Feb 19 2020, 12:06 AM.

Details

Summary

As mentioned in D71974, it is useful for must-be-executed-context to explore CFG backwardly.
This patch is ported from parts of D64975. We use a dominator tree to find the previous context if
a dominator tree is available.

Diff Detail

Event Timeline

uenoku created this revision.Feb 19 2020, 12:06 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 19 2020, 12:06 AM
jdoerfert accepted this revision.Feb 19 2020, 9:30 AM

Thank you for picking this up!

I inlined some minor comments but you can address them before commiting this.

LGTM.

llvm/include/llvm/Analysis/MustExecute.h
410

I think we should not set default values but force the user to decide.

llvm/lib/Analysis/MustExecute.cpp
362

"Unrelated": We have to make these unique_ptr so we can remove the delete at the end.

llvm/test/Analysis/MustExecute/must_be_executed_context.ll
26–27

We have backward exploration now.

232

Still missing F

This revision is now accepted and ready to land.Feb 19 2020, 9:30 AM
uenoku updated this revision to Diff 245567.Feb 19 2020, 7:27 PM
uenoku marked 2 inline comments as done.

Address comments

This revision was automatically updated to reflect the committed changes.

FWIW, the effect of this can be seen in D74888 pretty nicely. llvm.assume that must have been executed are used to improve the state :)