search for: ir_builder

Displaying 4 results from an estimated 4 matches for "ir_builder".

Did you mean: _builder
2018 Mar 13
2
How to optimize store of constant arrays
Hi all, I have this problem: I'm using LLVM's C++ API, mostly `IRBuilder<>` to generate code. Some of the generated code is just storing constant data to a location provided as a function argument. Something like `ir_builder.CreateStore(get_default_data(), ptrValue)` where `get_default_data()` may return a `ConstantArray` of `i8` and `ptrValue` is a function argument. Looking at the generated assembly, it seems inefficient, it generates a separate instruction for storing each byte relative to the pointer. Each inst...
2013 Sep 18
2
[LLVMdev] JIT compiled intrinsics calls is call to null pointer
Hi everyone, I am trying to call an LLVM intrinsic (llvm.pow.f32), inserted with the following call: std::vector<llvm::Type *> arg_types;arg_types.push_back(llvm::Type::getFloatTy(context));auto function=llvm::Intrinsic::getDeclaration(module, llvm::Intrinsic::pow, arg_types);auto result=ir_builder->CreateCall(function, args); When I try to execute the code generated by the JIT compiler, I see that the intrinsic is not compiled into a math coprocessor instruction, but in a call to a null address: 002300B8 sub esp,8 002300BB movss xmm0,dword ptr ds:[2300B0h] 002300C...
2012 Oct 18
1
[LLVMdev] Incrementing a pointer to array element?
Using the LLVM C++ API, if I want to create an array via an Alloca instruction like: Value *a = ir_builder.CreateAlloca( my_type, my_size ); and then I want to initialize each element of the array with values computed elsewhere like: for ( vector<Value*>::const_iterator i = v.begin(); i != v.end(); ++i ) { builder.CreateStore( *i, a ); // How do I increment 'a' to point to the nex...
2013 Sep 19
1
[LLVMdev] JIT compiled intrinsics calls is call to null pointer
...one, I am trying to call an LLVM intrinsic (llvm.pow.f32), inserted with the following call: std::vector<llvm::Type *> arg_types;arg_types.push_back(llvm::Type::getFloatTy(context)); auto function=llvm::Intrinsic::getDeclaration(module, llvm::Intrinsic::pow, arg_types);auto result=ir_builder->CreateCall(function, args); When I try to execute the code generated by the JIT compiler, I see that the intrinsic is not compiled into a math coprocessor instruction, but in a call to a null address: 002300B8 sub esp,8 002300BB movss xmm0,dword ptr ds:[2300B0h] 0...