diff options
| author | Arnold Schwaighofer <aschwaighofer@apple.com> | 2013-02-04 02:52:05 +0000 |
|---|---|---|
| committer | Arnold Schwaighofer <aschwaighofer@apple.com> | 2013-02-04 02:52:05 +0000 |
| commit | 98f1012f9bc32db15d3a24385090bb3fa5a09420 (patch) | |
| tree | e8c539c9889c214fbf489fe182db2c42d258ec90 /llvm/lib/Target/ARM | |
| parent | a9c5bb3ff3a71dc0529ebf72c243c6388112b2c5 (diff) | |
| download | bcm5719-llvm-98f1012f9bc32db15d3a24385090bb3fa5a09420.tar.gz bcm5719-llvm-98f1012f9bc32db15d3a24385090bb3fa5a09420.zip | |
ARM cost model: Penalize insertelement into D subregisters
Swift has a renaming dependency if we load into D subregisters. We don't have a
way of distinguishing between insertelement operations of values from loads and
other values. Therefore, we are pessimistic for now (The performance problem
showed up in example 14 of gcc-loops).
radar://13096933
llvm-svn: 174300
Diffstat (limited to 'llvm/lib/Target/ARM')
| -rw-r--r-- | llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp b/llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp index 61cb1f6b9a3..2ded63f8f71 100644 --- a/llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp +++ b/llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp @@ -117,6 +117,7 @@ public: unsigned getCastInstrCost(unsigned Opcode, Type *Dst, Type *Src) const; + unsigned getVectorInstrCost(unsigned Opcode, Type *Val, unsigned Index) const; /// @} }; @@ -197,3 +198,15 @@ unsigned ARMTTI::getCastInstrCost(unsigned Opcode, Type *Dst, return TargetTransformInfo::getCastInstrCost(Opcode, Dst, Src); } + +unsigned ARMTTI::getVectorInstrCost(unsigned Opcode, Type *ValTy, + unsigned Index) const { + // Penalize inserting into an D-subregister. + if (ST->isSwift() && + Opcode == Instruction::InsertElement && + ValTy->isVectorTy() && + ValTy->getScalarSizeInBits() <= 32) + return 2; + + return TargetTransformInfo::getVectorInstrCost(Opcode, ValTy, Index); +} |

