aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/PowerPC/PPC32ISelSimple.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Target/PowerPC/PPC32ISelSimple.cpp')
-rw-r--r--lib/Target/PowerPC/PPC32ISelSimple.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/Target/PowerPC/PPC32ISelSimple.cpp b/lib/Target/PowerPC/PPC32ISelSimple.cpp
index c4babe0..83ace16 100644
--- a/lib/Target/PowerPC/PPC32ISelSimple.cpp
+++ b/lib/Target/PowerPC/PPC32ISelSimple.cpp
@@ -3835,18 +3835,19 @@ void PPC32ISel::emitGEPOperation(MachineBasicBlock *MBB,
unsigned TargetReg = getReg(GEPI, MBB, IP);
unsigned basePtrReg = getReg(Src, MBB, IP);
- if ((indexReg == 0) && remainder->isNullValue())
- RegMap[GEPI] = basePtrReg;
-
+ if ((indexReg == 0) && remainder->isNullValue()) {
+ BuildMI(*MBB, IP, PPC::OR, 2, TargetReg).addReg(basePtrReg)
+ .addReg(basePtrReg);
+ return;
+ }
if (!remainder->isNullValue()) {
unsigned TmpReg = (indexReg == 0) ? TargetReg : makeAnotherReg(Type::IntTy);
emitBinaryConstOperation(MBB, IP, basePtrReg, remainder, 0, TmpReg);
basePtrReg = TmpReg;
}
- if (indexReg != 0) {
+ if (indexReg != 0)
BuildMI(*MBB, IP, PPC::ADD, 2, TargetReg).addReg(indexReg)
.addReg(basePtrReg);
- }
}
/// visitAllocaInst - If this is a fixed size alloca, allocate space from the