From 7f708dd9774773e704cb06b7a6f296927f9057df Mon Sep 17 00:00:00 2001
From: Thomas Schwinge <tschwinge@baylibre.com>
Date: Fri, 28 Jun 2024 16:04:18 +0200
Subject: [PATCH] Document 'pass_postreload' vs. 'pass_late_compilation'
See Subversion r217124 (Git commit 433e4164339f18d0b8798968444a56b681b5232c)
"Reorganize post-ra pipeline for targets without register allocation".
gcc/
* passes.cc: Document 'pass_postreload' vs. 'pass_late_compilation'.
* passes.def: Likewise.
---
gcc/passes.cc | 14 +++++++++++++-
gcc/passes.def | 3 +++
2 files changed, 16 insertions(+), 1 deletion(-)
@@ -660,6 +660,10 @@ make_pass_rest_of_compilation (gcc::context *ctxt)
namespace {
+/* A container pass (only) for '!targetm.no_register_allocation' targets, for
+ passes to run if reload completed (..., but not run them if it failed, for
+ example for an invalid 'asm'). See also 'pass_late_compilation'. */
+
const pass_data pass_data_postreload =
{
RTL_PASS, /* type */
@@ -681,7 +685,12 @@ public:
{}
/* opt_pass methods: */
- bool gate (function *) final override { return reload_completed; }
+ bool gate (function *) final override
+ {
+ if (reload_completed)
+ gcc_checking_assert (!targetm.no_register_allocation);
+ return reload_completed;
+ }
}; // class pass_postreload
@@ -695,6 +704,9 @@ make_pass_postreload (gcc::context *ctxt)
namespace {
+/* A container pass like 'pass_postreload', but for passes to run also for
+ 'targetm.no_register_allocation' targets. */
+
const pass_data pass_data_late_compilation =
{
RTL_PASS, /* type */
@@ -507,6 +507,9 @@ along with GCC; see the file COPYING3. If not see
NEXT_PASS (pass_early_remat);
NEXT_PASS (pass_ira);
NEXT_PASS (pass_reload);
+ /* In the following, some passes are tied to 'pass_postreload' and others
+ to 'pass_late_compilation'. The difference is that the latter also
+ run for 'targetm.no_register_allocation' targets. */
NEXT_PASS (pass_postreload);
PUSH_INSERT_PASSES_WITHIN (pass_postreload)
NEXT_PASS (pass_postreload_cse);
--
2.34.1