36 #define DEBUG_TYPE "ppc-tls-dynamic-call"
61 if (MI.
getOpcode() != PPC::ADDItlsgdLADDR &&
63 MI.
getOpcode() != PPC::ADDItlsgdLADDR32 &&
64 MI.
getOpcode() != PPC::ADDItlsldLADDR32) {
69 DEBUG(
dbgs() <<
"TLS Dynamic Call Fixup:\n " << MI);
74 unsigned GPR3 = Is64Bit ? PPC::X3 : PPC::R3;
76 const unsigned OrigRegs[] = {OutReg, InReg, GPR3};
81 case PPC::ADDItlsgdLADDR:
82 Opc1 = PPC::ADDItlsgdL;
83 Opc2 = PPC::GETtlsADDR;
85 case PPC::ADDItlsldLADDR:
86 Opc1 = PPC::ADDItlsldL;
87 Opc2 = PPC::GETtlsldADDR;
89 case PPC::ADDItlsgdLADDR32:
90 Opc1 = PPC::ADDItlsgdL32;
91 Opc2 = PPC::GETtlsADDR32;
93 case PPC::ADDItlsldLADDR32:
94 Opc1 = PPC::ADDItlsldL32;
95 Opc2 = PPC::GETtlsldADDR32;
102 BuildMI(MBB,
I, DL,
TII->get(PPC::ADJCALLSTACKDOWN)).addImm(0);
120 BuildMI(MBB,
I, DL,
TII->get(TargetOpcode::COPY), OutReg)
132 LIS->repairIntervalsInRange(&MBB, First, Last, OrigRegs);
142 LIS = &getAnalysis<LiveIntervals>();
144 bool Changed =
false;
166 "PowerPC TLS Dynamic Call Fixup",
false,
false)
170 "PowerPC TLS Dynamic Call Fixup",
false, false)
172 char PPCTLSDynamicCall::
ID = 0;
const MachineFunction * getParent() const
Return the MachineFunction containing this basic block.
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...
void initializePPCTLSDynamicCallPass(PassRegistry &)
INITIALIZE_PASS_BEGIN(PPCTLSDynamicCall, DEBUG_TYPE,"PowerPC TLS Dynamic Call Fixup", false, false) INITIALIZE_PASS_END(PPCTLSDynamicCall
FunctionPass * createPPCTLSDynamicCallPass()
AnalysisUsage & addRequired()
#define INITIALIZE_PASS_DEPENDENCY(depName)
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
const HexagonInstrInfo * TII
const MachineInstrBuilder & addImm(int64_t Val) const
Add a new immediate operand.
static GCRegistry::Add< OcamlGC > B("ocaml","ocaml 3.10-compatible GC")
unsigned getOpcode() const
Returns the opcode of this MachineInstr.
PowerPC TLS Dynamic Call false
MachineInstrBuilder BuildMI(MachineFunction &MF, const DebugLoc &DL, const MCInstrDesc &MCID)
Builder interface. Specify how to create the initial instruction itself.
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
const MachineOperand & getOperand(unsigned i) const
Represent the analysis usage information of a pass.
INITIALIZE_PASS_END(RegBankSelect, DEBUG_TYPE,"Assign register bank of generic virtual registers", false, false) RegBankSelect
FunctionPass class - This class is used to implement most global optimizations.
#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.
const DebugLoc & getDebugLoc() const
Returns the debug location id of this MachineInstr.
Representation of each machine instruction.
MachineInstr * removeFromParent()
Unlink 'this' from the containing basic block, and return it without deleting it. ...
unsigned getReg() const
getReg - Returns the register number.
PassRegistry - This class manages the registration and intitialization of the pass subsystem as appli...