Skip to content

Commit 58622ef

Browse files
committed
[InlineCost] Ignore default branch
1 parent f3c5278 commit 58622ef

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

llvm/lib/Analysis/InlineCost.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -701,8 +701,8 @@ class InlineCostCallAnalyzer final : public CallAnalyzer {
701701

702702
void onFinalizeSwitch(unsigned JumpTableSize, unsigned NumCaseCluster,
703703
bool DefaultDestUndefined) override {
704-
if (!DefaultDestUndefined)
705-
addCost(2 * InstrCost);
704+
// if (!DefaultDestUndefined)
705+
// addCost(2 * InstrCost);
706706
// If suitable for a jump table, consider the cost for the table size and
707707
// branch to destination.
708708
// Maximum valid cost increased in this function.
@@ -1235,9 +1235,9 @@ class InlineCostFeaturesAnalyzer final : public CallAnalyzer {
12351235

12361236
void onFinalizeSwitch(unsigned JumpTableSize, unsigned NumCaseCluster,
12371237
bool DefaultDestUndefined) override {
1238-
if (!DefaultDestUndefined)
1239-
increment(InlineCostFeatureIndex::switch_default_dest_penalty,
1240-
SwitchDefaultDestCostMultiplier * InstrCost);
1238+
// if (!DefaultDestUndefined)
1239+
// increment(InlineCostFeatureIndex::switch_default_dest_penalty,
1240+
// SwitchDefaultDestCostMultiplier * InstrCost);
12411241

12421242
if (JumpTableSize) {
12431243
int64_t JTCost = static_cast<int64_t>(JumpTableSize) * InstrCost +

0 commit comments

Comments
 (0)