This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/37571] [4.4 regression] Performance regression due to compare/branch fuse optimization
- From: "hjl dot tools at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 19 Sep 2008 18:03:56 -0000
- Subject: [Bug target/37571] [4.4 regression] Performance regression due to compare/branch fuse optimization
- References: <bug-37571-14503@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #4 from hjl dot tools at gmail dot com 2008-09-19 18:03 -------
(In reply to comment #1)
> Root cause is that instruction length of fused jcc is set to 16, which prevent
> the block from merging and copying. For some reason Core2 runs poorly with a
> unmerged branch block under certain circonstances.
>
I looked at the generated code without TARGET_FUSE_CMP_AND_BRANCH.
In most cases, gcc doesn't put any instructions between TEST/CMP
and JCC and we get macro-fusion optimization automatically even
when TARGET_FUSE_CMP_AND_BRANCH is off.
Since TARGET_FUSE_CMP_AND_BRANCH generates patterns with incorrect
instruction length, it prevents the block from merging and copying,
which hurt performance.
We have 2 choices:
1. Correct insn length for *jcc_fused_X patterns, which what Joey's
patch does.
2. Remove *jcc_fused_X patterns and optimize macro-fusion in Core 2
scheduling.
I think we should do #2.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37571