This is an archive of the discontinued LLVM Phabricator instance.

Small cleanup of MachineLICM.cpp
ClosedPublic

Authored by djasper on Feb 5 2015, 2:35 PM.

Details

Reviewers
chandlerc
Summary

Specifically:

  • Calculate the loop pre-header once at the start of HoistOutOfLoop, so:
    • We don't DFS-walk the MachineDomTree if we aren't going to do anything
    • Don't call getCurPreheader for each Scope
  • Don't needlessly use a do-while loop
  • Use early exit for Scopes.size() == 0

No functional changes intended.

Diff Detail

Event Timeline

djasper updated this revision to Diff 19433.Feb 5 2015, 2:35 PM
djasper retitled this revision from to Small cleanup of MachineLICM.cpp.
djasper updated this object.
djasper edited the test plan for this revision. (Show Details)
djasper added a reviewer: chandlerc.
djasper added a subscriber: Unknown Object (MLST).
chandlerc accepted this revision.Feb 5 2015, 2:38 PM
chandlerc edited edge metadata.

LGTM, nice cleanup.

This revision is now accepted and ready to land.Feb 5 2015, 2:38 PM
djasper closed this revision.Feb 5 2015, 2:41 PM

Committed as r228350.