diff options
author | James Greenhalgh <james.greenhalgh@arm.com> | 2016-07-21 15:41:59 +0000 |
---|---|---|
committer | James Greenhalgh <jgreenhalgh@gcc.gnu.org> | 2016-07-21 15:41:59 +0000 |
commit | f5a459a4392cacb1750c09bd2ecee8455d12af12 (patch) | |
tree | 7ac5f6a54c660c17fb69f44c672abf5ac9f9aa6c /gcc/optabs.c | |
parent | ebe8f3226c94173073958da74e9acb4e444e4097 (diff) | |
download | gcc-f5a459a4392cacb1750c09bd2ecee8455d12af12.zip gcc-f5a459a4392cacb1750c09bd2ecee8455d12af12.tar.gz gcc-f5a459a4392cacb1750c09bd2ecee8455d12af12.tar.bz2 |
[Patch 3/2 ifcvt costs] Don't expand a conditional move between identical sources
gcc/
* optabs.c (emit_condiitonal_move): Short circuit for identical
sources.
From-SVN: r238595
Diffstat (limited to 'gcc/optabs.c')
-rw-r--r-- | gcc/optabs.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/optabs.c b/gcc/optabs.c index 51e10e2..87b4f97 100644 --- a/gcc/optabs.c +++ b/gcc/optabs.c @@ -4214,6 +4214,17 @@ emit_conditional_move (rtx target, enum rtx_code code, rtx op0, rtx op1, enum insn_code icode; enum rtx_code reversed; + /* If the two source operands are identical, that's just a move. */ + + if (rtx_equal_p (op2, op3)) + { + if (!target) + target = gen_reg_rtx (mode); + + emit_move_insn (target, op3); + return target; + } + /* If one operand is constant, make it the second one. Only do this if the other operand is not constant as well. */ |