summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Instrumentation
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-09-11 01:21:29 +0000
committerChris Lattner <sabre@nondot.org>2002-09-11 01:21:29 +0000
commitb9d9e0ff8d4c5c505212448109bf5d2825bde9c5 (patch)
treefab69a4559ca37b5c42a7abeec662b8483a3956e /llvm/lib/Transforms/Instrumentation
parent236c129844ba239227ea5e96b7ca8c05f54f515e (diff)
downloadbcm5719-llvm-b9d9e0ff8d4c5c505212448109bf5d2825bde9c5.tar.gz
bcm5719-llvm-b9d9e0ff8d4c5c505212448109bf5d2825bde9c5.zip
- Change getelementptr instruction to use long indexes instead of uint
indexes for sequential types. llvm-svn: 3681
Diffstat (limited to 'llvm/lib/Transforms/Instrumentation')
-rw-r--r--llvm/lib/Transforms/Instrumentation/ProfilePaths/EdgeCode.cpp22
-rw-r--r--llvm/lib/Transforms/Instrumentation/TraceValues.cpp2
2 files changed, 10 insertions, 14 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/ProfilePaths/EdgeCode.cpp b/llvm/lib/Transforms/Instrumentation/ProfilePaths/EdgeCode.cpp
index 2e5c0e7ffe6..b8edb2260ad 100644
--- a/llvm/lib/Transforms/Instrumentation/ProfilePaths/EdgeCode.cpp
+++ b/llvm/lib/Transforms/Instrumentation/ProfilePaths/EdgeCode.cpp
@@ -55,9 +55,9 @@ static void getTriggerCode(Module *M, BasicBlock *BB, int MethNo, Value *pathNo,
//M->getGlobalList().push_back(gbl);
- vector<Value *> elargs;
- elargs.push_back(ConstantUInt::get(Type::UIntTy, 0));
- elargs.push_back(ConstantUInt::get(Type::UIntTy, 0));
+ //vector<Value *> elargs;
+ //elargs.push_back(ConstantSInt::get(Type::LongTy, 0));
+ //elargs.push_back(ConstantSInt::get(Type::LongTy, 0));
// commented out bb name frm which its called
//Instruction *getElmntInst=new GetElementPtrInst(gbl,elargs,"elmntInst");
@@ -119,7 +119,7 @@ void getEdgeCode::getCode(Instruction *rInst,
assert(inc>=0 && inc<=numPaths && "inc out of bound!");
Instruction *Idx = new GetElementPtrInst(countInst,
- vector<Value*>(1,ConstantUInt::get(Type::UIntTy, inc)),
+ vector<Value*>(1,ConstantSInt::get(Type::LongTy, inc)),
"", InsertPos);
Instruction *ldInst=new LoadInst(Idx, "ti1", InsertPos);
@@ -154,7 +154,7 @@ void getEdgeCode::getCode(Instruction *rInst,
//now load count[addIndex]
Instruction *castInst=new CastInst(addIndex,
- Type::UIntTy,"ctin", InsertPos);
+ Type::LongTy,"ctin", InsertPos);
Instruction *Idx = new GetElementPtrInst(countInst,
vector<Value*>(1,castInst), "",
InsertPos);
@@ -184,7 +184,7 @@ void getEdgeCode::getCode(Instruction *rInst,
Instruction *ldIndex=new LoadInst(rInst, "ti1", InsertPos);
//now load count[addIndex]
- Instruction *castInst2=new CastInst(ldIndex, Type::UIntTy,"ctin",InsertPos);
+ Instruction *castInst2=new CastInst(ldIndex, Type::LongTy,"ctin",InsertPos);
Instruction *Idx = new GetElementPtrInst(countInst,
vector<Value*>(1,castInst2), "",
InsertPos);
@@ -236,10 +236,6 @@ void insertInTopBB(BasicBlock *front,
Value *Int0 = ConstantInt::get(Type::IntTy, 0);
- //store uint 0, uint *%R, uint 0
- vector<Value *> idx;
- idx.push_back(ConstantUInt::get(Type::UIntTy, 0));
-
//now push all instructions in front of the BB
BasicBlock::iterator here=front->begin();
front->getInstList().insert(here, rVar);
@@ -249,13 +245,13 @@ void insertInTopBB(BasicBlock *front,
for (int i=0;i<k; i++){
Value *GEP2 = new GetElementPtrInst(countVar,
- vector<Value *>(1,ConstantUInt::get(Type::UIntTy, i)),
+ vector<Value *>(1,ConstantSInt::get(Type::LongTy, i)),
"", here);
new StoreInst(Int0, GEP2, here);
}
- Instruction *GEP = new GetElementPtrInst(rVar, idx, "", here);
- new StoreInst(Int0, GEP, here);
+ //store uint 0, uint *%R
+ new StoreInst(Int0, rVar, here);
}
diff --git a/llvm/lib/Transforms/Instrumentation/TraceValues.cpp b/llvm/lib/Transforms/Instrumentation/TraceValues.cpp
index f3fc7ba3227..5abfe272387 100644
--- a/llvm/lib/Transforms/Instrumentation/TraceValues.cpp
+++ b/llvm/lib/Transforms/Instrumentation/TraceValues.cpp
@@ -226,7 +226,7 @@ static void InsertPrintInst(Value *V, BasicBlock *BB, Instruction *InsertBefore,
// Turn the format string into an sbyte *
Instruction *GEP =
new GetElementPtrInst(fmtVal,
- vector<Value*>(2,ConstantUInt::get(Type::UIntTy, 0)),
+ vector<Value*>(2,ConstantSInt::get(Type::LongTy, 0)),
"trstr", InsertBefore);
// Insert a call to the hash function if this is a pointer value
OpenPOWER on IntegriCloud