* [PATCH 01/15] frv: Fix non-robust split condition in define_insn_and_split
2021-11-11 11:24 [PATCH 00/15] Fix non-robust split condition in define_insn_and_split Kewen Lin
@ 2021-11-11 11:24 ` Kewen Lin
2021-11-11 11:24 ` [PATCH 02/15] m32c: " Kewen Lin
` (13 subsequent siblings)
14 siblings, 0 replies; 22+ messages in thread
From: Kewen Lin @ 2021-11-11 11:24 UTC (permalink / raw)
To: gcc-patches; +Cc: Kewen Lin, aoliva, nickc
This patch is to fix some non-robust split conditions in some
define_insn_and_splits, to make each of them applied on top of
the corresponding condition for define_insn part, otherwise the
splitting could perform unexpectedly.
gcc/ChangeLog:
* config/frv/frv.md (*abssi2_internal, *minmax_si_signed,
*minmax_si_unsigned, *minmax_sf, *minmax_df): Fix split condition.
---
gcc/config/frv/frv.md | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/gcc/config/frv/frv.md b/gcc/config/frv/frv.md
index a2aa1b2d2ac..fea6dedc53d 100644
--- a/gcc/config/frv/frv.md
+++ b/gcc/config/frv/frv.md
@@ -4676,7 +4676,7 @@ (define_insn_and_split "*abssi2_internal"
(clobber (match_operand:CC_CCR 3 "icr_operand" "=v,v"))]
"TARGET_COND_MOVE"
"#"
- "reload_completed"
+ "&& reload_completed"
[(match_dup 4)]
"operands[4] = frv_split_abs (operands);"
[(set_attr "length" "12,16")
@@ -4717,7 +4717,7 @@ (define_insn_and_split "*minmax_si_signed"
(clobber (match_operand:CC_CCR 5 "icr_operand" "=v,v,v"))]
"TARGET_COND_MOVE"
"#"
- "reload_completed"
+ "&& reload_completed"
[(match_dup 6)]
"operands[6] = frv_split_minmax (operands);"
[(set_attr "length" "12,12,16")
@@ -4758,7 +4758,7 @@ (define_insn_and_split "*minmax_si_unsigned"
(clobber (match_operand:CC_CCR 5 "icr_operand" "=v,v,v"))]
"TARGET_COND_MOVE"
"#"
- "reload_completed"
+ "&& reload_completed"
[(match_dup 6)]
"operands[6] = frv_split_minmax (operands);"
[(set_attr "length" "12,12,16")
@@ -4799,7 +4799,7 @@ (define_insn_and_split "*minmax_sf"
(clobber (match_operand:CC_CCR 5 "fcr_operand" "=w,w,w"))]
"TARGET_COND_MOVE && TARGET_HARD_FLOAT"
"#"
- "reload_completed"
+ "&& reload_completed"
[(match_dup 6)]
"operands[6] = frv_split_minmax (operands);"
[(set_attr "length" "12,12,16")
@@ -4840,7 +4840,7 @@ (define_insn_and_split "*minmax_df"
(clobber (match_operand:CC_CCR 5 "fcr_operand" "=w,w,w"))]
"TARGET_COND_MOVE && TARGET_HARD_FLOAT && TARGET_DOUBLE"
"#"
- "reload_completed"
+ "&& reload_completed"
[(match_dup 6)]
"operands[6] = frv_split_minmax (operands);"
[(set_attr "length" "12,12,16")
--
2.27.0
^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH 02/15] m32c: Fix non-robust split condition in define_insn_and_split
2021-11-11 11:24 [PATCH 00/15] Fix non-robust split condition in define_insn_and_split Kewen Lin
2021-11-11 11:24 ` [PATCH 01/15] frv: " Kewen Lin
@ 2021-11-11 11:24 ` Kewen Lin
2021-11-11 11:24 ` [PATCH 03/15] rx: " Kewen Lin
` (12 subsequent siblings)
14 siblings, 0 replies; 22+ messages in thread
From: Kewen Lin @ 2021-11-11 11:24 UTC (permalink / raw)
To: gcc-patches
This patch is to fix some non-robust split conditions in some
define_insn_and_splits, to make each of them applied on top of
the corresponding condition for define_insn part, otherwise the
splitting could perform unexpectedly.
gcc/ChangeLog:
* config/m32c/cond.md (stzx_reversed_<mode>, movhicc_<code>_<mode>):
Fix split condition.
---
gcc/config/m32c/cond.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gcc/config/m32c/cond.md b/gcc/config/m32c/cond.md
index b80b10320fb..ce6493fc9f6 100644
--- a/gcc/config/m32c/cond.md
+++ b/gcc/config/m32c/cond.md
@@ -106,7 +106,7 @@ (define_insn_and_split "stzx_reversed_<mode>"
(match_operand:QHI 2 "const_int_operand" "")))]
"(TARGET_A24 || GET_MODE (operands[0]) == QImode) && reload_completed"
"#"
- ""
+ "&& 1"
[(set (match_dup 0)
(if_then_else:QHI (eq (reg:CC FLG_REGNO) (const_int 0))
(match_dup 2)
@@ -230,7 +230,7 @@ (define_insn_and_split "movhicc_<code>_<mode>"
(match_operand:HI 4 "const_int_operand" "")))]
"TARGET_A24"
"#"
- "reload_completed"
+ "&& reload_completed"
[(set (reg:CC FLG_REGNO)
(compare (match_dup 1)
(match_dup 2)))
--
2.27.0
^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH 03/15] rx: Fix non-robust split condition in define_insn_and_split
2021-11-11 11:24 [PATCH 00/15] Fix non-robust split condition in define_insn_and_split Kewen Lin
2021-11-11 11:24 ` [PATCH 01/15] frv: " Kewen Lin
2021-11-11 11:24 ` [PATCH 02/15] m32c: " Kewen Lin
@ 2021-11-11 11:24 ` Kewen Lin
2021-11-11 11:24 ` [PATCH 04/15] s390: " Kewen Lin
` (11 subsequent siblings)
14 siblings, 0 replies; 22+ messages in thread
From: Kewen Lin @ 2021-11-11 11:24 UTC (permalink / raw)
To: gcc-patches
This patch is to fix one non-robust split condition, to make
it applied on top of the corresponding condition for define_insn
part, otherwise the splitting could perform unexpectedly.
gcc/ChangeLog:
* config/rx/rx.md (cstoresf4): Fix split condition.
---
gcc/config/rx/rx.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gcc/config/rx/rx.md b/gcc/config/rx/rx.md
index b76fce97bdc..c5297685a38 100644
--- a/gcc/config/rx/rx.md
+++ b/gcc/config/rx/rx.md
@@ -714,7 +714,7 @@ (define_insn_and_split "cstoresf4"
(match_operand:SF 3 "rx_source_operand" "rFQ")]))]
"ALLOW_RX_FPU_INSNS"
"#"
- "reload_completed"
+ "&& reload_completed"
[(const_int 0)]
{
rtx flags, x;
--
2.27.0
^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH 04/15] s390: Fix non-robust split condition in define_insn_and_split
2021-11-11 11:24 [PATCH 00/15] Fix non-robust split condition in define_insn_and_split Kewen Lin
` (2 preceding siblings ...)
2021-11-11 11:24 ` [PATCH 03/15] rx: " Kewen Lin
@ 2021-11-11 11:24 ` Kewen Lin
2021-11-11 11:24 ` [PATCH 05/15] v850: " Kewen Lin
` (10 subsequent siblings)
14 siblings, 0 replies; 22+ messages in thread
From: Kewen Lin @ 2021-11-11 11:24 UTC (permalink / raw)
To: gcc-patches
This patch is to fix some non-robust split conditions in some
define_insn_and_splits, to make each of them applied on top of
the corresponding condition for define_insn part, otherwise the
splitting could perform unexpectedly.
gcc/ChangeLog:
* config/s390/s390.md (*cstorecc<mode>_z13): Fix split condition.
* config/s390/vector.md (fprx2_to_tf, tf_to_fprx2): Likewise.
---
gcc/config/s390/s390.md | 2 +-
gcc/config/s390/vector.md | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/gcc/config/s390/s390.md b/gcc/config/s390/s390.md
index 4debdcd1247..1d66c30b9d5 100644
--- a/gcc/config/s390/s390.md
+++ b/gcc/config/s390/s390.md
@@ -6941,7 +6941,7 @@ (define_insn_and_split "*cstorecc<mode>_z13"
(match_operand 3 "const_int_operand" "")]))]
"TARGET_Z13"
"#"
- "reload_completed"
+ "&& reload_completed"
[(set (match_dup 0) (const_int 0))
(set (match_dup 0)
(if_then_else:GPR
diff --git a/gcc/config/s390/vector.md b/gcc/config/s390/vector.md
index 1ed1d0665d4..8aa4e82c28d 100644
--- a/gcc/config/s390/vector.md
+++ b/gcc/config/s390/vector.md
@@ -641,7 +641,7 @@ (define_insn_and_split "fprx2_to_tf"
"@
vmrhg\t%v0,%1,%N1
#"
- "!(MEM_P (operands[0]) && MEM_VOLATILE_P (operands[0]))"
+ "&& !(MEM_P (operands[0]) && MEM_VOLATILE_P (operands[0]))"
[(set (match_dup 2) (match_dup 3))
(set (match_dup 4) (match_dup 5))]
{
@@ -916,7 +916,7 @@ (define_insn_and_split "tf_to_fprx2"
(subreg:FPRX2 (match_operand:TF 1 "general_operand" "v,AR") 0))]
"TARGET_VXE"
"#"
- "!(MEM_P (operands[1]) && MEM_VOLATILE_P (operands[1]))"
+ "&& !(MEM_P (operands[1]) && MEM_VOLATILE_P (operands[1]))"
[(set (match_dup 2) (match_dup 3))
(set (match_dup 4) (match_dup 5))]
{
--
2.27.0
^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH 05/15] v850: Fix non-robust split condition in define_insn_and_split
2021-11-11 11:24 [PATCH 00/15] Fix non-robust split condition in define_insn_and_split Kewen Lin
` (3 preceding siblings ...)
2021-11-11 11:24 ` [PATCH 04/15] s390: " Kewen Lin
@ 2021-11-11 11:24 ` Kewen Lin
2021-11-11 11:24 ` [PATCH 06/15] visium: " Kewen Lin
` (9 subsequent siblings)
14 siblings, 0 replies; 22+ messages in thread
From: Kewen Lin @ 2021-11-11 11:24 UTC (permalink / raw)
To: gcc-patches
This patch is to fix some non-robust split conditions in some
define_insn_and_splits, to make each of them applied on top of
the corresponding condition for define_insn part, otherwise the
splitting could perform unexpectedly.
gcc/ChangeLog:
* config/v850/v850.md (cbranchsf4, cbranchdf4, *movsicc_normal,
*movsicc_reversed): Fix split condition.
---
gcc/config/v850/v850.md | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/gcc/config/v850/v850.md b/gcc/config/v850/v850.md
index 872f17913de..d4a953c6bdb 100644
--- a/gcc/config/v850/v850.md
+++ b/gcc/config/v850/v850.md
@@ -374,7 +374,7 @@ (define_insn_and_split "cbranchsf4"
(pc)))]
"TARGET_USE_FPU"
"#"
- "reload_completed"
+ "&& reload_completed"
[(set (match_dup 4) (match_dup 5))
(set (pc)
(if_then_else (match_dup 6)
@@ -428,7 +428,7 @@ (define_insn_and_split "cbranchdf4"
(pc)))]
"TARGET_USE_FPU"
"#"
- "reload_completed"
+ "&& reload_completed"
;; How to get the mode here?
[(set (match_dup 4) (match_dup 5))
(set (pc)
@@ -1210,7 +1210,7 @@ (define_insn_and_split "*movsicc_normal"
(match_operand:SI 3 "reg_or_0_operand" "rI")))]
"(TARGET_V850E_UP)"
"#"
- "reload_completed"
+ "&& reload_completed"
[(set (reg:CC CC_REGNUM)
(compare:CC (match_dup 4) (match_dup 5)))
(set (match_dup 0)
@@ -1229,7 +1229,7 @@ (define_insn_and_split "*movsicc_reversed"
(match_operand:SI 3 "reg_or_0_operand" "rJ")))]
"(TARGET_V850E_UP)"
"#"
- "reload_completed"
+ "&& reload_completed"
[(set (reg:CC CC_REGNUM)
(compare:CC (match_dup 4) (match_dup 5)))
(set (match_dup 0)
--
2.27.0
^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH 06/15] visium: Fix non-robust split condition in define_insn_and_split
2021-11-11 11:24 [PATCH 00/15] Fix non-robust split condition in define_insn_and_split Kewen Lin
` (4 preceding siblings ...)
2021-11-11 11:24 ` [PATCH 05/15] v850: " Kewen Lin
@ 2021-11-11 11:24 ` Kewen Lin
2021-11-16 16:57 ` Eric Botcazou
2021-11-11 11:24 ` [PATCH 07/15] xtensa: " Kewen Lin
` (8 subsequent siblings)
14 siblings, 1 reply; 22+ messages in thread
From: Kewen Lin @ 2021-11-11 11:24 UTC (permalink / raw)
To: gcc-patches; +Cc: Kewen Lin, ebotcazou, ebotcazou
This patch is to fix some non-robust split conditions in some
define_insn_and_splits, to make each of them applied on top of
the corresponding condition for define_insn part, otherwise the
splitting could perform unexpectedly.
gcc/ChangeLog:
* config/visium/visium.md (*add<mode>3_insn, *addsi3_insn, *addi3_insn,
*sub<mode>3_insn, *subsi3_insn, *subdi3_insn, *neg<mode>2_insn,
*negdi2_insn, *and<mode>3_insn, *ior<mode>3_insn, *xor<mode>3_insn,
*one_cmpl<mode>2_insn, *ashl<mode>3_insn, *ashr<mode>3_insn,
*lshr<mode>3_insn, *trunchiqi2_insn, *truncsihi2_insn,
*truncdisi2_insn, *extendqihi2_insn, *extendqisi2_insn,
*extendhisi2_insn, *extendsidi2_insn, *zero_extendqihi2_insn,
*zero_extendqisi2_insn, *zero_extendsidi2_insn): Fix split condition.
---
gcc/config/visium/visium.md | 50 ++++++++++++++++++-------------------
1 file changed, 25 insertions(+), 25 deletions(-)
diff --git a/gcc/config/visium/visium.md b/gcc/config/visium/visium.md
index 83ccf088124..ca2234bf253 100644
--- a/gcc/config/visium/visium.md
+++ b/gcc/config/visium/visium.md
@@ -792,7 +792,7 @@ (define_insn_and_split "*add<mode>3_insn"
(match_operand:QHI 2 "register_operand" "r")))]
"ok_for_simple_arith_logic_operands (operands, <MODE>mode)"
"#"
- "reload_completed"
+ "&& reload_completed"
[(parallel [(set (match_dup 0)
(plus:QHI (match_dup 1) (match_dup 2)))
(clobber (reg:CC R_FLAGS))])]
@@ -850,7 +850,7 @@ (define_insn_and_split "*addsi3_insn"
(match_operand:SI 2 "add_operand" " L,r,J")))]
"ok_for_simple_arith_logic_operands (operands, SImode)"
"#"
- "reload_completed"
+ "&& reload_completed"
[(parallel [(set (match_dup 0)
(plus:SI (match_dup 1) (match_dup 2)))
(clobber (reg:CC R_FLAGS))])]
@@ -912,7 +912,7 @@ (define_insn_and_split "*addi3_insn"
(match_operand:DI 2 "add_operand" " L,J, r")))]
"ok_for_simple_arith_logic_operands (operands, DImode)"
"#"
- "reload_completed"
+ "&& reload_completed"
[(const_int 0)]
{
visium_split_double_add (PLUS, operands[0], operands[1], operands[2]);
@@ -1007,7 +1007,7 @@ (define_insn_and_split "*sub<mode>3_insn"
(match_operand:QHI 2 "register_operand" "r")))]
"ok_for_simple_arith_logic_operands (operands, <MODE>mode)"
"#"
- "reload_completed"
+ "&& reload_completed"
[(parallel [(set (match_dup 0)
(minus:QHI (match_dup 1) (match_dup 2)))
(clobber (reg:CC R_FLAGS))])]
@@ -1064,7 +1064,7 @@ (define_insn_and_split "*subsi3_insn"
(match_operand:SI 2 "add_operand" " L,r, J")))]
"ok_for_simple_arith_logic_operands (operands, SImode)"
"#"
- "reload_completed"
+ "&& reload_completed"
[(parallel [(set (match_dup 0)
(minus:SI (match_dup 1) (match_dup 2)))
(clobber (reg:CC R_FLAGS))])]
@@ -1125,7 +1125,7 @@ (define_insn_and_split "*subdi3_insn"
(match_operand:DI 2 "add_operand" " L,J, r")))]
"ok_for_simple_arith_logic_operands (operands, DImode)"
"#"
- "reload_completed"
+ "&& reload_completed"
[(const_int 0)]
{
visium_split_double_add (MINUS, operands[0], operands[1], operands[2]);
@@ -1209,7 +1209,7 @@ (define_insn_and_split "*neg<mode>2_insn"
(neg:I (match_operand:I 1 "register_operand" "r")))]
"ok_for_simple_arith_logic_operands (operands, <MODE>mode)"
"#"
- "reload_completed"
+ "&& reload_completed"
[(parallel [(set (match_dup 0) (neg:I (match_dup 1)))
(clobber (reg:CC R_FLAGS))])]
""
@@ -1253,7 +1253,7 @@ (define_insn_and_split "*negdi2_insn"
(neg:DI (match_operand:DI 1 "register_operand" "r")))]
"ok_for_simple_arith_logic_operands (operands, DImode)"
"#"
- "reload_completed"
+ "&& reload_completed"
[(const_int 0)]
{
visium_split_double_add (MINUS, operands[0], const0_rtx, operands[1]);
@@ -1415,7 +1415,7 @@ (define_insn_and_split "*and<mode>3_insn"
(match_operand:I 2 "register_operand" "r")))]
"ok_for_simple_arith_logic_operands (operands, <MODE>mode)"
"#"
- "reload_completed"
+ "&& reload_completed"
[(parallel [(set (match_dup 0)
(and:I (match_dup 1) (match_dup 2)))
(clobber (reg:CC R_FLAGS))])]
@@ -1453,7 +1453,7 @@ (define_insn_and_split "*ior<mode>3_insn"
(match_operand:I 2 "register_operand" "r")))]
"ok_for_simple_arith_logic_operands (operands, <MODE>mode)"
"#"
- "reload_completed"
+ "&& reload_completed"
[(parallel [(set (match_dup 0)
(ior:I (match_dup 1) (match_dup 2)))
(clobber (reg:CC R_FLAGS))])]
@@ -1491,7 +1491,7 @@ (define_insn_and_split "*xor<mode>3_insn"
(match_operand:I 2 "register_operand" "r")))]
"ok_for_simple_arith_logic_operands (operands, <MODE>mode)"
"#"
- "reload_completed"
+ "&& reload_completed"
[(parallel [(set (match_dup 0)
(xor:I (match_dup 1) (match_dup 2)))
(clobber (reg:CC R_FLAGS))])]
@@ -1527,7 +1527,7 @@ (define_insn_and_split "*one_cmpl<mode>2_insn"
(not:I (match_operand:I 1 "reg_or_0_operand" "rO")))]
"ok_for_simple_arith_logic_operands (operands, <MODE>mode)"
"#"
- "reload_completed"
+ "&& reload_completed"
[(parallel [(set (match_dup 0) (not:I (match_dup 1)))
(clobber (reg:CC R_FLAGS))])]
""
@@ -1563,7 +1563,7 @@ (define_insn_and_split "*ashl<mode>3_insn"
(match_operand:QI 2 "reg_or_shift_operand" "r,K")))]
"ok_for_simple_arith_logic_operands (operands, <MODE>mode)"
"#"
- "reload_completed"
+ "&& reload_completed"
[(parallel [(set (match_dup 0)
(ashift:I (match_dup 1) (match_dup 2)))
(clobber (reg:CC R_FLAGS))])]
@@ -1622,7 +1622,7 @@ (define_insn_and_split "*ashr<mode>3_insn"
(match_operand:QI 2 "reg_or_shift_operand" "r,K")))]
"ok_for_simple_arith_logic_operands (operands, <MODE>mode)"
"#"
- "reload_completed"
+ "&& reload_completed"
[(parallel [(set (match_dup 0)
(ashiftrt:I (match_dup 1) (match_dup 2)))
(clobber (reg:CC R_FLAGS))])]
@@ -1683,7 +1683,7 @@ (define_insn_and_split "*lshr<mode>3_insn"
(match_operand:QI 2 "reg_or_shift_operand" "r,K")))]
"ok_for_simple_arith_logic_operands (operands, <MODE>mode)"
"#"
- "reload_completed"
+ "&& reload_completed"
[(parallel [(set (match_dup 0)
(lshiftrt:I (match_dup 1) (match_dup 2)))
(clobber (reg:CC R_FLAGS))])]
@@ -1740,7 +1740,7 @@ (define_insn_and_split "*trunchiqi2_insn"
(truncate:QI (match_operand:HI 1 "register_operand" "r")))]
"ok_for_simple_arith_logic_operands (operands, QImode)"
"#"
- "reload_completed"
+ "&& reload_completed"
[(parallel [(set (match_dup 0) (truncate:QI (match_dup 1)))
(clobber (reg:CC R_FLAGS))])]
""
@@ -1764,7 +1764,7 @@ (define_insn_and_split "*truncsihi2_insn"
(truncate:HI (match_operand:SI 1 "register_operand" "r")))]
"ok_for_simple_arith_logic_operands (operands, HImode)"
"#"
- "reload_completed"
+ "&& reload_completed"
[(parallel [(set (match_dup 0) (truncate:HI (match_dup 1)))
(clobber (reg:CC R_FLAGS))])]
""
@@ -1788,7 +1788,7 @@ (define_insn_and_split "*truncdisi2_insn"
(truncate:SI (match_operand:DI 1 "register_operand" "r")))]
"ok_for_simple_arith_logic_operands (operands, SImode)"
"#"
- "reload_completed"
+ "&& reload_completed"
[(parallel [(set (match_dup 0) (truncate:SI (match_dup 1)))
(clobber (reg:CC R_FLAGS))])]
""
@@ -1822,7 +1822,7 @@ (define_insn_and_split "*extendqihi2_insn"
(sign_extend:HI (match_operand:QI 1 "register_operand" "r")))]
"ok_for_simple_arith_logic_operands (operands, HImode)"
"#"
- "reload_completed"
+ "&& reload_completed"
[(parallel [(set (match_dup 0) (sign_extend:HI (match_dup 1)))
(clobber (reg:CC R_FLAGS))])]
""
@@ -1846,7 +1846,7 @@ (define_insn_and_split "*extendqisi2_insn"
(sign_extend:SI (match_operand:QI 1 "register_operand" "r")))]
"ok_for_simple_arith_logic_operands (operands, SImode)"
"#"
- "reload_completed"
+ "&& reload_completed"
[(parallel [(set (match_dup 0) (sign_extend:SI (match_dup 1)))
(clobber (reg:CC R_FLAGS))])]
""
@@ -1870,7 +1870,7 @@ (define_insn_and_split "*extendhisi2_insn"
(sign_extend:SI (match_operand:HI 1 "register_operand" "r")))]
"ok_for_simple_arith_logic_operands (operands, SImode)"
"#"
- "reload_completed"
+ "&& reload_completed"
[(parallel [(set (match_operand:SI 0 "register_operand" "")
(sign_extend:SI (match_operand:HI 1 "register_operand" "")))
(clobber (reg:CC R_FLAGS))])]
@@ -1895,7 +1895,7 @@ (define_insn_and_split "*extendsidi2_insn"
(sign_extend:DI (match_operand:SI 1 "register_operand" "r")))]
"ok_for_simple_arith_logic_operands (operands, DImode)"
"#"
- "reload_completed"
+ "&& reload_completed"
[(parallel [(set (match_dup 3) (match_dup 1))
(clobber (reg:CC R_FLAGS))])
(parallel [(set (match_dup 2)
@@ -1931,7 +1931,7 @@ (define_insn_and_split "*zero_extendqihi2_insn"
(zero_extend:HI (match_operand:QI 1 "register_operand" "r")))]
"ok_for_simple_arith_logic_operands (operands, HImode)"
"#"
- "reload_completed"
+ "&& reload_completed"
[(parallel [(set (match_dup 0)
(ashift:HI (match_dup 2) (const_int 8)))
(clobber (reg:CC R_FLAGS))])
@@ -1953,7 +1953,7 @@ (define_insn_and_split "*zero_extendqisi2_insn"
(zero_extend:SI (match_operand:QI 1 "register_operand" "r")))]
"ok_for_simple_arith_logic_operands (operands, SImode)"
"#"
- "reload_completed"
+ "&& reload_completed"
[(parallel [(set (match_dup 0)
(ashift:SI (match_dup 2) (const_int 24)))
(clobber (reg:CC R_FLAGS))])
@@ -1982,7 +1982,7 @@ (define_insn_and_split "*zero_extendsidi2_insn"
(zero_extend:DI (match_operand:SI 1 "register_operand" "r")))]
"ok_for_simple_arith_logic_operands (operands, DImode)"
"#"
- "reload_completed"
+ "&& reload_completed"
[(parallel [(set (match_dup 3) (match_dup 1))
(clobber (reg:CC R_FLAGS))])
(set (match_dup 2) (const_int 0))]
--
2.27.0
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 06/15] visium: Fix non-robust split condition in define_insn_and_split
2021-11-11 11:24 ` [PATCH 06/15] visium: " Kewen Lin
@ 2021-11-16 16:57 ` Eric Botcazou
2021-11-17 6:06 ` Kewen.Lin
0 siblings, 1 reply; 22+ messages in thread
From: Eric Botcazou @ 2021-11-16 16:57 UTC (permalink / raw)
To: Kewen Lin; +Cc: gcc-patches
> gcc/ChangeLog:
>
> * config/visium/visium.md (*add<mode>3_insn, *addsi3_insn, *addi3_insn,
> *sub<mode>3_insn, *subsi3_insn, *subdi3_insn, *neg<mode>2_insn,
> *negdi2_insn, *and<mode>3_insn, *ior<mode>3_insn, *xor<mode>3_insn,
> *one_cmpl<mode>2_insn, *ashl<mode>3_insn, *ashr<mode>3_insn,
> *lshr<mode>3_insn, *trunchiqi2_insn, *truncsihi2_insn,
> *truncdisi2_insn, *extendqihi2_insn, *extendqisi2_insn,
> *extendhisi2_insn, *extendsidi2_insn, *zero_extendqihi2_insn,
> *zero_extendqisi2_insn, *zero_extendsidi2_insn): Fix split condition.
OK for mainline, thanks.
--
Eric Botcazou
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 06/15] visium: Fix non-robust split condition in define_insn_and_split
2021-11-16 16:57 ` Eric Botcazou
@ 2021-11-17 6:06 ` Kewen.Lin
0 siblings, 0 replies; 22+ messages in thread
From: Kewen.Lin @ 2021-11-17 6:06 UTC (permalink / raw)
To: Eric Botcazou; +Cc: gcc-patches
Hi Eric,
on 2021/11/17 上午12:57, Eric Botcazou wrote:
>> gcc/ChangeLog:
>>
>> * config/visium/visium.md (*add<mode>3_insn, *addsi3_insn, *addi3_insn,
>> *sub<mode>3_insn, *subsi3_insn, *subdi3_insn, *neg<mode>2_insn,
>> *negdi2_insn, *and<mode>3_insn, *ior<mode>3_insn, *xor<mode>3_insn,
>> *one_cmpl<mode>2_insn, *ashl<mode>3_insn, *ashr<mode>3_insn,
>> *lshr<mode>3_insn, *trunchiqi2_insn, *truncsihi2_insn,
>> *truncdisi2_insn, *extendqihi2_insn, *extendqisi2_insn,
>> *extendhisi2_insn, *extendsidi2_insn, *zero_extendqihi2_insn,
>> *zero_extendqisi2_insn, *zero_extendsidi2_insn): Fix split condition.
>
> OK for mainline, thanks.
>
Thanks! Committed as r12-5332.
BR,
Kewen
^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH 07/15] xtensa: Fix non-robust split condition in define_insn_and_split
2021-11-11 11:24 [PATCH 00/15] Fix non-robust split condition in define_insn_and_split Kewen Lin
` (5 preceding siblings ...)
2021-11-11 11:24 ` [PATCH 06/15] visium: " Kewen Lin
@ 2021-11-11 11:24 ` Kewen Lin
2021-11-19 22:26 ` augustine.sterling
2021-11-11 11:24 ` [PATCH 08/15] alpha: " Kewen Lin
` (7 subsequent siblings)
14 siblings, 1 reply; 22+ messages in thread
From: Kewen Lin @ 2021-11-11 11:24 UTC (permalink / raw)
To: gcc-patches; +Cc: Kewen Lin, augustine.sterling, jcmvbkbc
This patch is to fix some non-robust split conditions in some
define_insn_and_splits, to make each of them applied on top of
the corresponding condition for define_insn part, otherwise the
splitting could perform unexpectedly.
gcc/ChangeLog:
* config/xtensa/xtensa.md (movdi_internal, movdf_internal): Fix split
condition.
---
gcc/config/xtensa/xtensa.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gcc/config/xtensa/xtensa.md b/gcc/config/xtensa/xtensa.md
index cdf22f14b94..e0bf720d6e0 100644
--- a/gcc/config/xtensa/xtensa.md
+++ b/gcc/config/xtensa/xtensa.md
@@ -779,7 +779,7 @@ (define_insn_and_split "movdi_internal"
"register_operand (operands[0], DImode)
|| register_operand (operands[1], DImode)"
"#"
- "reload_completed"
+ "&& reload_completed"
[(set (match_dup 0) (match_dup 2))
(set (match_dup 1) (match_dup 3))]
{
@@ -1053,7 +1053,7 @@ (define_insn_and_split "movdf_internal"
"register_operand (operands[0], DFmode)
|| register_operand (operands[1], DFmode)"
"#"
- "reload_completed"
+ "&& reload_completed"
[(set (match_dup 0) (match_dup 2))
(set (match_dup 1) (match_dup 3))]
{
--
2.27.0
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 07/15] xtensa: Fix non-robust split condition in define_insn_and_split
2021-11-11 11:24 ` [PATCH 07/15] xtensa: " Kewen Lin
@ 2021-11-19 22:26 ` augustine.sterling
2021-11-22 2:21 ` Kewen.Lin
0 siblings, 1 reply; 22+ messages in thread
From: augustine.sterling @ 2021-11-19 22:26 UTC (permalink / raw)
To: Kewen Lin; +Cc: gcc-patches, Max Filippov
On Thu, Nov 11, 2021 at 3:25 AM Kewen Lin <linkw@linux.ibm.com> wrote:
> gcc/ChangeLog:
>
> * config/xtensa/xtensa.md (movdi_internal, movdf_internal): Fix split
> condition.
I had been hoping Max would reply (as I'm just doing legacy work
around this these days), but seeing that he hasn't. This is approved.
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 07/15] xtensa: Fix non-robust split condition in define_insn_and_split
2021-11-19 22:26 ` augustine.sterling
@ 2021-11-22 2:21 ` Kewen.Lin
0 siblings, 0 replies; 22+ messages in thread
From: Kewen.Lin @ 2021-11-22 2:21 UTC (permalink / raw)
To: augustine.sterling; +Cc: gcc-patches, Max Filippov
on 2021/11/20 上午6:26, augustine.sterling@gmail.com wrote:
> On Thu, Nov 11, 2021 at 3:25 AM Kewen Lin <linkw@linux.ibm.com> wrote:
>> gcc/ChangeLog:
>>
>> * config/xtensa/xtensa.md (movdi_internal, movdf_internal): Fix split
>> condition.
>
> I had been hoping Max would reply (as I'm just doing legacy work
> around this these days), but seeing that he hasn't. This is approved.
>
Thanks Augustine! Committed as r12-5444.
BR,
Kewen
^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH 08/15] alpha: Fix non-robust split condition in define_insn_and_split
2021-11-11 11:24 [PATCH 00/15] Fix non-robust split condition in define_insn_and_split Kewen Lin
` (6 preceding siblings ...)
2021-11-11 11:24 ` [PATCH 07/15] xtensa: " Kewen Lin
@ 2021-11-11 11:24 ` Kewen Lin
2021-11-11 11:24 ` [PATCH 09/15] arm: " Kewen Lin
` (6 subsequent siblings)
14 siblings, 0 replies; 22+ messages in thread
From: Kewen Lin @ 2021-11-11 11:24 UTC (permalink / raw)
To: gcc-patches
This patch is to fix some non-robust split conditions in some
define_insn_and_splits, to make each of them applied on top of
the corresponding condition for define_insn part, otherwise the
splitting could perform unexpectedly.
gcc/ChangeLog:
* config/alpha/alpha.md (*movtf_internal, *movti_internal): Fix split
condition.
---
gcc/config/alpha/alpha.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gcc/config/alpha/alpha.md b/gcc/config/alpha/alpha.md
index 98d09d43721..87617afd0c6 100644
--- a/gcc/config/alpha/alpha.md
+++ b/gcc/config/alpha/alpha.md
@@ -3830,7 +3830,7 @@ (define_insn_and_split "*movtf_internal"
"register_operand (operands[0], TFmode)
|| reg_or_0_operand (operands[1], TFmode)"
"#"
- "reload_completed"
+ "&& reload_completed"
[(set (match_dup 0) (match_dup 2))
(set (match_dup 1) (match_dup 3))]
"alpha_split_tmode_pair (operands, TFmode, true);")
@@ -4091,7 +4091,7 @@ (define_insn_and_split "*movti_internal"
&& ! CONSTANT_P (operands[1]))
|| reg_or_0_operand (operands[1], TImode)"
"#"
- "reload_completed"
+ "&& reload_completed"
[(set (match_dup 0) (match_dup 2))
(set (match_dup 1) (match_dup 3))]
"alpha_split_tmode_pair (operands, TImode, true);")
--
2.27.0
^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH 09/15] arm: Fix non-robust split condition in define_insn_and_split
2021-11-11 11:24 [PATCH 00/15] Fix non-robust split condition in define_insn_and_split Kewen Lin
` (7 preceding siblings ...)
2021-11-11 11:24 ` [PATCH 08/15] alpha: " Kewen Lin
@ 2021-11-11 11:24 ` Kewen Lin
2021-11-11 11:24 ` [PATCH 10/15] bfin: " Kewen Lin
` (5 subsequent siblings)
14 siblings, 0 replies; 22+ messages in thread
From: Kewen Lin @ 2021-11-11 11:24 UTC (permalink / raw)
To: gcc-patches; +Cc: Kewen Lin, kyrylo.tkachov, richard.earnshaw
This patch is to fix one non-robust split condition, to make
it applied on top of the corresponding condition for define_insn
part, otherwise the splitting could perform unexpectedly.
gcc/ChangeLog:
* config/arm/arm.md (*minmax_arithsi_non_canon): Fix split condition.
---
gcc/config/arm/arm.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md
index 4adc976b8b6..9a27d421484 100644
--- a/gcc/config/arm/arm.md
+++ b/gcc/config/arm/arm.md
@@ -4198,7 +4198,7 @@ (define_insn_and_split "*minmax_arithsi_non_canon"
"TARGET_32BIT && !arm_eliminable_register (operands[1])
&& !(arm_restrict_it && CONST_INT_P (operands[3]))"
"#"
- "TARGET_32BIT && !arm_eliminable_register (operands[1]) && reload_completed"
+ "&& reload_completed"
[(set (reg:CC CC_REGNUM)
(compare:CC (match_dup 2) (match_dup 3)))
--
2.27.0
^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH 10/15] bfin: Fix non-robust split condition in define_insn_and_split
2021-11-11 11:24 [PATCH 00/15] Fix non-robust split condition in define_insn_and_split Kewen Lin
` (8 preceding siblings ...)
2021-11-11 11:24 ` [PATCH 09/15] arm: " Kewen Lin
@ 2021-11-11 11:24 ` Kewen Lin
2021-11-11 11:24 ` [PATCH 11/15] csky: " Kewen Lin
` (4 subsequent siblings)
14 siblings, 0 replies; 22+ messages in thread
From: Kewen Lin @ 2021-11-11 11:24 UTC (permalink / raw)
To: gcc-patches
This patch is to fix some non-robust split conditions in some
define_insn_and_splits, to make each of them applied on top of
the corresponding condition for define_insn part, otherwise the
splitting could perform unexpectedly.
gcc/ChangeLog:
* config/bfin/bfin.md (movdi_insn, movdf_insn): Fix split condition.
---
gcc/config/bfin/bfin.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gcc/config/bfin/bfin.md b/gcc/config/bfin/bfin.md
index fd65f4d9e63..41a50974136 100644
--- a/gcc/config/bfin/bfin.md
+++ b/gcc/config/bfin/bfin.md
@@ -506,7 +506,7 @@ (define_insn_and_split "movdi_insn"
(match_operand:DI 1 "general_operand" "iFx,r,mx"))]
"GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) == REG"
"#"
- "reload_completed"
+ "&& reload_completed"
[(set (match_dup 2) (match_dup 3))
(set (match_dup 4) (match_dup 5))]
{
@@ -718,7 +718,7 @@ (define_insn_and_split "movdf_insn"
(match_operand:DF 1 "general_operand" "iFx,r,mx"))]
"GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) == REG"
"#"
- "reload_completed"
+ "&& reload_completed"
[(set (match_dup 2) (match_dup 3))
(set (match_dup 4) (match_dup 5))]
{
--
2.27.0
^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH 11/15] csky: Fix non-robust split condition in define_insn_and_split
2021-11-11 11:24 [PATCH 00/15] Fix non-robust split condition in define_insn_and_split Kewen Lin
` (9 preceding siblings ...)
2021-11-11 11:24 ` [PATCH 10/15] bfin: " Kewen Lin
@ 2021-11-11 11:24 ` Kewen Lin
2021-11-11 11:24 ` [PATCH 12/15] i386: " Kewen Lin
` (3 subsequent siblings)
14 siblings, 0 replies; 22+ messages in thread
From: Kewen Lin @ 2021-11-11 11:24 UTC (permalink / raw)
To: gcc-patches; +Cc: Kewen Lin, xianmiao_qu, cooper.qu
This patch is to fix some non-robust split conditions in some
define_insn_and_splits, to make each of them applied on top of
the corresponding condition for define_insn part, otherwise the
splitting could perform unexpectedly.
gcc/ChangeLog:
* config/csky/csky.md (*cskyv2_adddi3, *ck801_adddi3, *cskyv2_adddi1_1,
*cskyv2_subdi3, *ck801_subdi3, *cskyv2_subdi1_1, cskyv2_addcc,
cskyv2_addcc_invert, *cskyv2_anddi3, *ck801_anddi3, *cskyv2_iordi3,
*ck801_iordi3, *cskyv2_xordi3, *ck801_xordi3,): Fix split condition.
---
gcc/config/csky/csky.md | 28 ++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/gcc/config/csky/csky.md b/gcc/config/csky/csky.md
index f91d851cb2c..54143a0efea 100644
--- a/gcc/config/csky/csky.md
+++ b/gcc/config/csky/csky.md
@@ -850,7 +850,7 @@ (define_insn_and_split "*cskyv2_adddi3"
(clobber (reg:CC CSKY_CC_REGNUM))]
"CSKY_ISA_FEATURE (E2)"
"#"
- "reload_completed"
+ "&& reload_completed"
[(const_int 0)]
{
int hi = TARGET_BIG_ENDIAN ? 0 : UNITS_PER_WORD;
@@ -877,7 +877,7 @@ (define_insn_and_split "*ck801_adddi3"
(clobber (reg:CC CSKY_CC_REGNUM))]
"CSKY_ISA_FEATURE (E1)"
"#"
- "reload_completed"
+ "&& reload_completed"
[(const_int 0)]
{
int hi = TARGET_BIG_ENDIAN ? 0 : UNITS_PER_WORD;
@@ -906,7 +906,7 @@ (define_insn_and_split "*cskyv2_adddi1_1"
(clobber (reg:CC CSKY_CC_REGNUM))]
"CSKY_ISA_FEATURE (E2)"
"#"
- "reload_completed"
+ "&& reload_completed"
[(const_int 0)]
{
int hi = TARGET_BIG_ENDIAN ? 0 : UNITS_PER_WORD;
@@ -1048,7 +1048,7 @@ (define_insn_and_split "*cskyv2_subdi3"
(clobber (reg:CC CSKY_CC_REGNUM))]
"CSKY_ISA_FEATURE (E2)"
"#"
- "reload_completed"
+ "&& reload_completed"
[(const_int 0)]
{
int hi = TARGET_BIG_ENDIAN ? 0 : UNITS_PER_WORD;
@@ -1075,7 +1075,7 @@ (define_insn_and_split "*ck801_subdi3"
(clobber (reg:CC CSKY_CC_REGNUM))]
"CSKY_ISA_FEATURE (E1)"
"#"
- "reload_completed"
+ "&& reload_completed"
[(const_int 0)]
{
int hi = TARGET_BIG_ENDIAN ? 0 : UNITS_PER_WORD;
@@ -1104,7 +1104,7 @@ (define_insn_and_split "*cskyv2_subdi1_1"
(clobber (reg:CC CSKY_CC_REGNUM))]
"CSKY_ISA_FEATURE (E2)"
"#"
- "reload_completed"
+ "&& reload_completed"
[(const_int 0)]
{
int hi = TARGET_BIG_ENDIAN ? 0 : UNITS_PER_WORD;
@@ -1276,7 +1276,7 @@ (define_insn_and_split "cskyv2_addcc"
dect\t%0, %1, %M2
#
#"
- "reload_completed && !rtx_equal_p (operands[0], operands[1])"
+ "&& reload_completed && !rtx_equal_p (operands[0], operands[1])"
[(set (match_dup 0)
(if_then_else:SI (ne (reg:CC CSKY_CC_REGNUM) (const_int 0))
(plus:SI (match_dup 0) (match_dup 2))))]
@@ -1302,7 +1302,7 @@ (define_insn_and_split "cskyv2_addcc_invert"
decf\t%0, %1, %M2
#
#"
- "reload_completed && !rtx_equal_p (operands[0], operands[1])"
+ "&& reload_completed && !rtx_equal_p (operands[0], operands[1])"
[(set (match_dup 0)
(if_then_else:SI (eq (reg:CC CSKY_CC_REGNUM) (const_int 0))
(plus:SI (match_dup 0) (match_dup 2))))]
@@ -1691,7 +1691,7 @@ (define_insn_and_split "*cskyv2_anddi3"
(match_operand:DI 2 "register_operand" "b,r")))]
"CSKY_ISA_FEATURE (E2)"
"#"
- "reload_completed"
+ "&& reload_completed"
[(const_int 0)]
{
int hi = TARGET_BIG_ENDIAN ? 0 : UNITS_PER_WORD;
@@ -1716,7 +1716,7 @@ (define_insn_and_split "*ck801_anddi3"
(match_operand:DI 2 "register_operand" "r")))]
"CSKY_ISA_FEATURE (E1)"
"#"
- "reload_completed"
+ "&& reload_completed"
[(const_int 0)]
{
int hi = TARGET_BIG_ENDIAN ? 0 : UNITS_PER_WORD;
@@ -1801,7 +1801,7 @@ (define_insn_and_split "*cskyv2_iordi3"
(match_operand:DI 2 "register_operand" "b, r")))]
"CSKY_ISA_FEATURE (E2)"
"#"
- "reload_completed"
+ "&& reload_completed"
[(const_int 0)]
{
int hi = TARGET_BIG_ENDIAN ? 0 : UNITS_PER_WORD;
@@ -1826,7 +1826,7 @@ (define_insn_and_split "*ck801_iordi3"
(match_operand:DI 2 "register_operand" "r")))]
"CSKY_ISA_FEATURE (E1)"
"#"
- "reload_completed"
+ "&& reload_completed"
[(const_int 0)]
{
int hi = TARGET_BIG_ENDIAN ? 0 : UNITS_PER_WORD;
@@ -1911,7 +1911,7 @@ (define_insn_and_split "*cskyv2_xordi3"
(match_operand:DI 2 "register_operand" "b, r")))]
"CSKY_ISA_FEATURE (E2)"
"#"
- "reload_completed"
+ "&& reload_completed"
[(const_int 0)]
{
int hi = TARGET_BIG_ENDIAN ? 0 : UNITS_PER_WORD;
@@ -1936,7 +1936,7 @@ (define_insn_and_split "*ck801_xordi3"
(match_operand:DI 2 "register_operand" "r")))]
"CSKY_ISA_FEATURE (E1)"
"#"
- "reload_completed"
+ "&& reload_completed"
[(const_int 0)]
{
int hi = TARGET_BIG_ENDIAN ? 0 : UNITS_PER_WORD;
--
2.27.0
^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH 12/15] i386: Fix non-robust split condition in define_insn_and_split
2021-11-11 11:24 [PATCH 00/15] Fix non-robust split condition in define_insn_and_split Kewen Lin
` (10 preceding siblings ...)
2021-11-11 11:24 ` [PATCH 11/15] csky: " Kewen Lin
@ 2021-11-11 11:24 ` Kewen Lin
2021-11-17 7:13 ` Uros Bizjak
2021-11-11 11:24 ` [PATCH 13/15] ia64: " Kewen Lin
` (2 subsequent siblings)
14 siblings, 1 reply; 22+ messages in thread
From: Kewen Lin @ 2021-11-11 11:24 UTC (permalink / raw)
To: gcc-patches
This patch is to fix some non-robust split conditions in some
define_insn_and_splits, to make each of them applied on top of
the corresponding condition for define_insn part, otherwise the
splitting could perform unexpectedly.
gcc/ChangeLog:
* config/i386/i386.md (*add<dwi>3_doubleword, *addv<dwi>4_doubleword,
*addv<dwi>4_doubleword_1, *sub<dwi>3_doubleword,
*subv<dwi>4_doubleword, *subv<dwi>4_doubleword_1,
*add<dwi>3_doubleword_cc_overflow_1, *divmodsi4_const,
*neg<dwi>2_doubleword, *tls_dynamic_gnu2_combine_64_<mode>): Fix split
condition.
---
gcc/config/i386/i386.md | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index 6eb9de81921..2bd09e502ae 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -5491,7 +5491,7 @@ (define_insn_and_split "*add<dwi>3_doubleword"
(clobber (reg:CC FLAGS_REG))]
"ix86_binary_operator_ok (PLUS, <DWI>mode, operands)"
"#"
- "reload_completed"
+ "&& reload_completed"
[(parallel [(set (reg:CCC FLAGS_REG)
(compare:CCC
(plus:DWIH (match_dup 1) (match_dup 2))
@@ -6300,7 +6300,7 @@ (define_insn_and_split "*addv<dwi>4_doubleword"
(plus:<DWI> (match_dup 1) (match_dup 2)))]
"ix86_binary_operator_ok (PLUS, <DWI>mode, operands)"
"#"
- "reload_completed"
+ "&& reload_completed"
[(parallel [(set (reg:CCC FLAGS_REG)
(compare:CCC
(plus:DWIH (match_dup 1) (match_dup 2))
@@ -6347,7 +6347,7 @@ (define_insn_and_split "*addv<dwi>4_doubleword_1"
&& CONST_SCALAR_INT_P (operands[2])
&& rtx_equal_p (operands[2], operands[3])"
"#"
- "reload_completed"
+ "&& reload_completed"
[(parallel [(set (reg:CCC FLAGS_REG)
(compare:CCC
(plus:DWIH (match_dup 1) (match_dup 2))
@@ -6641,7 +6641,7 @@ (define_insn_and_split "*sub<dwi>3_doubleword"
(clobber (reg:CC FLAGS_REG))]
"ix86_binary_operator_ok (MINUS, <MODE>mode, operands)"
"#"
- "reload_completed"
+ "&& reload_completed"
[(parallel [(set (reg:CC FLAGS_REG)
(compare:CC (match_dup 1) (match_dup 2)))
(set (match_dup 0)
@@ -6817,7 +6817,7 @@ (define_insn_and_split "*subv<dwi>4_doubleword"
(minus:<DWI> (match_dup 1) (match_dup 2)))]
"ix86_binary_operator_ok (MINUS, <MODE>mode, operands)"
"#"
- "reload_completed"
+ "&& reload_completed"
[(parallel [(set (reg:CC FLAGS_REG)
(compare:CC (match_dup 1) (match_dup 2)))
(set (match_dup 0)
@@ -6862,7 +6862,7 @@ (define_insn_and_split "*subv<dwi>4_doubleword_1"
&& CONST_SCALAR_INT_P (operands[2])
&& rtx_equal_p (operands[2], operands[3])"
"#"
- "reload_completed"
+ "&& reload_completed"
[(parallel [(set (reg:CC FLAGS_REG)
(compare:CC (match_dup 1) (match_dup 2)))
(set (match_dup 0)
@@ -7542,7 +7542,7 @@ (define_insn_and_split "*add<dwi>3_doubleword_cc_overflow_1"
(plus:<DWI> (match_dup 1) (match_dup 2)))]
"ix86_binary_operator_ok (PLUS, <DWI>mode, operands)"
"#"
- "reload_completed"
+ "&& reload_completed"
[(parallel [(set (reg:CCC FLAGS_REG)
(compare:CCC
(plus:DWIH (match_dup 1) (match_dup 2))
@@ -9000,7 +9000,7 @@ (define_insn_and_split "*divmodsi4_const"
(clobber (reg:CC FLAGS_REG))]
"!optimize_function_for_size_p (cfun)"
"#"
- "reload_completed"
+ "&& reload_completed"
[(set (match_dup 0) (match_dup 2))
(set (match_dup 1) (match_dup 4))
(parallel [(set (match_dup 0)
@@ -10515,7 +10515,7 @@ (define_insn_and_split "*neg<dwi>2_doubleword"
(clobber (reg:CC FLAGS_REG))]
"ix86_unary_operator_ok (NEG, <DWI>mode, operands)"
"#"
- "reload_completed"
+ "&& reload_completed"
[(parallel
[(set (reg:CCC FLAGS_REG)
(ne:CCC (match_dup 1) (const_int 0)))
@@ -16898,7 +16898,7 @@ (define_insn_and_split "*tls_dynamic_gnu2_combine_64_<mode>"
(clobber (reg:CC FLAGS_REG))]
"TARGET_64BIT && TARGET_GNU2_TLS"
"#"
- ""
+ "&& 1"
[(set (match_dup 0) (match_dup 4))]
{
operands[4] = can_create_pseudo_p () ? gen_reg_rtx (ptr_mode) : operands[0];
--
2.27.0
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 12/15] i386: Fix non-robust split condition in define_insn_and_split
2021-11-11 11:24 ` [PATCH 12/15] i386: " Kewen Lin
@ 2021-11-17 7:13 ` Uros Bizjak
2021-11-17 10:06 ` Kewen.Lin
0 siblings, 1 reply; 22+ messages in thread
From: Uros Bizjak @ 2021-11-17 7:13 UTC (permalink / raw)
To: Kewen Lin; +Cc: gcc-patches
On Thu, Nov 11, 2021 at 12:25 PM Kewen Lin <linkw@linux.ibm.com> wrote:
>
> This patch is to fix some non-robust split conditions in some
> define_insn_and_splits, to make each of them applied on top of
> the corresponding condition for define_insn part, otherwise the
> splitting could perform unexpectedly.
>
> gcc/ChangeLog:
>
> * config/i386/i386.md (*add<dwi>3_doubleword, *addv<dwi>4_doubleword,
> *addv<dwi>4_doubleword_1, *sub<dwi>3_doubleword,
> *subv<dwi>4_doubleword, *subv<dwi>4_doubleword_1,
> *add<dwi>3_doubleword_cc_overflow_1, *divmodsi4_const,
> *neg<dwi>2_doubleword, *tls_dynamic_gnu2_combine_64_<mode>): Fix split
> condition.
OK.
Thanks,
Uros.
> ---
> gcc/config/i386/i386.md | 20 ++++++++++----------
> 1 file changed, 10 insertions(+), 10 deletions(-)
>
> diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
> index 6eb9de81921..2bd09e502ae 100644
> --- a/gcc/config/i386/i386.md
> +++ b/gcc/config/i386/i386.md
> @@ -5491,7 +5491,7 @@ (define_insn_and_split "*add<dwi>3_doubleword"
> (clobber (reg:CC FLAGS_REG))]
> "ix86_binary_operator_ok (PLUS, <DWI>mode, operands)"
> "#"
> - "reload_completed"
> + "&& reload_completed"
> [(parallel [(set (reg:CCC FLAGS_REG)
> (compare:CCC
> (plus:DWIH (match_dup 1) (match_dup 2))
> @@ -6300,7 +6300,7 @@ (define_insn_and_split "*addv<dwi>4_doubleword"
> (plus:<DWI> (match_dup 1) (match_dup 2)))]
> "ix86_binary_operator_ok (PLUS, <DWI>mode, operands)"
> "#"
> - "reload_completed"
> + "&& reload_completed"
> [(parallel [(set (reg:CCC FLAGS_REG)
> (compare:CCC
> (plus:DWIH (match_dup 1) (match_dup 2))
> @@ -6347,7 +6347,7 @@ (define_insn_and_split "*addv<dwi>4_doubleword_1"
> && CONST_SCALAR_INT_P (operands[2])
> && rtx_equal_p (operands[2], operands[3])"
> "#"
> - "reload_completed"
> + "&& reload_completed"
> [(parallel [(set (reg:CCC FLAGS_REG)
> (compare:CCC
> (plus:DWIH (match_dup 1) (match_dup 2))
> @@ -6641,7 +6641,7 @@ (define_insn_and_split "*sub<dwi>3_doubleword"
> (clobber (reg:CC FLAGS_REG))]
> "ix86_binary_operator_ok (MINUS, <MODE>mode, operands)"
> "#"
> - "reload_completed"
> + "&& reload_completed"
> [(parallel [(set (reg:CC FLAGS_REG)
> (compare:CC (match_dup 1) (match_dup 2)))
> (set (match_dup 0)
> @@ -6817,7 +6817,7 @@ (define_insn_and_split "*subv<dwi>4_doubleword"
> (minus:<DWI> (match_dup 1) (match_dup 2)))]
> "ix86_binary_operator_ok (MINUS, <MODE>mode, operands)"
> "#"
> - "reload_completed"
> + "&& reload_completed"
> [(parallel [(set (reg:CC FLAGS_REG)
> (compare:CC (match_dup 1) (match_dup 2)))
> (set (match_dup 0)
> @@ -6862,7 +6862,7 @@ (define_insn_and_split "*subv<dwi>4_doubleword_1"
> && CONST_SCALAR_INT_P (operands[2])
> && rtx_equal_p (operands[2], operands[3])"
> "#"
> - "reload_completed"
> + "&& reload_completed"
> [(parallel [(set (reg:CC FLAGS_REG)
> (compare:CC (match_dup 1) (match_dup 2)))
> (set (match_dup 0)
> @@ -7542,7 +7542,7 @@ (define_insn_and_split "*add<dwi>3_doubleword_cc_overflow_1"
> (plus:<DWI> (match_dup 1) (match_dup 2)))]
> "ix86_binary_operator_ok (PLUS, <DWI>mode, operands)"
> "#"
> - "reload_completed"
> + "&& reload_completed"
> [(parallel [(set (reg:CCC FLAGS_REG)
> (compare:CCC
> (plus:DWIH (match_dup 1) (match_dup 2))
> @@ -9000,7 +9000,7 @@ (define_insn_and_split "*divmodsi4_const"
> (clobber (reg:CC FLAGS_REG))]
> "!optimize_function_for_size_p (cfun)"
> "#"
> - "reload_completed"
> + "&& reload_completed"
> [(set (match_dup 0) (match_dup 2))
> (set (match_dup 1) (match_dup 4))
> (parallel [(set (match_dup 0)
> @@ -10515,7 +10515,7 @@ (define_insn_and_split "*neg<dwi>2_doubleword"
> (clobber (reg:CC FLAGS_REG))]
> "ix86_unary_operator_ok (NEG, <DWI>mode, operands)"
> "#"
> - "reload_completed"
> + "&& reload_completed"
> [(parallel
> [(set (reg:CCC FLAGS_REG)
> (ne:CCC (match_dup 1) (const_int 0)))
> @@ -16898,7 +16898,7 @@ (define_insn_and_split "*tls_dynamic_gnu2_combine_64_<mode>"
> (clobber (reg:CC FLAGS_REG))]
> "TARGET_64BIT && TARGET_GNU2_TLS"
> "#"
> - ""
> + "&& 1"
> [(set (match_dup 0) (match_dup 4))]
> {
> operands[4] = can_create_pseudo_p () ? gen_reg_rtx (ptr_mode) : operands[0];
> --
> 2.27.0
>
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 12/15] i386: Fix non-robust split condition in define_insn_and_split
2021-11-17 7:13 ` Uros Bizjak
@ 2021-11-17 10:06 ` Kewen.Lin
0 siblings, 0 replies; 22+ messages in thread
From: Kewen.Lin @ 2021-11-17 10:06 UTC (permalink / raw)
To: Uros Bizjak; +Cc: gcc-patches
Hi Uros,
on 2021/11/17 下午3:13, Uros Bizjak wrote:
> On Thu, Nov 11, 2021 at 12:25 PM Kewen Lin <linkw@linux.ibm.com> wrote:
>>
>> This patch is to fix some non-robust split conditions in some
>> define_insn_and_splits, to make each of them applied on top of
>> the corresponding condition for define_insn part, otherwise the
>> splitting could perform unexpectedly.
>>
>> gcc/ChangeLog:
>>
>> * config/i386/i386.md (*add<dwi>3_doubleword, *addv<dwi>4_doubleword,
>> *addv<dwi>4_doubleword_1, *sub<dwi>3_doubleword,
>> *subv<dwi>4_doubleword, *subv<dwi>4_doubleword_1,
>> *add<dwi>3_doubleword_cc_overflow_1, *divmodsi4_const,
>> *neg<dwi>2_doubleword, *tls_dynamic_gnu2_combine_64_<mode>): Fix split
>> condition.
>
> OK.
>
Thanks! Committed as r12-5334.
BR,
Kewen
> Thanks,
> Uros.
>
>> ---
>> gcc/config/i386/i386.md | 20 ++++++++++----------
>> 1 file changed, 10 insertions(+), 10 deletions(-)
>>
>> diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
>> index 6eb9de81921..2bd09e502ae 100644
>> --- a/gcc/config/i386/i386.md
>> +++ b/gcc/config/i386/i386.md
>> @@ -5491,7 +5491,7 @@ (define_insn_and_split "*add<dwi>3_doubleword"
>> (clobber (reg:CC FLAGS_REG))]
>> "ix86_binary_operator_ok (PLUS, <DWI>mode, operands)"
>> "#"
>> - "reload_completed"
>> + "&& reload_completed"
>> [(parallel [(set (reg:CCC FLAGS_REG)
>> (compare:CCC
>> (plus:DWIH (match_dup 1) (match_dup 2))
>> @@ -6300,7 +6300,7 @@ (define_insn_and_split "*addv<dwi>4_doubleword"
>> (plus:<DWI> (match_dup 1) (match_dup 2)))]
>> "ix86_binary_operator_ok (PLUS, <DWI>mode, operands)"
>> "#"
>> - "reload_completed"
>> + "&& reload_completed"
>> [(parallel [(set (reg:CCC FLAGS_REG)
>> (compare:CCC
>> (plus:DWIH (match_dup 1) (match_dup 2))
>> @@ -6347,7 +6347,7 @@ (define_insn_and_split "*addv<dwi>4_doubleword_1"
>> && CONST_SCALAR_INT_P (operands[2])
>> && rtx_equal_p (operands[2], operands[3])"
>> "#"
>> - "reload_completed"
>> + "&& reload_completed"
>> [(parallel [(set (reg:CCC FLAGS_REG)
>> (compare:CCC
>> (plus:DWIH (match_dup 1) (match_dup 2))
>> @@ -6641,7 +6641,7 @@ (define_insn_and_split "*sub<dwi>3_doubleword"
>> (clobber (reg:CC FLAGS_REG))]
>> "ix86_binary_operator_ok (MINUS, <MODE>mode, operands)"
>> "#"
>> - "reload_completed"
>> + "&& reload_completed"
>> [(parallel [(set (reg:CC FLAGS_REG)
>> (compare:CC (match_dup 1) (match_dup 2)))
>> (set (match_dup 0)
>> @@ -6817,7 +6817,7 @@ (define_insn_and_split "*subv<dwi>4_doubleword"
>> (minus:<DWI> (match_dup 1) (match_dup 2)))]
>> "ix86_binary_operator_ok (MINUS, <MODE>mode, operands)"
>> "#"
>> - "reload_completed"
>> + "&& reload_completed"
>> [(parallel [(set (reg:CC FLAGS_REG)
>> (compare:CC (match_dup 1) (match_dup 2)))
>> (set (match_dup 0)
>> @@ -6862,7 +6862,7 @@ (define_insn_and_split "*subv<dwi>4_doubleword_1"
>> && CONST_SCALAR_INT_P (operands[2])
>> && rtx_equal_p (operands[2], operands[3])"
>> "#"
>> - "reload_completed"
>> + "&& reload_completed"
>> [(parallel [(set (reg:CC FLAGS_REG)
>> (compare:CC (match_dup 1) (match_dup 2)))
>> (set (match_dup 0)
>> @@ -7542,7 +7542,7 @@ (define_insn_and_split "*add<dwi>3_doubleword_cc_overflow_1"
>> (plus:<DWI> (match_dup 1) (match_dup 2)))]
>> "ix86_binary_operator_ok (PLUS, <DWI>mode, operands)"
>> "#"
>> - "reload_completed"
>> + "&& reload_completed"
>> [(parallel [(set (reg:CCC FLAGS_REG)
>> (compare:CCC
>> (plus:DWIH (match_dup 1) (match_dup 2))
>> @@ -9000,7 +9000,7 @@ (define_insn_and_split "*divmodsi4_const"
>> (clobber (reg:CC FLAGS_REG))]
>> "!optimize_function_for_size_p (cfun)"
>> "#"
>> - "reload_completed"
>> + "&& reload_completed"
>> [(set (match_dup 0) (match_dup 2))
>> (set (match_dup 1) (match_dup 4))
>> (parallel [(set (match_dup 0)
>> @@ -10515,7 +10515,7 @@ (define_insn_and_split "*neg<dwi>2_doubleword"
>> (clobber (reg:CC FLAGS_REG))]
>> "ix86_unary_operator_ok (NEG, <DWI>mode, operands)"
>> "#"
>> - "reload_completed"
>> + "&& reload_completed"
>> [(parallel
>> [(set (reg:CCC FLAGS_REG)
>> (ne:CCC (match_dup 1) (const_int 0)))
>> @@ -16898,7 +16898,7 @@ (define_insn_and_split "*tls_dynamic_gnu2_combine_64_<mode>"
>> (clobber (reg:CC FLAGS_REG))]
>> "TARGET_64BIT && TARGET_GNU2_TLS"
>> "#"
>> - ""
>> + "&& 1"
>> [(set (match_dup 0) (match_dup 4))]
>> {
>> operands[4] = can_create_pseudo_p () ? gen_reg_rtx (ptr_mode) : operands[0];
>> --
>> 2.27.0
>>
^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH 13/15] ia64: Fix non-robust split condition in define_insn_and_split
2021-11-11 11:24 [PATCH 00/15] Fix non-robust split condition in define_insn_and_split Kewen Lin
` (11 preceding siblings ...)
2021-11-11 11:24 ` [PATCH 12/15] i386: " Kewen Lin
@ 2021-11-11 11:24 ` Kewen Lin
2021-11-11 11:24 ` [PATCH 14/15] mips: " Kewen Lin
2021-11-11 11:24 ` [PATCH 15/15] sh: " Kewen Lin
14 siblings, 0 replies; 22+ messages in thread
From: Kewen Lin @ 2021-11-11 11:24 UTC (permalink / raw)
To: gcc-patches; +Cc: Kewen Lin, hubicka
This patch is to fix some non-robust split conditions in some
define_insn_and_splits, to make each of them applied on top of
the corresponding condition for define_insn part, otherwise the
splitting could perform unexpectedly.
gcc/ChangeLog:
* config/ia64/vect.md (*vec_extractv2sf_0_le, *vec_extractv2sf_0_be):
Fix split condition.
---
gcc/config/ia64/vect.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gcc/config/ia64/vect.md b/gcc/config/ia64/vect.md
index 1a2452289b7..0f3a406d620 100644
--- a/gcc/config/ia64/vect.md
+++ b/gcc/config/ia64/vect.md
@@ -1422,7 +1422,7 @@ (define_insn_and_split "*vec_extractv2sf_0_le"
UNSPEC_VECT_EXTR))]
"!TARGET_BIG_ENDIAN"
"#"
- "reload_completed"
+ "&& reload_completed"
[(set (match_dup 0) (match_dup 1))]
{
if (REG_P (operands[1]) && FR_REGNO_P (REGNO (operands[1])))
@@ -1440,7 +1440,7 @@ (define_insn_and_split "*vec_extractv2sf_0_be"
UNSPEC_VECT_EXTR))]
"TARGET_BIG_ENDIAN"
"#"
- "reload_completed"
+ "&& reload_completed"
[(set (match_dup 0) (match_dup 1))]
{
if (MEM_P (operands[1]))
--
2.27.0
^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH 14/15] mips: Fix non-robust split condition in define_insn_and_split
2021-11-11 11:24 [PATCH 00/15] Fix non-robust split condition in define_insn_and_split Kewen Lin
` (12 preceding siblings ...)
2021-11-11 11:24 ` [PATCH 13/15] ia64: " Kewen Lin
@ 2021-11-11 11:24 ` Kewen Lin
2021-11-11 11:24 ` [PATCH 15/15] sh: " Kewen Lin
14 siblings, 0 replies; 22+ messages in thread
From: Kewen Lin @ 2021-11-11 11:24 UTC (permalink / raw)
To: gcc-patches; +Cc: Kewen Lin, mfortune
This patch is to fix some non-robust split conditions in some
define_insn_and_splits, to make each of them applied on top of
the corresponding condition for define_insn part, otherwise the
splitting could perform unexpectedly.
gcc/ChangeLog:
* config/mips/mips.md (*udivmod<mode>4, udivmod<mode>4_mips16): Fix
split condition.
---
gcc/config/mips/mips.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gcc/config/mips/mips.md b/gcc/config/mips/mips.md
index 455b9b802f6..4efb7503df3 100644
--- a/gcc/config/mips/mips.md
+++ b/gcc/config/mips/mips.md
@@ -2961,7 +2961,7 @@ (define_insn_and_split "*udivmod<mode>4"
(match_dup 2)))]
"ISA_HAS_<D>DIV && !TARGET_MIPS16"
"#"
- "reload_completed"
+ "&& reload_completed"
[(const_int 0)]
{
emit_insn (gen_udivmod<mode>4_split (operands[3], operands[1], operands[2]));
@@ -2982,7 +2982,7 @@ (define_insn_and_split "udivmod<mode>4_mips16"
(clobber (match_operand:GPR 4 "lo_operand" "=l"))]
"ISA_HAS_<D>DIV && TARGET_MIPS16"
"#"
- "cse_not_expected"
+ "&& cse_not_expected"
[(const_int 0)]
{
emit_insn (gen_udivmod<mode>4_split (operands[3], operands[1], operands[2]));
--
2.27.0
^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH 15/15] sh: Fix non-robust split condition in define_insn_and_split
2021-11-11 11:24 [PATCH 00/15] Fix non-robust split condition in define_insn_and_split Kewen Lin
` (13 preceding siblings ...)
2021-11-11 11:24 ` [PATCH 14/15] mips: " Kewen Lin
@ 2021-11-11 11:24 ` Kewen Lin
14 siblings, 0 replies; 22+ messages in thread
From: Kewen Lin @ 2021-11-11 11:24 UTC (permalink / raw)
To: gcc-patches; +Cc: Kewen Lin, aoliva, olegendo
This patch is to fix some non-robust split conditions in some
define_insn_and_splits, to make each of them applied on top of
the corresponding condition for define_insn part, otherwise the
splitting could perform unexpectedly.
gcc/ChangeLog:
* config/sh/sh.md (call_pcrel, call_value_pcrel, sibcall_pcrel,
sibcall_value_pcrel): Fix split condition.
---
gcc/config/sh/sh.md | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/gcc/config/sh/sh.md b/gcc/config/sh/sh.md
index 93ee7c9a7de..1bb325c7044 100644
--- a/gcc/config/sh/sh.md
+++ b/gcc/config/sh/sh.md
@@ -6566,7 +6566,7 @@ (define_insn_and_split "call_pcrel"
(clobber (match_scratch:SI 2 "=&r"))]
"TARGET_SH2"
"#"
- "reload_completed"
+ "&& reload_completed"
[(const_int 0)]
{
rtx lab = PATTERN (gen_call_site ());
@@ -6678,7 +6678,7 @@ (define_insn_and_split "call_value_pcrel"
(clobber (match_scratch:SI 3 "=&r"))]
"TARGET_SH2"
"#"
- "reload_completed"
+ "&& reload_completed"
[(const_int 0)]
{
rtx lab = PATTERN (gen_call_site ());
@@ -6877,7 +6877,7 @@ (define_insn_and_split "sibcall_pcrel"
(return)]
"TARGET_SH2 && !TARGET_FDPIC"
"#"
- "reload_completed"
+ "&& reload_completed"
[(const_int 0)]
{
rtx lab = PATTERN (gen_call_site ());
@@ -7043,7 +7043,7 @@ (define_insn_and_split "sibcall_value_pcrel"
(return)]
"TARGET_SH2 && !TARGET_FDPIC"
"#"
- "reload_completed"
+ "&& reload_completed"
[(const_int 0)]
{
rtx lab = PATTERN (gen_call_site ());
--
2.27.0
^ permalink raw reply [flat|nested] 22+ messages in thread