[google] LIPO regression tests and bug fixes (issue4444076)
Xinliang David Li
davidxl@google.com
Sat Apr 30 00:09:00 GMT 2011
On Fri, Apr 29, 2011 at 4:16 PM, Jan Hubicka <hubicka@ucw.cz> wrote:
> Hi,
> It seems that majority of testcases are independent of lipo. We could probably
> enjoy more of testing on mainline, so could you please take those working on
> mainline and make mainline patch and let me know what of the tests are not working
> there?
Actually those test cases are cloned from tree-prof directory into the
lipo sub-directory. The difference is that lipo.exp file passes
additional -fripa flag. The missing tests for LIPO are ones with
multiple source with non trivial module group testing -- I have not
added those yet.
>
> We probably ought to fix the pass name... We already have "ipa-profile" for profile
> propagation. What about "gcov", unless we could come with something better?
Yes -- tree_profile_ipa and ipa_profile confuses many people.
>> +int a[1000];
>> +int b[1000];
>> +int size=1;
>> +int max=10000;
>> +main()
>> +{
>> + int i;
>> + for (i=0;i<max; i++)
>> + {
>> + __builtin_memcpy (a, b, size * sizeof (a[0]));
>> + asm("");
>> + }
>> + return 0;
>> +}
>> +/* { dg-final-use { scan-ipa-dump "Single value 4 stringop" "tree_profile_ipa"} } */
>> +/* Really this ought to simplify into assignment, but we are not there yet. */
>> +/* a[0] = b[0] is what we fold the resulting memcpy into. */
>> +/* { dg-final-use { scan-tree-dump " = MEM.*&b" "optimized"} } */
>> +/* { dg-final-use { scan-tree-dump "MEM.*&a\\\] = " "optimized"} } */
>> +/* { dg-final-use { cleanup-tree-dump "optimized" } } */
>> +/* { dg-final-use { cleanup-ipa-dump "tree_profile_ipa" } } */
>> Index: testsuite/gcc.dg/tree-prof/lipo/pr34999.c
>> ===================================================================
>> --- testsuite/gcc.dg/tree-prof/lipo/pr34999.c (revision 0)
>> +++ testsuite/gcc.dg/tree-prof/lipo/pr34999.c (revision 0)
>> @@ -0,0 +1,45 @@
>> +/* Same test as built-in-setjmp.c. Includes the case where
>> + the source block of a crossing fallthru edge ends with a call. */
>> +/* { dg-require-effective-target freorder } */
>> +/* { dg-options "-O2 -freorder-blocks-and-partition" } */
>> +
>> +extern int strcmp(const char *, const char *);
>> +extern char *strcpy(char *, const char *);
>> +extern void abort(void);
>> +extern void exit(int);
>> +
>> +void *buf[20];
>> +
>> +void __attribute__((noinline))
>> +sub2 (void)
>> +{
>> + __builtin_longjmp (buf, 1);
>> +}
>> +
>> +int
>> +main ()
>> +{
>> + char *p = (char *) __builtin_alloca (20);
>> +
>> + strcpy (p, "test");
>> +
>> + if (__builtin_setjmp (buf))
>> + {
>> + if (strcmp (p, "test") != 0)
>> + abort ();
>> +
>> + exit (0);
>> + }
>> +
>> + {
>> + int *q = (int *) __builtin_alloca (p[2] * sizeof (int));
>> + int i;
>> +
>> + for (i = 0; i < p[2]; i++)
>> + q[i] = 0;
>> +
>> + while (1)
>> + sub2 ();
>> + }
>> +}
>> +
>> Index: testsuite/gcc.dg/tree-prof/lipo/stringop-2.c
>> ===================================================================
>> --- testsuite/gcc.dg/tree-prof/lipo/stringop-2.c (revision 0)
>> +++ testsuite/gcc.dg/tree-prof/lipo/stringop-2.c (revision 0)
>> @@ -0,0 +1,20 @@
>> +/* { dg-options "-O2 -fdump-tree-optimized -fdump-ipa-tree_profile_ipa" } */
>> +int a[1000];
>> +int b[1000];
>> +int size=1;
>> +int max=10000;
>> +main()
>> +{
>> + int i;
>> + for (i=0;i<max; i++)
>> + {
>> + __builtin_memset (a, 10, size * sizeof (a[0]));
>> + asm("");
>> + }
>> + return 0;
>> +}
>> +/* { dg-final-use { scan-ipa-dump "Single value 4 stringop" "tree_profile_ipa"} } */
>> +/* The versioned memset of size 4 should be optimized to an assignment. */
>> +/* { dg-final-use { scan-tree-dump "a\\\[0\\\] = 168430090" "optimized"} } */
>> +/* { dg-final-use { cleanup-tree-dump "optimized" } } */
>> +/* { dg-final-use { cleanup-ipa-dump "tree_profile_ipa" } } */
>> Index: testsuite/gcc.dg/tree-prof/lipo/update-loopch.c
>> ===================================================================
>> --- testsuite/gcc.dg/tree-prof/lipo/update-loopch.c (revision 0)
>> +++ testsuite/gcc.dg/tree-prof/lipo/update-loopch.c (revision 0)
>> @@ -0,0 +1,21 @@
>> +/* { dg-options "-O2 -fdump-ipa-tree_profile_ipa-blocks -fdump-tree-optimized-blocks" } */
>> +int max = 33333;
>> +int a[8];
>> +int
>> +main ()
>> +{
>> + int i;
>> + for (i = 0; i < max; i++)
>> + {
>> + a[i % 8]++;
>> + }
>> + return 0;
>> +}
>> +/* Loop header copying will peel away the initial conditional, so the loop body
>> + is once reached directly from entry point of function, rest via loopback
>> + edge. */
>> +/* { dg-final-use { scan-ipa-dump "count:33333" "tree_profile_ipa"} } */
>> +/* { dg-final-use { scan-tree-dump "count:33332" "optimized"} } */
>> +/* { dg-final-use { scan-tree-dump-not "Invalid sum" "optimized"} } */
>> +/* { dg-final-use { cleanup-ipa-dump "tree_profile_ipa" } } */
>> +/* { dg-final-use { cleanup-tree-dump "optimized" } } */
>> Index: testsuite/gcc.dg/tree-prof/lipo/indir-call-prof.c.040i.tree_profile_ipa
>> ===================================================================
>> --- testsuite/gcc.dg/tree-prof/lipo/indir-call-prof.c.040i.tree_profile_ipa (revision 0)
>> +++ testsuite/gcc.dg/tree-prof/lipo/indir-call-prof.c.040i.tree_profile_ipa (revision 0)
>
> Suprious add?
>
Right.
Thanks,
David
> Thanks,
> Honza
>
More information about the Gcc-patches
mailing list