[Bug tree-optimization/94617] Simple if condition not optimized

soap at gentoo dot org gcc-bugzilla@gcc.gnu.org
Thu Apr 16 12:18:03 GMT 2020


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94617

--- Comment #5 from David Seifert <soap at gentoo dot org> ---
(In reply to Richard Biener from comment #3)
> Note the RTL if-conversion pass doesn't recognize what we present to it.
> If you alter initial RTL expansion via -fno-tree-ter (not recommended in
> general)
> we produce a more 1:1 translation of the code as
> 
> _Z16vanilla_bandpassiiiPKcS0_:
> .LFB0:
>         .cfi_startproc
>         movl    %esi, %r9d
>         cmpl    %edx, %edi
>         setle   %sil
>         cmpl    %r9d, %edx
>         setl    %al
>         testb   %al, %sil
>         movq    %rcx, %rax
>         cmovne  %r8, %rax
>         ret
> 
> which I wouldn't expect to execute faster though.

just benchmarked the code on an oldish Ivybridge. GCC with vanilla_bandpass is
2.1x slower than GCC with funky_bandpass, and GCC with funky_bandpass is 12%
slower than Clang with vanilla_bandpass.


More information about the Gcc-bugs mailing list