This is an archive of the discontinued LLVM Phabricator instance.

[VPlan] Add recipe to handle SCEV expansion (NFC).
ClosedPublic

Authored by fhahn on Dec 26 2021, 12:01 PM.

Details

Summary

This can be used to explicitly model VPValues that depend on SCEV
expansion, like the step for inductions.

Diff Detail

Event Timeline

fhahn created this revision.Dec 26 2021, 12:01 PM
fhahn requested review of this revision.Dec 26 2021, 12:01 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 26 2021, 12:01 PM
Herald added a subscriber: vkmr. · View Herald Transcript

Now that D115953 is almost ready, it would be great if you could take a look at this change, which is required by D115953. It just adds a VPExpandSCEVRecipe. It will only be used once D115953 lands.

Ayal accepted this revision.Feb 22 2022, 2:09 AM
Ayal added inline comments.
llvm/lib/Transforms/Vectorize/VPlan.cpp
1403

Set the single value per part? (Tests with UF>1 work?)
Assert it's not called per lane.

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

but the recipe is currently placed in the header; place it in the pre-header once the latter is modelled in VPlan as a VPBasicBlock.

This revision is now accepted and ready to land.Feb 22 2022, 2:09 AM
fhahn updated this revision to Diff 411625.Feb 26 2022, 10:28 AM
fhahn marked an inline comment as done.

Thanks Ayal! Latest comments should be addressed and I am planning on landing this soon.

Ayal added inline comments.Feb 26 2022, 2:06 PM
llvm/lib/Transforms/Vectorize/VPlan.cpp
1411

Should this set the value for all Parts from 0 to UF-1, or is only Part 0 needed?

This revision was landed with ongoing or failed builds.Feb 27 2022, 4:48 AM
This revision was automatically updated to reflect the committed changes.
fhahn marked an inline comment as done.Feb 27 2022, 4:48 AM
fhahn added inline comments.
llvm/lib/Transforms/Vectorize/VPlan.cpp
1411

It's not needed for the anticipated use case, but I updated the code to set it for all UFs.