48char SystemZLDCleanup::ID = 0;
53 "SystemZ Local Dynamic TLS Access Clean-up",
false,
false)
56 return new SystemZLDCleanup();
59void SystemZLDCleanup::getAnalysisUsage(
AnalysisUsage &AU)
const {
66 if (skipFunction(
F.getFunction()))
79 &getAnalysis<MachineDominatorTreeWrapperPass>().getDomTree();
89 unsigned TLSBaseAddrReg) {
94 for (
auto I = BB->
begin(), E = BB->
end();
I != E; ++
I) {
95 switch (
I->getOpcode()) {
96 case SystemZ::TLS_LDCALL:
98 I = ReplaceTLSCall(&*
I, TLSBaseAddrReg);
100 I = SetRegister(&*
I, &TLSBaseAddrReg);
109 for (
auto &
N : *
Node)
110 Changed |= VisitNode(
N, TLSBaseAddrReg);
118 unsigned TLSBaseAddrReg) {
121 TII->get(TargetOpcode::COPY), SystemZ::R2D)
125 I->eraseFromParent();
133 unsigned *TLSBaseAddrReg) {
136 *TLSBaseAddrReg =
RegInfo.createVirtualRegister(&SystemZ::GR64BitRegClass);
141 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.
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...
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 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 &)