#include "ARM.h"
#include "ARMMachineFunctionInfo.h"
#include "ARMSubtarget.h"
#include "MCTargetDesc/ARMBaseInfo.h"
#include "Thumb2InstrInfo.h"
#include "llvm/ADT/SmallSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/CodeGen/MachineBasicBlock.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineInstr.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineInstrBundle.h"
#include "llvm/CodeGen/MachineOperand.h"
#include "llvm/IR/DebugLoc.h"
#include "llvm/MC/MCInstrDesc.h"
#include "llvm/MC/MCRegisterInfo.h"
#include <cassert>
#include <new>
usingnamespacellvm;
#define DEBUG_TYPE …
#define PASS_NAME …
STATISTIC(NumITs, "Number of IT blocks inserted");
STATISTIC(NumMovedInsts, "Number of predicated instructions moved");
RegisterSet;
namespace {
class Thumb2ITBlock : public MachineFunctionPass { … };
char Thumb2ITBlock::ID = …;
}
INITIALIZE_PASS(…)
static void TrackDefUses(MachineInstr *MI, RegisterSet &Defs, RegisterSet &Uses,
const TargetRegisterInfo *TRI) { … }
static void ClearKillFlags(MachineInstr *MI, RegisterSet &Uses) { … }
static bool isCopy(MachineInstr *MI) { … }
bool
Thumb2ITBlock::MoveCopyOutOfITBlock(MachineInstr *MI,
ARMCC::CondCodes CC, ARMCC::CondCodes OCC,
RegisterSet &Defs, RegisterSet &Uses) { … }
bool Thumb2ITBlock::InsertITInstructions(MachineBasicBlock &MBB) { … }
bool Thumb2ITBlock::runOnMachineFunction(MachineFunction &Fn) { … }
FunctionPass *llvm::createThumb2ITBlockPass() { … }