[llvm] 00ee52a - [NFC][ARM] Remove dead loop.
Sam Parker via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 24 07:37:41 PDT 2020
Author: Sam Parker
Date: 2020-09-24T15:37:26+01:00
New Revision: 00ee52ae0467f0bfa588d9797053a42c615d2332
URL: https://github.com/llvm/llvm-project/commit/00ee52ae0467f0bfa588d9797053a42c615d2332
DIFF: https://github.com/llvm/llvm-project/commit/00ee52ae0467f0bfa588d9797053a42c615d2332.diff
LOG: [NFC][ARM] Remove dead loop.
Remove a loop that just calculated a couple of values that were now
longer needed.
Added:
Modified:
llvm/lib/Target/ARM/ARMLowOverheadLoops.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/ARM/ARMLowOverheadLoops.cpp b/llvm/lib/Target/ARM/ARMLowOverheadLoops.cpp
index d5c57da6537f..5fab487e9174 100644
--- a/llvm/lib/Target/ARM/ARMLowOverheadLoops.cpp
+++ b/llvm/lib/Target/ARM/ARMLowOverheadLoops.cpp
@@ -1419,22 +1419,12 @@ void ARMLowOverheadLoops::ConvertVPTBlocks(LowOverheadLoop &LoLoop) {
? Divergent
: nullptr;
- unsigned Size = 0;
- auto E = MachineBasicBlock::reverse_iterator(Divergent);
- auto I = MachineBasicBlock::reverse_iterator(Insts.back());
- MachineInstr *InsertAt = nullptr;
- while (I != E) {
- InsertAt = &*I;
- ++Size;
- ++I;
- }
-
MachineInstrBuilder MIB;
if (VCMP) {
// Combine the VPST and VCMP into a VPT
- MIB =
- BuildMI(*InsertAt->getParent(), InsertAt, InsertAt->getDebugLoc(),
- TII->get(VCMPOpcodeToVPT(VCMP->getOpcode())));
+ MIB = BuildMI(*Divergent->getParent(), Divergent,
+ Divergent->getDebugLoc(),
+ TII->get(VCMPOpcodeToVPT(VCMP->getOpcode())));
MIB.addImm(ARMVCC::Then);
// Register one
MIB.add(VCMP->getOperand(1));
@@ -1448,8 +1438,8 @@ void ARMLowOverheadLoops::ConvertVPTBlocks(LowOverheadLoop &LoLoop) {
} else {
// Create a VPST (with a null mask for now, we'll recompute it later)
// or a VPT in case there was a VCMP right before it
- MIB = BuildMI(*InsertAt->getParent(), InsertAt,
- InsertAt->getDebugLoc(), TII->get(ARM::MVE_VPST));
+ MIB = BuildMI(*Divergent->getParent(), Divergent,
+ Divergent->getDebugLoc(), TII->get(ARM::MVE_VPST));
MIB.addImm(0);
LLVM_DEBUG(dbgs() << "ARM Loops: Created VPST: " << *MIB);
}
More information about the llvm-commits
mailing list