[llvm] [InlineOrder] fix the calculation of Cost for CostBenefitPriority (PR #86630)

Lei Wang via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 26 14:41:16 PDT 2024


================
@@ -114,7 +114,10 @@ class CostBenefitPriority {
   CostBenefitPriority(const CallBase *CB, FunctionAnalysisManager &FAM,
                       const InlineParams &Params) {
     auto IC = getInlineCostWrapper(const_cast<CallBase &>(*CB), FAM, Params);
-    Cost = IC.getCost();
+    if (IC.isVariable())
----------------
wlei-llvm wrote:

Oh, I think it needs to use the `IC` not only the cost, (I was just thinking to avoid those three duplicated code), no better idea so far, feel free to ignore. 

https://github.com/llvm/llvm-project/pull/86630


More information about the llvm-commits mailing list