Message ID | 20231112120817.2635864-1-lehua.ding@rivai.ai |
---|---|
Headers | show |
Series | ira/lra: Support subreg coalesce | expand |
On Sun, Nov 12, 2023 at 08:08:10PM +0800, Lehua Ding wrote: > V3 Changes: > 1. fix three ICE. > 2. rebase > > Hi, > > These patchs try to support subreg coalesce feature in > register allocation passes (ira and lra). > Hi Lehua, V3 indeed fixes the arm-none-eabi build. It's also confirmed by Linaro CI: https://patchwork.sourceware.org/project/gcc/patch/20231112120817.2635864-8-lehua.ding@rivai.ai/ But avr and pru backends are still broken, albeit with different crash signatures. Both targets are peculiar because they have UNITS_PER_WORD=1. I'll try building some 16-bit target like msp430. AVR fails when building libgcc: /mnt/nvme/dinux/local-workspace/gcc/libgcc/config/avr/lib2funcs.c: In function '__roundlr': /mnt/nvme/dinux/local-workspace/gcc/libgcc/config/avr/lib2funcs.c:115:3: internal compiler error: in check_allocation, at ira.cc:2673 115 | } | ^ /mnt/nvme/dinux/local-workspace/gcc/libgcc/config/avr/lib2funcs.c:106:3: note: in expansion of macro 'ROUND2' 106 | ROUND2 (FX) | ^~~~~~ /mnt/nvme/dinux/local-workspace/gcc/libgcc/config/avr/lib2funcs.c:117:1: note: in expansion of macro 'ROUND1' 117 | ROUND1(L_LABEL) | ^~~~~~ 0xc80b8d check_allocation /mnt/nvme/dinux/local-workspace/gcc/gcc/ira.cc:2673 0xc89451 ira /mnt/nvme/dinux/local-workspace/gcc/gcc/ira.cc:5873 0xc89451 execute /mnt/nvme/dinux/local-workspace/gcc/gcc/ira.cc:6104 Script I'm using to build avr: https://github.com/dinuxbg/gnupru/blob/master/testing/manual-build-avr.sh PRU fails building newlib: /mnt/nvme/dinux/local-workspace/newlib/newlib/libc/stdlib/gdtoa-gdtoa.c:835:9: internal compiler error: in lra_create_live_ranges, at lra-lives.cc:1933 835 | } | ^ 0x6b951c lra_create_live_ranges(bool, bool) /mnt/nvme/dinux/local-workspace/gcc/gcc/lra-lives.cc:1933 0xd9320c lra(_IO_FILE*) /mnt/nvme/dinux/local-workspace/gcc/gcc/lra.cc:2638 0xd3e519 do_reload /mnt/nvme/dinux/local-workspace/gcc/gcc/ira.cc:5960 0xd3e519 execute /mnt/nvme/dinux/local-workspace/gcc/gcc/ira.cc:6148 Script I'm using to build pru: https://github.com/dinuxbg/gnupru/blob/master/testing/manual-build-pru.sh Regards, Dimitar,
On 11/12/23 07:08, Lehua Ding wrote: > V3 Changes: > 1. fix three ICE. > 2. rebase > > Hi, > > These patchs try to support subreg coalesce feature in > register allocation passes (ira and lra). > I've started review of v3 patches and here is my initial general criticism of your patches: * Absence of comments for some functions, e.g. for `HARD_REG_SET operator>> (unsigned int shift_amount) const`. * Adding significant functionality to existing functions is not reflected in the function comment, e.g. in ira_set_allocno_class. * A lot of typos, e.g. `pesudo` or `reprensent`. I think you need to check spelling of you comments (I myself do spell checking in emacs by ispell-region command). * Grammar mistakes, e.g `Flag means need track subreg live range for the allocno`. I understand English is not your native languages (as for me). In case of some doubts I'd recommend to check grammar in ChatGPT (Proofread: <english> text). * Some local variables use upper case letters (e.g. `int A`) which should be used for macros or enums according to GNU coding standard (https://www.gnu.org/prep/standards/standards.html) . * Sometimes you put one space at the end of sentence. Please see GNU coding standard and GCC coding conventions (https://gcc.gnu.org/codingconventions.html) * There is no uniformity in your code, e.g. sometimes you use 'i++', sometimes `++i` or `i += 1`. Although the uniformity is not necessary, it makes a better impression about the patches. I also did not find what targets did you use for testing. I am asking this because I see new testsuite failures (apx-spill_to_egprs-1.c) even on x86-64. It might be nothing as the test expects a specific code generation. Also besides testing major targets I'd recommend testing at least one big endian target (I'd recommend ppc64be. gcc110.fsfrance.org could be used for this). Plenty RA issues occur because BE targets are not tested.
Hi Vladimir, On 2023/11/14 3:37, Vladimir Makarov wrote: > > On 11/12/23 07:08, Lehua Ding wrote: >> V3 Changes: >> 1. fix three ICE. >> 2. rebase >> >> Hi, >> >> These patchs try to support subreg coalesce feature in >> register allocation passes (ira and lra). >> > I've started review of v3 patches and here is my initial general > criticism of your patches: > > * Absence of comments for some functions, e.g. for `HARD_REG_SET > operator>> (unsigned int shift_amount) const`. > > * Adding significant functionality to existing functions is not > reflected in the function comment, e.g. in ira_set_allocno_class. > > * A lot of typos, e.g. `pesudo` or `reprensent`. I think you need to > check spelling of you comments (I myself do spell checking in emacs by > ispell-region command). > > * Grammar mistakes, e.g `Flag means need track subreg live range for > the allocno`. I understand English is not your native languages (as for > me). In case of some doubts I'd recommend to check grammar in ChatGPT > (Proofread: <english> text). > > * Some local variables use upper case letters (e.g. `int A`) which > should be used for macros or enums according to GNU coding standard > (https://www.gnu.org/prep/standards/standards.html) . > > * Sometimes you put one space at the end of sentence. Please see GNU > coding standard and GCC coding conventions > (https://gcc.gnu.org/codingconventions.html) > > * There is no uniformity in your code, e.g. sometimes you use 'i++', > sometimes `++i` or `i += 1`. Although the uniformity is not necessary, > it makes a better impression about the patches. Sorry for these issue, I'll address all those comments. > I also did not find what targets did you use for testing. I am asking > this because I see new testsuite failures (apx-spill_to_egprs-1.c) even > on x86-64. It might be nothing as the test expects a specific code > generation. There was testing x86, aarch64, riscv not long ago, but it looks like I'm missing something, I just locally tested with the latest code and also reproduced this fail you mentioned, along with a c++ fail (pr106877.C). I'll have a look at the cause. > Also besides testing major targets I'd recommend testing at least one > big endian target (I'd recommend ppc64be. gcc110.fsfrance.org could be > used for this). Plenty RA issues occur because BE targets are not tested. You said the address looks a bit wrong, it should be this gcc110.fsffrance.org right? I looked for it and it looks like you have to go to portal.cfarm.net first to apply for an account on this site, I'll try that, thanks a lot.
On 11/12/23 6:08 AM, Lehua Ding wrote: > V3 Changes: > 1. fix three ICE. > 2. rebase I tested this on powerpc64le-linux and powerpc64-linux. The LE build bootstrapped fine and it looks like only one testsuite FAIL which I have to look into why it's FAILing. The BE build did bootstrap, but the 32-bit and 64-bit testsuite runs both had lots of FAILs (over 100 between them both) which I have yet to look into what is happening. I'll also note I have done no performance testing yet until I have an idea of what the testsuite failures are. I think a patch like this that can affect the performance of all architectures needs some performance testing to ensure we don't have unintended performance degradations. I'll have someone on my team kick off some builds once I have a handle on the testsuite FAILs. Peter
On 11/13/23 11:37 PM, Lehua Ding wrote: > On 2023/11/14 3:37, Vladimir Makarov wrote: >> Also besides testing major targets I'd recommend testing at least one big >> endian target (I'd recommend ppc64be. gcc110.fsfrance.org could be used >> for this). Plenty RA issues occur because BE targets are not tested. > > You said the address looks a bit wrong, it should be this gcc110.fsffrance.org > right? I looked for it and it looks like you have to go to portal.cfarm.net > first to apply for an account on this site, I'll try that, thanks a lot. The compile farm just went through with a domain name change, so the Power7 BE gcc110.fsffrance.org system is now reachable via cfarm110.cfarm.net. You are correct on the address for requesting a cfarm account. That said, I posted results using your V3 patches for both LE and BE Power in my other reply. Peter
On 2023/11/14 0:43, Dimitar Dimitrov wrote: > On Sun, Nov 12, 2023 at 08:08:10PM +0800, Lehua Ding wrote: >> V3 Changes: >> 1. fix three ICE. >> 2. rebase >> >> Hi, >> >> These patchs try to support subreg coalesce feature in >> register allocation passes (ira and lra). >> > > Hi Lehua, > > V3 indeed fixes the arm-none-eabi build. It's also confirmed by Linaro CI: > https://patchwork.sourceware.org/project/gcc/patch/20231112120817.2635864-8-lehua.ding@rivai.ai/ > > But avr and pru backends are still broken, albeit with different crash > signatures. Both targets are peculiar because they have > UNITS_PER_WORD=1. I'll try building some 16-bit target like msp430. > > AVR fails when building libgcc: > /mnt/nvme/dinux/local-workspace/gcc/libgcc/config/avr/lib2funcs.c: In function '__roundlr': > /mnt/nvme/dinux/local-workspace/gcc/libgcc/config/avr/lib2funcs.c:115:3: internal compiler error: in check_allocation, at ira.cc:2673 > 115 | } > | ^ > /mnt/nvme/dinux/local-workspace/gcc/libgcc/config/avr/lib2funcs.c:106:3: note: in expansion of macro 'ROUND2' > 106 | ROUND2 (FX) > | ^~~~~~ > /mnt/nvme/dinux/local-workspace/gcc/libgcc/config/avr/lib2funcs.c:117:1: note: in expansion of macro 'ROUND1' > 117 | ROUND1(L_LABEL) > | ^~~~~~ > 0xc80b8d check_allocation > /mnt/nvme/dinux/local-workspace/gcc/gcc/ira.cc:2673 > 0xc89451 ira > /mnt/nvme/dinux/local-workspace/gcc/gcc/ira.cc:5873 > 0xc89451 execute > /mnt/nvme/dinux/local-workspace/gcc/gcc/ira.cc:6104 > > Script I'm using to build avr: https://github.com/dinuxbg/gnupru/blob/master/testing/manual-build-avr.sh > > > > PRU fails building newlib: > /mnt/nvme/dinux/local-workspace/newlib/newlib/libc/stdlib/gdtoa-gdtoa.c:835:9: internal compiler error: in lra_create_live_ranges, at lra-lives.cc:1933 > 835 | } > | ^ > 0x6b951c lra_create_live_ranges(bool, bool) > /mnt/nvme/dinux/local-workspace/gcc/gcc/lra-lives.cc:1933 > 0xd9320c lra(_IO_FILE*) > /mnt/nvme/dinux/local-workspace/gcc/gcc/lra.cc:2638 > 0xd3e519 do_reload > /mnt/nvme/dinux/local-workspace/gcc/gcc/ira.cc:5960 > 0xd3e519 execute > /mnt/nvme/dinux/local-workspace/gcc/gcc/ira.cc:6148 > > Script I'm using to build pru: https://github.com/dinuxbg/gnupru/blob/master/testing/manual-build-pru.sh These ICE will fixed in the V4 patchs and both targets build successfully in my machine, thank you so much for the reported.
On 2023/11/15 7:22, Peter Bergner wrote: > On 11/12/23 6:08 AM, Lehua Ding wrote: >> V3 Changes: >> 1. fix three ICE. >> 2. rebase > > > I tested this on powerpc64le-linux and powerpc64-linux. The LE build > bootstrapped fine and it looks like only one testsuite FAIL which I have > to look into why it's FAILing. > > The BE build did bootstrap, but the 32-bit and 64-bit testsuite runs both > had lots of FAILs (over 100 between them both) which I have yet to look > into what is happening. I've applied for machine permissions on the compile farm, can you give me the way to compile and run tests on PPC64BE machine? I'll take a look at it too, thanks a lot. > I'll also note I have done no performance testing yet until I have an > idea of what the testsuite failures are. I think a patch like this that > can affect the performance of all architectures needs some performance > testing to ensure we don't have unintended performance degradations. > I'll have someone on my team kick off some builds once I have a handle > on the testsuite FAILs. This is really great, thanks for helping to test the performance.
On 11/14/23 9:12 PM, Lehua Ding wrote: > I've applied for machine permissions on the compile farm, can you give > me the way to compile and run tests on PPC64BE machine? I'll take a look > at it too, thanks a lot. That's an old system, with too old system libgmp, etc. Let me attempt a build there so I can give you correct build directions for that system. That said, unfortunately, that system is currently almost out of available disk space: [bergner@gcc1-power7 ~]$ df -h Filesystem Size Used Avail Use% Mounted on ... /dev/md4 1.6T 1.6T 9.0G 100% /home Segher, can you please send out an admin note for people to clean up unneeded space on cfarm110? Thanks. Peter