47char SystemZLDCleanup::ID = 0;
52 "SystemZ Local Dynamic TLS Access Clean-up",
false,
false)
55 return new SystemZLDCleanup();
58void SystemZLDCleanup::getAnalysisUsage(
AnalysisUsage &AU)
const {
65 if (skipFunction(
F.getFunction()))
78 &getAnalysis<MachineDominatorTreeWrapperPass>().getDomTree();
88 unsigned TLSBaseAddrReg) {
93 for (
auto I = BB->
begin(), E = BB->
end();
I != E; ++
I) {
94 switch (
I->getOpcode()) {
95 case SystemZ::TLS_LDCALL:
97 I = ReplaceTLSCall(&*
I, TLSBaseAddrReg);
99 I = SetRegister(&*
I, &TLSBaseAddrReg);
108 for (
auto &
N : *
Node)
109 Changed |= VisitNode(
N, TLSBaseAddrReg);
117 unsigned TLSBaseAddrReg) {
120 TII->get(TargetOpcode::COPY), SystemZ::R2D)
124 I->eraseFromParent();
132 unsigned *TLSBaseAddrReg) {
135 *TLSBaseAddrReg =
RegInfo.createVirtualRegister(&SystemZ::GR64BitRegClass);
140 TII->get(TargetOpcode::COPY), *TLSBaseAddrReg)
const HexagonInstrInfo * TII
#define INITIALIZE_PASS(passName, arg, name, cfg, analysis)
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.
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 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...
unsigned getNumLocalDynamicTLSAccesses() 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 * createSystemZLDCleanupPass(SystemZTargetMachine &TM)
void initializeSystemZLDCleanupPass(PassRegistry &)