mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-23 02:32:11 +00:00
Eliminate another common source of moves that the register allocator
shouldn't be forced to coalesce for us: folded GEP operations. This too fires thousands of times across the testsuite. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17947 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
1f5308e5b5
commit
db869aad8c
@ -3834,8 +3834,6 @@ void PPC32ISel::emitGEPOperation(MachineBasicBlock *MBB,
|
|||||||
// We now have a base register, an index register, and possibly a constant
|
// We now have a base register, an index register, and possibly a constant
|
||||||
// remainder. If the GEP is going to be folded, we try to generate the
|
// remainder. If the GEP is going to be folded, we try to generate the
|
||||||
// optimal addressing mode.
|
// optimal addressing mode.
|
||||||
unsigned TargetReg = getReg(GEPI, MBB, IP);
|
|
||||||
unsigned basePtrReg = getReg(Src, MBB, IP);
|
|
||||||
ConstantSInt *remainder = ConstantSInt::get(Type::IntTy, constValue);
|
ConstantSInt *remainder = ConstantSInt::get(Type::IntTy, constValue);
|
||||||
|
|
||||||
// If we are emitting this during a fold, copy the current base register to
|
// If we are emitting this during a fold, copy the current base register to
|
||||||
@ -3853,14 +3851,15 @@ void PPC32ISel::emitGEPOperation(MachineBasicBlock *MBB,
|
|||||||
indexReg = TmpReg;
|
indexReg = TmpReg;
|
||||||
remainder = 0;
|
remainder = 0;
|
||||||
}
|
}
|
||||||
BuildMI (*MBB, IP, PPC::OR, 2, TargetReg).addReg(basePtrReg)
|
unsigned basePtrReg = getReg(Src, MBB, IP);
|
||||||
.addReg(basePtrReg);
|
GEPMap[GEPI] = FoldedGEP(basePtrReg, indexReg, remainder);
|
||||||
GEPMap[GEPI] = FoldedGEP(TargetReg, indexReg, remainder);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// We're not folding, so collapse the base, index, and any remainder into the
|
// We're not folding, so collapse the base, index, and any remainder into the
|
||||||
// destination register.
|
// destination register.
|
||||||
|
unsigned TargetReg = getReg(GEPI, MBB, IP);
|
||||||
|
unsigned basePtrReg = getReg(Src, MBB, IP);
|
||||||
if (indexReg != 0) {
|
if (indexReg != 0) {
|
||||||
unsigned TmpReg = makeAnotherReg(Type::IntTy);
|
unsigned TmpReg = makeAnotherReg(Type::IntTy);
|
||||||
BuildMI(*MBB, IP, PPC::ADD, 2, TmpReg).addReg(indexReg).addReg(basePtrReg);
|
BuildMI(*MBB, IP, PPC::ADD, 2, TmpReg).addReg(indexReg).addReg(basePtrReg);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user