[AArch64] Fix scheduling info for Armv8.4-a LDAPUR* instructions#171637
Merged
[AArch64] Fix scheduling info for Armv8.4-a LDAPUR* instructions#171637
Conversation
They were using the wrong scheduler resource. They're also missing from the optimisation guides, but WriteLD should be closer at least.
Member
|
@llvm/pr-subscribers-backend-aarch64 Author: Cullen Rhodes (c-rhodes) ChangesThey were using the wrong scheduler resource. They're also missing from the optimisation guides, but WriteLD should be closer at least. Patch is 37.03 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/171637.diff 7 Files Affected:
diff --git a/llvm/lib/Target/AArch64/AArch64InstrFormats.td b/llvm/lib/Target/AArch64/AArch64InstrFormats.td
index 4d2e740779961..892b8ee1ed3cb 100644
--- a/llvm/lib/Target/AArch64/AArch64InstrFormats.td
+++ b/llvm/lib/Target/AArch64/AArch64InstrFormats.td
@@ -4386,7 +4386,7 @@ multiclass BaseLoadUnscaleV84<string asm, bits<2> sz, bits<2> opc,
DAGOperand regtype > {
def i : BaseLoadStoreUnscale<sz, 0, opc, (outs regtype:$Rt),
(ins GPR64sp:$Rn, simm9:$offset), asm, []>,
- Sched<[WriteST]> {
+ Sched<[WriteLD]> {
let Inst{29} = 0;
let Inst{24} = 1;
}
diff --git a/llvm/test/tools/llvm-mca/AArch64/Neoverse/N2-rcpc-immo-instructions.s b/llvm/test/tools/llvm-mca/AArch64/Neoverse/N2-rcpc-immo-instructions.s
index cd3d7e0bf1b57..d9943f342b827 100644
--- a/llvm/test/tools/llvm-mca/AArch64/Neoverse/N2-rcpc-immo-instructions.s
+++ b/llvm/test/tools/llvm-mca/AArch64/Neoverse/N2-rcpc-immo-instructions.s
@@ -10,15 +10,15 @@
# CHECK-NEXT: [6]: HasSideEffects (U)
# CHECK: [1] [2] [3] [4] [5] [6] Instructions:
-# CHECK-NEXT: 2 1 0.50 * ldapur w7, [x24]
-# CHECK-NEXT: 2 1 0.50 * ldapur x20, [x13]
-# CHECK-NEXT: 2 1 0.50 * ldapurb w13, [x17]
-# CHECK-NEXT: 2 1 0.50 * ldapurh w3, [x22]
-# CHECK-NEXT: 2 1 0.50 U ldapursb w7, [x8]
-# CHECK-NEXT: 2 1 0.50 U ldapursb x29, [x7]
-# CHECK-NEXT: 2 1 0.50 U ldapursh w17, [x19]
-# CHECK-NEXT: 2 1 0.50 U ldapursh x3, [x3]
-# CHECK-NEXT: 2 1 0.50 U ldapursw x3, [x18]
+# CHECK-NEXT: 1 4 0.33 * ldapur w7, [x24]
+# CHECK-NEXT: 1 4 0.33 * ldapur x20, [x13]
+# CHECK-NEXT: 1 4 0.33 * ldapurb w13, [x17]
+# CHECK-NEXT: 1 4 0.33 * ldapurh w3, [x22]
+# CHECK-NEXT: 1 4 0.33 U ldapursb w7, [x8]
+# CHECK-NEXT: 1 4 0.33 U ldapursb x29, [x7]
+# CHECK-NEXT: 1 4 0.33 U ldapursh w17, [x19]
+# CHECK-NEXT: 1 4 0.33 U ldapursh x3, [x3]
+# CHECK-NEXT: 1 4 0.33 U ldapursw x3, [x18]
# CHECK-NEXT: 2 1 0.50 * stlur w3, [x27]
# CHECK-NEXT: 2 1 0.50 * stlur x23, [x25]
# CHECK-NEXT: 2 1 0.50 * stlurb w30, [x17]
@@ -41,19 +41,19 @@
# CHECK: Resource pressure per iteration:
# CHECK-NEXT: [0.0] [0.1] [1.0] [1.1] [2] [3.0] [3.1] [4] [5] [6.0] [6.1] [7] [8]
-# CHECK-NEXT: - - 6.50 6.50 - 6.50 6.50 - - - - - -
+# CHECK-NEXT: - - 2.00 2.00 3.00 5.00 5.00 - - - - - -
# CHECK: Resource pressure by instruction:
# CHECK-NEXT: [0.0] [0.1] [1.0] [1.1] [2] [3.0] [3.1] [4] [5] [6.0] [6.1] [7] [8] Instructions:
-# CHECK-NEXT: - - 0.50 0.50 - 0.50 0.50 - - - - - - ldapur w7, [x24]
-# CHECK-NEXT: - - 0.50 0.50 - 0.50 0.50 - - - - - - ldapur x20, [x13]
-# CHECK-NEXT: - - 0.50 0.50 - 0.50 0.50 - - - - - - ldapurb w13, [x17]
-# CHECK-NEXT: - - 0.50 0.50 - 0.50 0.50 - - - - - - ldapurh w3, [x22]
-# CHECK-NEXT: - - 0.50 0.50 - 0.50 0.50 - - - - - - ldapursb w7, [x8]
-# CHECK-NEXT: - - 0.50 0.50 - 0.50 0.50 - - - - - - ldapursb x29, [x7]
-# CHECK-NEXT: - - 0.50 0.50 - 0.50 0.50 - - - - - - ldapursh w17, [x19]
-# CHECK-NEXT: - - 0.50 0.50 - 0.50 0.50 - - - - - - ldapursh x3, [x3]
-# CHECK-NEXT: - - 0.50 0.50 - 0.50 0.50 - - - - - - ldapursw x3, [x18]
+# CHECK-NEXT: - - - - 0.33 0.33 0.33 - - - - - - ldapur w7, [x24]
+# CHECK-NEXT: - - - - 0.33 0.33 0.33 - - - - - - ldapur x20, [x13]
+# CHECK-NEXT: - - - - 0.33 0.33 0.33 - - - - - - ldapurb w13, [x17]
+# CHECK-NEXT: - - - - 0.33 0.33 0.33 - - - - - - ldapurh w3, [x22]
+# CHECK-NEXT: - - - - 0.33 0.33 0.33 - - - - - - ldapursb w7, [x8]
+# CHECK-NEXT: - - - - 0.33 0.33 0.33 - - - - - - ldapursb x29, [x7]
+# CHECK-NEXT: - - - - 0.33 0.33 0.33 - - - - - - ldapursh w17, [x19]
+# CHECK-NEXT: - - - - 0.33 0.33 0.33 - - - - - - ldapursh x3, [x3]
+# CHECK-NEXT: - - - - 0.33 0.33 0.33 - - - - - - ldapursw x3, [x18]
# CHECK-NEXT: - - 0.50 0.50 - 0.50 0.50 - - - - - - stlur w3, [x27]
# CHECK-NEXT: - - 0.50 0.50 - 0.50 0.50 - - - - - - stlur x23, [x25]
# CHECK-NEXT: - - 0.50 0.50 - 0.50 0.50 - - - - - - stlurb w30, [x17]
diff --git a/llvm/test/tools/llvm-mca/AArch64/Neoverse/N3-rcpc-immo-instructions.s b/llvm/test/tools/llvm-mca/AArch64/Neoverse/N3-rcpc-immo-instructions.s
index 6faa5e1f4db1b..d5302e96edf4e 100644
--- a/llvm/test/tools/llvm-mca/AArch64/Neoverse/N3-rcpc-immo-instructions.s
+++ b/llvm/test/tools/llvm-mca/AArch64/Neoverse/N3-rcpc-immo-instructions.s
@@ -10,15 +10,15 @@
# CHECK-NEXT: [6]: HasSideEffects (U)
# CHECK: [1] [2] [3] [4] [5] [6] Instructions:
-# CHECK-NEXT: 2 1 0.50 * ldapur w7, [x24]
-# CHECK-NEXT: 2 1 0.50 * ldapur x20, [x13]
-# CHECK-NEXT: 2 1 0.50 * ldapurb w13, [x17]
-# CHECK-NEXT: 2 1 0.50 * ldapurh w3, [x22]
-# CHECK-NEXT: 2 1 0.50 U ldapursb w7, [x8]
-# CHECK-NEXT: 2 1 0.50 U ldapursb x29, [x7]
-# CHECK-NEXT: 2 1 0.50 U ldapursh w17, [x19]
-# CHECK-NEXT: 2 1 0.50 U ldapursh x3, [x3]
-# CHECK-NEXT: 2 1 0.50 U ldapursw x3, [x18]
+# CHECK-NEXT: 1 4 0.33 * ldapur w7, [x24]
+# CHECK-NEXT: 1 4 0.33 * ldapur x20, [x13]
+# CHECK-NEXT: 1 4 0.33 * ldapurb w13, [x17]
+# CHECK-NEXT: 1 4 0.33 * ldapurh w3, [x22]
+# CHECK-NEXT: 1 4 0.33 U ldapursb w7, [x8]
+# CHECK-NEXT: 1 4 0.33 U ldapursb x29, [x7]
+# CHECK-NEXT: 1 4 0.33 U ldapursh w17, [x19]
+# CHECK-NEXT: 1 4 0.33 U ldapursh x3, [x3]
+# CHECK-NEXT: 1 4 0.33 U ldapursw x3, [x18]
# CHECK-NEXT: 2 1 0.50 * stlur w3, [x27]
# CHECK-NEXT: 2 1 0.50 * stlur x23, [x25]
# CHECK-NEXT: 2 1 0.50 * stlurb w30, [x17]
@@ -41,19 +41,19 @@
# CHECK: Resource pressure per iteration:
# CHECK-NEXT: [0.0] [0.1] [1.0] [1.1] [2] [3.0] [3.1] [4] [5] [6.0] [6.1] [7] [8]
-# CHECK-NEXT: - - 6.50 6.50 - 6.50 6.50 - - - - - -
+# CHECK-NEXT: - - 2.00 2.00 3.00 5.00 5.00 - - - - - -
# CHECK: Resource pressure by instruction:
# CHECK-NEXT: [0.0] [0.1] [1.0] [1.1] [2] [3.0] [3.1] [4] [5] [6.0] [6.1] [7] [8] Instructions:
-# CHECK-NEXT: - - 0.50 0.50 - 0.50 0.50 - - - - - - ldapur w7, [x24]
-# CHECK-NEXT: - - 0.50 0.50 - 0.50 0.50 - - - - - - ldapur x20, [x13]
-# CHECK-NEXT: - - 0.50 0.50 - 0.50 0.50 - - - - - - ldapurb w13, [x17]
-# CHECK-NEXT: - - 0.50 0.50 - 0.50 0.50 - - - - - - ldapurh w3, [x22]
-# CHECK-NEXT: - - 0.50 0.50 - 0.50 0.50 - - - - - - ldapursb w7, [x8]
-# CHECK-NEXT: - - 0.50 0.50 - 0.50 0.50 - - - - - - ldapursb x29, [x7]
-# CHECK-NEXT: - - 0.50 0.50 - 0.50 0.50 - - - - - - ldapursh w17, [x19]
-# CHECK-NEXT: - - 0.50 0.50 - 0.50 0.50 - - - - - - ldapursh x3, [x3]
-# CHECK-NEXT: - - 0.50 0.50 - 0.50 0.50 - - - - - - ldapursw x3, [x18]
+# CHECK-NEXT: - - - - 0.33 0.33 0.33 - - - - - - ldapur w7, [x24]
+# CHECK-NEXT: - - - - 0.33 0.33 0.33 - - - - - - ldapur x20, [x13]
+# CHECK-NEXT: - - - - 0.33 0.33 0.33 - - - - - - ldapurb w13, [x17]
+# CHECK-NEXT: - - - - 0.33 0.33 0.33 - - - - - - ldapurh w3, [x22]
+# CHECK-NEXT: - - - - 0.33 0.33 0.33 - - - - - - ldapursb w7, [x8]
+# CHECK-NEXT: - - - - 0.33 0.33 0.33 - - - - - - ldapursb x29, [x7]
+# CHECK-NEXT: - - - - 0.33 0.33 0.33 - - - - - - ldapursh w17, [x19]
+# CHECK-NEXT: - - - - 0.33 0.33 0.33 - - - - - - ldapursh x3, [x3]
+# CHECK-NEXT: - - - - 0.33 0.33 0.33 - - - - - - ldapursw x3, [x18]
# CHECK-NEXT: - - 0.50 0.50 - 0.50 0.50 - - - - - - stlur w3, [x27]
# CHECK-NEXT: - - 0.50 0.50 - 0.50 0.50 - - - - - - stlur x23, [x25]
# CHECK-NEXT: - - 0.50 0.50 - 0.50 0.50 - - - - - - stlurb w30, [x17]
diff --git a/llvm/test/tools/llvm-mca/AArch64/Neoverse/V1-rcpc-immo-instructions.s b/llvm/test/tools/llvm-mca/AArch64/Neoverse/V1-rcpc-immo-instructions.s
index 5c9b43a0e5121..dcea382de5fa9 100644
--- a/llvm/test/tools/llvm-mca/AArch64/Neoverse/V1-rcpc-immo-instructions.s
+++ b/llvm/test/tools/llvm-mca/AArch64/Neoverse/V1-rcpc-immo-instructions.s
@@ -10,15 +10,15 @@
# CHECK-NEXT: [6]: HasSideEffects (U)
# CHECK: [1] [2] [3] [4] [5] [6] Instructions:
-# CHECK-NEXT: 2 1 0.50 * ldapur w7, [x24]
-# CHECK-NEXT: 2 1 0.50 * ldapur x20, [x13]
-# CHECK-NEXT: 2 1 0.50 * ldapurb w13, [x17]
-# CHECK-NEXT: 2 1 0.50 * ldapurh w3, [x22]
-# CHECK-NEXT: 2 1 0.50 U ldapursb w7, [x8]
-# CHECK-NEXT: 2 1 0.50 U ldapursb x29, [x7]
-# CHECK-NEXT: 2 1 0.50 U ldapursh w17, [x19]
-# CHECK-NEXT: 2 1 0.50 U ldapursh x3, [x3]
-# CHECK-NEXT: 2 1 0.50 U ldapursw x3, [x18]
+# CHECK-NEXT: 1 4 0.33 * ldapur w7, [x24]
+# CHECK-NEXT: 1 4 0.33 * ldapur x20, [x13]
+# CHECK-NEXT: 1 4 0.33 * ldapurb w13, [x17]
+# CHECK-NEXT: 1 4 0.33 * ldapurh w3, [x22]
+# CHECK-NEXT: 1 4 0.33 U ldapursb w7, [x8]
+# CHECK-NEXT: 1 4 0.33 U ldapursb x29, [x7]
+# CHECK-NEXT: 1 4 0.33 U ldapursh w17, [x19]
+# CHECK-NEXT: 1 4 0.33 U ldapursh x3, [x3]
+# CHECK-NEXT: 1 4 0.33 U ldapursw x3, [x18]
# CHECK-NEXT: 2 1 0.50 * stlur w3, [x27]
# CHECK-NEXT: 2 1 0.50 * stlur x23, [x25]
# CHECK-NEXT: 2 1 0.50 * stlurb w30, [x17]
@@ -46,19 +46,19 @@
# CHECK: Resource pressure per iteration:
# CHECK-NEXT: [0.0] [0.1] [1.0] [1.1] [2.0] [2.1] [2.2] [3] [4.0] [4.1] [5] [6] [7.0] [7.1] [8] [9] [10] [11]
-# CHECK-NEXT: - - 6.50 6.50 - - - - 6.50 6.50 - - - - - - - -
+# CHECK-NEXT: - - 2.00 2.00 - - - 3.00 5.00 5.00 - - - - - - - -
# CHECK: Resource pressure by instruction:
# CHECK-NEXT: [0.0] [0.1] [1.0] [1.1] [2.0] [2.1] [2.2] [3] [4.0] [4.1] [5] [6] [7.0] [7.1] [8] [9] [10] [11] Instructions:
-# CHECK-NEXT: - - 0.50 0.50 - - - - 0.50 0.50 - - - - - - - - ldapur w7, [x24]
-# CHECK-NEXT: - - 0.50 0.50 - - - - 0.50 0.50 - - - - - - - - ldapur x20, [x13]
-# CHECK-NEXT: - - 0.50 0.50 - - - - 0.50 0.50 - - - - - - - - ldapurb w13, [x17]
-# CHECK-NEXT: - - 0.50 0.50 - - - - 0.50 0.50 - - - - - - - - ldapurh w3, [x22]
-# CHECK-NEXT: - - 0.50 0.50 - - - - 0.50 0.50 - - - - - - - - ldapursb w7, [x8]
-# CHECK-NEXT: - - 0.50 0.50 - - - - 0.50 0.50 - - - - - - - - ldapursb x29, [x7]
-# CHECK-NEXT: - - 0.50 0.50 - - - - 0.50 0.50 - - - - - - - - ldapursh w17, [x19]
-# CHECK-NEXT: - - 0.50 0.50 - - - - 0.50 0.50 - - - - - - - - ldapursh x3, [x3]
-# CHECK-NEXT: - - 0.50 0.50 - - - - 0.50 0.50 - - - - - - - - ldapursw x3, [x18]
+# CHECK-NEXT: - - - - - - - 0.33 0.33 0.33 - - - - - - - - ldapur w7, [x24]
+# CHECK-NEXT: - - - - - - - 0.33 0.33 0.33 - - - - - - - - ldapur x20, [x13]
+# CHECK-NEXT: - - - - - - - 0.33 0.33 0.33 - - - - - - - - ldapurb w13, [x17]
+# CHECK-NEXT: - - - - - - - 0.33 0.33 0.33 - - - - - - - - ldapurh w3, [x22]
+# CHECK-NEXT: - - - - - - - 0.33 0.33 0.33 - - - - - - - - ldapursb w7, [x8]
+# CHECK-NEXT: - - - - - - - 0.33 0.33 0.33 - - - - - - - - ldapursb x29, [x7]
+# CHECK-NEXT: - - - - - - - 0.33 0.33 0.33 - - - - - - - - ldapursh w17, [x19]
+# CHECK-NEXT: - - - - - - - 0.33 0.33 0.33 - - - - - - - - ldapursh x3, [x3]
+# CHECK-NEXT: - - - - - - - 0.33 0.33 0.33 - - - - - - - - ldapursw x3, [x18]
# CHECK-NEXT: - - 0.50 0.50 - - - - 0.50 0.50 - - - - - - - - stlur w3, [x27]
# CHECK-NEXT: - - 0.50 0.50 - - - - 0.50 0.50 - - - - - - - - stlur x23, [x25]
# CHECK-NEXT: - - 0.50 0.50 - - - - 0.50 0.50 - - - - - - - - stlurb w30, [x17]
diff --git a/llvm/test/tools/llvm-mca/AArch64/Neoverse/V2-rcpc-immo-instructions.s b/llvm/test/tools/llvm-mca/AArch64/Neoverse/V2-rcpc-immo-instructions.s
index 71fd689522215..dfcc202192392 100644
--- a/llvm/test/tools/llvm-mca/AArch64/Neoverse/V2-rcpc-immo-instructions.s
+++ b/llvm/test/tools/llvm-mca/AArch64/Neoverse/V2-rcpc-immo-instructions.s
@@ -10,15 +10,15 @@
# CHECK-NEXT: [6]: HasSideEffects (U)
# CHECK: [1] [2] [3] [4] [5] [6] Instructions:
-# CHECK-NEXT: 2 1 0.50 * ldapur w7, [x24]
-# CHECK-NEXT: 2 1 0.50 * ldapur x20, [x13]
-# CHECK-NEXT: 2 1 0.50 * ldapurb w13, [x17]
-# CHECK-NEXT: 2 1 0.50 * ldapurh w3, [x22]
-# CHECK-NEXT: 2 1 0.50 U ldapursb w7, [x8]
-# CHECK-NEXT: 2 1 0.50 U ldapursb x29, [x7]
-# CHECK-NEXT: 2 1 0.50 U ldapursh w17, [x19]
-# CHECK-NEXT: 2 1 0.50 U ldapursh x3, [x3]
-# CHECK-NEXT: 2 1 0.50 U ldapursw x3, [x18]
+# CHECK-NEXT: 1 4 0.33 * ldapur w7, [x24]
+# CHECK-NEXT: 1 4 0.33 * ldapur x20, [x13]
+# CHECK-NEXT: 1 4 0.33 * ldapurb w13, [x17]
+# CHECK-NEXT: 1 4 0.33 * ldapurh w3, [x22]
+# CHECK-NEXT: 1 4 0.33 U ldapursb w7, [x8]
+# CHECK-NEXT: 1 4 0.33 U ldapursb x29, [x7]
+# CHECK-NEXT: 1 4 0.33 U ldapursh w17, [x19]
+# CHECK-NEXT: 1 4 0.33 U ldapursh x3, [x3]
+# CHECK-NEXT: 1 4 0.33 U ldapursw x3, [x18]
# CHECK-NEXT: 2 1 0.50 * stlur w3, [x27]
# CHECK-NEXT: 2 1 0.50 * stlur x23, [x25]
# CHECK-NEXT: 2 1 0.50 * stlurb w30, [x17]
@@ -48,19 +48,19 @@
# CHECK: Resource pressure per iteration:
# CHECK-NEXT: [0.0] [0.1] [1.0] [1.1] [2.0] [2.1] [2.2] [3] [4.0] [4.1] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14]
-# CHECK-NEXT: - - 6.50 6.50 - - - - 6.50 6.50 - - - - - - - - - -
+# CHECK-NEXT: - - 2.00 2.00 - - - 3.00 5.00 5.00 - - - - - - - - - -
# CHECK: Resource pressure by instruction:
# CHECK-NEXT: [0.0] [0.1] [1.0] [1.1] [2.0] [2.1] [2.2] [3] [4.0] [4.1] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] Instructions:
-# CHECK-NEXT: - - 0.50 0.50 - - - - 0.50 0.50 - - - - - - - - - - ldapur w7, [x24]
-# CHECK-NEXT: - - 0.50 0.50 - - - - 0.50 0.50 - - - - - - - - - - ldapur x20, [x13]
-# CHECK-NEXT: - - 0.50 0.50 - - - - 0.50 0.50 - - - - - - - - - ...
[truncated]
|
Priyanshu3820
pushed a commit
to Priyanshu3820/llvm-project
that referenced
this pull request
Dec 20, 2025
…m#171637) They were using the wrong scheduler resource. They're also missing from the optimisation guides, but WriteLD should be closer at least.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
They were using the wrong scheduler resource. They're also missing from the optimisation guides, but WriteLD should be closer at least.