[RFA]: Merge stack alignment branch

Ye, Joey joey.ye@intel.com
Tue Apr 8 01:57:00 GMT 2008


Jan,

Here I break the patch into two. One for x86 port and one for generic.

There are cases that alignment information is missed after inlining. In
expand_used_vars, vars in unexpanded_var_list are supposely been
expanded. But to some reason I don't know the alignment info of
variables in inlined function is not collected in expand_one_var. Can
you point me to the right place?

Thanks - Joey

-----Original Message-----
From: Jan Hubicka [mailto:hubicka@ucw.cz] 
Sent: Saturday, April 05, 2008 2:39 AM
To: Ye, Joey
Cc: GCC Patches; Lu, Hongjiu; Guo, Xuepeng; ubizjak@gmail.com
Subject: Re: [RFA]: Merge stack alignment branch

Hi,
I will look in detail to the patch later this weekend.  I think it would
make sense to break up neccesary changes in generic bits to separate
patches (in -x -cp format).  This will ease reviewing process since I
for instance can't approve non-i386 specific bits of your patch.

Index: tree-inline.c
===================================================================
--- tree-inline.c	(.../trunk/gcc)	(revision 133813)
+++ tree-inline.c	(.../branches/stack/gcc)	(revision
133869)
@@ -2841,8 +2841,26 @@
 	cfun->unexpanded_var_list = tree_cons (NULL_TREE, var,
 
cfun->unexpanded_var_list);
       else
-	cfun->unexpanded_var_list = tree_cons (NULL_TREE, remap_decl
(var, id),
-
cfun->unexpanded_var_list);
+	{
+	  /* Update stack alignment requirement if needed.  */
+	  if (MAX_VECTORIZE_STACK_ALIGNMENT)
+	    {
+	      unsigned int align;
+
+	      if (TREE_STATIC (var) || DECL_EXTERNAL (var))
+		align = TYPE_ALIGN (TREE_TYPE (var));
+	      else
+		align = DECL_ALIGN (var);
+	      if (align  > cfun->stack_alignment_estimated)
+		{
+		  gcc_assert(!cfun->stack_realign_processed);
+		  cfun->stack_alignment_estimated = align;
+		}
+	    }
+	  cfun->unexpanded_var_list
+	    = tree_cons (NULL_TREE, remap_decl (var, id),
+			 cfun->unexpanded_var_list);
+	}

I think it is mistake to maintain info about stack alignment during
gimple transformations.  At expansion time we walk the list and we can
figure out the alignment once possibly some of the variables are
optimized out.

The info can also go into RTL datastructures I am trying to introduce
instead of cfun then.

Honza
-------------- next part --------------
A non-text attachment was scrubbed...
Name: stack-align-generic-0408.patch
Type: application/octet-stream
Size: 42241 bytes
Desc: stack-align-generic-0408.patch
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20080408/669f01dc/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: stack-align-x86-0408.patch
Type: application/octet-stream
Size: 30034 bytes
Desc: stack-align-x86-0408.patch
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20080408/669f01dc/attachment-0001.obj>


More information about the Gcc-patches mailing list