Skip to content

Conversation

@jthackray
Copy link
Contributor

Remove AArch64::FeatureMPAM guards from some MPAM system registers,
since these system registers are not any under feature guard for gcc.

Copy link
Contributor Author

jthackray commented Oct 13, 2025

@llvmbot
Copy link
Member

llvmbot commented Oct 13, 2025

@llvm/pr-subscribers-backend-aarch64

Author: Jonathan Thackray (jthackray)

Changes

Remove AArch64::FeatureMPAM guards from some MPAM system registers,
since these system registers are not any under feature guard for gcc.


Full diff: https://github.com/llvm/llvm-project/pull/163166.diff

3 Files Affected:

  • (modified) llvm/lib/Target/AArch64/AArch64SystemOperands.td (-2)
  • (modified) llvm/test/MC/AArch64/armv8.4a-mpam.s (-57)
  • (modified) llvm/test/MC/Disassembler/AArch64/armv8.4a-mpam.txt (+18-21)
diff --git a/llvm/lib/Target/AArch64/AArch64SystemOperands.td b/llvm/lib/Target/AArch64/AArch64SystemOperands.td
index 35a96a003d94b..d93ed85b11119 100644
--- a/llvm/lib/Target/AArch64/AArch64SystemOperands.td
+++ b/llvm/lib/Target/AArch64/AArch64SystemOperands.td
@@ -1885,7 +1885,6 @@ def : ROSysReg<"ERXPFGF_EL1",   0b11, 0b000, 0b0101, 0b0100, 0b100>;
 
 // v8.4a MPAM registers
 //                             Op0   Op1    CRn     CRm     Op2
-let Requires = [{ {AArch64::FeatureMPAM} }] in {
 def : RWSysReg<"MPAMVPMV_EL2", 0b11, 0b100, 0b1010, 0b0100, 0b001>;
 def : RWSysReg<"MPAMVPM0_EL2", 0b11, 0b100, 0b1010, 0b0110, 0b000>;
 def : RWSysReg<"MPAMVPM1_EL2", 0b11, 0b100, 0b1010, 0b0110, 0b001>;
@@ -1895,7 +1894,6 @@ def : RWSysReg<"MPAMVPM4_EL2", 0b11, 0b100, 0b1010, 0b0110, 0b100>;
 def : RWSysReg<"MPAMVPM5_EL2", 0b11, 0b100, 0b1010, 0b0110, 0b101>;
 def : RWSysReg<"MPAMVPM6_EL2", 0b11, 0b100, 0b1010, 0b0110, 0b110>;
 def : RWSysReg<"MPAMVPM7_EL2", 0b11, 0b100, 0b1010, 0b0110, 0b111>;
-} //FeatureMPAM
 
 // v8.4a Activity Monitor registers
 //                                 Op0   Op1    CRn     CRm     Op2
diff --git a/llvm/test/MC/AArch64/armv8.4a-mpam.s b/llvm/test/MC/AArch64/armv8.4a-mpam.s
index cabed93ecae44..7469227974410 100644
--- a/llvm/test/MC/AArch64/armv8.4a-mpam.s
+++ b/llvm/test/MC/AArch64/armv8.4a-mpam.s
@@ -1,5 +1,4 @@
 // RUN: not llvm-mc -triple aarch64-none-linux-gnu -show-encoding -mattr=+v8.4a < %s 2> %t | FileCheck %s --check-prefix=CHECK
-// RUN: not llvm-mc -triple aarch64-none-linux-gnu -show-encoding -mattr=-v8.4a < %s 2>&1 | FileCheck %s --check-prefix=CHECK-ERROR
 
 //------------------------------------------------------------------------------
 // ARMV8.4-A MPAM Extensions
@@ -74,59 +73,3 @@ mrs x0, MPAMIDR_EL1
 //CHECK:  mrs x0, MPAMIDR_EL1         // encoding: [0x80,0xa4,0x38,0xd5]
 
 
