]> granicus.if.org Git - clang/commitdiff
Do not disable completely loop unroll when optimizing for size.
authorMarianne Mailhot-Sarrasin <marianne.mailhot.sarrasin@gmail.com>
Wed, 4 May 2016 15:26:28 +0000 (15:26 +0000)
committerMarianne Mailhot-Sarrasin <marianne.mailhot.sarrasin@gmail.com>
Wed, 4 May 2016 15:26:28 +0000 (15:26 +0000)
Let the loop unroll pass handle /Os. It already checks that option and adjust its thresholds accordingly. Also, will allow the #pragma unroll to have an effect in /Os.

Differential Revision: http://reviews.llvm.org/D19827

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@268509 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Frontend/CompilerInvocation.cpp

index 69a4366213751284939fba2bbc29f2e13e013ba4..2091ec4af329065fc91d77953699e72e3e02515d 100644 (file)
@@ -513,7 +513,7 @@ static bool ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, InputKind IK,
     getAllNoBuiltinFuncValues(Args, Opts.NoBuiltinFuncs);
   Opts.UnrollLoops =
       Args.hasFlag(OPT_funroll_loops, OPT_fno_unroll_loops,
-                   (Opts.OptimizationLevel > 1 && !Opts.OptimizeSize));
+                   (Opts.OptimizationLevel > 1));
   Opts.RerollLoops = Args.hasArg(OPT_freroll_loops);
 
   Opts.DisableIntegratedAS = Args.hasArg(OPT_fno_integrated_as);