27#define DEBUG_TYPE "x86-cleanup-local-dynamic-tls"
37 return "Local Dynamic TLS Access Clean-up";
50char X86CleanupLocalDynamicTLSLegacy::ID = 0;
53 return new X86CleanupLocalDynamicTLSLegacy();
62 const bool is64Bit = STI.is64Bit();
67 BuildMI(*
I.getParent(),
I,
I.getDebugLoc(),
TII->get(TargetOpcode::COPY),
82 const bool is64Bit = STI.is64Bit();
87 *TLSBaseAddrReg =
RegInfo.createVirtualRegister(
is64Bit ? &X86::GR64RegClass
88 : &X86::GR32RegClass);
93 TII->get(TargetOpcode::COPY), *TLSBaseAddrReg)
111 switch (
I->getOpcode()) {
112 case X86::TLS_base_addr32:
113 case X86::TLS_base_addr64:
145bool X86CleanupLocalDynamicTLSLegacy::runOnMachineFunction(
150 MachineDominatorTree &DT =
151 getAnalysis<MachineDominatorTreeWrapperPass>().getDomTree();
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
const HexagonInstrInfo * TII
static MachineInstr * ReplaceTLSBaseAddrCall(MachineInstr &I, Register TLSBaseAddrReg)
static bool VisitNode(MachineDomTreeNode *Node, Register TLSBaseAddrReg)
static bool cleanupLocalDynamicTLS(MachineDominatorTree &DT)
static bool shouldSkipLocalDynamicTLS(MachineFunction &MF)
static MachineInstr * SetRegister(MachineInstr &I, Register *TLSBaseAddrReg)
static bool is64Bit(const char *name)
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.
MachineInstrBundleIterator< MachineInstr > iterator
Analysis pass which computes a MachineDominatorTree.
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.
Wrapper class representing virtual and physical registers.
StringRef - Represent a constant reference to a string, i.e.
PreservedAnalyses run(MachineFunction &MF, MachineFunctionAnalysisManager &MFAM)
X86MachineFunctionInfo - This class is derived from MachineFunction and contains private X86 target-s...
unsigned getNumLocalDynamicTLSAccesses() const
const X86InstrInfo * getInstrInfo() const override
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.
AnalysisManager< MachineFunction > MachineFunctionAnalysisManager
LLVM_ABI PreservedAnalyses getMachineFunctionPassPreservedAnalyses()
Returns the minimum set of Analyses that all machine function passes must preserve.
DomTreeNodeBase< MachineBasicBlock > MachineDomTreeNode
FunctionPass * createCleanupLocalDynamicTLSLegacyPass()
FunctionAddr VTableAddr Next