diff --git a/llvm/lib/Target/SparcV9/SparcV9BurgISel.cpp b/llvm/lib/Target/SparcV9/SparcV9BurgISel.cpp index fd03641786be..1c03a9eb869c 100644 --- a/llvm/lib/Target/SparcV9/SparcV9BurgISel.cpp +++ b/llvm/lib/Target/SparcV9/SparcV9BurgISel.cpp @@ -1139,7 +1139,8 @@ void CreateCodeToLoadConst(const TargetMachine& target, Function* F, // Get the constant pool index for this constant MachineConstantPool *CP = MachineFunction::get(F).getConstantPool(); Constant *C = cast(val); - unsigned CPI = CP->getConstantPoolIndex(C); + unsigned Align = target.getTargetData().getTypeAlignmentShift(C->getType()); + unsigned CPI = CP->getConstantPoolIndex(C, Align); // Put the address of the constant into a register MachineInstr* MI;