[llvm] [CostModel] Estimate the codesize cost of switch (PR #163569)
Hongyu Chen via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 16 02:47:13 PDT 2025
================
@@ -6155,6 +6155,23 @@ X86TTIImpl::getIntImmCostIntrin(Intrinsic::ID IID, unsigned Idx,
InstructionCost X86TTIImpl::getCFInstrCost(unsigned Opcode,
TTI::TargetCostKind CostKind,
const Instruction *I) const {
+ if (Opcode == Instruction::Switch && CostKind == TTI::TCK_CodeSize) {
+ unsigned JumpTableSize, NumSuccs = I->getNumSuccessors();
----------------
XChy wrote:
Oh, maybe I misunderstood your word. @RKSimon, did you mean moving to TargetTransformInfoImpl::getCFInstrCost() by the base impl?
https://github.com/llvm/llvm-project/pull/163569
More information about the llvm-commits
mailing list