[ARC] Register ARC specific passes with a .def file.
New arc-passes.def to register ARC specific passes. gcc/ xxxx-xx-xx Claudiu Zissulescu <claziss@synopsys.com> * config/arc/arc-protos.h (make_pass_arc_ifcvt): Declare. (make_pass_arc_predicate_delay_insns): Likewise. * config/arc/arc.c (class pass_arc_ifcvt): Reformat text, add gate method, remove clone. (class pass_arc_predicate_delay_insns): Likewise. (arc_init): Remove registering of ARC specific passes. * config/arc/t-arc (PASSES_EXTRA): Add arc-passes.def. * config/arc/arc-passes.def: New file. From-SVN: r278485
This commit is contained in:
parent
ee68672928
commit
f60689fa50
@ -1,3 +1,14 @@
|
||||
2019-11-20 Claudiu Zissulescu <claziss@synopsys.com>
|
||||
|
||||
* config/arc/arc-protos.h (make_pass_arc_ifcvt): Declare.
|
||||
(make_pass_arc_predicate_delay_insns): Likewise.
|
||||
* config/arc/arc.c (class pass_arc_ifcvt): Reformat text, add gate
|
||||
method, remove clone.
|
||||
(class pass_arc_predicate_delay_insns): Likewise.
|
||||
(arc_init): Remove registering of ARC specific passes.
|
||||
* config/arc/t-arc (PASSES_EXTRA): Add arc-passes.def.
|
||||
* config/arc/arc-passes.def: New file.
|
||||
|
||||
2019-11-20 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR middle-end/90840
|
||||
|
29
gcc/config/arc/arc-passes.def
Normal file
29
gcc/config/arc/arc-passes.def
Normal file
@ -0,0 +1,29 @@
|
||||
/* Description of target passes for ARC.
|
||||
Copyright (C) 2019 Free Software Foundation, Inc. */
|
||||
|
||||
/* This file is part of GCC.
|
||||
|
||||
GCC is free software; you can redistribute it and/or modify it under
|
||||
the terms of the GNU General Public License as published by the Free
|
||||
Software Foundation; either version 3, or (at your option) any later
|
||||
version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING3. If not see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* First target dependent ARC if-conversion pass. */
|
||||
INSERT_PASS_AFTER (pass_delay_slots, 1, pass_arc_ifcvt);
|
||||
|
||||
/* Second target dependent ARC if-conversion pass. */
|
||||
INSERT_PASS_BEFORE (pass_shorten_branches, 1, pass_arc_ifcvt);
|
||||
|
||||
/* Find annulled delay insns and convert them to use the appropriate
|
||||
predicate. This allows branch shortening to size up these
|
||||
instructions properly. */
|
||||
INSERT_PASS_AFTER (pass_delay_slots, 1, pass_arc_predicate_delay_insns);
|
@ -111,3 +111,6 @@ extern void arc_eh_return_address_location (rtx);
|
||||
extern bool arc_is_jli_call_p (rtx);
|
||||
extern void arc_file_end (void);
|
||||
extern bool arc_is_secure_call_p (rtx);
|
||||
|
||||
rtl_opt_pass * make_pass_arc_ifcvt (gcc::context *ctxt);
|
||||
rtl_opt_pass * make_pass_arc_predicate_delay_insns (gcc::context *ctxt);
|
||||
|
@ -962,14 +962,24 @@ const pass_data pass_data_arc_ifcvt =
|
||||
|
||||
class pass_arc_ifcvt : public rtl_opt_pass
|
||||
{
|
||||
public:
|
||||
pass_arc_ifcvt(gcc::context *ctxt)
|
||||
: rtl_opt_pass(pass_data_arc_ifcvt, ctxt)
|
||||
{}
|
||||
public:
|
||||
pass_arc_ifcvt (gcc::context *ctxt)
|
||||
: rtl_opt_pass (pass_data_arc_ifcvt, ctxt)
|
||||
{}
|
||||
|
||||
/* opt_pass methods: */
|
||||
opt_pass * clone () { return new pass_arc_ifcvt (m_ctxt); }
|
||||
virtual unsigned int execute (function *) { return arc_ifcvt (); }
|
||||
opt_pass * clone ()
|
||||
{
|
||||
return new pass_arc_ifcvt (m_ctxt);
|
||||
}
|
||||
virtual unsigned int execute (function *)
|
||||
{
|
||||
return arc_ifcvt ();
|
||||
}
|
||||
virtual bool gate (function *)
|
||||
{
|
||||
return (optimize > 1 && !TARGET_NO_COND_EXEC);
|
||||
}
|
||||
};
|
||||
|
||||
} // anon namespace
|
||||
@ -999,16 +1009,20 @@ const pass_data pass_data_arc_predicate_delay_insns =
|
||||
|
||||
class pass_arc_predicate_delay_insns : public rtl_opt_pass
|
||||
{
|
||||
public:
|
||||
pass_arc_predicate_delay_insns(gcc::context *ctxt)
|
||||
: rtl_opt_pass(pass_data_arc_predicate_delay_insns, ctxt)
|
||||
{}
|
||||
public:
|
||||
pass_arc_predicate_delay_insns(gcc::context *ctxt)
|
||||
: rtl_opt_pass(pass_data_arc_predicate_delay_insns, ctxt)
|
||||
{}
|
||||
|
||||
/* opt_pass methods: */
|
||||
virtual unsigned int execute (function *)
|
||||
{
|
||||
return arc_predicate_delay_insns ();
|
||||
}
|
||||
{
|
||||
return arc_predicate_delay_insns ();
|
||||
}
|
||||
virtual bool gate (function *)
|
||||
{
|
||||
return flag_delayed_branch;
|
||||
}
|
||||
};
|
||||
|
||||
} // anon namespace
|
||||
@ -1101,30 +1115,6 @@ arc_init (void)
|
||||
arc_punct_chars['&'] = 1;
|
||||
arc_punct_chars['+'] = 1;
|
||||
arc_punct_chars['_'] = 1;
|
||||
|
||||
if (optimize > 1 && !TARGET_NO_COND_EXEC)
|
||||
{
|
||||
/* There are two target-independent ifcvt passes, and arc_reorg may do
|
||||
one or more arc_ifcvt calls. */
|
||||
opt_pass *pass_arc_ifcvt_4 = make_pass_arc_ifcvt (g);
|
||||
struct register_pass_info arc_ifcvt4_info
|
||||
= { pass_arc_ifcvt_4, "dbr", 1, PASS_POS_INSERT_AFTER };
|
||||
struct register_pass_info arc_ifcvt5_info
|
||||
= { pass_arc_ifcvt_4->clone (), "shorten", 1, PASS_POS_INSERT_BEFORE };
|
||||
|
||||
register_pass (&arc_ifcvt4_info);
|
||||
register_pass (&arc_ifcvt5_info);
|
||||
}
|
||||
|
||||
if (flag_delayed_branch)
|
||||
{
|
||||
opt_pass *pass_arc_predicate_delay_insns
|
||||
= make_pass_arc_predicate_delay_insns (g);
|
||||
struct register_pass_info arc_predicate_delay_info
|
||||
= { pass_arc_predicate_delay_insns, "dbr", 1, PASS_POS_INSERT_AFTER };
|
||||
|
||||
register_pass (&arc_predicate_delay_info);
|
||||
}
|
||||
}
|
||||
|
||||
/* Parse -mirq-ctrl-saved=RegisterRange, blink, lp_copunt. The
|
||||
|
@ -43,6 +43,8 @@ $(srcdir)/config/arc/arc-tables.opt: $(srcdir)/config/arc/genoptions.awk \
|
||||
$(srcdir)/config/arc/arc-cpus.def
|
||||
$(AWK) -f $< -v FORMAT=Makefile $< $(srcdir)/config/arc/arc-cpus.def > $@
|
||||
|
||||
PASSES_EXTRA += $(srcdir)/config/arc/arc-passes.def
|
||||
|
||||
# Local Variables:
|
||||
# mode: Makefile
|
||||
# End:
|
||||
|
Loading…
Reference in New Issue
Block a user