[PATCH] D80885: [VectorCombine] scalarizeBinop - support an all-constant src vector operand
Sanjay Patel via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun May 31 08:30:17 PDT 2020
spatel added a comment.
In D80885#2065326 <https://reviews.llvm.org/D80885#2065326>, @RKSimon wrote:
> In D80885#2065299 <https://reviews.llvm.org/D80885#2065299>, @spatel wrote:
>
> > The 1 logic adjustment I'd make here (at least initially) is to add a pattern match to see if the scalar variable is being loaded directly from memory. In that case, we should bail out. A possible enhancement would adjust the cost calc to account for the fact that there is (probably?) no transfer from GPR to vector register in that case.
>
>
> Thanks @spatel, I'll update later today. Do you mean bail just for the 1 insertion load case or always bail if any loads+insertions are present?
I was only imagining the 1 insertion case. If both operands are insertions, then it seems unlikely that the vector op would win...but I guess we can add tests for that too if we're going to enhance the cost model.
> I haven't checked but adding an Instruction arg to getVectorInstrCost would allow us to get more specific costs for load+insert instructions - what would you say if I investigate that instead?
Sure, if we can build this into the cost model, that would be good. Not sure if the vectorizers would benefit too, but that can be another patch.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D80885/new/
https://reviews.llvm.org/D80885
More information about the llvm-commits
mailing list