diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2006-12-31 05:48:39 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2006-12-31 05:48:39 +0000 |
commit | c5b206b6be61d0d933b98b6af5e22f42edd48ad1 (patch) | |
tree | 9e6a1e6d3b90890de3d1464a44a7cef8d30fe1ae /lib/Transforms/Instrumentation/RSProfiling.cpp | |
parent | 05e52a1b35e7feb359a176af462591697c4d9647 (diff) |
For PR950:
This patch replaces signed integer types with signless ones:
1. [US]Byte -> Int8
2. [U]Short -> Int16
3. [U]Int -> Int32
4. [U]Long -> Int64.
5. Removal of isSigned, isUnsigned, getSignedVersion, getUnsignedVersion
and other methods related to signedness. In a few places this warranted
identifying the signedness information from other sources.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32785 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Instrumentation/RSProfiling.cpp')
-rw-r--r-- | lib/Transforms/Instrumentation/RSProfiling.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/Transforms/Instrumentation/RSProfiling.cpp b/lib/Transforms/Instrumentation/RSProfiling.cpp index b18d66befb..1553141cec 100644 --- a/lib/Transforms/Instrumentation/RSProfiling.cpp +++ b/lib/Transforms/Instrumentation/RSProfiling.cpp @@ -290,7 +290,7 @@ void GlobalRandomCounterOpt::ProcessChoicePoint(BasicBlock* bb) { CycleCounter::CycleCounter(Module& m, uint64_t resetmask) : rm(resetmask) { - F = m.getOrInsertFunction("llvm.readcyclecounter", Type::ULongTy, NULL); + F = m.getOrInsertFunction("llvm.readcyclecounter", Type::Int64Ty, NULL); } CycleCounter::~CycleCounter() {} @@ -302,11 +302,11 @@ void CycleCounter::ProcessChoicePoint(BasicBlock* bb) { CallInst* c = new CallInst(F, "rdcc", t); BinaryOperator* b = - BinaryOperator::createAnd(c, ConstantInt::get(Type::ULongTy, rm), + BinaryOperator::createAnd(c, ConstantInt::get(Type::Int64Ty, rm), "mrdcc", t); ICmpInst *s = new ICmpInst(ICmpInst::ICMP_EQ, b, - ConstantInt::get(Type::ULongTy, 0), + ConstantInt::get(Type::Int64Ty, 0), "mrdccc", t); t->setCondition(s); @@ -332,15 +332,15 @@ 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] = ConstantInt::get(Type::IntTy, CounterNum); + Indices[0] = Constant::getNullValue(Type::Int32Ty); + Indices[1] = ConstantInt::get(Type::Int32Ty, CounterNum); Constant *ElementPtr = ConstantExpr::getGetElementPtr(CounterArray, Indices); // Load, increment and store the value back. Value *OldVal = new LoadInst(ElementPtr, "OldCounter", InsertPos); profcode.insert(OldVal); Value *NewVal = BinaryOperator::createAdd(OldVal, - ConstantInt::get(Type::UIntTy, 1), + ConstantInt::get(Type::Int32Ty, 1), "NewCounter", InsertPos); profcode.insert(NewVal); profcode.insert(new StoreInst(NewVal, ElementPtr, InsertPos)); @@ -539,10 +539,10 @@ bool ProfilerRS::runOnFunction(Function& F) { bool ProfilerRS::doInitialization(Module &M) { switch (RandomMethod) { case GBV: - c = new GlobalRandomCounter(M, Type::UIntTy, (1 << 14) - 1); + c = new GlobalRandomCounter(M, Type::Int32Ty, (1 << 14) - 1); break; case GBVO: - c = new GlobalRandomCounterOpt(M, Type::UIntTy, (1 << 14) - 1); + c = new GlobalRandomCounterOpt(M, Type::Int32Ty, (1 << 14) - 1); break; case HOSTCC: c = new CycleCounter(M, (1 << 14) - 1); |