diff options
Diffstat (limited to 'lib/Target/PowerPC/PPCISelPattern.cpp')
-rw-r--r-- | lib/Target/PowerPC/PPCISelPattern.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Target/PowerPC/PPCISelPattern.cpp b/lib/Target/PowerPC/PPCISelPattern.cpp index 3187e4a349..7ff5eb9c13 100644 --- a/lib/Target/PowerPC/PPCISelPattern.cpp +++ b/lib/Target/PowerPC/PPCISelPattern.cpp @@ -866,7 +866,8 @@ unsigned ISel::SelectExpr(SDOperand N, bool Recording) { return Result; case ISD::ConstantPool: - Tmp1 = cast<ConstantPoolSDNode>(N)->getIndex(); + Tmp1 = BB->getParent()->getConstantPool()-> + getConstantPoolIndex(cast<ConstantPoolSDNode>(N)->get()); Tmp2 = MakeIntReg(); if (PICEnabled) BuildMI(BB, PPC::ADDIS, 2, Tmp2).addReg(getGlobalBaseReg()) @@ -927,7 +928,8 @@ unsigned ISel::SelectExpr(SDOperand N, bool Recording) { if (ConstantPoolSDNode *CP = dyn_cast<ConstantPoolSDNode>(Address)) { Tmp1 = MakeIntReg(); - int CPI = CP->getIndex(); + unsigned CPI = BB->getParent()->getConstantPool()-> + getConstantPoolIndex(CP->get()); if (PICEnabled) BuildMI(BB, PPC::ADDIS, 2, Tmp1).addReg(getGlobalBaseReg()) .addConstantPoolIndex(CPI); |