summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r--llvm/lib/Target/X86/X86TargetTransformInfo.cpp24
1 files changed, 11 insertions, 13 deletions
diff --git a/llvm/lib/Target/X86/X86TargetTransformInfo.cpp b/llvm/lib/Target/X86/X86TargetTransformInfo.cpp
index 0010423bc76..43931ccf034 100644
--- a/llvm/lib/Target/X86/X86TargetTransformInfo.cpp
+++ b/llvm/lib/Target/X86/X86TargetTransformInfo.cpp
@@ -1857,16 +1857,12 @@ int X86TTIImpl::getIntrinsicInstrCost(Intrinsic::ID IID, Type *RetTy,
{ ISD::FSQRT, MVT::v4f32, 56 }, // Pentium III from http://www.agner.org/
};
static const CostTblEntry X64CostTbl[] = { // 64-bit targets
- { ISD::BITREVERSE, MVT::i64, 14 },
- { X86ISD::SHLD, MVT::i64, 4 }
+ { ISD::BITREVERSE, MVT::i64, 14 }
};
static const CostTblEntry X86CostTbl[] = { // 32 or 64-bit targets
{ ISD::BITREVERSE, MVT::i32, 14 },
{ ISD::BITREVERSE, MVT::i16, 14 },
- { ISD::BITREVERSE, MVT::i8, 11 },
- { X86ISD::SHLD, MVT::i32, 4 },
- { X86ISD::SHLD, MVT::i16, 4 },
- { X86ISD::SHLD, MVT::i8, 4 }
+ { ISD::BITREVERSE, MVT::i8, 11 }
};
unsigned ISD = ISD::DELETED_NODE;
@@ -1888,11 +1884,6 @@ int X86TTIImpl::getIntrinsicInstrCost(Intrinsic::ID IID, Type *RetTy,
case Intrinsic::cttz:
ISD = ISD::CTTZ;
break;
- case Intrinsic::fshl:
- case Intrinsic::fshr:
- // SHRD has same costs so don't duplicate.
- ISD = X86ISD::SHLD;
- break;
case Intrinsic::sqrt:
ISD = ISD::FSQRT;
break;
@@ -1999,7 +1990,8 @@ int X86TTIImpl::getIntrinsicInstrCost(Intrinsic::ID IID, Type *RetTy,
};
static const CostTblEntry X64CostTbl[] = { // 64-bit targets
{ ISD::ROTL, MVT::i64, 1 },
- { ISD::ROTR, MVT::i64, 1 }
+ { ISD::ROTR, MVT::i64, 1 },
+ { X86ISD::SHLD, MVT::i64, 4 }
};
static const CostTblEntry X86CostTbl[] = { // 32 or 64-bit targets
{ ISD::ROTL, MVT::i32, 1 },
@@ -2007,7 +1999,10 @@ int X86TTIImpl::getIntrinsicInstrCost(Intrinsic::ID IID, Type *RetTy,
{ ISD::ROTL, MVT::i8, 1 },
{ ISD::ROTR, MVT::i32, 1 },
{ ISD::ROTR, MVT::i16, 1 },
- { ISD::ROTR, MVT::i8, 1 }
+ { ISD::ROTR, MVT::i8, 1 },
+ { X86ISD::SHLD, MVT::i32, 4 },
+ { X86ISD::SHLD, MVT::i16, 4 },
+ { X86ISD::SHLD, MVT::i8, 4 }
};
unsigned ISD = ISD::DELETED_NODE;
@@ -2015,10 +2010,13 @@ int X86TTIImpl::getIntrinsicInstrCost(Intrinsic::ID IID, Type *RetTy,
default:
break;
case Intrinsic::fshl:
+ ISD = X86ISD::SHLD;
if (Args[0] == Args[1])
ISD = ISD::ROTL;
break;
case Intrinsic::fshr:
+ // SHRD has same costs so don't duplicate.
+ ISD = X86ISD::SHLD;
if (Args[0] == Args[1])
ISD = ISD::ROTR;
break;
OpenPOWER on IntegriCloud