This is an archive of the discontinued LLVM Phabricator instance.

[ScalarEvolution] Mark a loop as finite if in a willreturn function
ClosedPublic

Authored by wsmoses on Jan 27 2022, 8:52 PM.

Details

Summary

A limited version of (https://reviews.llvm.org/D118090) that only marks a loop as finite if in a willreturn function.

Diff Detail

Event Timeline

wsmoses created this revision.Jan 27 2022, 8:52 PM
wsmoses requested review of this revision.Jan 27 2022, 8:52 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 27 2022, 8:52 PM

Can you please add a test for this? Taking an existing mustprogress test and adding a possibly side-effecting call should serve as a demonstration. Otherwise this looks fine to me.

jdoerfert accepted this revision.Jan 28 2022, 11:03 AM

Assuming the second test can be added, see below, LG.

llvm/test/Analysis/ScalarEvolution/lt-overflow.ll
219

This should also work w/o the call site attributes, correct?
If so add a second test.

This revision is now accepted and ready to land.Jan 28 2022, 11:03 AM
jdoerfert added inline comments.Jan 28 2022, 11:07 AM
llvm/test/Analysis/ScalarEvolution/lt-overflow.ll
219

If it doesn't work w/o, can u add negative tests with a FIXME.
Call site should inherit willreturn and one test with the outer function marked as willreturn and nounwind so the call site could inherit both.

wsmoses updated this revision to Diff 404099.Jan 28 2022, 11:11 AM

Add tests

jdoerfert accepted this revision.Jan 28 2022, 11:12 AM
This revision was landed with ongoing or failed builds.Jan 28 2022, 11:17 AM
This revision was automatically updated to reflect the committed changes.