Refine rules for function versioning

by Richard Hendersonon 2009-06-26T18:46:11+00:00

Re: Refine rules for function versioning

by H.J. Luon 2009-06-26T22:09:15+00:00.
On Fri, Jun 26, 2009 at 11:45 AM, Richard Henderson wrote:
> This is a small merge from the trans-mem branch, where I want to allow mo=
re
> functions to be versioned. =A0Merging this now means those rules get test=
ed
> with the ipa-cp routines on mainline, which should lead to less breakage
> when merging the branch.
>
> At present, function versioning is using exactly the same rules as for
> function inlining, even though quite a number of those rules don't really
> make sense as versioning rules -- such as calls to alloca or setjmp.
>
> This patch splits out the rules that apply only to the copying of code and
> uses that as a common base for both inlining and versioning. Further, rul=
es
> that apply only to ipcp's algorithms are pushed into a new function speci=
fic
> to ipcp.
>
> Finally, it fixes one bug that is exposed by ipcp now versioning a functi=
on
> that contains nested functions.
>
> Tested on x86-64 with ada.
>
This may have caused:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D40565
--=20
H.J.

Re: Refine rules for function versioning

by Richard Hendersonon 2009-06-27T01:15:45+00:00.
On 06/26/2009 03:09 PM, H.J. Lu wrote:
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40565
>
Hmph. IPA-CP now working as intended on tests that didn't expect it.
Fixed thus.
r~

Re: Refine rules for function versioning

by Richard Guentheron 2009-06-27T12:08:16+00:00.
On Sat, Jun 27, 2009 at 3:15 AM, Richard Henderson wrote:
> On 06/26/2009 03:09 PM, H.J. Lu wrote:
>>
>> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D40565
>>
>
> Hmph. =A0IPA-CP now working as intended on tests that didn't expect it. F=
ixed
> thus.
Are you sure you tested that patch?
Executing on host: /space/rguenther/obj/gcc/xgcc
-B/space/rguenther/obj/gcc/
/space/rguenther/trunk/gcc/testsuite/gcc.dg/vect/O3-vect-pr34223.c
-ftree-vectorize -fno-vect-cost-model -msse2 -O2
-fdump-tree-vect-details {-O3 -fno-ipa-cp-clone} -lm -m32 -o
./O3-vect-pr34223.exe (timeout =3D 300)
cc1: error: invalid option argument '-O3 -fno-ipa-cp-clone'^M
compiler exited with status 1
output is:
cc1: error: invalid option argument '-O3 -fno-ipa-cp-clone'^M
FAIL: gcc.dg/vect/O3-vect-pr34223.c (test for excess errors)
...
Richard.
>
> r~
>

Re: Refine rules for function versioning

by Paolo Bonzinion 2009-06-27T12:11:17+00:00.
I'll commit this.
Paolo
Index: testsuite/gcc.dg/vect/vect.exp
===================================================================
--- testsuite/gcc.dg/vect/vect.exp (revision 149005)
+++ testsuite/gcc.dg/vect/vect.exp (working copy)
@@ -259,7 +259,7 @@
# With -O3.
# Don't allow IPA cloning, because it throws our counts out of whack.
set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
-lappend DEFAULT_VECTCFLAGS "-O3 -fno-ipa-cp-clone"
+lappend DEFAULT_VECTCFLAGS "-O3" "-fno-ipa-cp-clone"
if [istarget "spu-*-*"] {
lappend DEFAULT_VECTCFLAGS "-funroll-loops"
}

Re: Refine rules for function versioning

by H.J. Luon 2009-06-27T13:59:42+00:00.
On Sat, Jun 27, 2009 at 5:10 AM, Paolo Bonzini wrote:
> I'll commit this.
>
> Paolo
>
> Index: testsuite/gcc.dg/vect/vect.exp
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> --- testsuite/gcc.dg/vect/vect.exp =A0 =A0 =A0(revision 149005)
> +++ testsuite/gcc.dg/vect/vect.exp =A0 =A0 =A0(working copy)
> @@ -259,7 +259,7 @@
> =A0# With -O3.
> =A0# Don't allow IPA cloning, because it throws our counts out of whack.
> =A0set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
> -lappend DEFAULT_VECTCFLAGS "-O3 -fno-ipa-cp-clone"
> +lappend DEFAULT_VECTCFLAGS "-O3" "-fno-ipa-cp-clone"
> =A0if =A0[istarget "spu-*-*"] {
> =A0 lappend DEFAULT_VECTCFLAGS "-funroll-loops"
> =A0}
>
Does this fix
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D40567
--=20
H.J.

Re: Refine rules for function versioning

by Paolo Bonzinion 2009-06-27T15:07:18+00:00.
>> -lappend DEFAULT_VECTCFLAGS "-O3 -fno-ipa-cp-clone"
>> +lappend DEFAULT_VECTCFLAGS "-O3" "-fno-ipa-cp-clone"
>
> Does this fix
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40567
Yes.

Re: Refine rules for function versioning

by Richard Hendersonon 2009-06-27T19:23:35+00:00.
On 06/27/2009 05:07 AM, Richard Guenther wrote:
> On Sat, Jun 27, 2009 at 3:15 AM, Richard Henderson wrote:
>> On 06/26/2009 03:09 PM, H.J. Lu wrote:
>>> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40565
>>>
>> Hmph. IPA-CP now working as intended on tests that didn't expect it. Fixed
>> thus.
>
> Are you sure you tested that patch?
Bah. No, not a full test. It was the last thing I did before running
out the door. Of course...
r~