search for: argx

Displaying 20 results from an estimated 27 matches for "argx".

Did you mean: arg
2007 Jan 23
2
[LLVMdev] Semi-random crashes seemingly related to Arguments
...ts, for example crashes or non-crashes depending on wether they had a name set or not (all combinations of these two parameters), but those seem to be quiescent at the time. Any ideas? Thanks, Marcel ------- my weird code.m ------------ -argumentAtIndex:(int)argIndex { Argument *ArgX; if ( argIndex < numArgs ) { int i; ArgX = ((Function*)function)->arg_begin(); for (i=0 ;i<argIndex;i++) { ++ArgX; } [NSString stringWithFormat:@"get argument[%d/%d]...
2011 Jun 18
1
[LLVMdev] loop only executes once
...h I've hit the wall already writing an iterative Fibonacci function. While I think the module dump looks ok it doesn't work for any input > 2 the function returns 2, the loop only executes once Hopefully someone can see what the problem is from the output and the source. Does the input ArgX require to be cast? Cheers module dump verifying module ; ModuleID = 'test fib' define fastcc i32 @fib2(i32 %ArgX) { EntryBlock: %A = alloca i32 %B = alloca i32 %C = alloca i32 %D = alloca i32 store i32 1, i32* %A store i32 1, i32* %B store i32 0, i32* %C store i32 %A...
2007 Jan 23
0
[LLVMdev] Semi-random crashes seemingly related to Arguments
...on wether they had a name set or not > (all combinations of these two parameters), but those seem to be > quiescent at the time. Any ideas? > > Thanks, > > Marcel > > > ------- my weird code.m ------------ > -argumentAtIndex:(int)argIndex > { > Argument *ArgX; > if ( argIndex < numArgs ) { > int i; > ArgX = ((Function*)function)->arg_begin(); > for (i=0 ;i<argIndex;i++) { > ++ArgX; > } > > [NSString stringWithF...
2012 Feb 01
1
[LLVMdev] Function Insertion Error
...unc =  cast<Function>(M.getOrInsertFunction("func", ty,Type::getInt32Ty(M.getContext()),  (Type *)0));        BasicBlock *BB = BasicBlock::Create(M.getContext(), "bb1", func);       IRBuilder<> builder(BB);        Value *One = builder.getInt32(1);       Argument *ArgX = func->arg_begin();          ArgX->setName("firstarg");                  Value *Add = builder.CreateAdd(One, ArgX);      builder.CreateRet(Add);     return true;     }   }; }   char FunctionInsert::ID = 0; static RegisterPass<FunctionInsert> X("FunctionInsert&qu...
2004 Aug 17
5
[LLVMdev] JIT API example (fibonacci)
...et(Type::IntTy, 1); > > Value *Two = ConstantSInt::get(Type::IntTy, 2); > > > > // Get pointers to the integer argument of the add1 function... > > assert(FibF->abegin() != FibF->aend()); // Make sure there's an arg > > > > Argument &ArgX = FibF->afront(); // Get the arg > > ArgX.setName("AnArg"); // Give it a nice symbolic name for fun. > > > > SetCondInst* CondInst > > = new SetCondInst( Instruction::SetLE, > > &ArgX, Two ); > > > > BB-&gt...
2004 Aug 17
4
[LLVMdev] JIT API example (fibonacci)
Hi LLVMers, the example attached I have used to prove that JIT and some visible optimizations are really invoked. Proved OK. I got 30% speed-up in comparison to gcc 3.3.3 on my Athlon XP 1500. Nice. P.S. guys, no fears, I don't plan to flood the cvs repository with my "brilliant" examples ;) --- Valery A.Khamenya -------------- next part -------------- An
2004 Aug 17
0
[LLVMdev] JIT API example (fibonacci)
...Value *One = ConstantSInt::get(Type::IntTy, 1); > Value *Two = ConstantSInt::get(Type::IntTy, 2); > > // Get pointers to the integer argument of the add1 function... > assert(FibF->abegin() != FibF->aend()); // Make sure there's an arg > > Argument &ArgX = FibF->afront(); // Get the arg > ArgX.setName("AnArg"); // Give it a nice symbolic name for fun. > > SetCondInst* CondInst > = new SetCondInst( Instruction::SetLE, > &ArgX, Two ); > > BB->getInstList().push_back(CondIn...
2004 Aug 17
0
[LLVMdev] JIT API example (fibonacci)
..., 1); >>> Value *Two = ConstantSInt::get(Type::IntTy, 2); >>> >>> // Get pointers to the integer argument of the add1 function... >>> assert(FibF->abegin() != FibF->aend()); // Make sure there's an arg >>> >>> Argument &ArgX = FibF->afront(); // Get the arg >>> ArgX.setName("AnArg"); // Give it a nice symbolic name for fun. >>> >>> SetCondInst* CondInst >>> = new SetCondInst( Instruction::SetLE, >>> &ArgX, Two ); >>> >&g...
2004 Aug 18
1
[LLVMdev] JIT API example (fibonacci)
...ue *Two = ConstantSInt::get(Type::IntTy, 2); > >>> > >>> // Get pointers to the integer argument of the add1 function... > >>> assert(FibF->abegin() != FibF->aend()); // Make sure there's an arg > >>> > >>> Argument &ArgX = FibF->afront(); // Get the arg > >>> ArgX.setName("AnArg"); // Give it a nice symbolic name for fun. > >>> > >>> SetCondInst* CondInst > >>> = new SetCondInst( Instruction::SetLE, > >>> &ArgX, T...
2007 Nov 25
2
[LLVMdev] Fibonacci example in OCaml
...the Fibonacci example into OCaml: open Printf open Llvm let build_fib m = let fibf = define_function "fib" (function_type i32_type [| i32_type |]) m in let bb = builder_at_end (entry_block fibf) in let one = const_int i32_type 1 and two = const_int i32_type 2 in let argx = param fibf 0 in set_value_name "AnArg" argx; let retbb = append_block "return" fibf in let retb = builder_at_end retbb in let recursebb = append_block "recurse" fibf in let recurseb = builder_at_end recursebb in let condinst = build_icmp Icmp_sle...
2005 Jan 11
2
[LLVMdev] Loop IR insertion
Hi, I am trying to insert a Loop IR into the existed bytecode file. insertion part by C code, char *p[n]; // pointer array for storing the address of strings int i; for(i=0;i<n;i++){ (p[i])[2] = (p[i])[2] ^ 0x27; } My questions are 1. for local variable 'char *p[n]' , it is represented by IR as alloca ...., so could I insert local variable (pointer array) directly as same way
2012 Apr 25
2
[LLVMdev] Crash in JIT
...t = LLVMCreateJITCompilerForModule(&jit, module, 0, &err); if (result) { printf("Fail: %s\n", err); return -1; } printf("JIT is %p\n", jit); LLVMGenericValueRef argM = LLVMCreateGenericValueOfInt(int32, 10, 0); LLVMGenericValueRef argX = LLVMCreateGenericValueOfInt(int32, 5, 0); LLVMGenericValueRef argB = LLVMCreateGenericValueOfInt(int32, 1, 0); LLVMGenericValueRef args[] = {argM, argX, argB}; LLVMGenericValueRef result2 = LLVMRunFunction(jit, func, 3, args); unsigned long long answer = LLVMGenericValueT...
2017 Apr 08
3
How to insert vector type input parameter for function in C/C++ API?
Fantastic! It's working! Thank you so much Craig!!! On Fri, Apr 7, 2017 at 6:05 PM, Craig Topper <craig.topper at gmail.com> wrote: > It should be VectorType::get(Type::getInt32Ty(Context),4). You need the > word "get" after VectorType:: > > ~Craig > > On Fri, Apr 7, 2017 at 6:01 PM, Michael Choi <choimichael103 at gmail.com> > wrote: >
2004 Aug 09
1
[LLVMdev] API on JIT, code snippets
...t; BasicBlock *BB = new BasicBlock("EntryBlock of add1 function", Add1F); > > // Get pointers to the constant `1'... > Value *One = ConstantSInt::get(Type::IntTy, 1); > > // Get pointers to the integer argument of the add1 function... > Value *ArgX = 0; // FIXME!! > > > // Create the add instruction... does not insert... > Instruction *Add = BinaryOperator::create(Instruction::Add, One, ArgX, > "addresult"); > > // explicitly insert it into the basic block... > BB->getInst...
2004 Aug 09
5
[LLVMdev] API on JIT, code snippets
...t; BasicBlock *BB = new BasicBlock("EntryBlock of add1 function", Add1F); > > // Get pointers to the constant `1'... > Value *One = ConstantSInt::get(Type::IntTy, 1); > > // Get pointers to the integer argument of the add1 function... > Value *ArgX = 0; // FIXME!! > > > // Create the add instruction... does not insert... > Instruction *Add = BinaryOperator::create(Instruction::Add, One, ArgX, > "addresult"); > > // explicitly insert it into the basic block... > BB->getInst...
2005 Jan 27
1
[LLVMdev] Question about inserting IR code
Hi, From the file HowToUseJIT.cpp, I learned how to insert some calcuation IR code like Add/Sub/Mul etc by using Instruction *Add = BinaryOperator::createAdd(One, ArgX, "addresult", BB); By following this way, it works well when I insert some IR code whose operand is integer type like IntTy, however, when I tried to insert similar thing whose operands are float point, I got the following message when I run it void llvm::BinaryOperator::init(llvm::Inst...
2012 Apr 25
0
[LLVMdev] Crash in JIT
...sult = LLVMCreateJITCompilerForModule(&jit, module, 0, &err); if (result) { printf("Fail: %s\n", err); return -1; } printf("JIT is %p\n", jit); LLVMGenericValueRef argM = LLVMCreateGenericValueOfInt(int32, 10, 0); LLVMGenericValueRef argX = LLVMCreateGenericValueOfInt(int32, 5, 0); LLVMGenericValueRef argB = LLVMCreateGenericValueOfInt(int32, 1, 0); LLVMGenericValueRef args[] = {argM, argX, argB}; LLVMGenericValueRef result2 = LLVMRunFunction(jit, func, 3, args); unsigned long long answer = LLVMGenericValueToInt(re...
2004 Aug 17
0
[LLVMdev] JIT API example (fibonacci)
On Wed, 18 Aug 2004, Valery A.Khamenya wrote: > the example attached I have used to prove that JIT and some visible > optimizations are really invoked. > > Proved OK. I got 30% speed-up in comparison to gcc 3.3.3 > on my Athlon XP 1500. Cool! Hey Valery, before we add this to the CVS repo, can you take a look at some of the changes I made to your HowToUseJIT example and
2004 Aug 09
0
[LLVMdev] API on JIT, code snippets
...w BasicBlock("EntryBlock of add1 function", Add1F); > > > > // Get pointers to the constant `1'... > > Value *One = ConstantSInt::get(Type::IntTy, 1); > > > > // Get pointers to the integer argument of the add1 function... > > Value *ArgX = 0; // FIXME!! > > > > > > // Create the add instruction... does not insert... > > Instruction *Add = BinaryOperator::create(Instruction::Add, One, ArgX, > > "addresult"); > > > > // explicitly insert it into the basic bloc...
2004 Aug 09
0
[LLVMdev] API on JIT, code snippets
Reid wrote: > I have to agree with Misha on this. None of us knows "everything" about > LLVM and as you can see, Misha responded three hours before I did :). > Asking questions here is encouraged, so please feel free to post them on > LLVMdev. We'll always help where we can. well, OK :) Please find the attachment with the first approach to such an example i've