Skip to content

Commit

Permalink
[TTI] Add generic cost handling of SK_Reverse shuffles
Browse files Browse the repository at this point in the history
These can be treated as a general permute.

This required a fix for missing reverse patterns on ARM

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345015 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
RKSimon committed Oct 23, 2018
1 parent 62bea74 commit befe74f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/llvm/CodeGen/BasicTTIImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,7 @@ class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
Type *SubTp) {
switch (Kind) {
case TTI::SK_Select:
case TTI::SK_Reverse:
case TTI::SK_Transpose:
case TTI::SK_PermuteSingleSrc:
case TTI::SK_PermuteTwoSrc:
Expand Down
2 changes: 2 additions & 0 deletions lib/Target/ARM/ARMTargetTransformInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,8 @@ int ARMTTIImpl::getShuffleCost(TTI::ShuffleKind Kind, Type *Tp, int Index,
{ISD::VECTOR_SHUFFLE, MVT::v2f32, 1},
{ISD::VECTOR_SHUFFLE, MVT::v2i64, 1},
{ISD::VECTOR_SHUFFLE, MVT::v2f64, 1},
{ISD::VECTOR_SHUFFLE, MVT::v4i16, 1},
{ISD::VECTOR_SHUFFLE, MVT::v8i8, 1},

{ISD::VECTOR_SHUFFLE, MVT::v4i32, 2},
{ISD::VECTOR_SHUFFLE, MVT::v4f32, 2},
Expand Down

0 comments on commit befe74f

Please sign in to comment.