[PATCH] D146602: [PowerPC] Enable canCombineStoreAndExtract target hook

Nemanja Ivanovic via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 3 13:11:02 PDT 2023


nemanjai added a comment.

For the most part, the code produced for `vector-promotion.ll` is worse as we're forcing the operations into the vector space rather than doing it in scalar registers. Perhaps we should return `false` from this query if the input vector is the result of a `load` and the only user is the `extract` instruction. This would of course require that we change the interface of the query to take the extract instruction rather than the type.
The idea is that if we are loading the vector, extracting an element, performing an operation and then storing, we won't really load the vector but will load only the single element. Promoting the operation will force us to load the vector which is counter productive.



================
Comment at: llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1632
+  auto *VTy = dyn_cast<VectorType>(VectorTy);
+  if (!VTy || !VTy->getScalarType()->isIntegerTy())
+    return false;
----------------
Why an integer type? `stxsd[x]/stfiwx/stxsiwx` don't really care about whether the input vector is integer or floating point.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D146602



More information about the llvm-commits mailing list