public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/106268] New: [suboptimal] Remove unnecessary loops releated to fortran compare to ifort
@ 2022-07-12 9:38 zhongyunde at huawei dot com
2022-07-12 10:15 ` [Bug fortran/106268] " rguenth at gcc dot gnu.org
2022-07-12 12:16 ` [Bug tree-optimization/106268] " zhongyunde at huawei dot com
0 siblings, 2 replies; 3+ messages in thread
From: zhongyunde at huawei dot com @ 2022-07-12 9:38 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106268
Bug ID: 106268
Summary: [suboptimal] Remove unnecessary loops releated to
fortran compare to ifort
Product: gcc
Version: 13.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: zhongyunde at huawei dot com
Target Milestone: ---
For the kernel inner loop body, gcc generate an loop, while icc doesn't, see
detail in https://godbolt.org/z/G77nKnf8W.
```
DO i = 1, 10000
do l = 1, ADM_lall
rhogw_vm(:,ADM_kmin ,l) = 0.D0
rhogw_vm(:,ADM_kmax+1,l) = 0.D0
enddo
enddo
```
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug fortran/106268] [suboptimal] Remove unnecessary loops releated to fortran compare to ifort
2022-07-12 9:38 [Bug fortran/106268] New: [suboptimal] Remove unnecessary loops releated to fortran compare to ifort zhongyunde at huawei dot com
@ 2022-07-12 10:15 ` rguenth at gcc dot gnu.org
2022-07-12 12:16 ` [Bug tree-optimization/106268] " zhongyunde at huawei dot com
1 sibling, 0 replies; 3+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-07-12 10:15 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106268
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Keywords| |missed-optimization
Last reconfirmed| |2022-07-12
Ever confirmed|0 |1
--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
I think ICC elides the outer loop, it does keep the inner loop where GCC
unrolls the inner loop, keeping the outer loop. There's no "benchmark loop"
elimination in GCC yet, instead we rely on code sinking which, at the moment,
cannot sink the memset calls out of the outer loop.
#include <string.h>
void foo (int *mem, int n)
{
for (int i = 0; i < 1000; ++i)
memset (mem, 0, n * sizeof (int));
}
ICC probably manages to elide the loop around the memset here.
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug tree-optimization/106268] [suboptimal] Remove unnecessary loops releated to fortran compare to ifort
2022-07-12 9:38 [Bug fortran/106268] New: [suboptimal] Remove unnecessary loops releated to fortran compare to ifort zhongyunde at huawei dot com
2022-07-12 10:15 ` [Bug fortran/106268] " rguenth at gcc dot gnu.org
@ 2022-07-12 12:16 ` zhongyunde at huawei dot com
1 sibling, 0 replies; 3+ messages in thread
From: zhongyunde at huawei dot com @ 2022-07-12 12:16 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106268
--- Comment #2 from vfdff <zhongyunde at huawei dot com> ---
it seems different for the C version, see detail
https://godbolt.org/z/vc1edYKhf
in your above case, the icc also doesn't elide the outer loop.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-07-12 12:16 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-12 9:38 [Bug fortran/106268] New: [suboptimal] Remove unnecessary loops releated to fortran compare to ifort zhongyunde at huawei dot com
2022-07-12 10:15 ` [Bug fortran/106268] " rguenth at gcc dot gnu.org
2022-07-12 12:16 ` [Bug tree-optimization/106268] " zhongyunde at huawei dot com
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).