[PATCH] D44528: [PowerPC] Implement canCombineStoreAndExtract and provide the missing pattern for the combination

Nemanja Ivanovic via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 15 10:34:48 PDT 2018


nemanjai created this revision.
nemanjai added reviewers: hfinkel, Carrot, kbarton, echristo.

We have VSX store instructions that will store a single element from a vector without modifying it in any way. Previous generation cores can do this for word-sized elements and Power9 can also do it for half-word and byte-sized elements.
The TableGen patterns for the word-sized versions were missing - this patch adds them.

Furthermore, it provides the information about the cost of such a combine - zero cost when the index is the element number that the instruction stores, cost of 3 for other elements. The cost for the other elements is because a vector permute is needed to shift the element and it's only worthwhile if keeping the value as a vector reduces the cost enough to offset the cost of the permute.


Repository:
  rL LLVM

https://reviews.llvm.org/D44528

Files:
  lib/Target/PowerPC/PPCISelLowering.cpp
  lib/Target/PowerPC/PPCISelLowering.h
  lib/Target/PowerPC/PPCInstrVSX.td
  test/CodeGen/PowerPC/combine-extract-store.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D44528.138580.patch
Type: text/x-patch
Size: 7205 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180315/c1db61f0/attachment.bin>


More information about the llvm-commits mailing list