[PATCH] D140498: [SLP]Fix cost of the broadcast buildvector/gather.

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 23 07:54:02 PST 2022


RKSimon added inline comments.


================
Comment at: llvm/include/llvm/Analysis/TargetTransformInfoImpl.h:1133
       if (CostKind == TTI::TCK_CodeSize && LI->hasOneUse() &&
-          !LoadType->isVectorTy()) {    
+          !LoadType->isVectorTy()) {
         if (const TruncInst *TI = dyn_cast<TruncInst>(*LI->user_begin()))
----------------
pre-commit whitespace cleanups separetely 


================
Comment at: llvm/test/Analysis/CostModel/X86/vector-insert-inseltpoison.ll:255
 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %v2i64_a = insertelement <2 x i64> poison, i64 undef, i32 %arg
-; SSE2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v2i64_0 = insertelement <2 x i64> poison, i64 undef, i32 0
+; SSE2-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %v2i64_0 = insertelement <2 x i64> poison, i64 undef, i32 0
 ; SSE2-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %v2i64_1 = insertelement <2 x i64> poison, i64 undef, i32 1
----------------
These costs are definitely not free - integer scalars still need to be transfered from gpr to xmm registers.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D140498



More information about the llvm-commits mailing list