|
LLVM
10.0.0
|
Finalize v8.1-m low-overhead loops by converting the associated pseudo instructions into machine operations. More...
#include "ARM.h"#include "ARMBaseInstrInfo.h"#include "ARMBaseRegisterInfo.h"#include "ARMBasicBlockInfo.h"#include "ARMSubtarget.h"#include "Thumb2InstrInfo.h"#include "llvm/ADT/SetOperations.h"#include "llvm/ADT/SmallSet.h"#include "llvm/CodeGen/MachineFunctionPass.h"#include "llvm/CodeGen/MachineLoopInfo.h"#include "llvm/CodeGen/MachineLoopUtils.h"#include "llvm/CodeGen/MachineRegisterInfo.h"#include "llvm/CodeGen/Passes.h"#include "llvm/CodeGen/ReachingDefAnalysis.h"#include "llvm/MC/MCInstrDesc.h"Go to the source code of this file.
Macros | |
| #define | DEBUG_TYPE "arm-low-overhead-loops" |
| #define | ARM_LOW_OVERHEAD_LOOPS_NAME "ARM Low Overhead Loops pass" |
Functions | |
| INITIALIZE_PASS (ARMLowOverheadLoops, DEBUG_TYPE, ARM_LOW_OVERHEAD_LOOPS_NAME, false, false) MachineInstr *LowOverheadLoop | |
| template<typename Iterator > | |
| static bool | IsSafeToMove (MachineInstr *From, MachineInstr *To, ReachingDefAnalysis *RDA) |
Finalize v8.1-m low-overhead loops by converting the associated pseudo instructions into machine operations.
The expectation is that the loop contains three pseudo instructions:
In addition to this, we also look for the presence of the VCTP instruction, which determines whether we can generated the tail-predicated low-overhead loop form.
Assumptions and Dependencies: Low-overhead loops are constructed and executed using a setup instruction: DLS, WLS, DLSTP or WLSTP and an instruction that loops back: LE or LETP. WLS(TP) and LE(TP) are branching instructions with a (large) limited range but fixed polarity: WLS can only branch forwards and LE can only branch backwards. These restrictions mean that this pass is dependent upon block layout and block sizes, which is why it's the last pass to run. The same is true for ConstantIslands, but this pass does not increase the size of the basic blocks, nor does it change the CFG. Instructions are mainly removed during the transform and pseudo instructions are replaced by real ones. In some cases, when we have to revert to a 'normal' loop, we have to introduce multiple instructions for a single pseudo (see RevertWhile and RevertLoopEnd). To handle this situation, t2WhileLoopStart and t2LoopEnd are defined to be as large as this maximum sequence of replacement instructions.
Definition in file ARMLowOverheadLoops.cpp.
Definition at line 59 of file ARMLowOverheadLoops.cpp.
| #define DEBUG_TYPE "arm-low-overhead-loops" |
Definition at line 58 of file ARMLowOverheadLoops.cpp.
| INITIALIZE_PASS | ( | ARMLowOverheadLoops | , |
| DEBUG_TYPE | , | ||
| ARM_LOW_OVERHEAD_LOOPS_NAME | , | ||
| false | , | ||
| false | |||
| ) |
Definition at line 261 of file ARMLowOverheadLoops.cpp.
|
static |
Definition at line 304 of file ARMLowOverheadLoops.cpp.
References assert(), llvm::MachineBasicBlock::back(), llvm::SmallSet< T, N, C >::count(), llvm::dbgs(), E, llvm::MachineLoopInfo::findLoopPreheader(), for(), llvm::ReachingDefAnalysis::getLocalLiveOutMIDef(), llvm::MachineBasicBlock::getParent(), llvm::ReachingDefAnalysis::getReachingDef(), llvm::ReachingDefAnalysis::hasSameReachingDef(), I, llvm::SmallSet< T, N, C >::insert(), llvm::MachineBasicBlock::insert(), llvm::MachineBasicBlock::insertAfter(), llvm::ReachingDefAnalysis::isReachingDefLiveOut(), llvm::isVCTP(), LLVM_DEBUG, MI, llvm::MachineInstr::operands(), llvm::MachineBasicBlock::pred_begin(), and llvm::MachineBasicBlock::pred_size().
1.8.13