[PATCH] D48172: [CostModel][AArch64] Add some initial costs for SK_Select and SK_PermuteSingleSrc
Eli Friedman via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 20 14:08:06 PDT 2018
efriedma added inline comments.
================
Comment at: lib/Target/AArch64/AArch64TargetTransformInfo.cpp:958
+ { TTI::SK_Select, MVT::v2i32, 1 }, // mov.
+ { TTI::SK_Select, MVT::v4i32, 2 }, // rev+trn.
+ { TTI::SK_Select, MVT::v2i64, 1 }, // mov.
----------------
I'm pretty sure the general case here is not rev+trn, but I guess it should be two instructions in general (it's always at most two vector-vector element insertions).
================
Comment at: lib/Target/AArch64/AArch64TargetTransformInfo.cpp:965
+ // TODO: handle vXi8/vXi16 selects.
+ { TTI::SK_PermuteSingleSrc, MVT::v2i32, 1 }, // mov.
+ { TTI::SK_PermuteSingleSrc, MVT::v4i32, 2 }, // rev+trn or similar.
----------------
For a single source with two elements, a shuffle is either an identity shuffle, a splat, or a reversal; I guess those are all in fact 1 instruction.
================
Comment at: lib/Target/AArch64/AArch64TargetTransformInfo.cpp:966
+ { TTI::SK_PermuteSingleSrc, MVT::v2i32, 1 }, // mov.
+ { TTI::SK_PermuteSingleSrc, MVT::v4i32, 2 }, // rev+trn or similar.
+ { TTI::SK_PermuteSingleSrc, MVT::v2i64, 1 }, // mov.
----------------
`egrep -c "[0-3],[0-3],[0-3],[0-3].*Cost [3-4]" lib/Target/AArch64/AArch64PerfectShuffle.h` says there are 182 permutes which cost more than 2. But I guess this is a reasonable estimate not knowing anything else.
Repository:
rL LLVM
https://reviews.llvm.org/D48172
More information about the llvm-commits
mailing list