parent
e64f008fe3
commit
df86f30815
|
@ -2494,8 +2494,8 @@ static void CreateCodeForVariableSizeAlloca(const TargetMachine& target,
|
||||||
numElementsVal->getType(), isValid);
|
numElementsVal->getType(), isValid);
|
||||||
assert(isValid && "Unexpectedly large array dimension in alloca!");
|
assert(isValid && "Unexpectedly large array dimension in alloca!");
|
||||||
int64_t total = numElem * tsize;
|
int64_t total = numElem * tsize;
|
||||||
if (int extra= total % target.getFrameInfo()->getStackFrameSizeAlignment())
|
if (int extra= total % SparcV9FrameInfo::StackFrameSizeAlignment)
|
||||||
total += target.getFrameInfo()->getStackFrameSizeAlignment() - extra;
|
total += SparcV9FrameInfo::StackFrameSizeAlignment - extra;
|
||||||
totalSizeVal = ConstantSInt::get(Type::IntTy, total);
|
totalSizeVal = ConstantSInt::get(Type::IntTy, total);
|
||||||
} else {
|
} else {
|
||||||
// The size is not a constant. Generate code to compute it and
|
// The size is not a constant. Generate code to compute it and
|
||||||
|
|
|
@ -7,9 +7,7 @@
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
//
|
//
|
||||||
// Interface to stack frame layout info for the UltraSPARC. Starting offsets
|
// Interface to stack frame layout info for the UltraSPARC.
|
||||||
// for each area of the stack frame are aligned at a multiple of
|
|
||||||
// getStackFrameSizeAlignment().
|
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
|
@ -57,9 +55,9 @@ SparcV9FrameInfo::getDynamicAreaOffset(MachineFunction& mcInfo, bool& pos) const
|
||||||
// dynamic-size alloca.
|
// dynamic-size alloca.
|
||||||
pos = false;
|
pos = false;
|
||||||
unsigned optArgsSize = mcInfo.getInfo()->getMaxOptionalArgsSize();
|
unsigned optArgsSize = mcInfo.getInfo()->getMaxOptionalArgsSize();
|
||||||
if (int extra = optArgsSize % getStackFrameSizeAlignment())
|
if (int extra = optArgsSize % 16)
|
||||||
optArgsSize += (getStackFrameSizeAlignment() - extra);
|
optArgsSize += (16 - extra);
|
||||||
int offset = optArgsSize + FirstOptionalOutgoingArgOffsetFromSP;
|
int offset = optArgsSize + FirstOptionalOutgoingArgOffsetFromSP;
|
||||||
assert((offset - OFFSET) % getStackFrameSizeAlignment() == 0);
|
assert((offset - OFFSET) % 16 == 0);
|
||||||
return offset;
|
return offset;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue