mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-28 04:33:05 +00:00
Instead of a virtual method call, lets try a direct constant reference
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15696 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
092ae6b5d1
commit
750d723062
@ -2575,7 +2575,7 @@ CreateCodeForFixedSizeAlloca(const TargetMachine& target,
|
|||||||
paddedSize,
|
paddedSize,
|
||||||
tsize * numElements);
|
tsize * numElements);
|
||||||
|
|
||||||
if (((int)paddedSize) > 8 * target.getFrameInfo()->getSizeOfEachArgOnStack()||
|
if (((int)paddedSize) > 8 * SparcV9FrameInfo::SizeOfEachArgOnStack ||
|
||||||
!target.getInstrInfo()->constantFitsInImmedField(V9::LDXi,offsetFromFP)) {
|
!target.getInstrInfo()->constantFitsInImmedField(V9::LDXi,offsetFromFP)) {
|
||||||
CreateCodeForVariableSizeAlloca(target, result, tsize,
|
CreateCodeForVariableSizeAlloca(target, result, tsize,
|
||||||
ConstantSInt::get(Type::IntTy,numElements),
|
ConstantSInt::get(Type::IntTy,numElements),
|
||||||
@ -3992,7 +3992,7 @@ void GetInstructionsByRule(InstructionNode* subtreeRoot, int ruleForNode,
|
|||||||
// not need to be adjusted.
|
// not need to be adjusted.
|
||||||
int argOffset = frameInfo.getOutgoingArgOffset(MF, argNo);
|
int argOffset = frameInfo.getOutgoingArgOffset(MF, argNo);
|
||||||
if (argType->isFloatingPoint()) {
|
if (argType->isFloatingPoint()) {
|
||||||
unsigned slotSize = frameInfo.getSizeOfEachArgOnStack();
|
unsigned slotSize = SparcV9FrameInfo::SizeOfEachArgOnStack;
|
||||||
assert(argSize <= slotSize && "Insufficient slot size!");
|
assert(argSize <= slotSize && "Insufficient slot size!");
|
||||||
argOffset += slotSize - argSize;
|
argOffset += slotSize - argSize;
|
||||||
}
|
}
|
||||||
@ -4132,7 +4132,7 @@ void GetInstructionsByRule(InstructionNode* subtreeRoot, int ruleForNode,
|
|||||||
Instruction* vaNextI = subtreeRoot->getInstruction();
|
Instruction* vaNextI = subtreeRoot->getInstruction();
|
||||||
assert(target.getTargetData().getTypeSize(vaNextI->getType()) <= 8 &&
|
assert(target.getTargetData().getTypeSize(vaNextI->getType()) <= 8 &&
|
||||||
"We assumed that all LLVM parameter types <= 8 bytes!");
|
"We assumed that all LLVM parameter types <= 8 bytes!");
|
||||||
int argSize = target.getFrameInfo()->getSizeOfEachArgOnStack();
|
unsigned argSize = SparcV9FrameInfo::SizeOfEachArgOnStack;
|
||||||
mvec.push_back(BuildMI(V9::ADDi, 3).addReg(vaNextI->getOperand(0)).
|
mvec.push_back(BuildMI(V9::ADDi, 3).addReg(vaNextI->getOperand(0)).
|
||||||
addSImm(argSize).addRegDef(vaNextI));
|
addSImm(argSize).addRegDef(vaNextI));
|
||||||
break;
|
break;
|
||||||
|
@ -58,8 +58,8 @@ static unsigned getStaticStackSize (MachineFunction &MF) {
|
|||||||
|
|
||||||
unsigned staticStackSize = MF.getInfo()->getStaticStackSize();
|
unsigned staticStackSize = MF.getInfo()->getStaticStackSize();
|
||||||
|
|
||||||
if (staticStackSize < (unsigned) frameInfo.getMinStackFrameSize())
|
if (staticStackSize < SparcV9FrameInfo::MinStackFrameSize)
|
||||||
staticStackSize = (unsigned) frameInfo.getMinStackFrameSize();
|
staticStackSize = SparcV9FrameInfo::MinStackFrameSize;
|
||||||
if (unsigned padsz = staticStackSize %
|
if (unsigned padsz = staticStackSize %
|
||||||
SparcV9FrameInfo::StackFrameSizeAlignment)
|
SparcV9FrameInfo::StackFrameSizeAlignment)
|
||||||
staticStackSize += SparcV9FrameInfo::StackFrameSizeAlignment - padsz;
|
staticStackSize += SparcV9FrameInfo::StackFrameSizeAlignment - padsz;
|
||||||
|
@ -25,6 +25,7 @@
|
|||||||
#include "SparcV9Internals.h"
|
#include "SparcV9Internals.h"
|
||||||
#include "SparcV9RegClassInfo.h"
|
#include "SparcV9RegClassInfo.h"
|
||||||
#include "SparcV9RegInfo.h"
|
#include "SparcV9RegInfo.h"
|
||||||
|
#include "SparcV9FrameInfo.h"
|
||||||
#include "SparcV9TargetMachine.h"
|
#include "SparcV9TargetMachine.h"
|
||||||
#include "SparcV9TmpInstr.h"
|
#include "SparcV9TmpInstr.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
@ -492,7 +493,7 @@ void SparcV9RegInfo::colorMethodArgs(const Function *Meth,
|
|||||||
// a full double-word so the offset does not need to be adjusted.
|
// a full double-word so the offset does not need to be adjusted.
|
||||||
if (regType == FPSingleRegType) {
|
if (regType == FPSingleRegType) {
|
||||||
unsigned argSize = target.getTargetData().getTypeSize(LR->getType());
|
unsigned argSize = target.getTargetData().getTypeSize(LR->getType());
|
||||||
unsigned slotSize = frameInfo.getSizeOfEachArgOnStack();
|
unsigned slotSize = SparcV9FrameInfo::SizeOfEachArgOnStack;
|
||||||
assert(argSize <= slotSize && "Insufficient slot size!");
|
assert(argSize <= slotSize && "Insufficient slot size!");
|
||||||
offsetFromFP += slotSize - argSize;
|
offsetFromFP += slotSize - argSize;
|
||||||
}
|
}
|
||||||
@ -550,7 +551,7 @@ void SparcV9RegInfo::colorMethodArgs(const Function *Meth,
|
|||||||
// a full double-word so the offset does not need to be adjusted.
|
// a full double-word so the offset does not need to be adjusted.
|
||||||
if (regType == FPSingleRegType) {
|
if (regType == FPSingleRegType) {
|
||||||
unsigned argSize = target.getTargetData().getTypeSize(LR->getType());
|
unsigned argSize = target.getTargetData().getTypeSize(LR->getType());
|
||||||
unsigned slotSize = frameInfo.getSizeOfEachArgOnStack();
|
unsigned slotSize = SparcV9FrameInfo::SizeOfEachArgOnStack;
|
||||||
assert(argSize <= slotSize && "Insufficient slot size!");
|
assert(argSize <= slotSize && "Insufficient slot size!");
|
||||||
offsetFromFP += slotSize - argSize;
|
offsetFromFP += slotSize - argSize;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user