<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [InlineCost] uninitialized InlineCost field cause behave different with Debug and Release mode"
   href="https://bugs.llvm.org/show_bug.cgi?id=48530">48530</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[InlineCost] uninitialized InlineCost field cause behave different with Debug and Release mode
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>10.0
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Windows NT
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Interprocedural Optimizations
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>zhongyunde@tom.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>In the commit 2094d5a03, Add a new field InRecursiveFunction without default
value. so for a non-recursive function, the value Params.InRecursiveFunction is
not uninitialized, which is used in function updateThreshold.


@@ -178,6 +179,9 @@ struct InlineParams {

   /// Compute inline cost even when the cost has exceeded the threshold.
   Optional<bool> ComputeFullInlineCost;
+
+  /// Inside recursive function
+  bool InRecursiveFunction;
 };


@@ -1252,6 +1253,12 @@ void InlineCostCallAnalyzer::updateThreshold(CallBase
&Call, Function &Callee) {
   // Cost in updateThreshold, but the bonus depends on the logic in this
method.
   if (OnlyOneCallAndLocalLinkage)
     Cost -= LastCallToStaticBonus;
+
+  // Add bonus to callsites within recursive functions
+  if (Call.getCaller() != Call.getCalledFunction() &&
+      Params.InRecursiveFunction) {
+    Cost -= CallerRecursiveBonus;
+  }</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>