search for: firstarg

Displaying 5 results from an estimated 5 matches for "firstarg".

Did you mean: first_arg
2012 Feb 01
1
[LLVMdev] Function Insertion Error
...uot;, 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", "Function Insertion Pass"); Most of the above cod...
2011 Sep 22
0
[LLVMdev] Need help in converting int to double
Hi Sarath, It would have really helped if you had removed the commented out code and inlined the calls to your homemade helper functions before sending it... You are doing this, in LLVM IR: %0 = getelementptr %Value* %firstArg, i32 0 ; i8** %1 = load i8** %0 ; i8* %2 = bitcast i8* %1 to i64* %3 = getelementptr %Value* %secondArg, i32 0 ; i8** %4 = load i8** %3; i8* %5 = bitcast i8* %4 to i64* %6 = load i64* %2 %7 = load i64* %5 Then you call convertDoubleToInt64(). What does this actually do? It's in trouble by t...
2011 Sep 22
2
[LLVMdev] Need help in converting int to double
...9 at gmail.com>wrote: > Hi James, > > First i converted the void * to int* and then did FPToSI...then did SHL...( > because CreateShl only accepts integers... i pointer casted it to int64 type > first)... Below is the code snippet.... > > > lhs = mBuilder.CreateStructGEP(firstArg, 0); > lhs = mBuilder.CreateLoad(lhs); > lhs = mBuilder.CreatePointerCast(lhs, PointerType::get( > mBuilder.getInt64Ty(), 0)); > int typelhs = getValueType(lhs); > rhs = mBuilder.CreateStructGEP(secondArg, 0); > rhs = mBuilder.CreateLoad(rhs); >...
2011 Sep 22
1
[LLVMdev] Need help in converting int to double
...> ** ** > > It would have really helped if you had removed the commented out code and > inlined the calls to your homemade helper functions before sending it...** > ** > > ** ** > > You are doing this, in LLVM IR:**** > > ** ** > > %0 = getelementptr %Value* %firstArg, i32 0 ; i8****** > > %1 = load i8** %0 ; i8***** > > %2 = bitcast i8* %1 to i64***** > > %3 = getelementptr %Value* %secondArg, i32 0 ; i8****** > > %4 = load i8** %3; i8***** > > %5 = bitcast i8* %4 to i64***** > > ** ** > > %6 = load i64* %2**** > &g...
2011 Sep 22
3
[LLVMdev] Need help in converting int to double
Hi, I'm pursuing M.Tech course. As a part of the project work i'm using LLVM as back-end. My project area is "Enhancing the performance of V8 javascript engine using LLVM as a back-end". Now i'm writing code for shift left(SHL) operator. I had my own Value Structure .. it's like this Struct Value { void *val ; char type; } The "char type" holds