Skip to content

Commit

Permalink
[CostModel][TTI] Replace BAD_ICMP_PREDICATE with ICMP_NE for generic …
Browse files Browse the repository at this point in the history
…smulo/umulo cost expansion

Match the predicate used in TargetLowering::expandMULO to detect overflow
  • Loading branch information
RKSimon committed Oct 6, 2021
1 parent 7bd097f commit 2ced9a4
Show file tree
Hide file tree
Showing 3 changed files with 195 additions and 196 deletions.
5 changes: 2 additions & 3 deletions llvm/include/llvm/CodeGen/BasicTTIImpl.h
Expand Up @@ -1846,9 +1846,8 @@ class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
CostKind, TTI::OK_AnyValue,
TTI::OK_UniformConstantValue);

Cost +=
thisT()->getCmpSelInstrCost(BinaryOperator::ICmp, MulTy, OverflowTy,
CmpInst::BAD_ICMP_PREDICATE, CostKind);
Cost += thisT()->getCmpSelInstrCost(
BinaryOperator::ICmp, MulTy, OverflowTy, CmpInst::ICMP_NE, CostKind);
return Cost;
}
case Intrinsic::ctpop:
Expand Down

0 comments on commit 2ced9a4

Please sign in to comment.