This is an archive of the discontinued LLVM Phabricator instance.

[LV] Mark induction PHI nodes as allowed exits (NFC).
Needs ReviewPublic

Authored by rickyz on Feb 13 2022, 5:37 PM.

Details

Reviewers
fhahn
Summary

Prior to this change, loop vectorization legality checks only added
induction PHI nodes to AllowedExit (the list of variables which are
allowed to be used outside of the loop) when its SCEV predicates are
alway true. However, this isn't strictly necessary - all necessary
predicates should have held whenever the final value was computed.

This is not expected to cause any functional change. Loop-external IV
uses are already allowed (correctly so, per the above reasoning), since
the existing code never checks induction PHIs against AllowedExit. The
only purpose of this change is to make the code a little easier to
understand by making the contents of AllowedExit consistent with what
the vectorization legality checks allow.

Diff Detail