[llvm] 1f3e90e - Fix Threshold overwrite bug in the Oz inlining model features.

Jacob Hegna via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 20 11:05:38 PDT 2021


Author: Jacob Hegna
Date: 2021-07-20T18:05:06Z
New Revision: 1f3e90e12894b1f91c5e857dcd358eb689e2d262

URL: https://github.com/llvm/llvm-project/commit/1f3e90e12894b1f91c5e857dcd358eb689e2d262
DIFF: https://github.com/llvm/llvm-project/commit/1f3e90e12894b1f91c5e857dcd358eb689e2d262.diff

LOG: Fix Threshold overwrite bug in the Oz inlining model features.

Differential Revision: https://reviews.llvm.org/D106336

Added: 
    

Modified: 
    llvm/lib/Analysis/InlineCost.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Analysis/InlineCost.cpp b/llvm/lib/Analysis/InlineCost.cpp
index e73b0fa1440ba..1b6ac94979a95 100644
--- a/llvm/lib/Analysis/InlineCost.cpp
+++ b/llvm/lib/Analysis/InlineCost.cpp
@@ -1097,9 +1097,9 @@ class InlineCostFeaturesAnalyzer final : public CallAnalyzer {
     set(InlineCostFeatureIndex::SROASavings, SROACostSavingOpportunities);
 
     if (NumVectorInstructions <= NumInstructions / 10)
-      increment(InlineCostFeatureIndex::Threshold, -1 * VectorBonus);
+      Threshold -= VectorBonus;
     else if (NumVectorInstructions <= NumInstructions / 2)
-      increment(InlineCostFeatureIndex::Threshold, -1 * (VectorBonus / 2));
+      Threshold -= VectorBonus / 2;
 
     set(InlineCostFeatureIndex::Threshold, Threshold);
 


        


More information about the llvm-commits mailing list