summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorMichael Zolotukhin <mzolotukhin@apple.com>2014-04-30 19:17:32 +0000
committerMichael Zolotukhin <mzolotukhin@apple.com>2014-04-30 19:17:32 +0000
commit1f4a960ccf3f70963657fb16c8514a093c9d7d58 (patch)
tree3f51117df9efbd86e7d25fff3e4a3e8c6615d61c /llvm/lib
parenta64f34b759bb19a49d9fcc6be6db8f703a9c79d7 (diff)
downloadbcm5719-llvm-1f4a960ccf3f70963657fb16c8514a093c9d7d58.tar.gz
bcm5719-llvm-1f4a960ccf3f70963657fb16c8514a093c9d7d58.zip
[X86] Never hoist the shift value of a shift instruction.
There is no need to check if we want to hoist the immediate value of an shift instruction. Simply return TCC_Free right away. This change is like r206101, but for X86. rdar://problem/16190769 llvm-svn: 207692
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/X86/X86TargetTransformInfo.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/llvm/lib/Target/X86/X86TargetTransformInfo.cpp b/llvm/lib/Target/X86/X86TargetTransformInfo.cpp
index 1543f109b4c..ce060aba644 100644
--- a/llvm/lib/Target/X86/X86TargetTransformInfo.cpp
+++ b/llvm/lib/Target/X86/X86TargetTransformInfo.cpp
@@ -956,15 +956,19 @@ unsigned X86TTI::getIntImmCost(unsigned Opcode, unsigned Idx, const APInt &Imm,
case Instruction::SDiv:
case Instruction::URem:
case Instruction::SRem:
- case Instruction::Shl:
- case Instruction::LShr:
- case Instruction::AShr:
case Instruction::And:
case Instruction::Or:
case Instruction::Xor:
case Instruction::ICmp:
ImmIdx = 1;
break;
+ // Always return TCC_Free for the shift value of a shift instruction.
+ case Instruction::Shl:
+ case Instruction::LShr:
+ case Instruction::AShr:
+ if (Idx == 1)
+ return TCC_Free;
+ break;
case Instruction::Trunc:
case Instruction::ZExt:
case Instruction::SExt:
OpenPOWER on IntegriCloud