@@ -1419,22 +1419,12 @@ void ARMLowOverheadLoops::ConvertVPTBlocks(LowOverheadLoop &LoLoop) {
1419
1419
? Divergent
1420
1420
: nullptr ;
1421
1421
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
-
1432
1422
MachineInstrBuilder MIB;
1433
1423
if (VCMP) {
1434
1424
// 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 ())));
1438
1428
MIB.addImm (ARMVCC::Then);
1439
1429
// Register one
1440
1430
MIB.add (VCMP->getOperand (1 ));
@@ -1448,8 +1438,8 @@ void ARMLowOverheadLoops::ConvertVPTBlocks(LowOverheadLoop &LoLoop) {
1448
1438
} else {
1449
1439
// Create a VPST (with a null mask for now, we'll recompute it later)
1450
1440
// 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));
1453
1443
MIB.addImm (0 );
1454
1444
LLVM_DEBUG (dbgs () << " ARM Loops: Created VPST: " << *MIB);
1455
1445
}
0 commit comments