[PATCH] D92317: [LV] ExtractValue instruction costs
Florian Hahn via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 30 11:33:14 PST 2020
fhahn added a comment.
In D92317#2423288 <https://reviews.llvm.org/D92317#2423288>, @SjoerdMeijer wrote:
> Decided to use `TTI.getInstructionCost` because getVectorInstrCost doesn't work here; it's an aggregate type, not really a vector.
> That means the cost for a ExtractValue will be Free now, which I think is actually more accurate (than 1, and also the original 4).
> I haven't added InsertValue yet, because that is e.g. not supported by getInstructionCost as it seems a little bit of a different beast.
SGTM, I was thinking about *insertelement*... Sorry about that.
================
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:
> > Better to use `TTI.getVectorInstrCost`? And perhaps also handle `InsertValue`?
> Yeah, cheers, will look/do that.
Should this also handle `InsertValue` for completeness?
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D92317/new/
https://reviews.llvm.org/D92317
More information about the llvm-commits
mailing list