Index: llvm/include/llvm/Analysis/TargetTransformInfoImpl.h =================================================================== --- llvm/include/llvm/Analysis/TargetTransformInfoImpl.h +++ llvm/include/llvm/Analysis/TargetTransformInfoImpl.h @@ -872,10 +872,7 @@ case Instruction::PtrToInt: case Instruction::Trunc: case Instruction::BitCast: - if (TargetTTI->getCastInstrCost(Opcode, Ty, OpTy, CostKind, I) == - TTI::TCC_Free) - return TTI::TCC_Free; - break; + return TargetTTI->getCastInstrCost(Opcode, Ty, OpTy, CostKind, I); case Instruction::FPExt: case Instruction::SExt: case Instruction::ZExt: