From 2086ba4770d435a084c65410ab061591e1a36c33 Mon Sep 17 00:00:00 2001 From: Bernhard Schommer Date: Fri, 7 Apr 2017 14:00:15 +0200 Subject: Add optimization option finline. The new option f(no-)inline controlls whether inlining is active or not. Bug 21343. --- backend/Inliningaux.ml | 2 +- doc/ccomp.1 | 5 +++++ driver/Clflags.ml | 1 + driver/Driver.ml | 1 + 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/backend/Inliningaux.ml b/backend/Inliningaux.ml index 265831a5..df33e1ac 100644 --- a/backend/Inliningaux.ml +++ b/backend/Inliningaux.ml @@ -13,4 +13,4 @@ (* To be considered: heuristics based on size of function? *) let should_inline (id: AST.ident) (f: RTL.coq_function) = - C2C.atom_is_inline id + !Clflags.option_finline && C2C.atom_is_inline id diff --git a/doc/ccomp.1 b/doc/ccomp.1 index c074ec9d..906e0ffc 100644 --- a/doc/ccomp.1 +++ b/doc/ccomp.1 @@ -138,6 +138,11 @@ Turn on/off common subexpression elimination. Enabled by default. . .TP +.BR \-finline ", " \-fno\-inline +Turn on/off inlining of functions. +Enabled by default. +. +.TP .BR \-fredundancy ", " \-fno\-redundancy Turn on/off redundancy elimination. Enabled by default. diff --git a/driver/Clflags.ml b/driver/Clflags.ml index c7a5d3bf..2d92e09b 100644 --- a/driver/Clflags.ml +++ b/driver/Clflags.ml @@ -33,6 +33,7 @@ let option_faligncondbranchs = ref 0 let option_finline_asm = ref false let option_mthumb = ref (Configuration.model = "armv7m") let option_Osize = ref false +let option_finline = ref true let option_dprepro = ref false let option_dparse = ref false let option_dcmedium = ref false diff --git a/driver/Driver.ml b/driver/Driver.ml index 48bd9034..a91bb67c 100644 --- a/driver/Driver.ml +++ b/driver/Driver.ml @@ -409,6 +409,7 @@ let cmdline_actions = @ f_opt "const-prop" option_fconstprop @ f_opt "cse" option_fcse @ f_opt "redundancy" option_fredundancy + @ f_opt "inline" option_finline (* Code generation options *) @ f_opt "fpu" option_ffpu @ f_opt "sse" option_ffpu (* backward compatibility *) -- cgit