aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/TargetMachine
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2001-09-07 21:22:57 +0000
committerChris Lattner <sabre@nondot.org>2001-09-07 21:22:57 +0000
commit1fa0c09e9deb4c680d26f304921e940cf549fe0e (patch)
treea11f6815bf911a12829b9ab0ba7f90d1b839290a /lib/CodeGen/TargetMachine
parent15dedbc585b45ede9497d2084b8d54aa5c56e6b9 (diff)
Updates to work with new lack of constant pool
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@490 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/TargetMachine')
-rw-r--r--lib/CodeGen/TargetMachine/Sparc/SparcInstrSelection.cpp27
1 files changed, 5 insertions, 22 deletions
diff --git a/lib/CodeGen/TargetMachine/Sparc/SparcInstrSelection.cpp b/lib/CodeGen/TargetMachine/Sparc/SparcInstrSelection.cpp
index 088d089d80..08dbbc5355 100644
--- a/lib/CodeGen/TargetMachine/Sparc/SparcInstrSelection.cpp
+++ b/lib/CodeGen/TargetMachine/Sparc/SparcInstrSelection.cpp
@@ -989,7 +989,7 @@ SetMemOperands_Internal(MachineInstr* minstr,
if (isConstantOffset)
{
// create a virtual register for the constant
- valueForRegOffset = new ConstPoolSInt(Type::IntTy, offset);
+ valueForRegOffset = ConstPoolSInt::get(Type::IntTy, offset);
}
}
else
@@ -1174,19 +1174,8 @@ MakeLoadConstInstr(Instruction* vmInstr,
TmpInstruction* tmpReg2 = NULL;
if (dval != 0.0)
{ // First, create an integer constant of the same value as dval
- ConstPoolSInt* ival = new ConstPoolSInt(Type::IntTy,
- (int64_t) dval);
- ConstantPool& cpool =
- vmInstr->getParent()->getParent()->getConstantPool();
- ConstPoolVal* prev = cpool.find(ival);
- if (prev == NULL)
- cpool.insert(ival);
- else
- {
- delete ival;
- ival = (ConstPoolSInt*) prev;
- }
-
+ ConstPoolSInt* ival = ConstPoolSInt::get(Type::IntTy,
+ (int64_t) dval);
// Create another TmpInstruction for the hidden integer register
TmpInstruction* tmpReg2 =
new TmpInstruction(Instruction::UserOp1, ival, NULL);
@@ -1788,10 +1777,7 @@ GetInstructionsByRule(InstructionNode* subtreeRoot,
//else go on to create the instructions needed...
// Create a temporary Value to hold the constant type-size
- ConstPoolSInt* valueForTSize = new ConstPoolSInt(Type::IntTy, tsize);
- ConstantPool &cpool = instr->getParent()->getParent()->getConstantPool();
- if (cpool.find(valueForTSize) == 0)
- cpool.insert(valueForTSize);
+ ConstPoolSInt* valueForTSize = ConstPoolSInt::get(Type::IntTy, tsize);
// Instruction 1: sub %sp, tsize -> %sp
// tsize is always constant, but it may have to be put into a
@@ -1832,10 +1818,7 @@ GetInstructionsByRule(InstructionNode* subtreeRoot,
//else go on to create the instructions needed...
// Create a temporary Value to hold the constant type-size
- ConstPoolSInt* valueForTSize = new ConstPoolSInt(Type::IntTy, tsize);
- ConstantPool &cpool = instr->getParent()->getParent()->getConstantPool();
- if (cpool.find(valueForTSize) == 0)
- cpool.insert(valueForTSize);
+ ConstPoolSInt* valueForTSize = ConstPoolSInt::get(Type::IntTy, tsize);
// Create a temporary value to hold `tmp'
Instruction* tmpInstr = new TmpInstruction(Instruction::UserOp1,