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
This commit is contained in:
Reid Spencer
2006-12-31 05:48:39 +00:00
parent 05e52a1b35
commit c5b206b6be
32 changed files with 400 additions and 521 deletions

View File

@ -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);