Skip to content

Commit 2ced9a4

Browse files
committed
[CostModel][TTI] Replace BAD_ICMP_PREDICATE with ICMP_NE for generic smulo/umulo cost expansion
Match the predicate used in TargetLowering::expandMULO to detect overflow
1 parent 7bd097f commit 2ced9a4

File tree

3 files changed

+195
-196
lines changed

3 files changed

+195
-196
lines changed

llvm/include/llvm/CodeGen/BasicTTIImpl.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1846,9 +1846,8 @@ class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
18461846
CostKind, TTI::OK_AnyValue,
18471847
TTI::OK_UniformConstantValue);
18481848

1849-
Cost +=
1850-
thisT()->getCmpSelInstrCost(BinaryOperator::ICmp, MulTy, OverflowTy,
1851-
CmpInst::BAD_ICMP_PREDICATE, CostKind);
1849+
Cost += thisT()->getCmpSelInstrCost(
1850+
BinaryOperator::ICmp, MulTy, OverflowTy, CmpInst::ICMP_NE, CostKind);
18521851
return Cost;
18531852
}
18541853
case Intrinsic::ctpop:

0 commit comments

Comments
 (0)