Skip to content

Commit 00ee52a

Browse files
committed
[NFC][ARM] Remove dead loop.
Remove a loop that just calculated a couple of values that were now longer needed.
1 parent d9beff0 commit 00ee52a

File tree

1 file changed

+5
-15
lines changed

1 file changed

+5
-15
lines changed

llvm/lib/Target/ARM/ARMLowOverheadLoops.cpp

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1419,22 +1419,12 @@ void ARMLowOverheadLoops::ConvertVPTBlocks(LowOverheadLoop &LoLoop) {
14191419
? Divergent
14201420
: nullptr;
14211421

1422-
unsigned Size = 0;
1423-
auto E = MachineBasicBlock::reverse_iterator(Divergent);
1424-
auto I = MachineBasicBlock::reverse_iterator(Insts.back());
1425-
MachineInstr *InsertAt = nullptr;
1426-
while (I != E) {
1427-
InsertAt = &*I;
1428-
++Size;
1429-
++I;
1430-
}
1431-
14321422
MachineInstrBuilder MIB;
14331423
if (VCMP) {
14341424
// Combine the VPST and VCMP into a VPT
1435-
MIB =
1436-
BuildMI(*InsertAt->getParent(), InsertAt, InsertAt->getDebugLoc(),
1437-
TII->get(VCMPOpcodeToVPT(VCMP->getOpcode())));
1425+
MIB = BuildMI(*Divergent->getParent(), Divergent,
1426+
Divergent->getDebugLoc(),
1427+
TII->get(VCMPOpcodeToVPT(VCMP->getOpcode())));
14381428
MIB.addImm(ARMVCC::Then);
14391429
// Register one
14401430
MIB.add(VCMP->getOperand(1));
@@ -1448,8 +1438,8 @@ void ARMLowOverheadLoops::ConvertVPTBlocks(LowOverheadLoop &LoLoop) {
14481438
} else {
14491439
// Create a VPST (with a null mask for now, we'll recompute it later)
14501440
// or a VPT in case there was a VCMP right before it
1451-
MIB = BuildMI(*InsertAt->getParent(), InsertAt,
1452-
InsertAt->getDebugLoc(), TII->get(ARM::MVE_VPST));
1441+
MIB = BuildMI(*Divergent->getParent(), Divergent,
1442+
Divergent->getDebugLoc(), TII->get(ARM::MVE_VPST));
14531443
MIB.addImm(0);
14541444
LLVM_DEBUG(dbgs() << "ARM Loops: Created VPST: " << *MIB);
14551445
}

0 commit comments

Comments
 (0)