ipa-cp.c (print_all_lattices): Skip cp clones.

* ipa-cp.c (print_all_lattices): Skip cp clones.

	* gcc.dg/lto/pr88297_0.c: New test.
	* gcc.dg/lto/pr88297_1.c: New test.

From-SVN: r267118
This commit is contained in:
Michael Ploujnikov 2018-12-14 00:19:08 +00:00 committed by Jeff Law
parent e8e50c1bd7
commit 9ee4655240
5 changed files with 92 additions and 0 deletions

View File

@ -1,5 +1,7 @@
2018-12-13 Michael Ploujnikov <michael.ploujnikov@oracle.com>
* ipa-cp.c (print_all_lattices): Skip cp clones.
* ipa-cp.c: Fix various comment typos.
2018-12-13 Jakub Jelinek <jakub@redhat.com>

View File

@ -542,6 +542,9 @@ print_all_lattices (FILE * f, bool dump_sources, bool dump_benefits)
struct ipa_node_params *info;
info = IPA_NODE_REF (node);
/* Skip constprop clones since we don't make lattices for them. */
if (info->ipcp_orig_node)
continue;
fprintf (f, " Node: %s:\n", node->dump_name ());
count = ipa_get_param_count (info);
for (i = 0; i < count; i++)

View File

@ -1,3 +1,8 @@
2018-12-13 Michael Ploujnikov <michael.ploujnikov@oracle.com>
* gcc.dg/lto/pr88297_0.c: New test.
* gcc.dg/lto/pr88297_1.c: New test.
2018-12-13 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/88444

View File

@ -0,0 +1,57 @@
/* { dg-require-effective-target lto } */
/* { dg-lto-options { { -flto -O3 -fipa-cp -fipa-cp-clone } } } */
/* { dg-lto-do run } */
/* In order to trigger IPA-CP cloning we have to:
1. Put the calls in main into a loop; otherwise everything is
cold and we would not clone.
2. Make different foos and bars actually semantically different;
otherwise IPA-ICF unified them (as it should).
*/
volatile int g;
void __attribute__ ((noipa))
use (int v)
{
g = v;
}
static int __attribute__ ((noinline))
foo (int arg)
{
return 7 * arg;
}
static int __attribute__ ((noinline))
bar (int arg)
{
return arg * arg;
}
extern int __attribute__ ((noinline))
entry2 (void);
int __attribute__ ((noipa))
get_opaque_number (void)
{
return 1;
}
int main (void)
{
int i;
for (i = 0; i < get_opaque_number (); i++)
{
use (bar (3));
use (bar (4));
use (foo (5));
use (foo (6));
entry2 ();
}
return 0;
}

View File

@ -0,0 +1,25 @@
extern void __attribute__ ((noipa))
use (int v);
static int __attribute__ ((noinline))
foo (int arg)
{
return 8 * arg;
}
static int __attribute__ ((noinline))
bar (int arg)
{
return arg * arg + 3;
}
int __attribute__ ((noinline))
entry2 (void)
{
use (bar (3));
use (bar (4));
use (foo (5));
use (foo (6));
return 0;
}