summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/PowerPC/PPC32ISelPattern.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-08-26 17:15:30 +0000
committerChris Lattner <sabre@nondot.org>2005-08-26 17:15:30 +0000
commitc30405e0ee1bdc26fbc8cbf63595f1bef1a2e347 (patch)
tree08a745b3b08cb5d08407c1dc97d70745f8548f79 /llvm/lib/Target/PowerPC/PPC32ISelPattern.cpp
parent7bbdae53d6a751e5c5bde99972c93f2f1e7d2822 (diff)
downloadbcm5719-llvm-c30405e0ee1bdc26fbc8cbf63595f1bef1a2e347.tar.gz
bcm5719-llvm-c30405e0ee1bdc26fbc8cbf63595f1bef1a2e347.zip
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. llvm-svn: 23081
Diffstat (limited to 'llvm/lib/Target/PowerPC/PPC32ISelPattern.cpp')
-rw-r--r--llvm/lib/Target/PowerPC/PPC32ISelPattern.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/Target/PowerPC/PPC32ISelPattern.cpp b/llvm/lib/Target/PowerPC/PPC32ISelPattern.cpp
index 3187e4a349c..7ff5eb9c13c 100644
--- a/llvm/lib/Target/PowerPC/PPC32ISelPattern.cpp
+++ b/llvm/lib/Target/PowerPC/PPC32ISelPattern.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);
OpenPOWER on IntegriCloud