36 #define DEBUG_TYPE "ppc-tls-dynamic-call" 55 bool NeedFence =
true;
62 if (MI.
getOpcode() != PPC::ADDItlsgdLADDR &&
64 MI.
getOpcode() != PPC::ADDItlsgdLADDR32 &&
65 MI.
getOpcode() != PPC::ADDItlsldLADDR32) {
71 if (MI.
getOpcode() == PPC::ADJCALLSTACKDOWN)
73 else if (MI.
getOpcode() == PPC::ADJCALLSTACKUP)
85 unsigned GPR3 = Is64Bit ? PPC::X3 : PPC::R3;
87 const unsigned OrigRegs[] = {OutReg, InReg, GPR3};
92 case PPC::ADDItlsgdLADDR:
93 Opc1 = PPC::ADDItlsgdL;
94 Opc2 = PPC::GETtlsADDR;
96 case PPC::ADDItlsldLADDR:
97 Opc1 = PPC::ADDItlsldL;
98 Opc2 = PPC::GETtlsldADDR;
100 case PPC::ADDItlsgdLADDR32:
101 Opc1 = PPC::ADDItlsgdL32;
102 Opc2 = PPC::GETtlsADDR32;
104 case PPC::ADDItlsldLADDR32:
105 Opc1 = PPC::ADDItlsldL32;
106 Opc2 = PPC::GETtlsldADDR32;
117 BuildMI(MBB,
I, DL, TII->get(PPC::ADJCALLSTACKDOWN)).addImm(0)
135 BuildMI(MBB,
I, DL, TII->get(PPC::ADJCALLSTACKUP)).addImm(0).
addImm(0);
137 BuildMI(MBB,
I, DL, TII->get(TargetOpcode::COPY), OutReg)
159 LIS = &getAnalysis<LiveIntervals>();
161 bool Changed =
false;
183 "PowerPC TLS Dynamic Call Fixup",
false,
false)
187 "PowerPC TLS Dynamic Call Fixup",
false,
false)
189 char PPCTLSDynamicCall::
ID = 0;
AnalysisUsage & addPreserved()
Add the specified Pass class to the set of analyses preserved by this pass.
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
This class represents lattice values for constants.
void initializePPCTLSDynamicCallPass(PassRegistry &)
const DebugLoc & getDebugLoc() const
Returns the debug location id of this MachineInstr.
unsigned getReg() const
getReg - Returns the register number.
FunctionPass * createPPCTLSDynamicCallPass()
AnalysisUsage & addRequired()
#define INITIALIZE_PASS_DEPENDENCY(depName)
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
const HexagonInstrInfo * TII
unsigned getOpcode() const
Returns the opcode of this MachineInstr.
INITIALIZE_PASS_BEGIN(PPCTLSDynamicCall, DEBUG_TYPE, "PowerPC TLS Dynamic Call Fixup", false, false) INITIALIZE_PASS_END(PPCTLSDynamicCall
MachineInstrBuilder BuildMI(MachineFunction &MF, const DebugLoc &DL, const MCInstrDesc &MCID)
Builder interface. Specify how to create the initial instruction itself.
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
Represent the analysis usage information of a pass.
FunctionPass class - This class is used to implement most global optimizations.
void repairIntervalsInRange(MachineBasicBlock *MBB, MachineBasicBlock::iterator Begin, MachineBasicBlock::iterator End, ArrayRef< unsigned > OrigRegs)
Update live intervals for instructions in a range of iterators.
INITIALIZE_PASS_END(RegBankSelect, DEBUG_TYPE, "Assign register bank of generic virtual registers", false, false) RegBankSelect
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Iterator for intrusive lists based on ilist_node.
void addOperand(MachineFunction &MF, const MachineOperand &Op)
Add the specified operand to the instruction.
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
Representation of each machine instruction.
const MachineFunction * getParent() const
Return the MachineFunction containing this basic block.
const MachineInstrBuilder & addImm(int64_t Val) const
Add a new immediate operand.
MachineInstr * removeFromParent()
Unlink 'this' from the containing basic block, and return it without deleting it. ...
PassRegistry - This class manages the registration and intitialization of the pass subsystem as appli...
const MachineOperand & getOperand(unsigned i) const