Re: [PATCH 12/15] i386: Fix non-robust split condition in define_insn_and_split
Hi Uros, on 2021/11/17 下午3:13, Uros Bizjak wrote: > On Thu, Nov 11, 2021 at 12:25 PM Kewen Lin 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 (*add3_doubleword, *addv4_doubleword, >> *addv4_doubleword_1, *sub3_doubleword, >> *subv4_doubleword, *subv4_doubleword_1, >> *add3_doubleword_cc_overflow_1, *divmodsi4_const, >> *neg2_doubleword, *tls_dynamic_gnu2_combine_64_): 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 "*add3_doubleword" >> (clobber (reg:CC FLAGS_REG))] >>"ix86_binary_operator_ok (PLUS, 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 "*addv4_doubleword" >> (plus: (match_dup 1) (match_dup 2)))] >>"ix86_binary_operator_ok (PLUS, 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 "*addv4_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 "*sub3_doubleword" >> (clobber (reg:CC FLAGS_REG))] >>"ix86_binary_operator_ok (MINUS, 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 "*subv4_doubleword" >> (minus: (match_dup 1) (match_dup 2)))] >>"ix86_binary_operator_ok (MINUS, 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 "*subv4_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 >> "*add3_doubleword_cc_overflow_1" >> (plus: (match_dup 1) (match_dup 2)))] >>"ix86_binary_operator_ok (PLUS, 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 "*neg2_doubleword" >> (clobber (reg:CC FLAGS_REG))] >>"ix86_unary_operator_ok (NEG, 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_" >> (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 >>
Re: [PATCH 12/15] i386: Fix non-robust split condition in define_insn_and_split
On Thu, Nov 11, 2021 at 12:25 PM Kewen Lin 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 (*add3_doubleword, *addv4_doubleword, > *addv4_doubleword_1, *sub3_doubleword, > *subv4_doubleword, *subv4_doubleword_1, > *add3_doubleword_cc_overflow_1, *divmodsi4_const, > *neg2_doubleword, *tls_dynamic_gnu2_combine_64_): 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 "*add3_doubleword" > (clobber (reg:CC FLAGS_REG))] >"ix86_binary_operator_ok (PLUS, 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 "*addv4_doubleword" > (plus: (match_dup 1) (match_dup 2)))] >"ix86_binary_operator_ok (PLUS, 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 "*addv4_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 "*sub3_doubleword" > (clobber (reg:CC FLAGS_REG))] >"ix86_binary_operator_ok (MINUS, 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 "*subv4_doubleword" > (minus: (match_dup 1) (match_dup 2)))] >"ix86_binary_operator_ok (MINUS, 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 "*subv4_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 > "*add3_doubleword_cc_overflow_1" > (plus: (match_dup 1) (match_dup 2)))] >"ix86_binary_operator_ok (PLUS, 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 "*neg2_doubleword" > (clobber (reg:CC FLAGS_REG))] >"ix86_unary_operator_ok (NEG, 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_" > (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 >
[PATCH 12/15] i386: Fix non-robust split condition in define_insn_and_split
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 (*add3_doubleword, *addv4_doubleword, *addv4_doubleword_1, *sub3_doubleword, *subv4_doubleword, *subv4_doubleword_1, *add3_doubleword_cc_overflow_1, *divmodsi4_const, *neg2_doubleword, *tls_dynamic_gnu2_combine_64_): 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 "*add3_doubleword" (clobber (reg:CC FLAGS_REG))] "ix86_binary_operator_ok (PLUS, 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 "*addv4_doubleword" (plus: (match_dup 1) (match_dup 2)))] "ix86_binary_operator_ok (PLUS, 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 "*addv4_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 "*sub3_doubleword" (clobber (reg:CC FLAGS_REG))] "ix86_binary_operator_ok (MINUS, 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 "*subv4_doubleword" (minus: (match_dup 1) (match_dup 2)))] "ix86_binary_operator_ok (MINUS, 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 "*subv4_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 "*add3_doubleword_cc_overflow_1" (plus: (match_dup 1) (match_dup 2)))] "ix86_binary_operator_ok (PLUS, 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 "*neg2_doubleword" (clobber (reg:CC FLAGS_REG))] "ix86_unary_operator_ok (NEG, 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_" (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