summaryrefslogtreecommitdiff
path: root/0141-Backport-SME-mode-switching-Use-1-based-edge-aux-fie.patch
diff options
context:
space:
mode:
Diffstat (limited to '0141-Backport-SME-mode-switching-Use-1-based-edge-aux-fie.patch')
-rw-r--r--0141-Backport-SME-mode-switching-Use-1-based-edge-aux-fie.patch56
1 files changed, 56 insertions, 0 deletions
diff --git a/0141-Backport-SME-mode-switching-Use-1-based-edge-aux-fie.patch b/0141-Backport-SME-mode-switching-Use-1-based-edge-aux-fie.patch
new file mode 100644
index 0000000..0cb257e
--- /dev/null
+++ b/0141-Backport-SME-mode-switching-Use-1-based-edge-aux-fie.patch
@@ -0,0 +1,56 @@
+From b0d3536b2a28d3a7084e3bbb9532e719aaf2016b Mon Sep 17 00:00:00 2001
+From: Richard Sandiford <richard.sandiford@arm.com>
+Date: Sat, 11 Nov 2023 17:28:59 +0000
+Subject: [PATCH 042/157] [Backport][SME] mode-switching: Use 1-based edge aux
+ fields
+
+Reference: https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=718228a6f479fe252e0e6f71933c2465b7b480a9
+
+The pass used the edge aux field to record which mode change
+should happen on the edge, with -1 meaning "none". It's more
+convenient for later patches to leave aux zero for "none",
+and use numbers based at 1 to record a change.
+
+gcc/
+ * mode-switching.cc (commit_mode_sets): Use 1-based edge aux values.
+---
+ gcc/mode-switching.cc | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/gcc/mode-switching.cc b/gcc/mode-switching.cc
+index 4f0445894..89a8494c6 100644
+--- a/gcc/mode-switching.cc
++++ b/gcc/mode-switching.cc
+@@ -106,10 +106,10 @@ commit_mode_sets (struct edge_list *edge_list, int e, struct bb_info *info)
+ for (int ed = NUM_EDGES (edge_list) - 1; ed >= 0; ed--)
+ {
+ edge eg = INDEX_EDGE (edge_list, ed);
+- int mode;
+
+- if ((mode = (int)(intptr_t)(eg->aux)) != -1)
++ if (eg->aux)
+ {
++ int mode = (int) (intptr_t) eg->aux - 1;
+ HARD_REG_SET live_at_edge;
+ basic_block src_bb = eg->src;
+ int cur_mode = info[src_bb->index].mode_out;
+@@ -727,14 +727,14 @@ optimize_mode_switching (void)
+ {
+ edge eg = INDEX_EDGE (edge_list, ed);
+
+- eg->aux = (void *)(intptr_t)-1;
++ eg->aux = (void *) (intptr_t) 0;
+
+ for (i = 0; i < no_mode; i++)
+ {
+ int m = targetm.mode_switching.priority (entity_map[j], i);
+ if (mode_bit_p (insert[ed], j, m))
+ {
+- eg->aux = (void *)(intptr_t)m;
++ eg->aux = (void *) (intptr_t) (m + 1);
+ break;
+ }
+ }
+--
+2.33.0
+