Index: include/llvm/Analysis/TargetTransformInfoImpl.h =================================================================== --- include/llvm/Analysis/TargetTransformInfoImpl.h +++ include/llvm/Analysis/TargetTransformInfoImpl.h @@ -805,15 +805,9 @@ return static_cast(this)->getCallCost(F, Arguments); } - if (const CastInst *CI = dyn_cast(U)) { - // Result of a cmp instruction is often extended (to be used by other - // cmp instructions, logical or return instructions). These are usually - // nop on most sane targets. - if (isa(CI->getOperand(0))) - return TTI::TCC_Free; + if (const CastInst *CI = dyn_cast(U)) if (isa(CI) || isa(CI) || isa(CI)) return static_cast(this)->getExtCost(CI, Operands.back()); - } return static_cast(this)->getOperationCost( Operator::getOpcode(U), U->getType(),