36 #define DEBUG_TYPE "ppc-tls-dynamic-call" 51 bool NeedFence =
true;
58 if (MI.
getOpcode() != PPC::ADDItlsgdLADDR &&
60 MI.
getOpcode() != PPC::ADDItlsgdLADDR32 &&
61 MI.
getOpcode() != PPC::ADDItlsldLADDR32) {
67 if (MI.
getOpcode() == PPC::ADJCALLSTACKDOWN)
69 else if (MI.
getOpcode() == PPC::ADJCALLSTACKUP)
81 unsigned GPR3 = Is64Bit ? PPC::X3 : PPC::R3;
83 const unsigned OrigRegs[] = {OutReg, InReg, GPR3};
88 case PPC::ADDItlsgdLADDR:
89 Opc1 = PPC::ADDItlsgdL;
90 Opc2 = PPC::GETtlsADDR;
92 case PPC::ADDItlsldLADDR:
93 Opc1 = PPC::ADDItlsldL;
94 Opc2 = PPC::GETtlsldADDR;
96 case PPC::ADDItlsgdLADDR32:
97 Opc1 = PPC::ADDItlsgdL32;
98 Opc2 = PPC::GETtlsADDR32;
100 case PPC::ADDItlsldLADDR32:
101 Opc1 = PPC::ADDItlsldL32;
102 Opc2 = PPC::GETtlsldADDR32;
113 BuildMI(MBB,
I, DL, TII->get(PPC::ADJCALLSTACKDOWN)).addImm(0)
131 BuildMI(MBB,
I, DL, TII->get(PPC::ADJCALLSTACKUP)).addImm(0).
addImm(0);
133 BuildMI(MBB,
I, DL, TII->get(TargetOpcode::COPY), OutReg)
155 LIS = &getAnalysis<LiveIntervals>();
157 bool Changed =
false;
179 "PowerPC TLS Dynamic Call Fixup",
false,
false)
183 "PowerPC TLS Dynamic Call Fixup",
false,
false)
185 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.
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. ...
Register getReg() const
getReg - Returns the register number.
const MachineOperand & getOperand(unsigned i) const
Wrapper class representing virtual and physical registers.