This is an archive of the discontinued LLVM Phabricator instance.

[VPlan] Replace AlsoPack field with shouldPack() method (NFC).
ClosedPublic

Authored by fhahn on Feb 12 2023, 2:32 PM.

Details

Summary

There is no need to update the AlsoPack field when creating
VPReplicateRecipes. It can be easily computed based on the VP def-use
chains when it is needed.

Diff Detail

Event Timeline

fhahn created this revision.Feb 12 2023, 2:32 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 12 2023, 2:32 PM
fhahn requested review of this revision.Feb 12 2023, 2:32 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 12 2023, 2:32 PM
Ayal accepted this revision.Feb 19 2023, 1:05 PM

Indeed better compute such information on demand than cache it! Looks good to me, adding a couple of nits.

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
9573

nit: may be slightly faster if swapped to check State.VF.isVector() first.

llvm/lib/Transforms/Vectorize/VPlan.h
1546

nit: used by a widened instruction indirectly - via an intervening PredInstPhi? Until the insert-element's are represented explicitly.

llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
929

This is indeed the current behavior, but better have it check if !U.usesScalars() instead, possibly as a follow-up?

This revision is now accepted and ready to land.Feb 19 2023, 1:05 PM
fhahn updated this revision to Diff 498758.Feb 20 2023, 1:19 AM

Rebase and address comments, thanks! I plan to land this shortly.

This revision was landed with ongoing or failed builds.Feb 20 2023, 2:29 AM
This revision was automatically updated to reflect the committed changes.