Skip to content

Conversation

MacDue
Copy link
Member

@MacDue MacDue commented Aug 27, 2025

No description provided.

@MacDue MacDue requested a review from sdesmalen-arm August 27, 2025 10:14
@MacDue MacDue changed the title [AArch64][SME] Address post-review comments on the MachineSMEABIPass (NFC) [AArch64][SME] Address post-commit comments on the MachineSMEABIPass (NFC) Aug 27, 2025
@llvmbot
Copy link
Member

llvmbot commented Aug 27, 2025

@llvm/pr-subscribers-backend-aarch64

Author: Benjamin Maxwell (MacDue)

Changes

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

1 Files Affected:

  • (modified) llvm/lib/Target/AArch64/MachineSMEABIPass.cpp (+4-4)
diff --git a/llvm/lib/Target/AArch64/MachineSMEABIPass.cpp b/llvm/lib/Target/AArch64/MachineSMEABIPass.cpp
index b58dfdf32e4ab..5dfaa891193cf 100644
--- a/llvm/lib/Target/AArch64/MachineSMEABIPass.cpp
+++ b/llvm/lib/Target/AArch64/MachineSMEABIPass.cpp
@@ -139,8 +139,8 @@ StringRef getZAStateString(ZAState State) {
 #undef MAKE_CASE
 }
 
-static bool isZAorZT0RegOp(const TargetRegisterInfo &TRI,
-                           const MachineOperand &MO) {
+static bool isZAorZTRegOp(const TargetRegisterInfo &TRI,
+                          const MachineOperand &MO) {
   if (!MO.isReg() || !MO.getReg().isPhysical())
     return false;
   return any_of(TRI.subregs_inclusive(MO.getReg()), [](const MCPhysReg &SR) {
@@ -166,7 +166,7 @@ getZAStateBeforeInst(const TargetRegisterInfo &TRI, MachineInstr &MI,
     return {ZAOffAtReturn ? ZAState::OFF : ZAState::ACTIVE, InsertPt};
 
   for (auto &MO : MI.operands()) {
-    if (isZAorZT0RegOp(TRI, MO))
+    if (isZAorZTRegOp(TRI, MO))
       return {ZAState::ACTIVE, InsertPt};
   }
 
@@ -266,7 +266,7 @@ void MachineSMEABI::collectNeededZAStates(SMEAttrs SMEFnAttrs) {
   State.Blocks.resize(MF->getNumBlockIDs());
   for (MachineBasicBlock &MBB : *MF) {
     BlockInfo &Block = State.Blocks[MBB.getNumber()];
-    if (&MBB == &MF->front()) {
+    if (MBB.isEntryBlock()) {
       // Entry block:
       Block.FixedEntryState = SMEFnAttrs.hasPrivateZAInterface()
                                   ? ZAState::CALLER_DORMANT

@MacDue MacDue merged commit a74a801 into llvm:main Aug 27, 2025
11 checks passed
@MacDue MacDue deleted the post_commit_nfc branch August 27, 2025 12:32
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.

3 participants