-//CHECK-ERROR: error: expected writable system register or pstate
-//CHECK-ERROR: msr MPAMVPMV_EL2, x0
-//CHECK-ERROR:     ^
-//CHECK-ERROR: error: expected writable system register or pstate
-//CHECK-ERROR: msr MPAMVPM0_EL2, x0
-//CHECK-ERROR:     ^
-//CHECK-ERROR: error: expected writable system register or pstate
-//CHECK-ERROR: msr MPAMVPM1_EL2, x0
-//CHECK-ERROR:     ^
-//CHECK-ERROR: error: expected writable system register or pstate
-//CHECK-ERROR: msr MPAMVPM2_EL2, x0
-//CHECK-ERROR:     ^
-//CHECK-ERROR: error: expected writable system register or pstate
-//CHECK-ERROR: msr MPAMVPM3_EL2, x0
-//CHECK-ERROR:     ^
-//CHECK-ERROR: error: expected writable system register or pstate
-//CHECK-ERROR: msr MPAMVPM4_EL2, x0
-//CHECK-ERROR:     ^
-//CHECK-ERROR: error: expected writable system register or pstate
-//CHECK-ERROR: msr MPAMVPM5_EL2, x0
-//CHECK-ERROR:     ^
-//CHECK-ERROR: error: expected writable system register or pstate
-//CHECK-ERROR: msr MPAMVPM6_EL2, x0
-//CHECK-ERROR:     ^
-//CHECK-ERROR: error: expected writable system register or pstate
-//CHECK-ERROR: msr MPAMVPM7_EL2, x0
-//CHECK-ERROR:     ^
-
-
-//CHECK-ERROR: error: expected readable system register
-//CHECK-ERROR: mrs x0, MPAMVPMV_EL2
-//CHECK-ERROR:         ^
-//CHECK-ERROR: error: expected readable system register
-//CHECK-ERROR: mrs x0, MPAMVPM0_EL2
-//CHECK-ERROR:         ^
-//CHECK-ERROR: error: expected readable system register
-//CHECK-ERROR: mrs x0, MPAMVPM1_EL2
-//CHECK-ERROR:         ^
-//CHECK-ERROR: error: expected readable system register
-//CHECK-ERROR: mrs x0, MPAMVPM2_EL2
-//CHECK-ERROR:         ^
-//CHECK-ERROR: error: expected readable system register
-//CHECK-ERROR: mrs x0, MPAMVPM3_EL2
-//CHECK-ERROR:         ^
-//CHECK-ERROR: error: expected readable system register
-//CHECK-ERROR: mrs x0, MPAMVPM4_EL2
-//CHECK-ERROR:         ^
-//CHECK-ERROR: error: expected readable system register
-//CHECK-ERROR: mrs x0, MPAMVPM5_EL2
-//CHECK-ERROR:         ^
-//CHECK-ERROR: error: expected readable system register
-//CHECK-ERROR: mrs x0, MPAMVPM6_EL2
-//CHECK-ERROR:         ^
-//CHECK-ERROR: error: expected readable system register
-//CHECK-ERROR: mrs x0, MPAMVPM7_EL2
-//CHECK-ERROR:         ^
diff --git a/llvm/test/MC/Disassembler/AArch64/armv8.4a-mpam.txt b/llvm/test/MC/Disassembler/AArch64/armv8.4a-mpam.txt
index 888924d561d3d..16eba25ab0cfb 100644
--- a/llvm/test/MC/Disassembler/AArch64/armv8.4a-mpam.txt
+++ b/llvm/test/MC/Disassembler/AArch64/armv8.4a-mpam.txt
@@ -73,15 +73,15 @@
 #CHECK-NOV84: msr MPAM1_EL12, x0
 #CHECK-NOV84: msr MPAMHCR_EL2, x0
 
