[PATCH] D92317: [LV] ExtractValue instruction costs

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 30 11:54:41 PST 2020


fhahn accepted this revision.
fhahn added a comment.
This revision is now accepted and ready to land.

LGTM, we should be able to rely on TTI for the cost. Also handling `InsertValue` as a follow-up would be great!



================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:6858
+    // Assume we need 1 instruction to extract a value from a vector.
+    return 1;
   default:
----------------
SjoerdMeijer wrote:
> fhahn wrote:
> > SjoerdMeijer wrote:
> > > fhahn wrote:
> > > > Better to use `TTI.getVectorInstrCost`? And perhaps also handle `InsertValue`?
> > > Yeah, cheers, will look/do that.
> > Should this also handle `InsertValue` for completeness?
> That doesn't seem to be supported by getInstructionCost, which means it returns -1 for InsertValue, which is probably not what we want. So, I think InsertValue needs a bit looking into, which probably best done separately? Although don't mind doing it part of this....
oh yes, just saw that. Probably best to do it separately.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D92317/new/

https://reviews.llvm.org/D92317



More information about the llvm-commits mailing list