[PATCH] D79821: [SVE] Remove usages of VectorType::getNumElements() from PowerPC

Christopher Tetreault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 12 16:09:55 PDT 2020


ctetreau created this revision.
Herald added subscribers: llvm-commits, shchenz, psnobl, rkruppe, kbarton, hiraditya, tschuett, nemanjai.
Herald added a reviewer: efriedma.
Herald added a project: LLVM.
ctetreau added reviewers: sdesmalen, c-rhodes, hfinkel.
Herald added a subscriber: wuzish.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D79821

Files:
  llvm/lib/Target/PowerPC/PPCTargetTransformInfo.cpp


Index: llvm/lib/Target/PowerPC/PPCTargetTransformInfo.cpp
===================================================================
--- llvm/lib/Target/PowerPC/PPCTargetTransformInfo.cpp
+++ llvm/lib/Target/PowerPC/PPCTargetTransformInfo.cpp
@@ -911,7 +911,8 @@
   // stores, loads are expanded using the vector-load + permutation sequence,
   // which is much less expensive).
   if (Src->isVectorTy() && Opcode == Instruction::Store)
-    for (int i = 0, e = cast<VectorType>(Src)->getNumElements(); i < e; ++i)
+    for (int i = 0, e = cast<FixedVectorType>(Src)->getNumElements(); i < e;
+         ++i)
       Cost += getVectorInstrCost(Instruction::ExtractElement, Src, i);
 
   return Cost;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D79821.263556.patch
Type: text/x-patch
Size: 691 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200512/9ce10676/attachment.bin>


More information about the llvm-commits mailing list