This is an archive of the discontinued LLVM Phabricator instance.

[LV] Move code from vectorizeMemoryInstruction to recipe's execute().
ClosedPublic

Authored by fhahn on Nov 20 2021, 12:47 PM.

Details

Summary

The code in widenMemoryInstruction has already been transitioned
to only rely on information provided by VPWidenMemoryInstructionRecipe
directly.

Moving the code directly to VPWidenMemoryInstructionRecipe::execute
completes the transition for the recipe.

It provides the following advantages:

  1. Less indirection, easier to see what's going on.
  2. Removes accesses to fields of ILV.
  1. in particular ensures that no dependencies on

fields in ILV for vector code generation are re-introduced.

Diff Detail

Event Timeline

fhahn created this revision.Nov 20 2021, 12:47 PM
fhahn requested review of this revision.Nov 20 2021, 12:47 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 20 2021, 12:47 PM
Ayal added inline comments.Nov 28 2021, 1:53 PM
llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
10045

The assert(Vec->getType()->isVectorTy() && "Invalid type"); of reverseVector() being dropped will be taken care of by Builder.CreateVectorReverse() anyhow?

10053

clean up above comments?

fhahn updated this revision to Diff 390658.Nov 30 2021, 3:41 AM
fhahn marked 2 inline comments as done.

remove commented out code

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

CreateVectorReverse has auto *Ty = cast<VectorType>(V->getType()); which should be equivalent to the assert.

10053

Removed!

Ayal accepted this revision.Nov 30 2021, 6:43 AM

Ship it!

This revision is now accepted and ready to land.Nov 30 2021, 6:43 AM