33#define TLSCLEANUP_PASS_NAME "AArch64 Local Dynamic TLS Access Clean-up"
53 &getAnalysis<MachineDominatorTreeWrapperPass>().getDomTree();
69 switch (
I->getOpcode()) {
70 case AArch64::TLSDESC_CALLSEQ:
72 if (!
I->getOperand(0).isSymbol() ||
73 strcmp(
I->getOperand(0).getSymbolName(),
"_TLS_MODULE_BASE_"))
77 I = replaceTLSBaseAddrCall(*
I, TLSBaseAddrReg);
79 I = setRegister(*
I, &TLSBaseAddrReg);
89 Changed |= VisitNode(
N, TLSBaseAddrReg);
98 unsigned TLSBaseAddrReg) {
105 TII->get(TargetOpcode::COPY), AArch64::X0)
109 if (
I.shouldUpdateCallSiteInfo())
110 I.getMF()->eraseCallSiteInfo(&
I);
126 *TLSBaseAddrReg =
RegInfo.createVirtualRegister(&AArch64::GPR64RegClass);
130 BuildMI(*
I.getParent(), ++
I.getIterator(),
I.getDebugLoc(),
131 TII->get(TargetOpcode::COPY), *TLSBaseAddrReg)
152 return new LDTLSCleanup();
#define TLSCLEANUP_PASS_NAME
const HexagonInstrInfo * TII
#define INITIALIZE_PASS(passName, arg, name, cfg, analysis)
AArch64FunctionInfo - This class is derived from MachineFunctionInfo and contains private AArch64-spe...
unsigned getNumLocalDynamicTLSAccesses() const
Represent the analysis usage information of a pass.
AnalysisUsage & addRequired()
void setPreservesCFG()
This function should be called by the pass, iff they do not:
Base class for the actual dominator tree node.
DomTreeNodeBase< NodeT > * getRootNode()
getRootNode - This returns the entry node for the CFG of the function.
FunctionPass class - This class is used to implement most global optimizations.
bool skipFunction(const Function &F) const
Optional passes call this function to check whether the pass should be skipped.
Analysis pass which computes a MachineDominatorTree.
DominatorTree Class - Concrete subclass of DominatorTreeBase that is used to compute a normal dominat...
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.
MachineRegisterInfo & getRegInfo()
getRegInfo - Return information about the registers currently in use.
Function & getFunction()
Return the LLVM function that this machine code represents.
Ty * getInfo()
getInfo - Keep track of various per-function pieces of information for backends that would like to do...
const MachineInstrBuilder & addReg(Register RegNo, unsigned flags=0, unsigned SubReg=0) const
Add a new virtual register operand.
Representation of each machine instruction.
MachineRegisterInfo - Keep track of information for virtual and physical registers,...
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
virtual StringRef getPassName() const
getPassName - Return a nice clean name for a pass.
StringRef - Represent a constant reference to a string, i.e.
TargetInstrInfo - Interface to description of machine instruction set.
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.
void initializeLDTLSCleanupPass(PassRegistry &)
MachineInstrBuilder BuildMI(MachineFunction &MF, const MIMetadata &MIMD, const MCInstrDesc &MCID)
Builder interface. Specify how to create the initial instruction itself.
FunctionPass * createAArch64CleanupLocalDynamicTLSPass()