[PATCH] D63706: [InlineCost] Fix bug 42084: remember negative result when computing full inline cost

Yevgeny Rouban via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 24 23:09:37 PDT 2019


yrouban added a comment.

In D63706#1555837 <https://reviews.llvm.org/D63706#1555837>, @fedor.sergeev wrote:

> Please, see my comment to PR42084: https://bugs.llvm.org/show_bug.cgi?id=42084#c3.
>  A core of the problem is in two difference Cost-vs-Threshold checks used in analyzeBlock (Cost >= Threshold) and analyzeCall (Cost < max(1, Threshold)).
>  I believe a proper fix for this bug would be to use a unified Cost-vs-Threshold check everywhere.


I agree that those two checks seem to be inconsistent with each other, but I insist on my fix. It makes the method //analyzeBlock()// return same result (negative or positive) regardless of the flag //ComputeFullInlineCost//.
The root cause is that the //analyzeBlock()// returns different results (negative or positive) for different //ComputeFullInlineCost//. And the checks you mentioned if fixed could just hide this difference.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D63706/new/

https://reviews.llvm.org/D63706





More information about the llvm-commits mailing list