* [PATCH] apply_subst_iterator: Handle define_split/define_insn_and_split
@ 2018-10-26 8:42 H.J. Lu
2018-11-04 15:25 ` PING: " H.J. Lu
2018-11-21 8:50 ` Richard Biener
0 siblings, 2 replies; 5+ messages in thread
From: H.J. Lu @ 2018-10-26 8:42 UTC (permalink / raw)
To: Uros Bizjak; +Cc: gcc-patches, Eric Botcazou
[-- Attachment #1: Type: text/plain, Size: 2727 bytes --]
On 10/25/18, Uros Bizjak <ubizjak@gmail.com> wrote:
> On Fri, Oct 26, 2018 at 8:48 AM H.J. Lu <hjl.tools@gmail.com> wrote:
>>
>> On 10/25/18, Uros Bizjak <ubizjak@gmail.com> wrote:
>> > On Fri, Oct 26, 2018 at 8:07 AM H.J. Lu <hjl.tools@gmail.com> wrote:
>> >>
>> >> * read-rtl.c (apply_subst_iterator): Handle
>> >> define_insn_and_split.
>> >> ---
>> >> gcc/read-rtl.c | 6 ++++--
>> >> 1 file changed, 4 insertions(+), 2 deletions(-)
>> >>
>> >> diff --git a/gcc/read-rtl.c b/gcc/read-rtl.c
>> >> index d698dd4af4d..5957c29671a 100644
>> >> --- a/gcc/read-rtl.c
>> >> +++ b/gcc/read-rtl.c
>> >> @@ -275,9 +275,11 @@ apply_subst_iterator (rtx rt, unsigned int, int
>> >> value)
>> >> if (value == 1)
>> >> return;
>> >> gcc_assert (GET_CODE (rt) == DEFINE_INSN
>> >> + || GET_CODE (rt) == DEFINE_INSN_AND_SPLIT
>> >> || GET_CODE (rt) == DEFINE_EXPAND);
>> >
>> > Can we also handle DEFINE_SPLIT here?
>> >
>>
>> Yes, we could if there were a usage for it. I am reluctant to add
>> something
>> I have no use nor test for.
>
> Just split one define_insn_and_split to define_insn and corresponding
> define_split.
>
> define_insn_and_split is a contraction for for the define_insn and
> corresponding define_split, so it looks weird to only handle
> define_insn_and-split without handling define_split.
>
Here is the updated patch to handle define_split. Tested with
(define_insn "*sse4_1_<code>v8qiv8hi2<mask_name>_2"
[(set (match_operand:V8HI 0 "register_operand")
(any_extend:V8HI
(vec_select:V8QI
(subreg:V16QI
(vec_concat:V2DI
(match_operand:DI 1 "memory_operand")
(const_int 0)) 0)
(parallel [(const_int 0) (const_int 1)
(const_int 2) (const_int 3)
(const_int 4) (const_int 5)
(const_int 6) (const_int 7)]))))]
"TARGET_SSE4_1 && <mask_avx512bw_condition> && <mask_avx512vl_condition>"
"#")
(define_split
[(set (match_operand:V8HI 0 "register_operand")
(any_extend:V8HI
(vec_select:V8QI
(subreg:V16QI
(vec_concat:V2DI
(match_operand:DI 1 "memory_operand")
(const_int 0)) 0)
(parallel [(const_int 0) (const_int 1)
(const_int 2) (const_int 3)
(const_int 4) (const_int 5)
(const_int 6) (const_int 7)]))))]
"TARGET_SSE4_1 && <mask_avx512bw_condition> && <mask_avx512vl_condition>
&& can_create_pseudo_p ()"
[(set (match_dup 0)
(any_extend:V8HI (match_dup 1)))]
{
operands[1] = adjust_address_nv (operands[1], V8QImode, 0);
})
--
H.J.
[-- Attachment #2: 0001-apply_subst_iterator-Handle-define_split-define_insn.patch --]
[-- Type: text/x-patch, Size: 1504 bytes --]
From b2f58ad0121520619fb342fff93bc55ca88b8c0a Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools@gmail.com>
Date: Thu, 25 Oct 2018 15:16:49 -0700
Subject: [PATCH] apply_subst_iterator: Handle
define_split/define_insn_and_split
* read-rtl.c (apply_subst_iterator): Handle define_split and
define_insn_and_split.
---
gcc/read-rtl.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/gcc/read-rtl.c b/gcc/read-rtl.c
index d698dd4af4d..dfe22d3333b 100644
--- a/gcc/read-rtl.c
+++ b/gcc/read-rtl.c
@@ -272,12 +272,15 @@ apply_subst_iterator (rtx rt, unsigned int, int value)
rtx new_attr;
rtvec attrs_vec, new_attrs_vec;
int i;
- if (value == 1)
+ /* define_split has no attributes. */
+ if (value == 1 || GET_CODE (rt) == DEFINE_SPLIT)
return;
gcc_assert (GET_CODE (rt) == DEFINE_INSN
+ || GET_CODE (rt) == DEFINE_INSN_AND_SPLIT
|| GET_CODE (rt) == DEFINE_EXPAND);
- attrs_vec = XVEC (rt, 4);
+ int attrs = GET_CODE (rt) == DEFINE_INSN_AND_SPLIT ? 7 : 4;
+ attrs_vec = XVEC (rt, attrs);
/* If we've already added attribute 'current_iterator_name', then we
have nothing to do now. */
@@ -309,7 +312,7 @@ apply_subst_iterator (rtx rt, unsigned int, int value)
GET_NUM_ELEM (attrs_vec) * sizeof (rtx));
new_attrs_vec->elem[GET_NUM_ELEM (attrs_vec)] = new_attr;
}
- XVEC (rt, 4) = new_attrs_vec;
+ XVEC (rt, attrs) = new_attrs_vec;
}
/* Map subst-attribute ATTR to subst iterator ITER. */
--
2.17.2
^ permalink raw reply [flat|nested] 5+ messages in thread
* PING: [PATCH] apply_subst_iterator: Handle define_split/define_insn_and_split
2018-10-26 8:42 [PATCH] apply_subst_iterator: Handle define_split/define_insn_and_split H.J. Lu
@ 2018-11-04 15:25 ` H.J. Lu
2018-11-13 14:09 ` PING^2: " H.J. Lu
2018-11-21 8:50 ` Richard Biener
1 sibling, 1 reply; 5+ messages in thread
From: H.J. Lu @ 2018-11-04 15:25 UTC (permalink / raw)
To: Uros Bizjak, Jeffrey Law, Jakub Jelinek; +Cc: GCC Patches, Eric Botcazou
On Fri, Oct 26, 2018 at 12:44 AM H.J. Lu <hjl.tools@gmail.com> wrote:
>
> On 10/25/18, Uros Bizjak <ubizjak@gmail.com> wrote:
> > On Fri, Oct 26, 2018 at 8:48 AM H.J. Lu <hjl.tools@gmail.com> wrote:
> >>
> >> On 10/25/18, Uros Bizjak <ubizjak@gmail.com> wrote:
> >> > On Fri, Oct 26, 2018 at 8:07 AM H.J. Lu <hjl.tools@gmail.com> wrote:
> >> >>
> >> >> * read-rtl.c (apply_subst_iterator): Handle
> >> >> define_insn_and_split.
> >> >> ---
> >> >> gcc/read-rtl.c | 6 ++++--
> >> >> 1 file changed, 4 insertions(+), 2 deletions(-)
> >> >>
> >> >> diff --git a/gcc/read-rtl.c b/gcc/read-rtl.c
> >> >> index d698dd4af4d..5957c29671a 100644
> >> >> --- a/gcc/read-rtl.c
> >> >> +++ b/gcc/read-rtl.c
> >> >> @@ -275,9 +275,11 @@ apply_subst_iterator (rtx rt, unsigned int, int
> >> >> value)
> >> >> if (value == 1)
> >> >> return;
> >> >> gcc_assert (GET_CODE (rt) == DEFINE_INSN
> >> >> + || GET_CODE (rt) == DEFINE_INSN_AND_SPLIT
> >> >> || GET_CODE (rt) == DEFINE_EXPAND);
> >> >
> >> > Can we also handle DEFINE_SPLIT here?
> >> >
> >>
> >> Yes, we could if there were a usage for it. I am reluctant to add
> >> something
> >> I have no use nor test for.
> >
> > Just split one define_insn_and_split to define_insn and corresponding
> > define_split.
> >
> > define_insn_and_split is a contraction for for the define_insn and
> > corresponding define_split, so it looks weird to only handle
> > define_insn_and-split without handling define_split.
> >
>
> Here is the updated patch to handle define_split. Tested with
>
> (define_insn "*sse4_1_<code>v8qiv8hi2<mask_name>_2"
> [(set (match_operand:V8HI 0 "register_operand")
> (any_extend:V8HI
> (vec_select:V8QI
> (subreg:V16QI
> (vec_concat:V2DI
> (match_operand:DI 1 "memory_operand")
> (const_int 0)) 0)
> (parallel [(const_int 0) (const_int 1)
> (const_int 2) (const_int 3)
> (const_int 4) (const_int 5)
> (const_int 6) (const_int 7)]))))]
> "TARGET_SSE4_1 && <mask_avx512bw_condition> && <mask_avx512vl_condition>"
> "#")
>
> (define_split
> [(set (match_operand:V8HI 0 "register_operand")
> (any_extend:V8HI
> (vec_select:V8QI
> (subreg:V16QI
> (vec_concat:V2DI
> (match_operand:DI 1 "memory_operand")
> (const_int 0)) 0)
> (parallel [(const_int 0) (const_int 1)
> (const_int 2) (const_int 3)
> (const_int 4) (const_int 5)
> (const_int 6) (const_int 7)]))))]
> "TARGET_SSE4_1 && <mask_avx512bw_condition> && <mask_avx512vl_condition>
> && can_create_pseudo_p ()"
> [(set (match_dup 0)
> (any_extend:V8HI (match_dup 1)))]
> {
> operands[1] = adjust_address_nv (operands[1], V8QImode, 0);
> })
>
PING:
https://gcc.gnu.org/ml/gcc-patches/2018-10/msg01665.html
This patch blocks an i386 backend patch.
--
H.J.
^ permalink raw reply [flat|nested] 5+ messages in thread
* PING^2: [PATCH] apply_subst_iterator: Handle define_split/define_insn_and_split
2018-11-04 15:25 ` PING: " H.J. Lu
@ 2018-11-13 14:09 ` H.J. Lu
2018-11-20 17:09 ` PING^3: " H.J. Lu
0 siblings, 1 reply; 5+ messages in thread
From: H.J. Lu @ 2018-11-13 14:09 UTC (permalink / raw)
To: Uros Bizjak, Jeffrey Law, Jakub Jelinek, Richard Guenther
Cc: GCC Patches, Eric Botcazou
On Sun, Nov 4, 2018 at 7:24 AM H.J. Lu <hjl.tools@gmail.com> wrote:
>
> On Fri, Oct 26, 2018 at 12:44 AM H.J. Lu <hjl.tools@gmail.com> wrote:
> >
> > On 10/25/18, Uros Bizjak <ubizjak@gmail.com> wrote:
> > > On Fri, Oct 26, 2018 at 8:48 AM H.J. Lu <hjl.tools@gmail.com> wrote:
> > >>
> > >> On 10/25/18, Uros Bizjak <ubizjak@gmail.com> wrote:
> > >> > On Fri, Oct 26, 2018 at 8:07 AM H.J. Lu <hjl.tools@gmail.com> wrote:
> > >> >>
> > >> >> * read-rtl.c (apply_subst_iterator): Handle
> > >> >> define_insn_and_split.
> > >> >> ---
> > >> >> gcc/read-rtl.c | 6 ++++--
> > >> >> 1 file changed, 4 insertions(+), 2 deletions(-)
> > >> >>
> > >> >> diff --git a/gcc/read-rtl.c b/gcc/read-rtl.c
> > >> >> index d698dd4af4d..5957c29671a 100644
> > >> >> --- a/gcc/read-rtl.c
> > >> >> +++ b/gcc/read-rtl.c
> > >> >> @@ -275,9 +275,11 @@ apply_subst_iterator (rtx rt, unsigned int, int
> > >> >> value)
> > >> >> if (value == 1)
> > >> >> return;
> > >> >> gcc_assert (GET_CODE (rt) == DEFINE_INSN
> > >> >> + || GET_CODE (rt) == DEFINE_INSN_AND_SPLIT
> > >> >> || GET_CODE (rt) == DEFINE_EXPAND);
> > >> >
> > >> > Can we also handle DEFINE_SPLIT here?
> > >> >
> > >>
> > >> Yes, we could if there were a usage for it. I am reluctant to add
> > >> something
> > >> I have no use nor test for.
> > >
> > > Just split one define_insn_and_split to define_insn and corresponding
> > > define_split.
> > >
> > > define_insn_and_split is a contraction for for the define_insn and
> > > corresponding define_split, so it looks weird to only handle
> > > define_insn_and-split without handling define_split.
> > >
> >
> > Here is the updated patch to handle define_split. Tested with
> >
> > (define_insn "*sse4_1_<code>v8qiv8hi2<mask_name>_2"
> > [(set (match_operand:V8HI 0 "register_operand")
> > (any_extend:V8HI
> > (vec_select:V8QI
> > (subreg:V16QI
> > (vec_concat:V2DI
> > (match_operand:DI 1 "memory_operand")
> > (const_int 0)) 0)
> > (parallel [(const_int 0) (const_int 1)
> > (const_int 2) (const_int 3)
> > (const_int 4) (const_int 5)
> > (const_int 6) (const_int 7)]))))]
> > "TARGET_SSE4_1 && <mask_avx512bw_condition> && <mask_avx512vl_condition>"
> > "#")
> >
> > (define_split
> > [(set (match_operand:V8HI 0 "register_operand")
> > (any_extend:V8HI
> > (vec_select:V8QI
> > (subreg:V16QI
> > (vec_concat:V2DI
> > (match_operand:DI 1 "memory_operand")
> > (const_int 0)) 0)
> > (parallel [(const_int 0) (const_int 1)
> > (const_int 2) (const_int 3)
> > (const_int 4) (const_int 5)
> > (const_int 6) (const_int 7)]))))]
> > "TARGET_SSE4_1 && <mask_avx512bw_condition> && <mask_avx512vl_condition>
> > && can_create_pseudo_p ()"
> > [(set (match_dup 0)
> > (any_extend:V8HI (match_dup 1)))]
> > {
> > operands[1] = adjust_address_nv (operands[1], V8QImode, 0);
> > })
> >
>
> PING:
>
> https://gcc.gnu.org/ml/gcc-patches/2018-10/msg01665.html
>
> This patch blocks an i386 backend patch.
>
PING.
--
H.J.
^ permalink raw reply [flat|nested] 5+ messages in thread
* PING^3: [PATCH] apply_subst_iterator: Handle define_split/define_insn_and_split
2018-11-13 14:09 ` PING^2: " H.J. Lu
@ 2018-11-20 17:09 ` H.J. Lu
0 siblings, 0 replies; 5+ messages in thread
From: H.J. Lu @ 2018-11-20 17:09 UTC (permalink / raw)
To: Uros Bizjak, Jeffrey Law, Jakub Jelinek, Richard Guenther,
Richard Sandiford
Cc: GCC Patches, Eric Botcazou
On Tue, Nov 13, 2018 at 6:08 AM H.J. Lu <hjl.tools@gmail.com> wrote:
>
> On Sun, Nov 4, 2018 at 7:24 AM H.J. Lu <hjl.tools@gmail.com> wrote:
> >
> > On Fri, Oct 26, 2018 at 12:44 AM H.J. Lu <hjl.tools@gmail.com> wrote:
> > >
> > > On 10/25/18, Uros Bizjak <ubizjak@gmail.com> wrote:
> > > > On Fri, Oct 26, 2018 at 8:48 AM H.J. Lu <hjl.tools@gmail.com> wrote:
> > > >>
> > > >> On 10/25/18, Uros Bizjak <ubizjak@gmail.com> wrote:
> > > >> > On Fri, Oct 26, 2018 at 8:07 AM H.J. Lu <hjl.tools@gmail.com> wrote:
> > > >> >>
> > > >> >> * read-rtl.c (apply_subst_iterator): Handle
> > > >> >> define_insn_and_split.
> > > >> >> ---
> > > >> >> gcc/read-rtl.c | 6 ++++--
> > > >> >> 1 file changed, 4 insertions(+), 2 deletions(-)
> > > >> >>
> > > >> >> diff --git a/gcc/read-rtl.c b/gcc/read-rtl.c
> > > >> >> index d698dd4af4d..5957c29671a 100644
> > > >> >> --- a/gcc/read-rtl.c
> > > >> >> +++ b/gcc/read-rtl.c
> > > >> >> @@ -275,9 +275,11 @@ apply_subst_iterator (rtx rt, unsigned int, int
> > > >> >> value)
> > > >> >> if (value == 1)
> > > >> >> return;
> > > >> >> gcc_assert (GET_CODE (rt) == DEFINE_INSN
> > > >> >> + || GET_CODE (rt) == DEFINE_INSN_AND_SPLIT
> > > >> >> || GET_CODE (rt) == DEFINE_EXPAND);
> > > >> >
> > > >> > Can we also handle DEFINE_SPLIT here?
> > > >> >
> > > >>
> > > >> Yes, we could if there were a usage for it. I am reluctant to add
> > > >> something
> > > >> I have no use nor test for.
> > > >
> > > > Just split one define_insn_and_split to define_insn and corresponding
> > > > define_split.
> > > >
> > > > define_insn_and_split is a contraction for for the define_insn and
> > > > corresponding define_split, so it looks weird to only handle
> > > > define_insn_and-split without handling define_split.
> > > >
> > >
> > > Here is the updated patch to handle define_split. Tested with
> > >
> > > (define_insn "*sse4_1_<code>v8qiv8hi2<mask_name>_2"
> > > [(set (match_operand:V8HI 0 "register_operand")
> > > (any_extend:V8HI
> > > (vec_select:V8QI
> > > (subreg:V16QI
> > > (vec_concat:V2DI
> > > (match_operand:DI 1 "memory_operand")
> > > (const_int 0)) 0)
> > > (parallel [(const_int 0) (const_int 1)
> > > (const_int 2) (const_int 3)
> > > (const_int 4) (const_int 5)
> > > (const_int 6) (const_int 7)]))))]
> > > "TARGET_SSE4_1 && <mask_avx512bw_condition> && <mask_avx512vl_condition>"
> > > "#")
> > >
> > > (define_split
> > > [(set (match_operand:V8HI 0 "register_operand")
> > > (any_extend:V8HI
> > > (vec_select:V8QI
> > > (subreg:V16QI
> > > (vec_concat:V2DI
> > > (match_operand:DI 1 "memory_operand")
> > > (const_int 0)) 0)
> > > (parallel [(const_int 0) (const_int 1)
> > > (const_int 2) (const_int 3)
> > > (const_int 4) (const_int 5)
> > > (const_int 6) (const_int 7)]))))]
> > > "TARGET_SSE4_1 && <mask_avx512bw_condition> && <mask_avx512vl_condition>
> > > && can_create_pseudo_p ()"
> > > [(set (match_dup 0)
> > > (any_extend:V8HI (match_dup 1)))]
> > > {
> > > operands[1] = adjust_address_nv (operands[1], V8QImode, 0);
> > > })
> > >
> >
> > PING:
> >
> > https://gcc.gnu.org/ml/gcc-patches/2018-10/msg01665.html
> >
> > This patch blocks an i386 backend patch.
> >
>
> PING.
>
PING.
--
H.J.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] apply_subst_iterator: Handle define_split/define_insn_and_split
2018-10-26 8:42 [PATCH] apply_subst_iterator: Handle define_split/define_insn_and_split H.J. Lu
2018-11-04 15:25 ` PING: " H.J. Lu
@ 2018-11-21 8:50 ` Richard Biener
1 sibling, 0 replies; 5+ messages in thread
From: Richard Biener @ 2018-11-21 8:50 UTC (permalink / raw)
To: H. J. Lu; +Cc: Uros Bizjak, GCC Patches, Eric Botcazou
On Fri, Oct 26, 2018 at 9:44 AM H.J. Lu <hjl.tools@gmail.com> wrote:
>
> On 10/25/18, Uros Bizjak <ubizjak@gmail.com> wrote:
> > On Fri, Oct 26, 2018 at 8:48 AM H.J. Lu <hjl.tools@gmail.com> wrote:
> >>
> >> On 10/25/18, Uros Bizjak <ubizjak@gmail.com> wrote:
> >> > On Fri, Oct 26, 2018 at 8:07 AM H.J. Lu <hjl.tools@gmail.com> wrote:
> >> >>
> >> >> * read-rtl.c (apply_subst_iterator): Handle
> >> >> define_insn_and_split.
> >> >> ---
> >> >> gcc/read-rtl.c | 6 ++++--
> >> >> 1 file changed, 4 insertions(+), 2 deletions(-)
> >> >>
> >> >> diff --git a/gcc/read-rtl.c b/gcc/read-rtl.c
> >> >> index d698dd4af4d..5957c29671a 100644
> >> >> --- a/gcc/read-rtl.c
> >> >> +++ b/gcc/read-rtl.c
> >> >> @@ -275,9 +275,11 @@ apply_subst_iterator (rtx rt, unsigned int, int
> >> >> value)
> >> >> if (value == 1)
> >> >> return;
> >> >> gcc_assert (GET_CODE (rt) == DEFINE_INSN
> >> >> + || GET_CODE (rt) == DEFINE_INSN_AND_SPLIT
> >> >> || GET_CODE (rt) == DEFINE_EXPAND);
> >> >
> >> > Can we also handle DEFINE_SPLIT here?
> >> >
> >>
> >> Yes, we could if there were a usage for it. I am reluctant to add
> >> something
> >> I have no use nor test for.
> >
> > Just split one define_insn_and_split to define_insn and corresponding
> > define_split.
> >
> > define_insn_and_split is a contraction for for the define_insn and
> > corresponding define_split, so it looks weird to only handle
> > define_insn_and-split without handling define_split.
> >
>
> Here is the updated patch to handle define_split. Tested with
OK.
> (define_insn "*sse4_1_<code>v8qiv8hi2<mask_name>_2"
> [(set (match_operand:V8HI 0 "register_operand")
> (any_extend:V8HI
> (vec_select:V8QI
> (subreg:V16QI
> (vec_concat:V2DI
> (match_operand:DI 1 "memory_operand")
> (const_int 0)) 0)
> (parallel [(const_int 0) (const_int 1)
> (const_int 2) (const_int 3)
> (const_int 4) (const_int 5)
> (const_int 6) (const_int 7)]))))]
> "TARGET_SSE4_1 && <mask_avx512bw_condition> && <mask_avx512vl_condition>"
> "#")
>
> (define_split
> [(set (match_operand:V8HI 0 "register_operand")
> (any_extend:V8HI
> (vec_select:V8QI
> (subreg:V16QI
> (vec_concat:V2DI
> (match_operand:DI 1 "memory_operand")
> (const_int 0)) 0)
> (parallel [(const_int 0) (const_int 1)
> (const_int 2) (const_int 3)
> (const_int 4) (const_int 5)
> (const_int 6) (const_int 7)]))))]
> "TARGET_SSE4_1 && <mask_avx512bw_condition> && <mask_avx512vl_condition>
> && can_create_pseudo_p ()"
> [(set (match_dup 0)
> (any_extend:V8HI (match_dup 1)))]
> {
> operands[1] = adjust_address_nv (operands[1], V8QImode, 0);
> })
>
> --
> H.J.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2018-11-21 8:50 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-26 8:42 [PATCH] apply_subst_iterator: Handle define_split/define_insn_and_split H.J. Lu
2018-11-04 15:25 ` PING: " H.J. Lu
2018-11-13 14:09 ` PING^2: " H.J. Lu
2018-11-20 17:09 ` PING^3: " H.J. Lu
2018-11-21 8:50 ` Richard Biener
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).