@@ -111,7 +111,7 @@ static bool isZAorZT0RegOp(const TargetRegisterInfo &TRI,
111
111
// / to where any code required to change the ZA state should be inserted.
112
112
static std::pair<ZAState, MachineBasicBlock::iterator>
113
113
getZAStateBeforeInst (const TargetRegisterInfo &TRI, MachineInstr &MI,
114
- bool ZALiveAtReturn ) {
114
+ bool ZAOffAtReturn ) {
115
115
MachineBasicBlock::iterator InsertPt (MI);
116
116
117
117
if (MI.getOpcode () == AArch64::InOutZAUsePseudo)
@@ -121,7 +121,7 @@ getZAStateBeforeInst(const TargetRegisterInfo &TRI, MachineInstr &MI,
121
121
return {ZAState::LOCAL_SAVED, std::prev (InsertPt)};
122
122
123
123
if (MI.isReturn ())
124
- return {ZALiveAtReturn ? ZAState::ACTIVE : ZAState::OFF , InsertPt};
124
+ return {ZAOffAtReturn ? ZAState::OFF : ZAState::ACTIVE , InsertPt};
125
125
126
126
for (auto &MO : MI.operands ()) {
127
127
if (isZAorZT0RegOp (TRI, MO))
@@ -257,7 +257,7 @@ void MachineSMEABI::collectNeededZAStates(SMEAttrs SMEFnAttrs) {
257
257
LiveUnits.stepBackward (MI);
258
258
LiveRegs PhysLiveRegs = GetPhysLiveRegs ();
259
259
auto [NeededState, InsertPt] = getZAStateBeforeInst (
260
- *TRI, MI, /* ZALiveAtReturn =*/ SMEFnAttrs.hasSharedZAInterface ());
260
+ *TRI, MI, /* ZAOffAtReturn =*/ SMEFnAttrs.hasPrivateZAInterface ());
261
261
assert ((InsertPt == MBBI ||
262
262
InsertPt->getOpcode () == AArch64::ADJCALLSTACKDOWN) &&
263
263
" Unexpected state change insertion point!" );
@@ -287,7 +287,7 @@ void MachineSMEABI::assignBundleZAStates() {
287
287
for (unsigned BlockID : Bundles->getBlocks (I)) {
288
288
LLVM_DEBUG (dbgs () << " - bb." << BlockID);
289
289
290
- BlockInfo &Block = State.Blocks [BlockID];
290
+ const BlockInfo &Block = State.Blocks [BlockID];
291
291
if (Block.Insts .empty ()) {
292
292
LLVM_DEBUG (dbgs () << " (no state preference)\n " );
293
293
continue ;
@@ -332,7 +332,7 @@ void MachineSMEABI::assignBundleZAStates() {
332
332
333
333
void MachineSMEABI::insertStateChanges () {
334
334
for (MachineBasicBlock &MBB : *MF) {
335
- BlockInfo &Block = State.Blocks [MBB.getNumber ()];
335
+ const BlockInfo &Block = State.Blocks [MBB.getNumber ()];
336
336
ZAState InState =
337
337
State.BundleStates [Bundles->getBundle (MBB.getNumber (), /* Out=*/ false )];
338
338
0 commit comments