-#CHECK-NOV84:  msr S3_4_C10_C4_1, x0
-#CHECK-NOV84:  msr S3_4_C10_C6_0, x0
-#CHECK-NOV84:  msr S3_4_C10_C6_1, x0
-#CHECK-NOV84:  msr S3_4_C10_C6_2, x0
-#CHECK-NOV84:  msr S3_4_C10_C6_3, x0
-#CHECK-NOV84:  msr S3_4_C10_C6_4, x0
-#CHECK-NOV84:  msr S3_4_C10_C6_5, x0
-#CHECK-NOV84:  msr S3_4_C10_C6_6, x0
-#CHECK-NOV84:  msr S3_4_C10_C6_7, x0
+#CHECK-NOV84:  msr MPAMVPMV_EL2, x0
+#CHECK-NOV84:  msr MPAMVPM0_EL2, x0
+#CHECK-NOV84:  msr MPAMVPM1_EL2, x0
+#CHECK-NOV84:  msr MPAMVPM2_EL2, x0
+#CHECK-NOV84:  msr MPAMVPM3_EL2, x0
+#CHECK-NOV84:  msr MPAMVPM4_EL2, x0
+#CHECK-NOV84:  msr MPAMVPM5_EL2, x0
+#CHECK-NOV84:  msr MPAMVPM6_EL2, x0
+#CHECK-NOV84:  msr MPAMVPM7_EL2, x0
 
 // Available outside MPAM from Armv9.7
 #CHECK-NOV84: mrs x0, MPAM0_EL1
@@ -91,16 +91,13 @@
 #CHECK-NOV84: mrs x0, MPAM1_EL12
 #CHECK-NOV84: mrs x0, MPAMHCR_EL2
 
-#CHECK-NOV84:  mrs x0, S3_4_C10_C4_1
-#CHECK-NOV84:  mrs x0, S3_4_C10_C6_0
-#CHECK-NOV84:  mrs x0, S3_4_C10_C6_1
-#CHECK-NOV84:  mrs x0, S3_4_C10_C6_2
-#CHECK-NOV84:  mrs x0, S3_4_C10_C6_3
-#CHECK-NOV84:  mrs x0, S3_4_C10_C6_4
-#CHECK-NOV84:  mrs x0, S3_4_C10_C6_5
-#CHECK-NOV84:  mrs x0, S3_4_C10_C6_6
-#CHECK-NOV84:  mrs x0, S3_4_C10_C6_7
-
-// Available outside MPAM from Armv9.7
+#CHECK-NOV84:  mrs x0, MPAMVPMV_EL2
+#CHECK-NOV84:  mrs x0, MPAMVPM0_EL2
+#CHECK-NOV84:  mrs x0, MPAMVPM1_EL2
+#CHECK-NOV84:  mrs x0, MPAMVPM2_EL2
+#CHECK-NOV84:  mrs x0, MPAMVPM3_EL2
+#CHECK-NOV84:  mrs x0, MPAMVPM4_EL2
+#CHECK-NOV84:  mrs x0, MPAMVPM5_EL2
+#CHECK-NOV84:  mrs x0, MPAMVPM6_EL2
+#CHECK-NOV84:  mrs x0, MPAMVPM7_EL2
 #CHECK-NOV84:  mrs x0, MPAMIDR_EL1
-

@jthackray jthackray force-pushed the users/jthackray/armv9.7a-neon branch from 03e8371 to a6b0561 Compare October 13, 2025 16:49
@jthackray jthackray force-pushed the users/jthackray/remove_guards branch from a7a7cbf to 0e3951b Compare October 13, 2025 16:49
@jthackray jthackray force-pushed the users/jthackray/armv9.7a-neon branch from a6b0561 to 729c6b4 Compare October 13, 2025 17:49
@jthackray jthackray force-pushed the users/jthackray/remove_guards branch 2 times, most recently from bc7f1f0 to 76b311e Compare October 13, 2025 17:59
@jthackray jthackray force-pushed the users/jthackray/armv9.7a-neon branch from 729c6b4 to 2f6800b Compare October 13, 2025 17:59
Copy link
Contributor

