Teach TargetData to handle 'preferred' alignment for each target, and use

these alignment amounts to align scalars when we can.  Patch by Scott Michel!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33409 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2007-01-20 22:35:55 +00:00
parent c5633c235e
commit 58092e35a3
12 changed files with 365 additions and 141 deletions

View File

@ -123,7 +123,8 @@ MachineFunction::MachineFunction(const Function *F,
const TargetData &TD = *TM.getTargetData();
bool IsPic = TM.getRelocationModel() == Reloc::PIC_;
unsigned EntrySize = IsPic ? 4 : TD.getPointerSize();
unsigned Alignment = IsPic ? TD.getIntAlignment() : TD.getPointerAlignment();
unsigned Alignment = IsPic ? TD.getIntABIAlignment()
: TD.getPointerABIAlignment();
JumpTableInfo = new MachineJumpTableInfo(EntrySize, Alignment);
BasicBlocks.Parent = this;