Message ID | 20181026060319.28506-2-hjl.tools@gmail.com |
---|---|
State | New |
Headers | show |
Series | Update apply_subst_iterator and fix x86 pmovzx/pmovsx patterns | expand |
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? Uros.
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.
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. Uros.
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); - 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 +311,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. */