PATCH: extra machine-dependent passes
DJ Delorie
dj@redhat.com
Fri Jun 15 13:24:00 GMT 2001
On a port I'm working on, one register needs to be treated specially.
I've tried various other things, but I really need to tweak the insn
list at key places before register allocation to get it right. I
added two new machine dependent hooks, modelled after the existing
MACHINE_DEPENDENT_REORG. Ok to apply?
2001-06-15 DJ Delorie <dj@redhat.com>
* toplev.c (rest_of_compilation): Add target-dependent macros
MACHINE_DEPENDENT_POSTINLINE and MACHINE_DEPENDENT_PREALLOC
for extra target-specific passes.
Index: toplev.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/toplev.c,v
retrieving revision 1.470
diff -p -3 -r1.470 toplev.c
*** toplev.c 2001/06/13 03:21:48 1.470
--- toplev.c 2001/06/15 20:18:28
*************** rest_of_compilation (decl)
*** 2944,2949 ****
--- 2944,2953 ----
goto exit_rest_of_compilation;
}
+ #ifdef MACHINE_DEPENDENT_POSTINLINE
+ MACHINE_DEPENDENT_POSTINLINE (insns);
+ #endif
+
timevar_push (TV_JUMP);
if (optimize > 0)
*************** rest_of_compilation (decl)
*** 3364,3369 ****
--- 3368,3377 ----
close_dump_file (DFI_ce, print_rtl_with_bb, insns);
timevar_pop (TV_IFCVT);
}
+
+ #ifdef MACHINE_DEPENDENT_PREALLOC
+ MACHINE_DEPENDENT_PREALLOC (insns);
+ #endif
/* Register allocation pre-pass, to reduce number of moves
necessary for two-address machines. */
Index: doc/tm.texi
===================================================================
RCS file: /cvs/gcc/gcc/gcc/doc/tm.texi,v
retrieving revision 1.4
diff -p -3 -r1.4 tm.texi
*** tm.texi 2001/06/14 22:51:18 1.4
--- tm.texi 2001/06/15 20:18:46
*************** slot of @var{insn}.
*** 8330,8335 ****
--- 8330,8350 ----
You need not define this macro if it would always return zero.
+ @findex MACHINE_DEPENDENT_POSTINLINE
+ @item MACHINE_DEPENDENT_POSTINLINE (@var{insn})
+ In rare cases, correct code generation requires extra machine dependent
+ processing just after function inlining (say, to emit moves between
+ function-specific pseudos created by the back end). On those machines,
+ define this macro as a C statement to act on the code starting at
+ @var{insn}.
+
+ @findex MACHINE_DEPENDENT_PREALLOC
+ @item MACHINE_DEPENDENT_PREALLOC (@var{insn})
+ In rare cases, optimal code generation requires extra machine dependent
+ processing just before register allocation (say, assigning a special
+ pseudo to a hard register). On those machines, define this macro as a C
+ statement to act on the code starting at @var{insn}.
+
@findex MACHINE_DEPENDENT_REORG
@item MACHINE_DEPENDENT_REORG (@var{insn})
In rare cases, correct code generation requires extra machine
More information about the Gcc-patches
mailing list