This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch, RTL] Eliminate redundant vec_select moves.
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Tejas Belagod <belagod dot tejas at gmail dot com>
- Cc: Richard Henderson <rth at redhat dot com>, Kirill Yukhin <kirill dot yukhin at gmail dot com>, Tejas Belagod <tbelagod at arm dot com>, "Yukhin, Kirill" <kirill dot yukhin at intel dot com>, Jeff Law <law at redhat dot com>, Bill Schmidt <wschmidt at linux dot vnet dot ibm dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, Uros Bizjak <ubizjak at gmail dot com>, Jakub Jelinek <jakub at redhat dot com>, Richard Sandiford <rdsandiford at googlemail dot com>
- Date: Tue, 10 Dec 2013 17:33:11 -0800
- Subject: Re: [Patch, RTL] Eliminate redundant vec_select moves.
- Authentication-results: sourceware.org; auth=none
- References: <529F666F dot 4000507 at redhat dot com> <CAMe9rOo+2LnE=T9y7bmoxfWov+T4WDizTmpU5jFhpYe_xadgXA at mail dot gmail dot com> <52A07CF6 dot 6010003 at arm dot com> <CAMe9rOpZ41Qe-PqoqyJaVaYPSQfQXSkXPJeUQa23v2=0UabSXA at mail dot gmail dot com> <20131205134000 dot GG44339 at msticlxl57 dot ims dot intel dot com> <20131209064909 dot GA21317 at msticlxl57 dot ims dot intel dot com> <52A593B1 dot 6080406 at arm dot com> <CAMe9rOod87YRhu5vYfHUvDEtG_7_VJHafmUUGc=2Sj9q92SAtQ at mail dot gmail dot com> <CAMe9rOrbyJku55xx0RNFaathvRPSJXwZ5g6ad5v9q+NGPdg9tg at mail dot gmail dot com> <CAMe9rOoCz-9QM8-zMsPkxKnzJ2=M8D9LYKuRFAjwKKP4EU4acg at mail dot gmail dot com> <20131210160532 dot GB25880 at msticlxl57 dot ims dot intel dot com> <CAMe9rOo2FtK7Xk1-f__UMgxS7Q8reG8on2MxboiLGMQDSO64Mg at mail dot gmail dot com> <87bo0o7fn3 dot fsf at talisman dot default> <CAMe9rOr3QBQT6EcvthtgAKFFoFb9YpJpZLZZ_3Wrmxy1UURHeQ at mail dot gmail dot com> <8738m07eaj dot fsf at talisman dot default> <CAMe9rOq1hCZgrzHBjAdv6RUk3PJa_9JS_nz0xXaya16L11M-2w at mail dot gmail dot com> <87y53s5yvr dot fsf at talisman dot default> <52A77C02 dot 80306 at redhat dot com> <CAMe9rOp=+GUVEa2w065O+Y_8xPGnxPvmu1_EWg9TD+UWbX2VuQ at mail dot gmail dot com> <CAMe9rOpspj7Vpgk1CJ9YFv3HOOi3gik8oiQ4zz7UAcFgninxhQ at mail dot gmail dot com> <CACGj6S+t=GQQMZ=f3kewosCOt8BrFLcHT+2pdOYZjTiiEYt0HQ at mail dot gmail dot com> <CAMe9rOoMua+aXshF-_evYk0ZzuH77CchQMDp6TN4G8qG81-XvQ at mail dot gmail dot com>
On Tue, Dec 10, 2013 at 2:33 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Tue, Dec 10, 2013 at 2:25 PM, Tejas Belagod <belagod.tejas@gmail.com> wrote:
>> On 10 December 2013 21:51, H.J. Lu <hjl.tools@gmail.com> wrote:
>>> On Tue, Dec 10, 2013 at 1:09 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
>>>> On Tue, Dec 10, 2013 at 12:39 PM, Richard Henderson <rth@redhat.com> wrote:
>>>>> On 12/10/2013 10:44 AM, Richard Sandiford wrote:
>>>>>> Sorry, I don't understand. I never said it was invalid. I said
>>>>>> (subreg:SF (reg:V4SF X) 1) was invalid if (reg:V4SF X) represents
>>>>>> a single register. On a little-endian target, the offset cannot be
>>>>>> anything other than 0 in that case.
>>>>>>
>>>>>> So the CANNOT_CHANGE_MODE_CLASS code above seems to be checking for
>>>>>> something that is always invalid, regardless of the target. That kind
>>>>>> of situation should be rejected by target-independent code instead.
>>>>>
>>>>> But, we want to disable the subreg before we know whether or not (reg:V4SF X)
>>>>> will be allocated to a single hard register. That is something that we can't
>>>>> know in target-independent code before register allocation.
>>>>
>>>> I tried Kirill's patch. But LRA isn't prepared to handle it:
>>>>
>>>> spawn -ignore SIGHUP /export/build/gnu/gcc/build-x86_64-linux/gcc/xgcc
>>>> -B/export/build/gnu/gcc/build-x86_64-linux/gcc/
>>>> /export/gnu/import/git/gcc/gcc/testsuite/gcc.dg/atomic/c11-atomic-exec-1.c
>>>> -B/export/build/gnu/gcc/build-x86_64-linux/x86_64-unknown-linux-gnu/32/libatomic/
>>>> -L/export/build/gnu/gcc/build-x86_64-linux/x86_64-unknown-linux-gnu/32/libatomic/.libs
>>>> -latomic -fno-diagnostics-show-caret -fdiagnostics-color=never -O1
>>>> -std=c11 -pedantic-errors -lm -m32 -o ./c11-atomic-exec-1.exe^M
>>>> /export/gnu/import/git/gcc/gcc/testsuite/gcc.dg/atomic/c11-atomic-exec-1.c:
>>>> In function 'test_simple_assign':^M
>>>> /export/gnu/import/git/gcc/gcc/testsuite/gcc.dg/atomic/c11-atomic-exec-1.c:81:1:
>>>> internal compiler error: Maximum number of LRA constraint passes is
>>>> achieved (30)^M
>>>> ^M
>>>> 0x88ed77 lra_constraints(bool)^M
>>>> /export/gnu/import/git/gcc/gcc/lra-constraints.c:3871^M
>>>> 0x87fe8c lra(_IO_FILE*)^M
>>>> /export/gnu/import/git/gcc/gcc/lra.c:2331^M
>>>> 0x840f76 do_reload^M
>>>> /export/gnu/import/git/gcc/gcc/ira.c:5455^M
>>>> 0x840f76 rest_of_handle_reload^M
>>>> /export/gnu/import/git/gcc/gcc/ira.c:5584^M
>>>> 0x840f76 execute^M
>>>> /export/gnu/import/git/gcc/gcc/ira.c:5613^M
>>>>
>>>
>>> I got several hundred failures like this in GCC
>>> testsuite with -m32 and -m64 on Linux/x86-64.
>>>
>>
>> I think this is the same as:
>>
>> http://gcc.gnu.org/ml/gcc/2013-12/msg00086.html
>>
>> LRA does not seem to know how to resolve subregs with non-zero offsets
>> that don't map to a full-hardreg.
>>
>
> Looks like it. I am rebuilding and retesting Kirill's patch +
> Vladimir's patch.
>
Vladimir's patch cuts down the ICEs to 53. I still got
spawn -ignore SIGHUP /export/build/gnu/gcc/build-x86_64-linux/gcc/xgcc
-B/export/build/gnu/gcc/build-x86_64-linux/gcc/
/export/gnu/import/git/gcc/gcc/testsuite/gcc.dg/vect/slp-2.c
-fno-diagnostics-show-caret -fdiagnostics-color=never -msse2
-ftree-vectorize -fno-vect-cost-model -fno-common -O2
-fdump-tree-vect-details -lm -o ./slp-2.exe^M
/export/gnu/import/git/gcc/gcc/testsuite/gcc.dg/vect/slp-2.c: In
function 'main1':^M
/export/gnu/import/git/gcc/gcc/testsuite/gcc.dg/vect/slp-2.c:131:1:
internal compiler error: Max. number of generated reload insns per
insn is achieved (90)^M
^M
0x88ecb3 lra_constraints(bool)^M
/export/gnu/import/git/gcc/gcc/lra-constraints.c:3986^M
0x87fe8c lra(_IO_FILE*)^M
/export/gnu/import/git/gcc/gcc/lra.c:2331^M
0x840f76 do_reload^M
/export/gnu/import/git/gcc/gcc/ira.c:5455^M
0x840f76 rest_of_handle_reload^M
/export/gnu/import/git/gcc/gcc/ira.c:5584^M
0x840f76 execute^M
/export/gnu/import/git/gcc/gcc/ira.c:5613^M
Please submit a full bug report,^M
with preprocessed source if appropriate.^M
Please include the complete backtrace with any bug report.^M
See <http://gcc.gnu.org/bugs.html> for instructions.^M
compiler exited with status 1
I also got the wrong code regression:
FAIL: gfortran.dg/round_4.f90 -O0 execution test
FAIL: gfortran.dg/round_4.f90 -O1 execution test
FAIL: gfortran.dg/round_4.f90 -O2 execution test
FAIL: gfortran.dg/round_4.f90 -O3 -fomit-frame-pointer execution test
FAIL: gfortran.dg/round_4.f90 -O3 -fomit-frame-pointer
-funroll-all-loops -finline-functions execution test
FAIL: gfortran.dg/round_4.f90 -O3 -fomit-frame-pointer -funroll-loops
execution test
FAIL: gfortran.dg/round_4.f90 -O3 -g execution test
FAIL: gfortran.dg/round_4.f90 -Os execution test
My hjl/subreg branch doesn't have those regressions.
--
H.J.
- References:
- Re: [Patch, RTL] Eliminate redundant vec_select moves.
- Re: [Patch, RTL] Eliminate redundant vec_select moves.
- Re: [Patch, RTL] Eliminate redundant vec_select moves.
- Re: [Patch, RTL] Eliminate redundant vec_select moves.
- Re: [Patch, RTL] Eliminate redundant vec_select moves.
- Re: [Patch, RTL] Eliminate redundant vec_select moves.
- Re: [Patch, RTL] Eliminate redundant vec_select moves.
- Re: [Patch, RTL] Eliminate redundant vec_select moves.
- Re: [Patch, RTL] Eliminate redundant vec_select moves.
- Re: [Patch, RTL] Eliminate redundant vec_select moves.
- Re: [Patch, RTL] Eliminate redundant vec_select moves.
- Re: [Patch, RTL] Eliminate redundant vec_select moves.
- Re: [Patch, RTL] Eliminate redundant vec_select moves.
- Re: [Patch, RTL] Eliminate redundant vec_select moves.
- Re: [Patch, RTL] Eliminate redundant vec_select moves.
- Re: [Patch, RTL] Eliminate redundant vec_select moves.
- Re: [Patch, RTL] Eliminate redundant vec_select moves.
- Re: [Patch, RTL] Eliminate redundant vec_select moves.
- Re: [Patch, RTL] Eliminate redundant vec_select moves.
- Re: [Patch, RTL] Eliminate redundant vec_select moves.
- Re: [Patch, RTL] Eliminate redundant vec_select moves.
- Re: [Patch, RTL] Eliminate redundant vec_select moves.