[cfe-commits] r167021 - in /cfe/trunk: lib/CodeGen/CGCall.cpp test/CodeGen/attr-forcesizeopt.c test/CodeGen/attr-minsize.c

Quentin Colombet qcolombet at apple.com
Tue Oct 30 09:33:19 PDT 2012


Author: qcolombet
Date: Tue Oct 30 11:33:19 2012
New Revision: 167021

URL: http://llvm.org/viewvc/llvm-project?rev=167021&view=rev
Log:
Change ForceSizeOpt attribute into MinSize attribute

Added:
    cfe/trunk/test/CodeGen/attr-minsize.c
      - copied, changed from r166973, cfe/trunk/test/CodeGen/attr-forcesizeopt.c
Removed:
    cfe/trunk/test/CodeGen/attr-forcesizeopt.c
Modified:
    cfe/trunk/lib/CodeGen/CGCall.cpp

Modified: cfe/trunk/lib/CodeGen/CGCall.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGCall.cpp?rev=167021&r1=167020&r2=167021&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGCall.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGCall.cpp Tue Oct 30 11:33:19 2012
@@ -969,7 +969,7 @@
   if (CodeGenOpts.OptimizeSize)
     FuncAttrs.addAttribute(llvm::Attributes::OptimizeForSize);
   if (CodeGenOpts.OptimizeSize == 2)
-    FuncAttrs.addAttribute(llvm::Attributes::ForceSizeOpt);
+    FuncAttrs.addAttribute(llvm::Attributes::MinSize);
   if (CodeGenOpts.DisableRedZone)
     FuncAttrs.addAttribute(llvm::Attributes::NoRedZone);
   if (CodeGenOpts.NoImplicitFloat)

Removed: cfe/trunk/test/CodeGen/attr-forcesizeopt.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/attr-forcesizeopt.c?rev=167020&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/attr-forcesizeopt.c (original)
+++ cfe/trunk/test/CodeGen/attr-forcesizeopt.c (removed)
@@ -1,26 +0,0 @@
-// RUN: %clang_cc1 -Oz -emit-llvm %s -o - | FileCheck %s -check-prefix=Oz
-// RUN: %clang_cc1 -O0 -emit-llvm %s -o - | FileCheck %s -check-prefix=OTHER
-// RUN: %clang_cc1 -O1 -emit-llvm %s -o - | FileCheck %s -check-prefix=OTHER
-// RUN: %clang_cc1 -O2 -emit-llvm %s -o - | FileCheck %s -check-prefix=OTHER
-// RUN: %clang_cc1 -O3 -emit-llvm %s -o - | FileCheck %s -check-prefix=OTHER
-// RUN: %clang_cc1 -Os -emit-llvm %s -o - | FileCheck %s -check-prefix=OTHER
-// Check that we set the forcesizeopt attribute on each function
-// when Oz optimization level is set.
-
-int test1() {
-  return 42;
-// Oz: @test1{{.*}}forcesizeopt
-// Oz: ret
-// OTHER: @test1
-// OTHER-NOT: forcesizeopt
-// OTHER: ret
-}
-
-int test2() {
-  return 42;
-// Oz: @test2{{.*}}forcesizeopt
-// Oz: ret
-// OTHER: @test2
-// OTHER-NOT: forcesizeopt
-// OTHER: ret
-}

Copied: cfe/trunk/test/CodeGen/attr-minsize.c (from r166973, cfe/trunk/test/CodeGen/attr-forcesizeopt.c)
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/attr-minsize.c?p2=cfe/trunk/test/CodeGen/attr-minsize.c&p1=cfe/trunk/test/CodeGen/attr-forcesizeopt.c&r1=166973&r2=167021&rev=167021&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/attr-forcesizeopt.c (original)
+++ cfe/trunk/test/CodeGen/attr-minsize.c Tue Oct 30 11:33:19 2012
@@ -4,23 +4,23 @@
 // RUN: %clang_cc1 -O2 -emit-llvm %s -o - | FileCheck %s -check-prefix=OTHER
 // RUN: %clang_cc1 -O3 -emit-llvm %s -o - | FileCheck %s -check-prefix=OTHER
 // RUN: %clang_cc1 -Os -emit-llvm %s -o - | FileCheck %s -check-prefix=OTHER
-// Check that we set the forcesizeopt attribute on each function
+// Check that we set the minsize attribute on each function
 // when Oz optimization level is set.
 
 int test1() {
   return 42;
-// Oz: @test1{{.*}}forcesizeopt
+// Oz: @test1{{.*}}minsize
 // Oz: ret
 // OTHER: @test1
-// OTHER-NOT: forcesizeopt
+// OTHER-NOT: minsize
 // OTHER: ret
 }
 
 int test2() {
   return 42;
-// Oz: @test2{{.*}}forcesizeopt
+// Oz: @test2{{.*}}minsize
 // Oz: ret
 // OTHER: @test2
-// OTHER-NOT: forcesizeopt
+// OTHER-NOT: minsize
 // OTHER: ret
 }





More information about the cfe-commits mailing list