[PATCH] PR rtl-optimization/66790: uninitialized registers handling in REE
Pierre-Marie de Rodat
derodat@adacore.com
Sun Jul 19 06:40:00 GMT 2015
Hello,
This patch is an attempt to fix PR rtl-optimization/66790: please see
<https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66790> for the context.
This adds a new dataflow problem (MIR for Must-Initialized Registers)
and use it in the REE pass to remove oversights, fixing the original issue.
I would also like to draw your attention to the use of the
"must-initialized" term. Being new to dataflow problems, I understand it
as "registers that are always initialized whatever the path leading to
its use" and this seems to be confirmed by the current "LIVE AND
MUST-INITIALIZED REGISTERS" comment in df-problems.c. However, it feels
like what is currently called "must-initialized" in this source file is
actually registers that *may* be initialized: see in particular the use
of the bitmap_ior_into operation in df_live_confluence_n.
Can someone confirm this, please? If I'm right, I will update the
attached patch to reword the corresponding comments.
This patch bootstraps and yields no regression on x86_64-linux. I'm
still trying to fiddle the build system to actually see how assemblies
from the bootstrap are affected. Thank you in advance for the review! :-)
gcc/ChangeLog:
PR rtl-optimization/66790
* df.h (DF_MIR): New macro.
(DF_LAST_PROBLEM_PLUS1): Update to be past DF_MIR
(DF_MIR_INFO_BB): New macro.
(DF_MIR_IN, DF_MIR_OUT): New macros.
(struct df_mir_bb_info): New.
(df_mir): New macro.
(df_mir_add_problem, df_mir_simulate_one_insn): New forward
declarations.
(df_mir_get_bb_info): New.
* df-problems.c (struct df_mir_problem_data): New.
(df_mir_free_bb_info, df_mir_alloc, df_mir_reset,
df_mir_bb_local_compute, df_mir_local_compute, df_mir_init,
df_mir_confluence_n, df_mir_transfer_function, df_mir_free,
df_mir_top_dump, df_mir_bottom_dump,
df_mir_verify_solution_start, df_mir_verify_solution_end): New.
(problem_MIR): New.
(df_mir_add_problem, df_mir_simulate_one_insn): New.
* timevar.def (TV_DF_MIR): New.
* ree.c: Include bitmap.h
(add_removable_extension): Add an INIT_REGS parameter. Use it
to skip extensions that may get an uninitialized register.
(find_removable_extensions): Compute must-initialized registers
using the MIR dataflow problem. Update the call to
add_removable_extension.
(find_and_remove_re): Call df_mir_add_problem.
--
Pierre-Marie de Rodat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-REE-fix-uninitialized-registers-handling.patch
Type: text/x-patch
Size: 21689 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20150719/ea4b16b2/attachment.bin>
More information about the Gcc-patches
mailing list