34#define TLSCLEANUP_PASS_NAME "AArch64 Local Dynamic TLS Access Clean-up"
54 &getAnalysis<MachineDominatorTreeWrapperPass>().getDomTree();
70 switch (
I->getOpcode()) {
71 case AArch64::TLSDESC_CALLSEQ:
73 if (!
I->getOperand(0).isSymbol() ||
74 strcmp(
I->getOperand(0).getSymbolName(),
"_TLS_MODULE_BASE_"))
78 I = replaceTLSBaseAddrCall(*
I, TLSBaseAddrReg);
80 I = setRegister(*
I, &TLSBaseAddrReg);
90 Changed |= VisitNode(
N, TLSBaseAddrReg);
99 unsigned TLSBaseAddrReg) {
106 TII->get(TargetOpcode::COPY), AArch64::X0)
110 if (
I.shouldUpdateCallSiteInfo())
111 I.getMF()->eraseCallSiteInfo(&
I);
127 *TLSBaseAddrReg =
RegInfo.createVirtualRegister(&AArch64::GPR64RegClass);
131 BuildMI(*
I.getParent(), ++
I.getIterator(),
I.getDebugLoc(),
132 TII->get(TargetOpcode::COPY), *TLSBaseAddrReg)
153 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.
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...
MachineDomTreeNode * getRootNode() const
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()