Skip to content

Commit 9333f91

Browse files
committed
[InlineCost] The jump table only requires a jump instruction
1 parent d69f4bc commit 9333f91

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

llvm/lib/Analysis/InlineCost.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -709,8 +709,9 @@ class InlineCostCallAnalyzer final : public CallAnalyzer {
709709
// branch if it's reachable.
710710
if (!DefaultDestUndefined)
711711
addCost(2 * InstrCost);
712+
// The jump table only requires a jump instruction.
712713
int64_t JTCost =
713-
static_cast<int64_t>(JumpTableSize) * InstrCost + 4 * InstrCost;
714+
static_cast<int64_t>(JumpTableSize) * InstrCost + InstrCost;
714715
addCost(JTCost);
715716
return;
716717
}
@@ -1157,7 +1158,7 @@ class InlineCostFeaturesAnalyzer final : public CallAnalyzer {
11571158
// FIXME: These constants are taken from the heuristic-based cost visitor.
11581159
// These should be removed entirely in a later revision to avoid reliance on
11591160
// heuristics in the ML inliner.
1160-
static constexpr int JTCostMultiplier = 4;
1161+
static constexpr int JTCostMultiplier = 1;
11611162
static constexpr int CaseClusterCostMultiplier = 2;
11621163
static constexpr int SwitchDefaultDestCostMultiplier = 2;
11631164
static constexpr int SwitchCostMultiplier = 2;

0 commit comments

Comments
 (0)