From f8b94812a15515efd5a9ddf422358bad5ebb4105 Mon Sep 17 00:00:00 2001 From: Devang Patel Date: Thu, 4 Sep 2008 23:05:13 +0000 Subject: [PATCH] Document function notes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55808 91177308-0d34-0410-b5e6-96231b3b80d8 --- docs/LangRef.html | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/docs/LangRef.html b/docs/LangRef.html index 4d73aaafe8d..56691145273 100644 --- a/docs/LangRef.html +++ b/docs/LangRef.html @@ -750,7 +750,8 @@ an optional linkage type, an optional parameter attribute for the return type, a function name, a (possibly empty) argument list (each with optional parameter attributes), an optional section, an -optional alignment, an optional garbage collector name, an +optional alignment, an optional garbage collector name, +an optional function notes, an opening curly brace, a list of basic blocks, and a closing curly brace. LLVM function declarations consist of the "declare" keyword, an @@ -910,6 +911,41 @@ collector which will cause the compiler to alter its output in order to support the named garbage collection algorithm.

+ +
+ Function Notes +
+ +
+

Each function may specify function notes.

+ +
+
define void @f() notes(inline=Always) { ... }
+
define void @f() notes(inline=Always,opt-size) { ... }
+
define void @f() notes(inline=Never,opt-size) { ... }
+
define void @f() notes(opt-size) { ... }
+
+ +

+

  • inline=Always +

    +This note requests inliner to inline this function irrespective of +inlining size threshold for this function. +

  • +
  • inline=Never +

    +This note requests inliner to never inline this function in any situation. +This note may not be used together with inline=Always note. +

  • +
  • opt-size +

    +This note suggests optimization passes and code generator passes to make +choices that help reduce code size. +

  • +

    +The notes that are not documented here are considered invalid notes. +

    +
    Module-Level Inline Assembly