Implement more of the PPC32 Pattern ISel:
1) dynamic stack alloc
2) loads
3) shifts
4) subtract
5) immediate form of add, and, or, xor
6) change flag from -pattern-isel to -enable-ppc-pattern-isel
Remove dead arguments from getGlobalBaseReg in the simple ISel
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20810 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/PowerPC/PPC32ISelSimple.cpp b/lib/Target/PowerPC/PPC32ISelSimple.cpp
index 53f5535..c3675dc 100644
--- a/lib/Target/PowerPC/PPC32ISelSimple.cpp
+++ b/lib/Target/PowerPC/PPC32ISelSimple.cpp
@@ -421,8 +421,7 @@
/// base address to use for accessing globals into a register. Returns the
/// register containing the base address.
///
- unsigned getGlobalBaseReg(MachineBasicBlock *MBB,
- MachineBasicBlock::iterator IP);
+ unsigned getGlobalBaseReg();
/// copyConstantToRegister - Output the instructions required to put the
/// specified constant into the specified register.
@@ -590,8 +589,7 @@
/// getGlobalBaseReg - Output the instructions required to put the
/// base address to use for accessing globals into a register.
///
-unsigned PPC32ISel::getGlobalBaseReg(MachineBasicBlock *MBB,
- MachineBasicBlock::iterator IP) {
+unsigned PPC32ISel::getGlobalBaseReg() {
if (!GlobalBaseInitialized) {
// Insert the set of GlobalBaseReg into the first MBB of the function
MachineBasicBlock &FirstMBB = F->front();
@@ -690,7 +688,7 @@
unsigned Opcode = (Ty == Type::FloatTy) ? PPC::LFS : PPC::LFD;
// Move value at base + distance into return reg
BuildMI(*MBB, IP, PPC::LOADHiAddr, 2, Reg1)
- .addReg(getGlobalBaseReg(MBB, IP)).addConstantPoolIndex(CPI);
+ .addReg(getGlobalBaseReg()).addConstantPoolIndex(CPI);
BuildMI(*MBB, IP, Opcode, 2, R).addConstantPoolIndex(CPI).addReg(Reg1);
} else if (isa<ConstantPointerNull>(C)) {
// Copy zero (null pointer) to the register.
@@ -703,7 +701,7 @@
// Move value at base + distance into return reg
BuildMI(*MBB, IP, PPC::LOADHiAddr, 2, TmpReg)
- .addReg(getGlobalBaseReg(MBB, IP)).addGlobalAddress(GV);
+ .addReg(getGlobalBaseReg()).addGlobalAddress(GV);
if (GV->hasWeakLinkage() || GV->isExternal()) {
BuildMI(*MBB, IP, PPC::LWZ, 2, R).addGlobalAddress(GV).addReg(TmpReg);