This is an archive of the discontinued LLVM Phabricator instance.

[LV] Use usesScalars in widenPHIInstruction.
ClosedPublic

Authored by fhahn on Mar 14 2022, 9:42 AM.

Details

Summary

This uses the existing VPlan helpers to check whether there are scalar
uses of a phi recipe. It remove one of the few remaining dependencies on
the cost model from VPlan code generation.

Depends on D121612.

Diff Detail

Event Timeline

fhahn created this revision.Mar 14 2022, 9:42 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 14 2022, 9:42 AM
fhahn requested review of this revision.Mar 14 2022, 9:42 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 14 2022, 9:42 AM
Herald added a subscriber: vkmr. · View Herald Transcript
Ayal accepted this revision.Mar 15 2022, 8:05 AM

Ship it!

Ideally all other users of Cost->isScalarAfterVectorization() will also be refactored to query VPlan to retire this interface.

llvm/test/Transforms/LoopVectorize/AArch64/sve-widen-gep.ll
147

This is a case where we now know all users use scalars more accurately, where previously we generated vectors redundantly?

This revision is now accepted and ready to land.Mar 15 2022, 8:05 AM
fhahn marked an inline comment as done.Mar 17 2022, 4:59 AM
fhahn added inline comments.
llvm/test/Transforms/LoopVectorize/AArch64/sve-widen-gep.ll
147

Yes exactly. Previously we had to compute the vector GEP and then just extract lane 0.

This revision was landed with ongoing or failed builds.Mar 17 2022, 6:16 AM
This revision was automatically updated to reflect the committed changes.
fhahn marked an inline comment as done.