29 #define DEBUG_TYPE "aarch64-branch-targets" 30 #define AARCH64_BRANCH_TARGETS_NAME "AArch64 Branch Targets" 51 void AArch64BranchTargets::getAnalysisUsage(
AnalysisUsage &AU)
const {
57 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)
76 JumpTableTargets.
insert(MBB);
78 bool MadeChange =
false;
80 bool CouldCall =
false, CouldJump =
false;
92 if (MBB.hasAddressTaken() || JumpTableTargets.count(&MBB))
95 if (CouldCall || CouldJump) {
96 addBTI(MBB, CouldCall, CouldJump);
107 << (CouldCall ?
"c" :
"") <<
" to " << MBB.
getName()
113 unsigned HintNum = 32;
118 assert(HintNum != 32 &&
"No target kinds!");
120 auto MBBI = MBB.
begin();
123 if (MBBI != MBB.
end() && (MBBI->getOpcode() == AArch64::PACIASP ||
124 MBBI->getOpcode() == AArch64::PACIBSP))
128 TII->
get(AArch64::HINT))
bool hasLocalLinkage() const
This class represents lattice values for constants.
bool hasFnAttribute(Attribute::AttrKind Kind) const
Return true if the function has the attribute.
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
const HexagonInstrInfo * TII
virtual const TargetInstrInfo * getInstrInfo() const
StringRef getName() const
getName - Return the name of the corresponding LLVM function.
MachineInstrBuilder BuildMI(MachineFunction &MF, const DebugLoc &DL, const MCInstrDesc &MCID)
Builder interface. Specify how to create the initial instruction itself.
static MDTuple * get(LLVMContext &Context, ArrayRef< Metadata *> MDs)
StringRef getName() const
Return the name of the corresponding LLVM basic block, or an empty string.
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
DebugLoc findDebugLoc(instr_iterator MBBI)
Find the next valid DebugLoc starting at MBBI, skipping any DBG_VALUE and DBG_LABEL instructions...
std::pair< iterator, bool > insert(PtrType Ptr)
Inserts Ptr if and only if there is no element in the container equal to Ptr.
Represent the analysis usage information of a pass.
FunctionPass class - This class is used to implement most global optimizations.
SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements...
#define AARCH64_BRANCH_TARGETS_NAME
const Function & getFunction() const
Return the LLVM function that this machine code represents.
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
INITIALIZE_PASS(AArch64BranchTargets, "aarch64-branch-targets", AARCH64_BRANCH_TARGETS_NAME, false, false) void AArch64BranchTargets
const MachineFunction * getParent() const
Return the MachineFunction containing this basic block.
FunctionPass * createAArch64BranchTargetsPass()
bool hasAddressTaken(const User **=nullptr) const
hasAddressTaken - returns true if there are any uses of this function other than direct calls or invo...
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
StringRef - Represent a constant reference to a string, i.e.
const MachineJumpTableInfo * getJumpTableInfo() const
getJumpTableInfo - Return the jump table info object for the current function.