Nabila ABDESSAIED
2011-Apr-26 12:04 UTC
[LLVMdev] inserting a fucntion call at the end of basic bloc
2011/4/26 Duncan Sands <baldrick at free.fr>> Hi Nabila, > > > Now when i tried this pass an error says: >> Wrong type for attribute noalias >> tail call void @consume(i32 noalias 3, i32* @y) nounwind >> > > noalias is only for arguments of pointer type. You probably meant it to > be on the second argument rather than the first. I suggest you correct > your code that adds the attribute. > > Ciao, Duncan. >no my fucntion is void consume(int nb_into_bloc, int *nb_total) the second is a pointer here is how I pass the parameters Instruction* ii = i->getTerminator(); const int n = cast <int> (i->size()); ConstantInt* inValue = ConstantInt::get(Type::getInt32Ty(Context), n); std::vector<Value*> int32_16_params; int32_16_params.push_back(inValue); int32_16_params.push_back(gvar_int32_y); CallInst* int32_16 = CallInst::Create(func_consume, int32_16_params.begin(), int32_16_params.end(), "", ii); -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110426/401ffb3b/attachment.html>
Duncan Sands
2011-Apr-26 12:08 UTC
[LLVMdev] inserting a fucntion call at the end of basic bloc
Hi Nabila,> Now when i tried this pass an error says: > Wrong type for attribute noalias > tail call void @consume(i32 noalias 3, i32* @y) nounwind > > > noalias is only for arguments of pointer type. You probably meant it to > be on the second argument rather than the first. I suggest you correct > your code that adds the attribute. > > Ciao, Duncan. > > > no my fucntion is > void consume(int nb_into_bloc, int *nb_total) > the second is a pointer > here is how I pass the parameters > Instruction* ii = i->getTerminator(); > const int n = cast <int> (i->size()); > ConstantInt* inValue = ConstantInt::get(Type::getInt32Ty(Context), n); > std::vector<Value*> int32_16_params; > int32_16_params.push_back(inValue); > int32_16_params.push_back(gvar_int32_y); > CallInst* int32_16 = CallInst::Create(func_consume, int32_16_params.begin(), > int32_16_params.end(), "", ii);where did the "noalias" attribute and "tail call" (rather than "call") come from? Are you setting these yourself or running some optimization pass after your pass? Ciao, Duncan.
Nabila ABDESSAIED
2011-Apr-26 12:13 UTC
[LLVMdev] inserting a fucntion call at the end of basic bloc
2011/4/26 Duncan Sands <baldrick at free.fr>> Hi Nabila, > > Now when i tried this pass an error says: >> Wrong type for attribute noalias >> tail call void @consume(i32 noalias 3, i32* @y) nounwind >> >> >> noalias is only for arguments of pointer type. You probably meant it >> to >> be on the second argument rather than the first. I suggest you correct >> your code that adds the attribute. >> >> Ciao, Duncan. >> >> >> no my fucntion is >> void consume(int nb_into_bloc, int *nb_total) >> the second is a pointer >> here is how I pass the parameters >> Instruction* ii = i->getTerminator(); >> const int n = cast <int> (i->size()); >> ConstantInt* inValue = ConstantInt::get(Type::getInt32Ty(Context), n); >> std::vector<Value*> int32_16_params; >> int32_16_params.push_back(inValue); >> int32_16_params.push_back(gvar_int32_y); >> CallInst* int32_16 = CallInst::Create(func_consume, >> int32_16_params.begin(), >> int32_16_params.end(), "", ii); >> > > where did the "noalias" attribute and "tail call" (rather than "call") come > from? Are you setting these yourself or running some optimization pass > after > your pass? >i have written a module pass and i have compiled it and then opt -load /home/inspiron/PhdWork/llvm-2.8/Release/lib/Example.so -Example2 < hello.bc > /dev/null i get the error message Wrong type for attribute noalias tail call void @consume(i32 noalias 3, i32* @y) nounwind Broken module found, compilation aborted! 0 libLLVM-2.8.so.1 0x019bc628 Stack dump: 0. Program arguments: opt -load /home/inspiron/PhdWork/llvm-2.8/Release/lib/Example.so -Example2 1. Running pass 'Function Pass Manager' on module '<stdin>'. 2. Running pass 'Module Verifier' on function '@main' Aborted> Ciao, Duncan. >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110426/75547212/attachment.html>
Seemingly Similar Threads
- [LLVMdev] inserting a fucntion call at the end of basic bloc
- [LLVMdev] inserting a fucntion call at the end of basic bloc
- [LLVMdev] inserting a fucntion call at the end of basic bloc
- [LLVMdev] inserting a fucntion call at the end of basic bloc
- [LLVMdev] inserting a fucntion call at the end of basic bloc