35 SystemZLDCleanupLegacy() : MachineFunctionPass(ID) {}
38 void getAnalysisUsage(AnalysisUsage &AU)
const override;
41char SystemZLDCleanupLegacy::ID = 0;
46 "SystemZ Local Dynamic TLS Access Clean-up",
false,
false)
49 return new SystemZLDCleanupLegacy();
52void SystemZLDCleanupLegacy::getAnalysisUsage(
AnalysisUsage &AU)
const {
64 TII->get(TargetOpcode::COPY), SystemZ::R2D)
76 unsigned *TLSBaseAddrReg,
80 *TLSBaseAddrReg =
RegInfo.createVirtualRegister(&SystemZ::GR64BitRegClass);
85 TII->get(TargetOpcode::COPY), *TLSBaseAddrReg)
103 switch (
I->getOpcode()) {
104 case SystemZ::TLS_LDCALL:
138bool SystemZLDCleanupLegacy::runOnMachineFunction(
MachineFunction &MF) {
143 return &getAnalysis<MachineDominatorTreeWrapperPass>().getDomTree();
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
const HexagonInstrInfo * TII
static bool visitNode(MBBInfo &MBBI, ScopedHTType &ScopedHT)
Visit MBB.
#define INITIALIZE_PASS(passName, arg, name, cfg, analysis)
static MachineInstr * setRegister(MachineFunction &MF, MachineInstr *I, unsigned *TLSBaseAddrReg, const TargetInstrInfo *TII)
static MachineInstr * replaceTLSCall(MachineInstr *I, unsigned TLSBaseAddrReg, const TargetInstrInfo *TII)
static bool runLDCleanupOnMF(MachineFunction &MF, function_ref< MachineDominatorTree *()> GetMDT)
PassT::Result & getResult(IRUnitT &IR, ExtraArgTs... ExtraArgs)
Get the result of an analysis pass for a given IR unit.
Represent the analysis usage information of a pass.
AnalysisUsage & addRequired()
LLVM_ABI void setPreservesCFG()
This function should be called by the pass, iff they do not:
Represents analyses that only rely on functions' control flow.
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.
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, RegState Flags={}, 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 PreservedAnalyses all()
Construct a special preserved set that preserves all passes.
PreservedAnalyses & preserveSet()
Mark an analysis set as preserved.
PreservedAnalyses run(MachineFunction &MF, MachineFunctionAnalysisManager &MFAM)
unsigned getNumLocalDynamicTLSAccesses() const
TargetInstrInfo - Interface to description of machine instruction set.
An efficient, type-erasing, non-owning reference to a callable.
Pass manager infrastructure for declaring and invalidating analyses.
This is an optimization pass for GlobalISel generic memory operations.
FunctionPass * createSystemZLDCleanupLegacyPass(SystemZTargetMachine &TM)
MachineInstrBuilder BuildMI(MachineFunction &MF, const MIMetadata &MIMD, const MCInstrDesc &MCID)
Builder interface. Specify how to create the initial instruction itself.
AnalysisManager< MachineFunction > MachineFunctionAnalysisManager
LLVM_ABI PreservedAnalyses getMachineFunctionPassPreservedAnalyses()
Returns the minimum set of Analyses that all machine function passes must preserve.
DomTreeNodeBase< MachineBasicBlock > MachineDomTreeNode
RelativeUniformCounterPtr ValuesPtrExpr VTableAddr Next