From cf03068d91f70cb0a0aeff2409ac67fe781f6390 Mon Sep 17 00:00:00 2001 From: Juergen Ributzka Date: Sat, 12 Apr 2014 02:53:51 +0000 Subject: [ARM64] 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. llvm-svn: 206101 --- llvm/lib/Target/ARM64/ARM64TargetTransformInfo.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'llvm/lib') diff --git a/llvm/lib/Target/ARM64/ARM64TargetTransformInfo.cpp b/llvm/lib/Target/ARM64/ARM64TargetTransformInfo.cpp index cc8cc806ec7..372900e99fe 100644 --- a/llvm/lib/Target/ARM64/ARM64TargetTransformInfo.cpp +++ b/llvm/lib/Target/ARM64/ARM64TargetTransformInfo.cpp @@ -203,15 +203,19 @@ unsigned ARM64TTI::getIntImmCost(unsigned Opcode, unsigned Idx, 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: -- cgit v1.2.3