[PATCH] D125527: [CostModel][X86] getScalarizationOverhead - improve extraction costs for > 128-bit vectors

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 16 08:04:23 PDT 2022


RKSimon added inline comments.


================
Comment at: llvm/lib/Target/X86/X86TargetTransformInfo.cpp:3898
+
+        Cost += DemandedUpper128Lanes.countPopulation();
+
----------------
ABataev wrote:
> Can we estimate regcopy somehow here?
OK - I can update this to call getShuffleCost(TTI::SK_ExtractSubvector) instead


================
Comment at: llvm/lib/Target/X86/X86TargetTransformInfo.cpp:3905
+            unsigned Idx = I % Scale;
+            Cost += getVectorInstrCost(Instruction::ExtractElement, Ty, Idx);
+          }
----------------
ABataev wrote:
> Maybe use BaseT::getScalarizationOverhead again here rather than `getVectorInstrCost(Instruction::ExtractElement`? Also, what about possible getExtractWithExtendCost here?
We can't easily use BaseT::getScalarizationOverhead as we need the index adjustments.

I've been looking at adding getExtractWithExtendCost handling to getScalarizationOverhead but it'll require a minor refactor that we don't need for this cost fix.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D125527



More information about the llvm-commits mailing list