mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-03-09 11:32:48 +00:00
Align doubles on 8-byte boundaries if possible.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21993 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
0db07092a7
commit
a8217e3000
@ -140,6 +140,15 @@ FunctionLoweringInfo::FunctionLoweringInfo(TargetLowering &tli,
|
|||||||
const Type *Ty = AI->getAllocatedType();
|
const Type *Ty = AI->getAllocatedType();
|
||||||
uint64_t TySize = TLI.getTargetData().getTypeSize(Ty);
|
uint64_t TySize = TLI.getTargetData().getTypeSize(Ty);
|
||||||
unsigned Align = TLI.getTargetData().getTypeAlignment(Ty);
|
unsigned Align = TLI.getTargetData().getTypeAlignment(Ty);
|
||||||
|
|
||||||
|
// If the alignment of the value is smaller than the size of the value,
|
||||||
|
// and if the size of the value is particularly small (<= 8 bytes),
|
||||||
|
// round up to the size of the value for potentially better performance.
|
||||||
|
//
|
||||||
|
// FIXME: This could be made better with a preferred alignment hook in
|
||||||
|
// TargetData. It serves primarily to 8-byte align doubles for X86.
|
||||||
|
if (Align < TySize && TySize <= 8) Align = TySize;
|
||||||
|
|
||||||
TySize *= CUI->getValue(); // Get total allocated size.
|
TySize *= CUI->getValue(); // Get total allocated size.
|
||||||
StaticAllocaMap[AI] =
|
StaticAllocaMap[AI] =
|
||||||
MF.getFrameInfo()->CreateStackObject((unsigned)TySize, Align);
|
MF.getFrameInfo()->CreateStackObject((unsigned)TySize, Align);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user