This is an archive of the discontinued LLVM Phabricator instance.

[LoopFlatten] Use Loop to identify loop induction phi. NFC
ClosedPublic

Authored by RosieSumpter on Jul 15 2021, 1:27 AM.

Details

Summary

Replace code which identifies induction phi with helper function
getInductionVariable to improve robustness.

Diff Detail

Event Timeline

RosieSumpter created this revision.Jul 15 2021, 1:27 AM
RosieSumpter requested review of this revision.Jul 15 2021, 1:27 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 15 2021, 1:27 AM
SjoerdMeijer added inline comments.
llvm/lib/Transforms/Scalar/LoopFlatten.cpp
126–127

We don't need this anymore?

131

And we don't need the else I think.

@fhahn : just for completeness, this is following up our our discussion in D105802, and is probably the first of a series of refactoring patches to use more Loop and SCEV here in LoopFlatten.

RosieSumpter marked 2 inline comments as done.
  • Removed setting inductionPHI to nullptr
  • Removed else
SjoerdMeijer accepted this revision.Jul 15 2021, 5:41 AM

Looks like a good bit of refactoring to me.

This revision is now accepted and ready to land.Jul 15 2021, 5:41 AM
This revision was landed with ongoing or failed builds.Jul 19 2021, 1:14 AM
This revision was automatically updated to reflect the committed changes.