mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-14 17:34:41 +00:00
Make MachineConstantPool entries alignments explicit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26071 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
5ac38d147b
commit
948d9668a7
@ -23,6 +23,7 @@
|
||||
#include "llvm/Target/TargetInstrItineraries.h"
|
||||
#include "llvm/Target/TargetLowering.h"
|
||||
#include "llvm/Support/Debug.h"
|
||||
#include "llvm/Constant.h"
|
||||
#include <iostream>
|
||||
using namespace llvm;
|
||||
|
||||
@ -194,8 +195,17 @@ void ScheduleDAG::EmitNode(NodeInfo *NI) {
|
||||
MI->addFrameIndexOperand(FI->getIndex());
|
||||
} else if (ConstantPoolSDNode *CP =
|
||||
dyn_cast<ConstantPoolSDNode>(Node->getOperand(i))) {
|
||||
unsigned Idx = ConstPool->getConstantPoolIndex(CP->get(),
|
||||
CP->getAlignment());
|
||||
unsigned Align = CP->getAlignment();
|
||||
// MachineConstantPool wants an explicit alignment.
|
||||
if (Align == 0) {
|
||||
if (CP->get()->getType() == Type::DoubleTy)
|
||||
Align = 3; // always 8-byte align doubles.
|
||||
else
|
||||
Align = TM.getTargetData()
|
||||
.getTypeAlignmentShift(CP->get()->getType());
|
||||
}
|
||||
|
||||
unsigned Idx = ConstPool->getConstantPoolIndex(CP->get(), Align);
|
||||
MI->addConstantPoolIndexOperand(Idx);
|
||||
} else if (ExternalSymbolSDNode *ES =
|
||||
dyn_cast<ExternalSymbolSDNode>(Node->getOperand(i))) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user