summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/X86/X86TargetTransformInfo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Target/X86/X86TargetTransformInfo.cpp')
-rw-r--r--llvm/lib/Target/X86/X86TargetTransformInfo.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/llvm/lib/Target/X86/X86TargetTransformInfo.cpp b/llvm/lib/Target/X86/X86TargetTransformInfo.cpp
index 831b6a76ed1..9f71d626dda 100644
--- a/llvm/lib/Target/X86/X86TargetTransformInfo.cpp
+++ b/llvm/lib/Target/X86/X86TargetTransformInfo.cpp
@@ -2400,9 +2400,15 @@ int X86TTIImpl::getVectorInstrCost(unsigned Opcode, Type *Val, unsigned Index) {
unsigned Width = LT.second.getVectorNumElements();
Index = Index % Width;
- // Floating point scalars are already located in index #0.
- if (ScalarType->isFloatingPointTy() && Index == 0)
- return 0;
+ if (Index == 0) {
+ // Floating point scalars are already located in index #0.
+ if (ScalarType->isFloatingPointTy())
+ return 0;
+
+ // Assume movd/movq XMM <-> GPR is relatively cheap on all targets.
+ if (ScalarType->isIntegerTy())
+ return 1;
+ }
int ISD = TLI->InstructionOpcodeToISD(Opcode);
assert(ISD && "Unexpected vector opcode");
OpenPOWER on IntegriCloud