Displaying 20 results from an estimated 1000 matches similar to: "[LLVMdev] non-pointer gcroot"
2008 Nov 08
0
[LLVMdev] non-pointer gcroot
On Nov 7, 2008, at 15:29, Scott Graham wrote:
> I'm getting an assert in LowerIntrinsics::InsertRootInitializers
> because I'm gcroot'ing an alloca to a non-pointer.
>
> I was hoping to modify InsertRootInitializers to memset the
> structure in the case that it's not a pointer, but I'm not sure how
> to. Can anyone suggest what should go at "todo;
2011 Oct 08
0
[LLVMdev] Initializing GC roots
On Oct 6, 2011, at 17:19, Yiannis Tsiouris wrote:
> Hello all,
>
> I set: InitRoots = true; in my gc plugin as i want the roots to be
> initialized to the "null" value.
> Is there a way to define which value should be the initial one? For
> example, i would like to initialize my roots to -5 (tagged, null value
> for the GC in my runtime system) instead of 0.
>
2011 Oct 06
2
[LLVMdev] Initializing GC roots
Hello all,
I set: InitRoots = true; in my gc plugin as i want the roots to be
initialized to the "null" value.
Is there a way to define which value should be the initial one? For
example, i would like to initialize my roots to -5 (tagged, null value
for the GC in my runtime system) instead of 0.
Ofcourse, i could do it in the frontend (storing -5 to all GC roots),
but i was wondering
2017 Nov 01
2
llvm.gcroot trouble with non-i8* allocas
I'm allocating { i8*, i32 } on the stack, and would like to add this as a
GC root, but I'm having trouble figuring this out.
This works as expected:
declare void @llvm.gcroot(i8** %ptrloc, i8* %metadata)
define i8* @bar(i8* %x) gc "shadow-stack" {
entry:
%objptr = alloca i8*
call void @llvm.gcroot(i8** %objptr, i8* null)
store i8* %x, i8** %objptr
%v = load i8*, i8**
2017 Nov 01
0
llvm.gcroot trouble with non-i8* allocas
Solved by using alloca i8*, i32 2 which the system seems happy enough with,
and bitcasting to the actual type for rest of the code after llvm.gcroot.
Not entirely sure if this is a terrible workaround or exactly the way
gcroot is supposed to be used...
On Wed, Nov 1, 2017 at 11:59 AM, Nikodemus Siivola <
nikodemus at random-state.net> wrote:
> I'm allocating { i8*, i32 } on the
2004 Jul 01
1
[LLVMdev] Add assert in llvm::StroreInst::init and llvm::LoadInst::init
I'm make silly error (swap arguments in llvm::StroreInst constructor call:
llvm::Value* var = genExpr(bb,*varExpr,false);
llvm::Value* val = genExpr(bb,*valExpr,true );
llvm::StoreInst* lStore = new llvm::StoreInst(var,val,bb);
instead
assert(var && var->getType()->getTypeID()==llvm::Type::PointerTyID && "var
side isn't pointer type");
llvm::StoreInst*
2009 Mar 20
0
[LLVMdev] GC interface suggestions
Hello,
I have a few suggestions for the GC interface. First, initialization of roots fails if the root isn't just a pointer. Some implementations require more data than just the pointer for handling references to the interior of an aggregate. On my end it just required changing ConstantPointerNull::get() to Constant::GetNullValue() to support fat pointers. The roots that were being
2004 Jun 17
3
[LLVMdev] Primitive types
Hello,
I'm getting this in debugger, where 't' is 'Type*':
(gdb) p t->isPrimitiveType()
$15 = false
(gdb) p t->getPrimitiveID()
$16 = PointerTyID
(gdb) p t->getPrimitiveSize()
$17 = 0
There are a couple of things that I'd like to ask. First, if isPrimitiveType()
returns false, that the fact that getPrimitiveID returns reasonable value is
quite
2004 Jun 17
0
[LLVMdev] Primitive types
On Thu, 17 Jun 2004, Vladimir Prus wrote:
> I'm getting this in debugger, where 't' is 'Type*':
>
> (gdb) p t->isPrimitiveType()
> $15 = false
> (gdb) p t->getPrimitiveID()
> $16 = PointerTyID
> (gdb) p t->getPrimitiveSize()
> $17 = 0
>
> There are a couple of things that I'd like to ask. First, if
>
2007 Nov 25
2
[LLVMdev] C embedded extensions and LLVM
>>> Please add a generous block comment to
>>> llvm/include/llvm/Bitcode/LLVMBitCodes.h above the new enum
>>> explaining
>>> what the difference is though. :)
>>
>
> Should have said:
>
>> Should I take the same approach to the encoding of pointer types in
>> the types table?
PointerTypes are a bit easier. The code to write them
2007 Oct 11
0
[LLVMdev] Can't bootstrap llvm-gcc-4.0 for x84_64
Hi David,
> "LLVM type size doesn't match GCC type size!"' failed.
this assertion checks that gcc types are converted into
LLVM types of the same size. Try running cc1 in gdb.
When you hit the assertion, go up a few stack frames
until you get to ConvertType. Do
call debug_tree(type)
That will tell you what the gcc type was. From that
and the LLVM type it should be clear
2008 Sep 08
0
[LLVMdev] Problems when refining type
On Mon, Sep 8, 2008 at 2:45 PM, Scott Graham <scott.llvm at h4ck3r.net> wrote:
> LLVMTypeRef a = LLVMPointerType(LLVMOpaqueType(), 0);
> LLVMTypeHandleRef ha = LLVMCreateTypeHandle(a);
> LLVMTypeRef atypes[1] = { LLVMResolveTypeHandle(ha) };
> LLVMRefineType(LLVMResolveTypeHandle(ha), LLVMStructType(atypes, 1, 0));
>
> Can anyone explain what I'm doing wrong
2004 Dec 21
3
[LLVMdev] Help with code
Hi,
I have this call instruction to printf inserted which is causing
an assertion failure. Any pointers to where I am wrong :
Code Dump :
Function *printFn=M.getNamedFunction(std::string("printf"));
Constant *str=ConstantArray::get("Value : %d\n");
std::vector<Value *> Args(2);
std::vector<Constant *> GEPIndices(2);
2012 Feb 22
0
[LLVMdev] Size of structs & arrays
On Wed, Feb 22, 2012 at 1:56 PM, Fraser Cormack <frasercrmck at gmail.com> wrote:
>
> I'm trying to work out the size of a struct so that I can pass this to the
> 'llvm.memcpy' intrinsic. It's easy to find out how I'm supposed to do this,
> as I keep seeing the following:
>
> %Size = getelementptr %T* null, int 1
> %SizeI = cast %T* %Size to uint
>
2011 May 18
2
[LLVMdev] access array problem
δΊ 2011/5/18 14:29, Duncan Sands ει:
> Hi Tan Guangming,
>
>> I want to access an array in my instrumentation code. For example:
>>
>> GlobalVariable:
>> int *counter; //counter the number of load/store operations in run-time
>> int *counterArray; //record the load/store addresses
> strictly speaking these are not arrays, they are pointers. Also, you have
2011 May 18
3
[LLVMdev] access array problem
Hi,
I want to access an array in my instrumentation code. For example:
GlobalVariable:
int *counter; //counter the number of load/store operations in run-time
int *counterArray; //record the load/store addresses
//increase the counter if a load/store is performed
std::vector<Constant *>index(2);
index[0] = Constant::getNullvalue(Type:getInt32Ty(Context));
index[1] =
2008 Apr 21
2
[LLVMdev] newbie question for type comparison
On Apr 21, 2008, at 15:07, John Criswell wrote:
>> 1. For getting ALL struct allocation, when I use
>>
>> if( (AI = dyn_cast<AllocaInst>(&*i)))
>> if(AI->getOperand(0)->getType()->getTypeID() ==
>> Type::StructTyID) {
>>
>> to get all alloca instructions allocating a structure, it does not
>> work. In my gdb
2012 Feb 22
5
[LLVMdev] Size of structs & arrays
I'm trying to work out the size of a struct so that I can pass this to the
'llvm.memcpy' intrinsic. It's easy to find out how I'm supposed to do this,
as I keep seeing the following:
%Size = getelementptr %T* null, int 1
%SizeI = cast %T* %Size to uint
But I'm unsure how I actually do this in the C++ API. Is the 'null' here a
llvm::ConstantPointerNull? Any help
2007 Nov 25
0
[LLVMdev] C embedded extensions and LLVM
On Nov 24, 2007, at 7:47 PM, Christopher Lamb wrote:
>
> On Nov 21, 2007, at 6:22 PM, Chris Lattner wrote:
>
>> On Wed, 21 Nov 2007, Christopher Lamb wrote:
>>>> Unlike alignment and volatility, I think that the address space
>>>> qualifier
>>>> should be represented explicitly in the type system. The
>>>> reason for this
2012 Feb 22
1
[LLVMdev] Size of structs & arrays
Eli Friedman-2 wrote:
>
>
> Try llvm::Constant::getNullValue().
>
>
I'm trying this:
llvm::Constant* one =
llvm::Constant::getNullValue(llvm::IntegerType::get(mod->getContext(), 64));
llvm::ConstantInt* two = llvm::ConstantInt::get(mod->getContext(),
llvm::APInt(32, llvm::StringRef("1"), 10));
std::vector<llvm::Value*> indices;