[llvm-commits] CVS: llvm/lib/Transforms/Instrumentation/ProfilePaths/EdgeCode.cpp
Chris Lattner
lattner at cs.uiuc.edu
Tue Sep 10 20:23:06 PDT 2002
Changes in directory llvm/lib/Transforms/Instrumentation/ProfilePaths:
EdgeCode.cpp updated: 1.13 -> 1.14
---
Log message:
- Change getelementptr instruction to use long indexes instead of uint
indexes for sequential types.
---
Diffs of the changes:
Index: llvm/lib/Transforms/Instrumentation/ProfilePaths/EdgeCode.cpp
diff -u llvm/lib/Transforms/Instrumentation/ProfilePaths/EdgeCode.cpp:1.13 llvm/lib/Transforms/Instrumentation/ProfilePaths/EdgeCode.cpp:1.14
--- llvm/lib/Transforms/Instrumentation/ProfilePaths/EdgeCode.cpp:1.13 Tue Sep 10 12:03:06 2002
+++ llvm/lib/Transforms/Instrumentation/ProfilePaths/EdgeCode.cpp Tue Sep 10 20:21:29 2002
@@ -55,9 +55,9 @@
//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 @@
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 @@
//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 @@
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 @@
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 @@
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);
}
More information about the llvm-commits
mailing list