From 5839bf2b3bd22689d9dd0e9de66c2dce71d130ae Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Fri, 26 Aug 2005 17:15:30 +0000 Subject: Change ConstantPoolSDNode to actually hold the Constant itself instead of putting it into the constant pool. This allows the isel machinery to create constants that it will end up deciding are not needed, without them ending up in the resultant function constant pool. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23081 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/PowerPC/PPCISelPattern.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib/Target/PowerPC/PPCISelPattern.cpp') 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(N)->getIndex(); + Tmp1 = BB->getParent()->getConstantPool()-> + getConstantPoolIndex(cast(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(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); -- cgit v1.2.3