@@ -344,7 +344,7 @@ class CallAnalyzer : public InstVisitor<CallAnalyzer, bool> {
344344 // / Called at the end of processing a switch instruction, with the given
345345 // / number of case clusters.
346346 virtual void onFinalizeSwitch (unsigned JumpTableSize, unsigned NumCaseCluster,
347- bool DefaultDestUndefined ) {}
347+ bool DefaultDestUnreachable ) {}
348348
349349 // / Called to account for any other instruction not specifically accounted
350350 // / for.
@@ -722,14 +722,14 @@ class InlineCostCallAnalyzer final : public CallAnalyzer {
722722 }
723723
724724 void onFinalizeSwitch (unsigned JumpTableSize, unsigned NumCaseCluster,
725- bool DefaultDestUndefined ) override {
725+ bool DefaultDestUnreachable ) override {
726726 // If suitable for a jump table, consider the cost for the table size and
727727 // branch to destination.
728728 // Maximum valid cost increased in this function.
729729 if (JumpTableSize) {
730730 // Suppose a default branch includes one compare and one conditional
731731 // branch if it's reachable.
732- if (!DefaultDestUndefined )
732+ if (!DefaultDestUnreachable )
733733 addCost (2 * InstrCost);
734734 // Suppose a jump table requires one load and one jump instruction.
735735 int64_t JTCost =
@@ -742,7 +742,7 @@ class InlineCostCallAnalyzer final : public CallAnalyzer {
742742 // Suppose a comparison includes one compare and one conditional branch.
743743 // We can reduce a set of instructions if the default branch is
744744 // undefined.
745- addCost ((NumCaseCluster - DefaultDestUndefined ) * 2 * InstrCost);
745+ addCost ((NumCaseCluster - DefaultDestUnreachable ) * 2 * InstrCost);
746746 return ;
747747 }
748748
@@ -1268,9 +1268,9 @@ class InlineCostFeaturesAnalyzer final : public CallAnalyzer {
12681268 }
12691269
12701270 void onFinalizeSwitch (unsigned JumpTableSize, unsigned NumCaseCluster,
1271- bool DefaultDestUndefined ) override {
1271+ bool DefaultDestUnreachable ) override {
12721272 if (JumpTableSize) {
1273- if (!DefaultDestUndefined )
1273+ if (!DefaultDestUnreachable )
12741274 increment (InlineCostFeatureIndex::switch_default_dest_penalty,
12751275 SwitchDefaultDestCostMultiplier * InstrCost);
12761276 int64_t JTCost = static_cast <int64_t >(JumpTableSize) * InstrCost +
@@ -1281,7 +1281,7 @@ class InlineCostFeaturesAnalyzer final : public CallAnalyzer {
12811281
12821282 if (NumCaseCluster <= 3 ) {
12831283 increment (InlineCostFeatureIndex::case_cluster_penalty,
1284- (NumCaseCluster - DefaultDestUndefined ) *
1284+ (NumCaseCluster - DefaultDestUnreachable ) *
12851285 CaseClusterCostMultiplier * InstrCost);
12861286 return ;
12871287 }
@@ -2508,7 +2508,7 @@ bool CallAnalyzer::visitSwitchInst(SwitchInst &SI) {
25082508 unsigned NumCaseCluster =
25092509 TTI.getEstimatedNumberOfCaseClusters (SI, JumpTableSize, PSI, BFI);
25102510
2511- onFinalizeSwitch (JumpTableSize, NumCaseCluster, SI.defaultDestUndefined ());
2511+ onFinalizeSwitch (JumpTableSize, NumCaseCluster, SI.defaultDestUnreachable ());
25122512 return false ;
25132513}
25142514
0 commit comments