aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2001-09-07 16:43:22 +0000
committerChris Lattner <sabre@nondot.org>2001-09-07 16:43:22 +0000
commitb70d82fb396b83f54d75540bdb41f236d4c001cd (patch)
tree8c24a30b1e30acb304362a540ede5efeb2755d71 /lib
parent78721d54186cad8db817bad13360dad286524945 (diff)
downloadexternal_llvm-b70d82fb396b83f54d75540bdb41f236d4c001cd.zip
external_llvm-b70d82fb396b83f54d75540bdb41f236d4c001cd.tar.gz
external_llvm-b70d82fb396b83f54d75540bdb41f236d4c001cd.tar.bz2
* Eliminate reference to ConstantPool class
* Constants are global objects that are not allocated or freed git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@456 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Transforms/Scalar/SCCP.cpp21
1 files changed, 7 insertions, 14 deletions
diff --git a/lib/Transforms/Scalar/SCCP.cpp b/lib/Transforms/Scalar/SCCP.cpp
index f1f8d77..268b654 100644
--- a/lib/Transforms/Scalar/SCCP.cpp
+++ b/lib/Transforms/Scalar/SCCP.cpp
@@ -20,7 +20,6 @@
#include "llvm/Method.h"
#include "llvm/BasicBlock.h"
#include "llvm/ConstPoolVals.h"
-#include "llvm/ConstantPool.h"
#include "llvm/InstrTypes.h"
#include "llvm/iOther.h"
#include "llvm/iMemory.h"
@@ -63,7 +62,7 @@ public:
ConstantVal = V;
return true;
} else {
- assert(ConstantVal->equals(V) && "Marking constant with different value");
+ assert(ConstantVal == V && "Marking constant with different value");
}
return false;
}
@@ -257,7 +256,7 @@ bool SCCP::doSCCP() {
// The new constant inherits the old name of the operator...
if (Inst->hasName() && !Const->hasName())
- Const->setName(Inst->getName());
+ Const->setName(Inst->getName(), M->getSymbolTableSure());
// Delete the operator now...
delete Inst;
@@ -281,7 +280,7 @@ bool SCCP::doSCCP() {
// introduced constants that already exist, and we don't want to pollute later
// stages with extraneous constants.
//
- return MadeChanges | opt::DoConstantPoolMerging(M->getConstantPool());
+ return MadeChanges;
}
@@ -340,7 +339,7 @@ void SCCP::UpdateInstruction(Instruction *I) {
// can continue on.
// Check to see if there are two different constants merging...
- if (!IV.getConstant()->equals(OperandIV->getConstant())) {
+ if (IV.getConstant() != OperandIV->getConstant()) {
// Yes there is. This means the PHI node is not constant.
// You must be overdefined poor PHI.
//
@@ -411,7 +410,7 @@ void SCCP::UpdateInstruction(Instruction *I) {
ConstPoolVal *CPV = SCValue.getConstant();
// Make sure to skip the "default value" which isn't a value
for (unsigned i = 1, E = SI->getNumSuccessors(); i != E; ++i) {
- if (SI->getSuccessorValue(i)->equals(CPV)) {// Found the right branch...
+ if (SI->getSuccessorValue(i) == CPV) {// Found the right branch...
markExecutable(SI->getSuccessor(i));
return;
}
@@ -447,10 +446,7 @@ void SCCP::UpdateInstruction(Instruction *I) {
VState.getConstant());
if (Result) {
- // This instruction constant folds! The only problem is that the value
- // returned is newly allocated. Make sure to stick it into the methods
- // constant pool...
- M->getConstantPool().insert(Result);
+ // This instruction constant folds!
markConstant(I, Result);
} else {
markOverdefined(I); // Don't know how to fold this instruction. :(
@@ -477,10 +473,7 @@ void SCCP::UpdateInstruction(Instruction *I) {
V1State.getConstant(),
V2State.getConstant());
if (Result) {
- // This instruction constant folds! The only problem is that the value
- // returned is newly allocated. Make sure to stick it into the methods
- // constant pool...
- M->getConstantPool().insert(Result);
+ // This instruction constant folds!
markConstant(I, Result);
} else {
markOverdefined(I); // Don't know how to fold this instruction. :(