28#define DEBUG_TYPE "arm-branch-targets"
29#define ARM_BRANCH_TARGETS_NAME "ARM Branch Targets"
45char ARMBranchTargets::ID = 0;
50void ARMBranchTargets::getAnalysisUsage(
AnalysisUsage &AU)
const {
56 return new ARMBranchTargets();
64 <<
"********** Function: " << MF.
getName() <<
'\n');
68 bool MadeChange =
false;
70 bool IsFirstBB = &
MBB == &MF.
front();
81 addBTI(
TII,
MBB, IsFirstBB);
98 unsigned OpCode = ARM::t2BTI;
103 return MI.isMetaInstruction();
111 <<
"' to replace with PACBTI\n");
114 auto NextMBBI = std::next(
MBBI);
121 << (OpCode == ARM::t2BTI ?
"BTI" :
"PACBTI")
122 <<
"' instr into BB '" <<
MBB.
getName() <<
"'\n");
#define ARM_BRANCH_TARGETS_NAME
MachineBasicBlock MachineBasicBlock::iterator MBBI
const HexagonInstrInfo * TII
#define INITIALIZE_PASS(passName, arg, name, cfg, analysis)
ARMFunctionInfo - This class is derived from MachineFunctionInfo and contains private ARM-specific in...
bool branchTargetEnforcement() const
Represent the analysis usage information of a pass.
FunctionPass class - This class is used to implement most global optimizations.
bool isEHPad() const
Returns true if the block is a landing pad.
bool hasAddressTaken() const
Test whether this block is used as something other than the target of a terminator,...
DebugLoc findDebugLoc(instr_iterator MBBI)
Find the next valid DebugLoc starting at MBBI, skipping any debug instructions.
void eraseFromParent()
This method unlinks 'this' from the containing function and deletes it.
instr_iterator instr_end()
StringRef getName() const
Return the name of the corresponding LLVM basic block, or an empty string.
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
virtual bool runOnMachineFunction(MachineFunction &MF)=0
runOnMachineFunction - This method must be overloaded to perform the desired machine code transformat...
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
StringRef getName() const
getName - Return the name of the corresponding LLVM function.
Ty * getInfo()
getInfo - Keep track of various per-function pieces of information for backends that would like to do...
const MachineInstrBuilder & setMIFlags(unsigned Flags) const
Representation of each machine instruction.
virtual StringRef getPassName() const
getPassName - Return a nice clean name for a pass.
StringRef - Represent a constant reference to a string, i.e.
virtual const TargetInstrInfo * getInstrInfo() const
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
This is an optimization pass for GlobalISel generic memory operations.
MachineInstrBuilder BuildMI(MachineFunction &MF, const MIMetadata &MIMD, const MCInstrDesc &MCID)
Builder interface. Specify how to create the initial instruction itself.
FunctionPass * createARMBranchTargetsPass()
auto find_if_not(R &&Range, UnaryPredicate P)
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.