Skip to content

Commit 7de23f7

Browse files
committed
Fixup
1 parent 5f24229 commit 7de23f7

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

llvm/lib/Target/AArch64/AArch64ExpandPseudoInsts.cpp

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1005,10 +1005,8 @@ AArch64ExpandPseudo::expandConditionalPseudo(MachineBasicBlock &MBB,
10051005
MachineBasicBlock::iterator MBBI,
10061006
DebugLoc DL,
10071007
MachineInstrBuilder &Branch) {
1008-
MachineInstr &MI = *MBBI;
10091008
assert((std::next(MBBI) != MBB.end() ||
1010-
MI.getParent()->successors().begin() !=
1011-
MI.getParent()->successors().end()) &&
1009+
MBB.successors().begin() != MBB.successors().end()) &&
10121010
"Unexpected unreachable in block");
10131011

10141012
// Split MBB and create two new blocks:
@@ -1017,9 +1015,10 @@ AArch64ExpandPseudo::expandConditionalPseudo(MachineBasicBlock &MBB,
10171015
// - EndBB contains all instructions after the conditional pseudo.
10181016
MachineInstr &PrevMI = *std::prev(MBBI);
10191017
MachineBasicBlock *CondBB = MBB.splitAt(PrevMI, /*UpdateLiveIns*/ true);
1020-
MachineBasicBlock *EndBB = std::next(MI.getIterator()) == CondBB->end()
1021-
? *CondBB->successors().begin()
1022-
: CondBB->splitAt(MI, /*UpdateLiveIns*/ true);
1018+
MachineBasicBlock *EndBB =
1019+
std::next(MBBI) == CondBB->end()
1020+
? *CondBB->successors().begin()
1021+
: CondBB->splitAt(*MBBI, /*UpdateLiveIns*/ true);
10231022

10241023
// Add the SMBB label to the branch instruction & create a branch to EndBB.
10251024
Branch.addMBB(CondBB);
@@ -1064,8 +1063,6 @@ AArch64ExpandPseudo::expandCommitZASave(MachineBasicBlock &MBB,
10641063
MachineBasicBlock::iterator MBBI) {
10651064
MachineInstr &MI = *MBBI;
10661065
DebugLoc DL = MI.getDebugLoc();
1067-
[[maybe_unused]] auto *TRI =
1068-
MBB.getParent()->getSubtarget().getRegisterInfo();
10691066

10701067
// Compare TPIDR2_EL0 against 0. Commit ZA if TPIDR2_EL0 is non-zero.
10711068
MachineInstrBuilder Branch =
@@ -1084,6 +1081,8 @@ AArch64ExpandPseudo::expandCommitZASave(MachineBasicBlock &MBB,
10841081
.addReg(AArch64::XZR);
10851082
bool ZeroZA = MI.getOperand(1).getImm() != 0;
10861083
if (ZeroZA) {
1084+
[[maybe_unused]] auto *TRI =
1085+
MBB.getParent()->getSubtarget().getRegisterInfo();
10871086
assert(MI.definesRegister(AArch64::ZAB0, TRI) && "should define ZA!");
10881087
BuildMI(CondBB, CondBB.back(), DL, TII->get(AArch64::ZERO_M))
10891088
.addImm(ZERO_ALL_ZA_MASK)

0 commit comments

Comments
 (0)