[llvm-commits] CVS: llvm/lib/Target/IA64/IA64ISelPattern.cpp

Chris Lattner lattner at cs.uiuc.edu
Fri Aug 26 10:15:42 PDT 2005



Changes in directory llvm/lib/Target/IA64:

IA64ISelPattern.cpp updated: 1.61 -> 1.62
---
Log message:

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.



---
Diffs of the changes:  (+5 -2)

 IA64ISelPattern.cpp |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)


Index: llvm/lib/Target/IA64/IA64ISelPattern.cpp
diff -u llvm/lib/Target/IA64/IA64ISelPattern.cpp:1.61 llvm/lib/Target/IA64/IA64ISelPattern.cpp:1.62
--- llvm/lib/Target/IA64/IA64ISelPattern.cpp:1.61	Wed Aug 24 19:03:21 2005
+++ llvm/lib/Target/IA64/IA64ISelPattern.cpp	Fri Aug 26 12:15:30 2005
@@ -956,7 +956,8 @@
   }
 
   case ISD::ConstantPool: {
-    Tmp1 = cast<ConstantPoolSDNode>(N)->getIndex();
+    Tmp1 = BB->getParent()->getConstantPool()->
+          getConstantPoolIndex(cast<ConstantPoolSDNode>(N)->get());
     IA64Lowering.restoreGP(BB); // FIXME: do i really need this?
     BuildMI(BB, IA64::ADD, 2, Result).addConstantPoolIndex(Tmp1)
       .addReg(IA64::r1);
@@ -1974,10 +1975,12 @@
         BuildMI(BB, IA64::CMPNE, 2, Result).addReg(dummy3).addReg(IA64::r0);
       }
     } else if(ConstantPoolSDNode *CP = dyn_cast<ConstantPoolSDNode>(Address)) {
+      unsigned CPIdx = BB->getParent()->getConstantPool()->
+         getConstantPoolIndex(cast<ConstantPoolSDNode>(N)->get());
       Select(Chain);
       IA64Lowering.restoreGP(BB);
       unsigned dummy = MakeReg(MVT::i64);
-      BuildMI(BB, IA64::ADD, 2, dummy).addConstantPoolIndex(CP->getIndex())
+      BuildMI(BB, IA64::ADD, 2, dummy).addConstantPoolIndex(CPIdx)
         .addReg(IA64::r1); // CPI+GP
       if(!isBool)
         BuildMI(BB, Opc, 1, Result).addReg(dummy);






More information about the llvm-commits mailing list