Re: [PATCH 4/5] tree-walk: unroll get_mode since loop boundaries are well-known
- From
Dan McGee <dpmcgee@gmail.com>
- Date
- Apr 6, 2011, 20:45 UTC
- Message-ID
- <BANLkTikNv+xGKZv-5bxQJWASym1ZDuAuYw@mail.gmail.com>
- In-Reply-To
- <BANLkTin9P-OdTQhPTwcvgvpDoBg7E+va5Q@mail.gmail.com>
On Tue, Apr 5, 2011 at 6:55 PM, Antriksh Pany <antriksh.pany@gmail.com> wrote:
Show 13 quoted lines
> On Mon, Apr 4, 2011 at 10:33 PM, Dan McGee <dpmcgee@gmail.com> wrote: >> .... >> Totally agree; I should have tried to do it this way in the first >> place. However, compiling the fixed-length 0 to 5 loop does not >> produce fully-unrolled assembly for me with CFLAGS="-march=native >> -mtune=native -O2 -pipe -g" on x86_64. I see two copies of the loop >> only, and even worse is the (lack of) performance (each is the mode of >> 3 runs). Compilers are stupid apparently. >> .... > > Can you try -O3? Or an explicit '-funroll-loops'? > gcc I think does not do aggressive speed optimizations at the cost of > space when at O2.
Sure- both of these options show the loop being unrolled for all 5 iterations. However, that doesn't help me and the other 95% of people using distro packages, git-scm.com binaries, or anyone compiling with the default CFLAGS optimization level which is unfortunate.
-Dan