TargetData doesn't know the alignment of vectors :(

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26884 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2006-03-20 01:51:46 +00:00
parent abdff1ee6d
commit 54a30b9639

View File

@ -20,6 +20,7 @@
#include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetInstrInfo.h"
#include "llvm/Target/TargetLowering.h"
#include "llvm/Support/MathExtras.h"
using namespace llvm;
@ -124,9 +125,15 @@ void ScheduleDAG::AddOperand(MachineInstr *MI, SDOperand Op,
if (Align == 0) {
if (CP->get()->getType() == Type::DoubleTy)
Align = 3; // always 8-byte align doubles.
else
else {
Align = TM.getTargetData()
.getTypeAlignmentShift(CP->get()->getType());
if (Align == 0) {
// Alignment of packed types. FIXME!
Align = TM.getTargetData().getTypeSize(CP->get()->getType());
Align = Log2_64(Align);
}
}
}
unsigned Idx = ConstPool->getConstantPoolIndex(CP->get(), Align);