This is an archive of the discontinued LLVM Phabricator instance.

[NFC][LoopVectorize] Make the createStepForVF interface more caller-friendly
ClosedPublic

Authored by david-arm on Nov 3 2021, 9:10 AM.

Details

Summary

The common use case for calling createStepForVF is currently something
like:

Value *Step = createStepForVF(Builder, ConstantInt::get(Ty, UF), VF);

and it makes more sense to reduce overall lines of code and change the
function to let it create the constant instead. With my patch this
becomes:

Value *Step = createStepForVF(Builder, Ty, VF, UF);

and the ConstantInt is created instead createStepForVF. A side-effect of
this is that the code in createStepForVF is also becomes simpler.

As part of this patch I've also replaced some calls to getRuntimeVF
with calls to createStepForVF, i.e.

getRuntimeVF(Builder, Count->getType(), VFactor * UFactor) ->
createStepForVF(Builder, Count->getType(), VFactor, UFactor)

because this feels semantically better.

Diff Detail

Event Timeline

david-arm created this revision.Nov 3 2021, 9:10 AM
david-arm requested review of this revision.Nov 3 2021, 9:10 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 3 2021, 9:10 AM
sdesmalen accepted this revision.Nov 8 2021, 5:24 AM
This revision is now accepted and ready to land.Nov 8 2021, 5:24 AM
This revision was landed with ongoing or failed builds.Nov 8 2021, 7:14 AM
This revision was automatically updated to reflect the committed changes.