[llvm] [CostModel] Estimate the codesize cost of switch (PR #163569)

Hongyu Chen via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 20 02:06:23 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:

Gently ping. @RKSimon, could you confirm that? Many thanks.

https://github.com/llvm/llvm-project/pull/163569


More information about the llvm-commits mailing list