diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2006-10-20 07:07:24 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2006-10-20 07:07:24 +0000 |
commit | b83eb6447ba155342598f0fabe1f08f5baa9164a (patch) | |
tree | a5822f5fdac89033b7b16ba8e5aaf1ae10833b1c /lib/Transforms/Instrumentation/RSProfiling.cpp | |
parent | 6e7dd9db6bf677c9161a6ecc12f90651cf1231e0 (diff) |
For PR950:
This patch implements the first increment for the Signless Types feature.
All changes pertain to removing the ConstantSInt and ConstantUInt classes
in favor of just using ConstantInt.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31063 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Instrumentation/RSProfiling.cpp')
-rw-r--r-- | lib/Transforms/Instrumentation/RSProfiling.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/lib/Transforms/Instrumentation/RSProfiling.cpp b/lib/Transforms/Instrumentation/RSProfiling.cpp index 54a9ef7003..5d6654d504 100644 --- a/lib/Transforms/Instrumentation/RSProfiling.cpp +++ b/lib/Transforms/Instrumentation/RSProfiling.cpp @@ -188,10 +188,10 @@ static void getBackEdges(Function& F, T& BackEdges); GlobalRandomCounter::GlobalRandomCounter(Module& M, const Type* t, uint64_t resetval) : T(t) { + ConstantInt* Init = ConstantInt::get(T, resetval); + ResetValue = Init; Counter = new GlobalVariable(T, false, GlobalValue::InternalLinkage, - ConstantUInt::get(T, resetval), - "RandomSteeringCounter", &M); - ResetValue = ConstantUInt::get(T, resetval); + Init, "RandomSteeringCounter", &M); } GlobalRandomCounter::~GlobalRandomCounter() {} @@ -205,7 +205,7 @@ void GlobalRandomCounter::ProcessChoicePoint(BasicBlock* bb) { LoadInst* l = new LoadInst(Counter, "counter", t); SetCondInst* s = new SetCondInst(Instruction::SetEQ, l, - ConstantUInt::get(T, 0), + ConstantInt::get(T, 0), "countercc", t); Value* nv = BinaryOperator::createSub(l, ConstantInt::get(T, 1), "counternew", t); @@ -225,10 +225,10 @@ void GlobalRandomCounter::ProcessChoicePoint(BasicBlock* bb) { GlobalRandomCounterOpt::GlobalRandomCounterOpt(Module& M, const Type* t, uint64_t resetval) : AI(0), T(t) { + ConstantInt* Init = ConstantInt::get(T, resetval); + ResetValue = Init; Counter = new GlobalVariable(T, false, GlobalValue::InternalLinkage, - ConstantUInt::get(T, resetval), - "RandomSteeringCounter", &M); - ResetValue = ConstantUInt::get(T, resetval); + Init, "RandomSteeringCounter", &M); } GlobalRandomCounterOpt::~GlobalRandomCounterOpt() {} @@ -278,7 +278,7 @@ void GlobalRandomCounterOpt::ProcessChoicePoint(BasicBlock* bb) { LoadInst* l = new LoadInst(AI, "counter", t); SetCondInst* s = new SetCondInst(Instruction::SetEQ, l, - ConstantUInt::get(T, 0), + ConstantInt::get(T, 0), "countercc", t); Value* nv = BinaryOperator::createSub(l, ConstantInt::get(T, 1), "counternew", t); @@ -309,11 +309,11 @@ void CycleCounter::ProcessChoicePoint(BasicBlock* bb) { CallInst* c = new CallInst(F, "rdcc", t); BinaryOperator* b = - BinaryOperator::createAnd(c, ConstantUInt::get(Type::ULongTy, rm), + BinaryOperator::createAnd(c, ConstantInt::get(Type::ULongTy, rm), "mrdcc", t); SetCondInst* s = new SetCondInst(Instruction::SetEQ, b, - ConstantUInt::get(Type::ULongTy, 0), + ConstantInt::get(Type::ULongTy, 0), "mrdccc", t); t->setCondition(s); } @@ -339,7 +339,7 @@ void RSProfilers_std::IncrementCounterInBlock(BasicBlock *BB, unsigned CounterNu // Create the getelementptr constant expression std::vector<Constant*> Indices(2); Indices[0] = Constant::getNullValue(Type::IntTy); - Indices[1] = ConstantSInt::get(Type::IntTy, CounterNum); + Indices[1] = ConstantInt::get(Type::IntTy, CounterNum); Constant *ElementPtr = ConstantExpr::getGetElementPtr(CounterArray, Indices); // Load, increment and store the value back. |