summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen/inline-optim.c
diff options
context:
space:
mode:
authorHans Wennborg <hans@hanshq.net>2016-06-22 16:56:16 +0000
committerHans Wennborg <hans@hanshq.net>2016-06-22 16:56:16 +0000
commit44d061a4714769b33e17c6099a35a61e3c62b726 (patch)
tree7773dc6d0c287f39e9afddf854ff5be755c83fb8 /clang/test/CodeGen/inline-optim.c
parenteeec4c83648a9a296724c801e1a3fa8686270d4e (diff)
downloadbcm5719-llvm-44d061a4714769b33e17c6099a35a61e3c62b726.tar.gz
bcm5719-llvm-44d061a4714769b33e17c6099a35a61e3c62b726.zip
Add support for /Ob1 and -finline-hint-functions flags
Add support for /Ob1 (and equivalent -finline-hint-functions), which enable inlining only for functions marked inline, either explicitly (via inline keyword, for example), or implicitly (function definition in class body, for example). This works by enabling inlining pass, and adding noinline attribute to every function not marked inline. Patch by Rudy Pons <rudy.pons@ilod.org>! Differential Revision: http://reviews.llvm.org/D20647 llvm-svn: 273440
Diffstat (limited to 'clang/test/CodeGen/inline-optim.c')
-rw-r--r--clang/test/CodeGen/inline-optim.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/test/CodeGen/inline-optim.c b/clang/test/CodeGen/inline-optim.c
index 7ee9c033410..f8b355afd9c 100644
--- a/clang/test/CodeGen/inline-optim.c
+++ b/clang/test/CodeGen/inline-optim.c
@@ -2,6 +2,7 @@
// RUN: %clang_cc1 -triple i686-pc-win32 -emit-llvm %s -o - | FileCheck -check-prefix=NOINLINE %s
// RUN: %clang_cc1 -triple i686-pc-win32 -O3 -fno-inline-functions -emit-llvm %s -o - | FileCheck -check-prefix=NOINLINE %s
+// RUN: %clang_cc1 -triple i686-pc-win32 -finline-hint-functions -emit-llvm %s -o - | FileCheck -check-prefix=HINT %s
// RUN: %clang_cc1 -triple i686-pc-win32 -finline-functions -emit-llvm %s -o - | FileCheck -check-prefix=INLINE %s
inline int inline_hint(int a, int b) { return(a+b); }
@@ -13,14 +14,18 @@ inline __attribute__ ((__always_inline__)) int inline_always(int a, int b) { ret
volatile int *pa = (int*) 0x1000;
void foo() {
// NOINLINE-LABEL: @foo
+// HINT-LABEL: @foo
// INLINE-LABEL: @foo
// NOINLINE: call i32 @inline_hint
+// HINT-NOT: call i32 @inline_hint
// INLINE-NOT: call i32 @inline_hint
pa[0] = inline_hint(pa[1],pa[2]);
// NOINLINE-NOT: call i32 @inline_always
+// HINT-NOT: call i32 @inline_always
// INLINE-NOT: call i32 @inline_always
pa[3] = inline_always(pa[4],pa[5]);
// NOINLINE: call i32 @inline_no_hint
+// HINT: call i32 @inline_no_hint
// INLINE-NOT: call i32 @inline_no_hint
pa[6] = inline_no_hint(pa[7], pa[8]);
}
OpenPOWER on IntegriCloud