This is an archive of the discontinued LLVM Phabricator instance.

[VPlan] NFC: Change VFRange to take ElementCount

Authored by sdesmalen on Nov 3 2020, 1:46 PM.



This patch changes the type of Start, End in VFRange to be an ElementCount
instead of unsigned. This is done as preparation to make VPlans for
scalable vectors, but is otherwise NFC.

Diff Detail

Event Timeline

sdesmalen created this revision.Nov 3 2020, 1:46 PM
Herald added a project: Restricted Project. · View Herald Transcript
dmgreen accepted this revision.Nov 5 2020, 2:53 AM

This looks simple enough to me. I guess it does mean we can't use the same vplan for representing scalable and non-scalable vectorization plans, but that's probably a sensible thing to do.


This revision is now accepted and ready to land.Nov 5 2020, 2:53 AM
fhahn accepted this revision.Nov 5 2020, 3:03 AM



Now that we have a constructor here, can we also assert that Start is a power-of-2?

vkmr added a comment.EditedNov 5 2020, 7:30 AM

Other than the minor nit, LGTM.


Nit: Add an isEmpty() method to VFRange. Removes the burden of knowing the condition for an empty range.

sdesmalen updated this revision to Diff 303154.Nov 5 2020, 10:02 AM
sdesmalen marked an inline comment as done.
  • Added isEmpty method to VFRange.
  • Added check that VFRange::Start is a power of 2.

Thanks for the reviews and suggestions!

vkmr accepted this revision.Nov 5 2020, 1:09 PM


This revision was automatically updated to reflect the committed changes.