[llvm] [X86][CostModel] Estimate the codesize cost of switch (PR #163569)
Hongyu Chen via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 15 12:17:14 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:
Move it to the base impl now.
https://github.com/llvm/llvm-project/pull/163569
More information about the llvm-commits
mailing list