]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Document 'pass_postreload' vs. 'pass_late_compilation'
authorThomas Schwinge <tschwinge@baylibre.com>
Fri, 28 Jun 2024 14:04:18 +0000 (16:04 +0200)
committerThomas Schwinge <tschwinge@baylibre.com>
Wed, 4 Sep 2024 10:29:45 +0000 (12:29 +0200)
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
gcc/passes.def

index 057850f4decbc7d4a6f805b9efe49d4feb910d65..e2a07ebedf5d82191197ca9e3865edefe6a68208 100644 (file)
@@ -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 */
index b06d6d45f63187bd1b461ae2d9153a136b201677..6d98c3c9282a2518c7a30d695d5d64462d986190 100644 (file)
@@ -509,6 +509,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);