aboutsummaryrefslogtreecommitdiff
path: root/lib/Target/PowerPC/PPC32ISelSimple.cpp
diff options
context:
space:
mode:
authorNate Begeman <natebegeman@mac.com>2005-03-24 06:28:42 +0000
committerNate Begeman <natebegeman@mac.com>2005-03-24 06:28:42 +0000
commit5e9666129a0273b73f7a11fbb46acb234a8760c7 (patch)
tree1c3e46144f97ff0ed105a79b6b5787e3bb9d5d96 /lib/Target/PowerPC/PPC32ISelSimple.cpp
parent246fa6316db341a199a1992ea74c16fbb20e3f48 (diff)
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
Diffstat (limited to 'lib/Target/PowerPC/PPC32ISelSimple.cpp')
-rw-r--r--lib/Target/PowerPC/PPC32ISelSimple.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/Target/PowerPC/PPC32ISelSimple.cpp b/lib/Target/PowerPC/PPC32ISelSimple.cpp
index 53f553589a..c3675dc2cd 100644
--- a/lib/Target/PowerPC/PPC32ISelSimple.cpp
+++ b/lib/Target/PowerPC/PPC32ISelSimple.cpp
@@ -421,8 +421,7 @@ namespace {
/// 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 @@ unsigned PPC32ISel::getFixedSizedAllocaFI(AllocaInst *AI) {
/// 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 @@ void PPC32ISel::copyConstantToRegister(MachineBasicBlock *MBB,
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 @@ void PPC32ISel::copyConstantToRegister(MachineBasicBlock *MBB,
// 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);