diff options
author | H.J. Lu <hongjiu.lu@intel.com> | 2014-08-19 16:26:35 +0000 |
---|---|---|
committer | H.J. Lu <hjl@gcc.gnu.org> | 2014-08-19 09:26:35 -0700 |
commit | b4e8ceb98c4ec844b4886e61363a70e5a2c6b140 (patch) | |
tree | 0cbb8ba29b38fa01a21c2a1cc7d40660a17a0969 | |
parent | 95204cd5b8f4bf1c475b88300014aa3d020c38ff (diff) | |
download | gcc-b4e8ceb98c4ec844b4886e61363a70e5a2c6b140.zip gcc-b4e8ceb98c4ec844b4886e61363a70e5a2c6b140.tar.gz gcc-b4e8ceb98c4ec844b4886e61363a70e5a2c6b140.tar.bz2 |
Don't clear destination if it is used in source
* config/i386/i386.md (*ctz<mode>2_falsedep_1): Don't clear
destination if it is used in source.
(*clz<mode>2_lzcnt_falsedep_1): Likewise.
(*popcount<mode>2_falsedep_1): Likewise.
From-SVN: r214169
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/config/i386/i386.md | 24 |
2 files changed, 25 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0751681..01597a4 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,12 @@ 2014-08-19 H.J. Lu <hongjiu.lu@intel.com> + * config/i386/i386.md (*ctz<mode>2_falsedep_1): Don't clear + destination if it is used in source. + (*clz<mode>2_lzcnt_falsedep_1): Likewise. + (*popcount<mode>2_falsedep_1): Likewise. + +2014-08-19 H.J. Lu <hongjiu.lu@intel.com> + PR other/62168 * configure.ac: Set install_gold_as_default to no first. * configure: Regenerated. diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index 4749b74..8e74eab 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -12269,8 +12269,11 @@ (match_operand:SWI248 1 "nonimmediate_operand"))) (clobber (reg:CC FLAGS_REG))])]) +; False dependency happens when destination is only updated by tzcnt, +; lzcnt or popcnt. There is no false dependency when destination is +; also used in source. (define_insn_and_split "*ctz<mode>2_falsedep_1" - [(set (match_operand:SWI48 0 "register_operand" "=&r") + [(set (match_operand:SWI48 0 "register_operand" "=r") (ctz:SWI48 (match_operand:SWI48 1 "nonimmediate_operand" "rm"))) (clobber (reg:CC FLAGS_REG))] @@ -12283,7 +12286,10 @@ (ctz:SWI48 (match_dup 1))) (unspec [(match_dup 0)] UNSPEC_INSN_FALSE_DEP) (clobber (reg:CC FLAGS_REG))])] - "ix86_expand_clear (operands[0]);") +{ + if (!reg_mentioned_p (operands[0], operands[1])) + ix86_expand_clear (operands[0]); +}) (define_insn "*ctz<mode>2_falsedep" [(set (match_operand:SWI48 0 "register_operand" "=r") @@ -12363,7 +12369,7 @@ "TARGET_LZCNT") (define_insn_and_split "*clz<mode>2_lzcnt_falsedep_1" - [(set (match_operand:SWI48 0 "register_operand" "=&r") + [(set (match_operand:SWI48 0 "register_operand" "=r") (clz:SWI48 (match_operand:SWI48 1 "nonimmediate_operand" "rm"))) (clobber (reg:CC FLAGS_REG))] @@ -12376,7 +12382,10 @@ (clz:SWI48 (match_dup 1))) (unspec [(match_dup 0)] UNSPEC_INSN_FALSE_DEP) (clobber (reg:CC FLAGS_REG))])] - "ix86_expand_clear (operands[0]);") +{ + if (!reg_mentioned_p (operands[0], operands[1])) + ix86_expand_clear (operands[0]); +}) (define_insn "*clz<mode>2_lzcnt_falsedep" [(set (match_operand:SWI48 0 "register_operand" "=r") @@ -12683,7 +12692,7 @@ "TARGET_POPCNT") (define_insn_and_split "*popcount<mode>2_falsedep_1" - [(set (match_operand:SWI48 0 "register_operand" "=&r") + [(set (match_operand:SWI48 0 "register_operand" "=r") (popcount:SWI48 (match_operand:SWI48 1 "nonimmediate_operand" "rm"))) (clobber (reg:CC FLAGS_REG))] @@ -12696,7 +12705,10 @@ (popcount:SWI48 (match_dup 1))) (unspec [(match_dup 0)] UNSPEC_INSN_FALSE_DEP) (clobber (reg:CC FLAGS_REG))])] - "ix86_expand_clear (operands[0]);") +{ + if (!reg_mentioned_p (operands[0], operands[1])) + ix86_expand_clear (operands[0]); +}) (define_insn "*popcount<mode>2_falsedep" [(set (match_operand:SWI48 0 "register_operand" "=r") |