[llvm-commits] [llvm-gcc-4.2] r57300 - in /llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple: bswap-1.c bswap-2.c

Dale Johannesen dalej at apple.com
Wed Oct 8 10:52:24 PDT 2008


Author: johannes
Date: Wed Oct  8 12:52:23 2008
New Revision: 57300

URL: http://llvm.org/viewvc/llvm-project?rev=57300&view=rev
Log:
llvm-gcc does better optimization than gcc on these;
adjust tests to compensate.


Modified:
    llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/bswap-1.c
    llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/bswap-2.c

Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/bswap-1.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/bswap-1.c?rev=57300&r1=57299&r2=57300&view=diff

==============================================================================
--- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/bswap-1.c (original)
+++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/bswap-1.c Wed Oct  8 12:52:23 2008
@@ -58,6 +58,7 @@
 }
 /* The capital R's throughout are so these match only instructions: */
 /* { dg-final { if [ istarget arm*-*-darwin* ] { global compiler_flags; if [string match "*-march=armv6*" $compiler_flags] { scan-assembler-times "\\\trev" 9 } } } } */
-/* { dg-final { if [ istarget i?86-*-darwin* ] { global compiler_flags; if ![string match "*-m64 *" $compiler_flags] { scan-assembler-times "\\\tbswap" 3 } } } } */
+/* LLVM LOCAL llvm-gcc reduces more cases than gcc */
+/* { dg-final { if [ istarget i?86-*-darwin* ] { global compiler_flags; if ![string match "*-m64 *" $compiler_flags] { scan-assembler-times "\\\tbswap" 9 } } } } */
 /* { dg-final { if [ istarget i?86-*-darwin* ] { global compiler_flags; if [string match "*-m64 *" $compiler_flags] { scan-assembler-times "\\\tbswap" 6 } } } } */
 

Modified: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/bswap-2.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/bswap-2.c?rev=57300&r1=57299&r2=57300&view=diff

==============================================================================
--- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/bswap-2.c (original)
+++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/bswap-2.c Wed Oct  8 12:52:23 2008
@@ -17,8 +17,14 @@
 
 static int count = 0;
 static int llcount = 0; 
-uint32 f(uint32 x) { count++; return x; }
-uint64 llf(uint64 x) { llcount++; return x; }
+/* LLVM LOCAL begin llvm-gcc is smart enough to figure out f() returns its
+   argument and does optimizations based on that.  Undefine these to preserve
+   the point of the test. */
+/*extern uint32 f(){ count++; return x; }*/
+/*uint64 llf(uint64 x) { llcount++; return x; }*/
+extern uint32 f();
+extern uint64 llf();
+/* LLVM LOCAL end */
 
 unsigned int Reverse4 (volatile unsigned int x) {   /* does NOT produce Rev */
   return ((x & 0x0000ff00) <<8) | ((x & 0x00ff0000) >> 8) | ((x & 0xff000000) >> 24) | ((x & 0x000000ff) << 24);





More information about the llvm-commits mailing list