diff options
author | Karthik Bhat <kv.bhat@samsung.com> | 2014-08-25 04:56:54 +0000 |
---|---|---|
committer | Karthik Bhat <kv.bhat@samsung.com> | 2014-08-25 04:56:54 +0000 |
commit | 7f33ff7deaea1454422a99d3a497fa0d11955e2a (patch) | |
tree | 87a2d6dddf2342728ee8a1d9c75dfe0bc5ed05d2 /llvm/lib/CodeGen/BasicTargetTransformInfo.cpp | |
parent | c6914d068f317f3c8bc9734b6bbeb090975b50b1 (diff) | |
download | bcm5719-llvm-7f33ff7deaea1454422a99d3a497fa0d11955e2a.tar.gz bcm5719-llvm-7f33ff7deaea1454422a99d3a497fa0d11955e2a.zip |
Allow vectorization of division by uniform power of 2.
This patch adds support to recognize division by uniform power of 2 and modifies the cost table to vectorize division by uniform power of 2 whenever possible.
Updates Cost model for Loop and SLP Vectorizer.The cost table is currently only updated for X86 backend.
Thanks to Hal, Andrea, Sanjay for the review. (http://reviews.llvm.org/D4971)
llvm-svn: 216371
Diffstat (limited to 'llvm/lib/CodeGen/BasicTargetTransformInfo.cpp')
-rw-r--r-- | llvm/lib/CodeGen/BasicTargetTransformInfo.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/BasicTargetTransformInfo.cpp b/llvm/lib/CodeGen/BasicTargetTransformInfo.cpp index 24bc570f44a..85045eaa6df 100644 --- a/llvm/lib/CodeGen/BasicTargetTransformInfo.cpp +++ b/llvm/lib/CodeGen/BasicTargetTransformInfo.cpp @@ -104,7 +104,8 @@ public: unsigned getMaximumUnrollFactor() const override; unsigned getRegisterBitWidth(bool Vector) const override; unsigned getArithmeticInstrCost(unsigned Opcode, Type *Ty, OperandValueKind, - OperandValueKind) const override; + OperandValueKind, OperandValueProperties, + OperandValueProperties) const override; unsigned getShuffleCost(ShuffleKind Kind, Type *Tp, int Index, Type *SubTp) const override; unsigned getCastInstrCost(unsigned Opcode, Type *Dst, @@ -289,8 +290,9 @@ unsigned BasicTTI::getMaximumUnrollFactor() const { } unsigned BasicTTI::getArithmeticInstrCost(unsigned Opcode, Type *Ty, - OperandValueKind, - OperandValueKind) const { + OperandValueKind, OperandValueKind, + OperandValueProperties, + OperandValueProperties) const { // Check if any of the operands are vector operands. const TargetLoweringBase *TLI = getTLI(); int ISD = TLI->InstructionOpcodeToISD(Opcode); |