Displaying 20 results from an estimated 62 matches for "getint64ty".
Did you mean:
getint32ty
2013 May 03
2
[LLVMdev] set of integers to metadata
Hello everyone,
I want to pass a set of integers using metadata but I don't know how. I
have tried:
the integers are in array[]
*1. *
LLVMContext& C = is->getContext();
Value* values[size];
for(int gy=0;gy<size;gy++){
values[gy]=ConstantInt::getSigned(Type::getInt64Ty(C),array[gy]);
}
*is->setMetadata("path",MDNode::get(C,values));*
failes when setMetadata(), since
*Hello.cpp:706:56: error: no matching function for call to
‘llvm::MDNode::get(llvm::LLVMContext&, llvm::Value* [(((unsigned
int)(((int)cebagcnt) + -0x00000000000000001)) + 1)])’
Hel...
2017 Oct 11
2
How to create an alloca variable of type i64 in LLVM IR?
To create a stack based (local) 64 bit integer in LLVM IR, I used:
Value *var = builder.CreateAlloca(Type::getInt64Ty(Ctx));
I wish to pass this variable to a function "void foo(unsigned long)". I
created the signature of function foo() as follows:
Constant *func = M->getOrInsertFunction("foo",
Type::getVoidTy(Ctx),Type::getInt64Ty(Ctx), NULL);
To pass the newly created variable var to foo...
2013 May 03
0
[LLVMdev] set of integers to metadata
I also tried the following, with no compilation errors, but segfault, core
dumped:
*LLVMContext& C = is->getContext();
Value* values[size];
for(int gy=0;gy<size;gy++){
values[gy]=ConstantInt::getSigned(Type::getInt64Ty(C),array[gy]);
}
llvm::ArrayRef<Value*> bla = values[size];
is->setMetadata("path",MDNode::get(C,bla));*
On Fri, May 3, 2013 at 1:18 PM, Alexandru Ionut Diaconescu <
alexandruionutdiaconescu at gmail.com> wrote:
> Hello everyone,
>
> I want to pass a se...
2017 Oct 20
2
How to create a 64 bit ConstInt having a value of -1?
I tried the following:
- ConstantInt::get(Type::getInt64Ty(Ctx), APInt(0xFFFFFFFFFFFFFFFF, 64,
false))
- ConstantInt::get(Type::getInt64Ty(Ctx), APInt(-1, 64))
I am receiving the following error: Assertion `NumBits <= MAX_INT_BITS &&
"bitwidth too large" failed
--
Thanks & Regards,
Dipanjan
-------------- next part -----------...
2016 Mar 29
2
JIT compiler and calls to existing functions
That seems to work, thanks! The specific code I ended up with to call
int64_t print(int64_t) looks like:
auto f = builder.CreateIntToPtr(
ConstantInt::get(builder.getInt64Ty(), uintptr_t(print)),
PointerType::getUnqual(FunctionType::get(
builder.getInt64Ty(), {builder.getInt64Ty()}, false)));
return builder.CreateCall(f, args);
On Mon, Mar 28, 2016 at 1:40 PM, Caldarale, Charles R <
Chuck.Caldarale at unisys.com> wrote:
>...
2016 Mar 29
0
JIT compiler and calls to existing functions
...link time if you can.
Philip
On 03/28/2016 06:33 PM, Russell Wallace via llvm-dev wrote:
> That seems to work, thanks! The specific code I ended up with to call
> int64_t print(int64_t) looks like:
>
> auto f = builder.CreateIntToPtr(
> ConstantInt::get(builder.getInt64Ty(), uintptr_t(print)),
> PointerType::getUnqual(FunctionType::get(
> builder.getInt64Ty(), {builder.getInt64Ty()}, false)));
> return builder.CreateCall(f, args);
>
>
> On Mon, Mar 28, 2016 at 1:40 PM, Caldarale, Charles R
> <Chuck.Caldara...
2016 Mar 29
2
JIT compiler and calls to existing functions
...> Philip
>
>
> On 03/28/2016 06:33 PM, Russell Wallace via llvm-dev wrote:
>
> That seems to work, thanks! The specific code I ended up with to call
> int64_t print(int64_t) looks like:
>
> auto f = builder.CreateIntToPtr(
> ConstantInt::get(builder.getInt64Ty(), uintptr_t(print)),
> PointerType::getUnqual(FunctionType::get(
> builder.getInt64Ty(), {builder.getInt64Ty()}, false)));
> return builder.CreateCall(f, args);
>
>
> On Mon, Mar 28, 2016 at 1:40 PM, Caldarale, Charles R <
> <Chuck.Cal...
2009 Sep 07
2
[LLVMdev] PR4882
Hello,
This patch fixes bug 4882.
Regards
-Jakub
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr4882.patch
Type: application/octet-stream
Size: 6856 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090907/266f900c/attachment.obj>
2009 Sep 07
0
[LLVMdev] PR4882
Hi Jakub, looks good.
> + LLVMContext *Context = &SI->getContext();
I guess this could be
LLVMContext &Context = SI->getContext();
which means you can use Context rather than *Context below.
> - const Type *Ty = Type::getInt64Ty(SI->getContext());
> - MemSetF = Intrinsic::getDeclaration(M, Intrinsic::memset, &Ty, 1);
> + const Type *Tys[] = {Type::getInt64Ty(*Context)};
> + MemSetF = Intrinsic::getDeclaration(M, Intrinsic::memset,
> + Tys, 1);
Why...
2009 Sep 07
1
[LLVMdev] PR4882
...looks good.
>
>> + LLVMContext *Context = &SI->getContext();
>
> I guess this could be
> LLVMContext &Context = SI->getContext();
> which means you can use Context rather than *Context below.
Right, C bad habit ;) Fixed.
>> - const Type *Ty = Type::getInt64Ty(SI->getContext());
>> - MemSetF = Intrinsic::getDeclaration(M, Intrinsic::memset,
>> &Ty, 1);
>> + const Type *Tys[] = {Type::getInt64Ty(*Context)};
>> + MemSetF = Intrinsic::getDeclaration(M, Intrinsic::memset,
>> +...
2016 Mar 29
0
JIT compiler and calls to existing functions
...gt; On 03/28/2016 06:33 PM, Russell Wallace via llvm-dev wrote:
>>> That seems to work, thanks! The specific code I ended up with to call int64_t print(int64_t) looks like:
>>>
>>> auto f = builder.CreateIntToPtr(
>>> ConstantInt::get(builder.getInt64Ty(), uintptr_t(print)),
>>> PointerType::getUnqual(FunctionType::get(
>>> builder.getInt64Ty(), {builder.getInt64Ty()}, false)));
>>> return builder.CreateCall(f, args);
>>>
>>>
>>> On Mon, Mar 28, 2016 at 1:4...
2014 Aug 04
3
[LLVMdev] LLVM AllocaInst and StoreInst
...ng to write a simple interpreter.
I am trying to generate LLVM IR for assignment operation. The code for the
generation part looks like this
llvm::Value* codeGenSymTab(llvm::LLVMContext& context) {
> printf("\n CodeGen SymTab \n");
> Value *num = ConstantInt::get(Type::getInt64Ty(context), aTable.value,
> true);
> Value *alloc = new AllocaInst(IntegerType::get(context, 32),
> aTable.variableName,entry);
> StoreInst *ptr = new StoreInst(num,alloc,false,entry);
> }
Here goes the SymTab definition:
struct SymTab {
char* variableName;
int val...
2011 May 18
3
[LLVMdev] access array problem
...ype::getInt32Ty(Context), 0);
Constant *ElementPtr = ConstantExpr::getGetElementPtr(counter,
&index[0], index.size());
Value *oldcounter = new LoadInst(ElementPtr, "oldcounter", InsertPos);
Value *newcounter = BinaryOperator::Create(Instruction::Add,
oldcounter, ConstantInt::get(Type::getInt64Ty(Context), 1),
"newcounter", InsertPos);
new StoreInst(newcounter, ElmentPtr, InserPos);
//store the memory address to counterArray[oldcounter]
std::vector<Constant*> indexC(2);
indexC[0] = Constant::getNullvalue(Type:getInt32Ty(Context));
indexC[1] = dync_cast(llvm::ConstantInt>...
2016 Mar 29
3
JIT compiler and calls to existing functions
...t; On 03/28/2016 06:33 PM, Russell Wallace via llvm-dev wrote:
>>
>> That seems to work, thanks! The specific code I ended up with to call
>> int64_t print(int64_t) looks like:
>>
>> auto f = builder.CreateIntToPtr(
>> ConstantInt::get(builder.getInt64Ty(), uintptr_t(print)),
>> PointerType::getUnqual(FunctionType::get(
>> builder.getInt64Ty(), {builder.getInt64Ty()}, false)));
>> return builder.CreateCall(f, args);
>>
>>
>> On Mon, Mar 28, 2016 at 1:40 PM, Caldarale, Charles R...
2015 Jun 30
4
[LLVMdev] Crashes on Windows 8 with >4k stack frames
...compile LLVM and
our program with Microsoft's Visual Studio 2010. Both debug and release
builds are affected.
The variables are created en-block at the beginning of the function with
code looking like
for (i=0; i<513; ++i) {
AllocaInst *variable =
mBuilder.CreateAlloca(Type::getInt64Ty(mContext),0,"");
mBuilder.CreateStore(GetConstI("INT4_8",0),variable);
}
We have not yet looked at the compiled machine code (same on Win 7 and
8, or differs?). But the 4k limit made us suspicious, as there were some
bug reports - some still open - regarding this limit wit...
2017 Oct 14
2
Bug in replaceUsesOfWith: does not keep addrspace consistent in GEP
...e::ExternalLinkage, name, &m);
};
static const bool SHOW_ERROR = false;
int main() {
static LLVMContext ctx;
static IRBuilder<> Builder(ctx);
Module *m = new Module("Module", ctx);
Function *F = getOrCreateFunction(
*m,
FunctionType::get(Builder.getInt64Ty(),
{PointerType::get(Builder.getInt32Ty(), 42),
PointerType::get(Builder.getInt32Ty(), 1)},
NON_VAR_ARG),
"f");
auto It = F->arg_begin();
Value *Arg = &*It;
It++;
Value *Arg2 = &am...
2016 Mar 28
0
JIT compiler and calls to existing functions
> From: llvm-dev [mailto:llvm-dev-bounces at lists.llvm.org]
> On Behalf Of Russell Wallace via llvm-dev
> Subject: [llvm-dev] JIT compiler and calls to existing functions
> In the context of a JIT compiler, what's the recommended way to generate a call to an
> existing function, that is, not one that you are generating on-the-fly with LLVM, but
> one that's already
2011 May 18
2
[LLVMdev] access array problem
.../record the load/store addresses
> strictly speaking these are not arrays, they are pointers. Also, you have
> written them in some kind of C-style idiom. What are the declarations in
> LLVM IR?
const Type *IntTy = Type::getInt32Ty(M.getContext());
const Type *ATyC = ArrayType::get(Type::getInt64Ty(M.getContext()), 1);
GlobalVariable *CounterSize = new GlobalVariable(M, ATyC, false,
GlobalValue::InternalLinkage,
Constant::getNullValue(ATyC), "MemTraceCounterSize");
const Type *ATy = ArrayType::get(Type::getInt32Ty(M.getContext()), 3000);
GlobalVariable *Counters = new GlobalVaria...
2011 May 18
0
[LLVMdev] access array problem
...ys.
> Constant *ElementPtr = ConstantExpr::getGetElementPtr(counter,
> &index[0], index.size());
> Value *oldcounter = new LoadInst(ElementPtr, "oldcounter", InsertPos);
> Value *newcounter = BinaryOperator::Create(Instruction::Add,
> oldcounter, ConstantInt::get(Type::getInt64Ty(Context), 1),
> "newcounter", InsertPos);
> new StoreInst(newcounter, ElmentPtr, InserPos);
>
> //store the memory address to counterArray[oldcounter]
> std::vector<Constant*> indexC(2);
> indexC[0] = Constant::getNullvalue(Type:getInt32Ty(Context));
> indexC[...
2016 Mar 30
4
JIT compiler and calls to existing functions
...lvm-dev wrote:
>>>>
>>>> That seems to work, thanks! The specific code I ended up with to call
>>>> int64_t print(int64_t) looks like:
>>>>
>>>> auto f = builder.CreateIntToPtr(
>>>> ConstantInt::get(builder.getInt64Ty(), uintptr_t(print)),
>>>> PointerType::getUnqual(FunctionType::get(
>>>> builder.getInt64Ty(), {builder.getInt64Ty()}, false)));
>>>> return builder.CreateCall(f, args);
>>>>
>>>>
>>>> On Mo...