re PR target/92549 (Use x86 xchg instruction more)

PR target/92549
	* config/i386/i386.md (peephole2 for *swap<mode>): New peephole2.

	* gcc.target/i386/pr92549.c: New test.

From-SVN: r278439
This commit is contained in:
Jakub Jelinek 2019-11-19 10:31:59 +01:00 committed by Jakub Jelinek
parent beeac4c271
commit 63b8871190
4 changed files with 34 additions and 0 deletions

View File

@ -1,5 +1,8 @@
2019-11-19 Jakub Jelinek <jakub@redhat.com>
PR target/92549
* config/i386/i386.md (peephole2 for *swap<mode>): New peephole2.
PR middle-end/91450
* internal-fn.c (expand_mul_overflow): For s1 * s2 -> ur, if one
operand is negative and one non-negative, compare the non-negative

View File

@ -2787,6 +2787,17 @@
(set_attr "amdfam10_decode" "double")
(set_attr "bdver1_decode" "double")])
(define_peephole2
[(set (match_operand:SWI 0 "register_operand")
(match_operand:SWI 1 "register_operand"))
(set (match_dup 1)
(match_operand:SWI 2 "register_operand"))
(set (match_dup 2) (match_dup 0))]
"peep2_reg_dead_p (3, operands[0])
&& optimize_insn_for_size_p ()"
[(parallel [(set (match_dup 1) (match_dup 2))
(set (match_dup 2) (match_dup 1))])])
(define_expand "movstrict<mode>"
[(set (strict_low_part (match_operand:SWI12 0 "register_operand"))
(match_operand:SWI12 1 "general_operand"))]

View File

@ -1,5 +1,8 @@
2019-11-19 Jakub Jelinek <jakub@redhat.com>
PR target/92549
* gcc.target/i386/pr92549.c: New test.
PR middle-end/91450
* gcc.c-torture/execute/pr91450-1.c: New test.
* gcc.c-torture/execute/pr91450-2.c: New test.

View File

@ -0,0 +1,17 @@
/* PR target/92549 */
/* { dg-do compile } */
/* { dg-options "-Os -masm=att" } */
/* { dg-additional-options "-mregparm=2" { target ia32 } } */
/* { dg-final { scan-assembler "xchgl" } } */
__attribute__((noipa)) int
bar (int a, int b)
{
return b - a + 5;
}
int
foo (int a, int b)
{
return 1 + bar (b, a);
}