@CarolineConcatto CarolineConcatto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you Jonathan,
LGTM

@jthackray jthackray force-pushed the users/jthackray/armv9.7a-neon branch from 584ff4d to abba6f6 Compare October 23, 2025 22:14
@jthackray jthackray force-pushed the users/jthackray/remove_guards branch 2 times, most recently from 3b843f7 to e549b1b Compare October 23, 2025 22:27
@jthackray jthackray force-pushed the users/jthackray/armv9.7a-neon branch from abba6f6 to 4e45059 Compare October 23, 2025 22:27
@jthackray jthackray force-pushed the users/jthackray/remove_guards branch from e549b1b to f3b10d2 Compare October 23, 2025 22:32
@jthackray jthackray force-pushed the users/jthackray/armv9.7a-neon branch from 4e45059 to 359ebd3 Compare October 23, 2025 22:32
@jthackray jthackray force-pushed the users/jthackray/remove_guards branch from f3b10d2 to aa30539 Compare October 23, 2025 22:36
@jthackray jthackray force-pushed the users/jthackray/armv9.7a-neon branch from 359ebd3 to b63e81f Compare October 23, 2025 22:36
@jthackray jthackray force-pushed the users/jthackray/remove_guards branch from aa30539 to 84f9b31 Compare October 23, 2025 22:40
@jthackray jthackray force-pushed the users/jthackray/armv9.7a-neon branch 2 times, most recently from 42d5834 to d049a2c Compare October 23, 2025 22:44
@jthackray jthackray force-pushed the users/jthackray/remove_guards branch 2 times, most recently from b2c6f09 to e0d777b Compare October 23, 2025 22:48
@jthackray jthackray force-pushed the users/jthackray/armv9.7a-neon branch 2 times, most recently from eacb200 to c5a2c2f Compare October 23, 2025 22:52
@jthackray jthackray force-pushed the users/jthackray/remove_guards branch 2 times, most recently from b716a48 to 7613e69 Compare October 23, 2025 22:55
@jthackray jthackray force-pushed the users/jthackray/armv9.7a-neon branch 2 times, most recently from 2e9b06f to 8cdf16b Compare October 23, 2025 22:58
@jthackray jthackray force-pushed the users/jthackray/remove_guards branch from 7613e69 to 734d089 Compare October 23, 2025 22:58
@jthackray jthackray force-pushed the users/jthackray/armv9.7a-neon branch from 8cdf16b to 7ed20c8 Compare October 23, 2025 23:02
@jthackray jthackray force-pushed the users/jthackray/remove_guards branch from 734d089 to 0969435 Compare October 23, 2025 23:02
Base automatically changed from users/jthackray/armv9.7a-neon to main October 23, 2025 23:05
Remove `AArch64::FeatureMPAM` guards from some MPAM system registers,
since these system registers are not any under feature guard for gcc.
@jthackray jthackray force-pushed the users/jthackray/remove_guards branch from 0969435 to 1b45b53 Compare October 23, 2025 23:05
@jthackray jthackray merged commit 6dd78f6 into main Oct 23, 2025
4 of 5 checks passed
@jthackray jthackray deleted the users/jthackray/remove_guards branch October 23, 2025 23:08
dvbuka pushed a commit to dvbuka/llvm-project that referenced this pull request Oct 27, 2025
…63166)

Remove `AArch64::FeatureMPAM` guards from some MPAM system registers,
since these system registers are not any under feature guard for gcc.
Lukacma pushed a commit to Lukacma/llvm-project that referenced this pull request Oct 29, 2025
…63166)

Remove `AArch64::FeatureMPAM` guards from some MPAM system registers,
since these system registers are not any under feature guard for gcc.
aokblast pushed a commit to aokblast/llvm-project that referenced this pull request Oct 30, 2025
…63166)

Remove `AArch64::FeatureMPAM` guards from some MPAM system registers,
since these system registers are not any under feature guard for gcc.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants