This is an archive of the discontinued LLVM Phabricator instance.

[MustExec][LICM] Refactor the first iteration condition check
AcceptedPublic

Authored by jdoerfert on Jul 19 2019, 12:16 AM.

Details

Summary

This patch exposes components that allow to simplify conditions for the
first iteration of a loop. The logic was almost completely copied.
Slight modifications include:

  • Use the loop predecessor instead of loop preheader.
  • Try to simplify both sides of the ICmp.
  • Do not give up if no PHI was found or the PHI was not in a header.

One test was improved, a proper negative example was added to keep
coverage high.

Event Timeline

jdoerfert created this revision.Jul 19 2019, 12:16 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 19 2019, 12:16 AM
lebedev.ri resigned from this revision.Jul 21 2019, 1:53 PM
reames accepted this revision.Mar 25 2020, 11:09 AM

LGTM w/required changes before commit.

llvm/lib/Analysis/MustExecute.cpp
123

All callers pass L. Simplify.

126

The LI but no L path is utterly untested in this patch. Remove.

This revision is now accepted and ready to land.Mar 25 2020, 11:09 AM
arsenm resigned from this revision.Apr 5 2020, 7:48 AM