29#define DEBUG_TYPE "aarch64-branch-targets"
30#define AARCH64_BRANCH_TARGETS_NAME "AArch64 Branch Targets"
47char AArch64BranchTargets::ID = 0;
52void AArch64BranchTargets::getAnalysisUsage(
AnalysisUsage &AU)
const {
58 return new AArch64BranchTargets();
66 dbgs() <<
"********** AArch64 Branch Targets **********\n"
67 <<
"********** Function: " << MF.
getName() <<
'\n');
74 for (
auto &JTE : JTI->getJumpTables())
75 for (
auto *
MBB : JTE.MBBs)
78 bool MadeChange =
false;
81 bool CouldCall =
false, CouldJump =
false;
99 if (CouldCall || CouldJump) {
100 addBTI(
MBB, CouldCall, CouldJump, HasWinCFI);
109 bool CouldJump,
bool HasWinCFI) {
111 << (CouldCall ?
"c" :
"") <<
" to " <<
MBB.
getName()
117 unsigned HintNum = 32;
122 assert(HintNum != 32 &&
"No target kinds!");
128 (
MBBI->isMetaInstruction() ||
MBBI->getOpcode() == AArch64::EMITBKEY);
135 (
MBBI->getOpcode() == AArch64::PACIASP ||
136 MBBI->getOpcode() == AArch64::PACIBSP))
141 TII->get(AArch64::SEH_Nop));
144 TII->get(AArch64::HINT))
#define AARCH64_BRANCH_TARGETS_NAME
MachineBasicBlock MachineBasicBlock::iterator MBBI
const HexagonInstrInfo * TII
#define INITIALIZE_PASS(passName, arg, name, cfg, analysis)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
AArch64FunctionInfo - This class is derived from MachineFunctionInfo and contains private AArch64-spe...
bool branchTargetEnforcement() const
Represent the analysis usage information of a pass.
FunctionPass class - This class is used to implement most global optimizations.
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.
const MachineFunction * getParent() const
Return the MachineFunction containing this basic block.
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 MachineJumpTableInfo * getJumpTableInfo() const
getJumpTableInfo - Return the jump table info object for the current function.
const MachineInstrBuilder & addImm(int64_t Val) const
Add a new immediate operand.
virtual StringRef getPassName() const
getPassName - Return a nice clean name for a pass.
size_type count(ConstPtrType Ptr) const
count - Return 1 if the specified pointer is in the set, 0 otherwise.
std::pair< iterator, bool > insert(PtrType Ptr)
Inserts Ptr if and only if there is no element in the container equal to Ptr.
SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements.
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.
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
FunctionPass * createAArch64BranchTargetsPass()