[PATCH] D110713: [WIP] BasicTTI::getInterleavedMemoryOpCost(): use getScalarizationOverhead()

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 29 07:53:18 PDT 2021


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

LG, it's a bit of an improvement in modelling precision, but not much.
Thank you!



================
Comment at: llvm/include/llvm/CodeGen/BasicTTIImpl.h:1257
       // <8 x i32> vector and insert them into a <4 x i32> vector.
-      for (unsigned Index : Indices) {
-        assert(Index < Factor && "Invalid index for interleaved memory op");
-
-        // Extract elements from loaded vector for each sub vector.
-        for (unsigned Elm = 0; Elm < NumSubElts; Elm++)
-          Cost += thisT()->getVectorInstrCost(Instruction::ExtractElement, VT,
-                                              Index + Elm * Factor);
-      }
-
-      InstructionCost InsSubCost = 0;
-      for (unsigned Elm = 0; Elm < NumSubElts; Elm++)
-        InsSubCost +=
-            thisT()->getVectorInstrCost(Instruction::InsertElement, SubVT, Elm);
-
+      InstructionCost InsSubCost = getScalarizationOverhead(SubVT, true, false);
       Cost += Indices.size() * InsSubCost;
----------------
Please can you name the bool params?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D110713



More information about the llvm-commits mailing list