[PATCH] D48172: [CostModel][AArch64] Add some initial costs for SK_Select and SK_PermuteSingleSrc

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 14 13:15:28 PDT 2018


RKSimon added inline comments.


================
Comment at: lib/Target/AArch64/AArch64TargetTransformInfo.cpp:963
+  if (Kind == TTI::SK_Select) {
+    static const CostTblEntry SelectTbl[] = {
+        {ISD::VECTOR_SHUFFLE, MVT::v2i32, 1},
----------------
evandro wrote:
> RKSimon wrote:
> > evandro wrote:
> > > I'm not sure that the costs of 64 and 128 bits long vectors should be different.
> > I'm going off the codegen in the shuffle-select.ll tests below where 2X32 selects are a move and 4X32 selects are a rev+trn.
> > 
> > If you have better cost estimates please suggest them - I don't know much about the aarch64 microarch and I'm really just wanting to fix regressions in D48174 caused by the existing (dubious) shuffle costs.
> That's an artifact due to the mask values being different for both tests.  Were they, say, `<0, 2>` in `sel.v2i32()` and `<0, 2, 4, 6>` in `sel.v4i32()`, both would result in a single instruction performing the shuffle.
But this is for SK_Select style patterns:

2x32 - <0,3> or <2,1> - this will always be 1 mov AFAICT
4x32 - <0,1,2,7>, <0,1,6,3>, <0,5,2,7>, etc. - I couldn't cause this to be anything more than 2 instructions, sometimes independent othertimes not.

That was the reasoning behind the costs - I'm a litttle more unsure about what would is the maximum for SK_PermuteSingleSrc but I reckoned it would be 2 instructions as well.


Repository:
  rL LLVM

https://reviews.llvm.org/D48172





More information about the llvm-commits mailing list