summaryrefslogtreecommitdiff
path: root/lib/Transforms/Instrumentation
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2006-10-20 07:07:24 +0000
committerReid Spencer <rspencer@reidspencer.com>2006-10-20 07:07:24 +0000
commitb83eb6447ba155342598f0fabe1f08f5baa9164a (patch)
treea5822f5fdac89033b7b16ba8e5aaf1ae10833b1c /lib/Transforms/Instrumentation
parent6e7dd9db6bf677c9161a6ecc12f90651cf1231e0 (diff)
downloadllvm-b83eb6447ba155342598f0fabe1f08f5baa9164a.tar.gz
llvm-b83eb6447ba155342598f0fabe1f08f5baa9164a.tar.bz2
llvm-b83eb6447ba155342598f0fabe1f08f5baa9164a.tar.xz
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')
-rw-r--r--lib/Transforms/Instrumentation/EmitFunctions.cpp2
-rw-r--r--lib/Transforms/Instrumentation/ProfilingUtils.cpp4
-rw-r--r--lib/Transforms/Instrumentation/RSProfiling.cpp22
-rw-r--r--lib/Transforms/Instrumentation/TraceBasicBlocks.cpp2
4 files changed, 15 insertions, 15 deletions
diff --git a/lib/Transforms/Instrumentation/EmitFunctions.cpp b/lib/Transforms/Instrumentation/EmitFunctions.cpp
index 05c3419e29..b4523257af 100644
--- a/lib/Transforms/Instrumentation/EmitFunctions.cpp
+++ b/lib/Transforms/Instrumentation/EmitFunctions.cpp
@@ -110,7 +110,7 @@ bool EmitFunctionTable::runOnModule(Module &M){
M.getGlobalList().push_back(funcArray);
- ConstantInt *cnst = ConstantSInt::get(Type::IntTy, counter);
+ ConstantInt *cnst = ConstantInt::get(Type::IntTy, counter);
GlobalVariable *fnCount = new GlobalVariable(Type::IntTy, true,
GlobalValue::ExternalLinkage,
cnst, "llvmFunctionCount");
diff --git a/lib/Transforms/Instrumentation/ProfilingUtils.cpp b/lib/Transforms/Instrumentation/ProfilingUtils.cpp
index 82e7ae7ba1..4c31793f42 100644
--- a/lib/Transforms/Instrumentation/ProfilingUtils.cpp
+++ b/lib/Transforms/Instrumentation/ProfilingUtils.cpp
@@ -51,7 +51,7 @@ void llvm::InsertProfilingInitCall(Function *MainFn, const char *FnName,
// pass null.
Args[2] = ConstantPointerNull::get(UIntPtr);
}
- Args[3] = ConstantUInt::get(Type::UIntTy, NumElements);
+ Args[3] = ConstantInt::get(Type::UIntTy, NumElements);
Instruction *InitCall = new CallInst(InitFn, Args, "newargc", InsertPos);
@@ -96,7 +96,7 @@ void llvm::IncrementCounterInBlock(BasicBlock *BB, unsigned CounterNum,
// 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.
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.
diff --git a/lib/Transforms/Instrumentation/TraceBasicBlocks.cpp b/lib/Transforms/Instrumentation/TraceBasicBlocks.cpp
index d3af056ffc..8bf6001053 100644
--- a/lib/Transforms/Instrumentation/TraceBasicBlocks.cpp
+++ b/lib/Transforms/Instrumentation/TraceBasicBlocks.cpp
@@ -49,7 +49,7 @@ static void InsertInstrumentationCall (BasicBlock *BB,
Function *InstrFn = M.getOrInsertFunction (FnName, Type::VoidTy,
Type::UIntTy, (Type *)0);
std::vector<Value*> Args (1);
- Args[0] = ConstantUInt::get (Type::UIntTy, BBNumber);
+ Args[0] = ConstantInt::get (Type::UIntTy, BBNumber);
// Insert the call after any alloca or PHI instructions...
BasicBlock::iterator InsertPos = BB->begin();