Inliner: Do zero-cost inlines even if above a negative threshold (PR24851)
[oota-llvm.git] / lib / Analysis / InlineCost.cpp
index 8169ce482461c151184b08f003145dc0244338a0..26f2e7ff504a8a6ad8f0b013ea7daad7643e1a77 100644 (file)
@@ -1296,7 +1296,7 @@ bool CallAnalyzer::analyzeCall(CallSite CS) {
   else if (NumVectorInstructions <= NumInstructions / 2)
     Threshold -= (FiftyPercentVectorBonus - TenPercentVectorBonus);
 
-  return Cost < Threshold;
+  return Cost <= std::max(0, Threshold);
 }
 
 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)