[PATCH] D13088: [InlineCost] Adjust inlining cost for implicit null checks

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 23 09:00:57 PDT 2015


Test case?

On Tue, Sep 22, 2015 at 8:48 PM, Chen Li via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> chenli created this revision.
> chenli added reviewers: reames, chandlerc.
> chenli added a subscriber: llvm-commits.
>
> Implicit null checks act like unconditional branches, and their inlining
> cost should be free.
>
> http://reviews.llvm.org/D13088
>
> Files:
>   lib/Analysis/InlineCost.cpp
>
> Index: lib/Analysis/InlineCost.cpp
> ===================================================================
> --- lib/Analysis/InlineCost.cpp
> +++ lib/Analysis/InlineCost.cpp
> @@ -602,6 +602,11 @@
>      disableSROA(CostIt);
>    }
>
> +  // Implicit null checks act as unconditional branches, and
> +  // they should be free. See the comments in visitBranchInst.
> +  if (I.getMetadata(LLVMContext::MD_make_implicit))
> +    return true;
> +
>    return false;
>  }
>
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150923/fb16a519/attachment.html>


More information about the llvm-commits mailing list