[PATCH] D110739: [CostModel] Update default cost model for sadd/ssub overflow to match TargetLowering

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 29 12:27:24 PDT 2021


RKSimon added inline comments.


================
Comment at: llvm/include/llvm/CodeGen/BasicTTIImpl.h:1797
       InstructionCost Cost = 0;
       Cost += thisT()->getArithmeticInstrCost(Opcode, SumTy, CostKind);
       Cost += 2 * thisT()->getCmpSelInstrCost(
----------------
Worth trying to specify the Args as well via the IntrinsicCostAttributes arg?


================
Comment at: llvm/include/llvm/CodeGen/BasicTTIImpl.h:1800
+                      Instruction::ICmp, SumTy, OverflowTy,
                       CmpInst::BAD_ICMP_PREDICATE, CostKind);
+      Cost += thisT()->getArithmeticInstrCost(BinaryOperator::Xor, OverflowTy,
----------------
Can we specify the predicate (ICMP_SGT) as well? I've been meaning to deal with PR48337 for ages so X86 actually uses it...


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D110739/new/

https://reviews.llvm.org/D110739



More information about the llvm-commits mailing list