Displaying 10 results from an estimated 10 matches for "sizei".
Did you mean:
size
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 here would be much appreciated.
Additionally, I was wondering whether I can use this method to find out the
size of variable-length arrays, such as [...
2008 May 02
0
[LLVMdev] Pointer sizes, GetElementPtr, and offset sizes
...nt i32** %tmp1 to i32 ; <i32> [#uses=1]
%x45 = ptrtoint [2 x i32*]* %x to i32 ; <i32> [#uses=1]
%tmp6 = sub i32 %tmp23, %x45 ; <i32> [#uses=1]
%size = getelementptr i32** null, i32 1 ; <i32**> [#uses=1]
%sizeI = ptrtoint i32** %size to i32 ; <i32> [#uses=1]
%tmp7 = ashr i32 %tmp6, %sizeI ; <i32> [#uses=1]
ret i32 %tmp7
}
There, pointer size independent. The problem you see is you are using
a frontend targeting a specific platform, so pointersize is known...
2008 May 02
4
[LLVMdev] Pointer sizes, GetElementPtr, and offset sizes
The LLVA and LLVM papers motivate the GetElementPtr instruction by arguing
that it abstracts implementation details, in particular pointer size, from
the compiler. While it does this fine for pointer addresses, it does not
manage it for address offsets. Consider the following code:
$ cat test.c
int main() {
int *x[2];
int **y = &x[1];
return (y - x);
}
$ llvm-gcc -O3 -c test.c
2013 Jan 03
1
[LLVMdev] Does getelementptr get optimized in compile-time?
...ptimizers.
I think my case is stated above among your answer.
http://nondot.org/sabre/LLVMNotes/SizeOf-OffsetOf-VariableSizedStructs.txt
There is a brief document about using getelmentptr trick above.
And I was wondering something similar to this case.
%Size = getelementptr %T* null, int 1
%SizeI = cast %T* %Size to uint
I understood that for this case, getelementptr will be collapsed to a
number during optimization. It is also explained in the brief document
above. I didn't understood by the document at that time.
OK. Thank you very much. I understood very well.
Sincerely
Journeyer...
2012 Feb 22
0
[LLVMdev] Size of structs & arrays
...t 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
>
> But I'm unsure how I actually do this in the C++ API. Is the 'null' here a
> llvm::ConstantPointerNull? Any help here would be much appreciated.
Try llvm::Constant::getNullValue().
> Additionally, I was wondering whether I can use this method t...
2007 Jul 27
2
[LLVMdev] Forcing JIT of all functions before execution starts (was: Implementing sizeof)
Chris Lattner wrote:
> Check out http://nondot.org/sabre/LLVMNotes
>
>
%Size = getelementptr %T* null, int 1
%SizeI = cast %T* %Size to uint
How incredibly cunning. :-) Thanks for that.
Next stupid question. I've put together a simple coroutine/fibre style
threading system on top of the Linux setcontext/getcontext stuff, which
surprisingly enough seems to work *almost* perfectly under the JITted
envir...
2013 Jan 03
0
[LLVMdev] Does getelementptr get optimized in compile-time?
Hi Journeyer,
> I've got a question about getelementptr.
>
> I've been told that getelementptr is evaluated in compile-time NOT in run-time.
this is impossible if the arguments are not constants. If they are constant,
then the optimizers will turn a getelementptr instruction into a getelementptr
constant expression (http://llvm.org/docs/LangRef.html#constant-expressions).
Even
2007 Jul 27
0
[LLVMdev] Implementing sizeof
...model-checker-specific intrinsics so I can track memory modifications
> efficiently, but just having the address isn't enough, I really need
> the
> size too. Or are reads and writes always guaranteed to be simple
> types,
> so the bit width (as given by the Type::getPrimitiveSizeInBits()
> member
> function) divided by 8 and rounded up if necessary is enough? (The
> latter works well for me too, I just don't want to mess myself up by
> making assumptions).
>
> As usual, thank you in advance.
>
> Sarah
> _____________________________________...
2013 Jan 03
2
[LLVMdev] Does getelementptr get optimized in compile-time?
Hello List,
I've got a question about getelementptr.
I've been told that getelementptr is evaluated in compile-time NOT in run-time.
So I tested it with clang web compiler below.
http://llvm.org/demo/index.cgi
But with LTO nor Standard, neither one optimize getelementptr out.
Does getelementptr get evaluated in compile-time?
Or doesn't it get executed in run-time? (I believed so.
2007 Jul 27
3
[LLVMdev] Implementing sizeof
...store instructions into
model-checker-specific intrinsics so I can track memory modifications
efficiently, but just having the address isn't enough, I really need the
size too. Or are reads and writes always guaranteed to be simple types,
so the bit width (as given by the Type::getPrimitiveSizeInBits() member
function) divided by 8 and rounded up if necessary is enough? (The
latter works well for me too, I just don't want to mess myself up by
making assumptions).
As usual, thank you in advance.
Sarah