Re: [PATCH v2] gcc: do not apply store motion on loop with no exits.

2025-04-26 Thread ywgrit via Gcc
I encountered one problem with loop-im pass. I compiled the program dhry2reg which belongs to unixbench( https://github.com/kdlucas/byte-unixbench). The gcc used gcc (GCC) 12.3.0 The commands executed as following make ./Run -c -i 1 dhry2reg The results are shown below. Dhrystone 2 using registe

Re: [PATCH] Do not apply store motion on loop with no exits.

2025-04-25 Thread ywgrit via Gcc
I encountered one problem with loop-im pass. I compiled the program dhry2reg which belongs to unixbench( https://github.com/kdlucas/byte-unixbench). The gcc used gcc (GCC) 12.3.0 The commands executed as following make ./Run -c -i 1 dhry2reg The results are shown below. Dhrystone 2 using registe

Re: Could we enhance the ifcombine pass?

2025-07-19 Thread ywgrit via Gcc
Can we add a -merge-branch option to merge branch bbs when the programmer can ensure that the inner branch bb will not trap? Also, the current ifcombine pass can only merge very simple nested branches, and if statements usually generate multiple gimple statements, so a lot of merge opportunities ar

Re: Could we enhance the ifcombine pass?

2025-07-19 Thread ywgrit via Gcc
I've tested merging for nested branches on icc, and it seems that icc does a branch merge for code that might trap, making a more aggressive optimization. Way_.cpp struct waymapt { int fillnum; int num; }; typedef waymapt* waymappt; class wayobj { public: int boundl; waymappt waymap;

Could we enhance the ifcombine pass?

2025-07-18 Thread ywgrit via Gcc
For now, if combine pass can combine the simple nested comparison branches, e.g. if (a != b) if (c == d) These cond bbs must have only the conditional, which is too harsh. We often meet code like this: if (a != b) if (m[index] == k[index]) m and c are arrays, so the 2nd branch belongs to a bb

Re: Could we enhance the ifcombine pass?

2025-07-22 Thread ywgrit via Gcc
after merging this nested branches is very significant. Icc merges this nested branch, but gcc doesn't. Richard Biener 于2025年7月21日周一 15:02写道: > On Sat, 19 Jul 2025, Andrew Pinski wrote: > > > On Sat, Jul 19, 2025 at 8:41 PM ywgrit via Gcc wrote: > > > > > > I've t