diff options
author | Michael Zolotukhin <mzolotukhin@apple.com> | 2014-04-30 19:17:32 +0000 |
---|---|---|
committer | Michael Zolotukhin <mzolotukhin@apple.com> | 2014-04-30 19:17:32 +0000 |
commit | c80b103a2b1659482332b41c42f49137f3a5c069 (patch) | |
tree | c079a356779ab5deb88238fb2baacd5db7c69c0c /lib | |
parent | 4aef7270c975ed62788ce5956a1763101113bc6f (diff) | |
download | llvm-c80b103a2b1659482332b41c42f49137f3a5c069.tar.gz llvm-c80b103a2b1659482332b41c42f49137f3a5c069.tar.bz2 llvm-c80b103a2b1659482332b41c42f49137f3a5c069.tar.xz |
[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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207692 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Target/X86/X86TargetTransformInfo.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/Target/X86/X86TargetTransformInfo.cpp b/lib/Target/X86/X86TargetTransformInfo.cpp index 1543f109b4..ce060aba64 100644 --- a/lib/Target/X86/X86TargetTransformInfo.cpp +++ b/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: |