Displaying 20 results from an estimated 33 matches for "variablesizedstructs".
2008 May 23
2
[LLVMdev] How to handle size_t in front ends?
...known. These "late bound
>> constants" could then be used to implement "sizeof(type)" and other
>> constants whose value is different on different targets.
>>
>
> LLVM already does this.
>
> http://www.nondot.org/sabre/LLVMNotes/SizeOf-OffsetOf-VariableSizedStructs.txt
>
> — Gordon
>
Is there a similar technique that would allow calculation of the
alignment? (which is also required by the DWARF derived-type descriptor.)
-- Talin
2011 Dec 08
2
[LLVMdev] GetElementPtr
...gt; code using GEP's without worrying about how a given target actually
> lays out structures. It isn't target-independent in the sense that
> the actual computed offset in bytes isn't the same for every target.
> See also
> http://nondot.org/sabre/LLVMNotes/SizeOf-OffsetOf-VariableSizedStructs.txt
> .
>
> -Eli
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20111208/4aefbbeb/attachment.html>
2005 Jun 25
2
[LLVMdev] Re: variable sized structs in LLVM
...ld maybe add this example to the getelementptr
>> documentation.
>
> This isn't really appropriate for the reference manual, but I added it to
> the "Source Language Implementation Notes" of my web page here:
>
> http://nondot.org/sabre/LLVMNotes/SizeOf-OffsetOf-VariableSizedStructs.txt
>
> Hope this helps!
Bingo, it does help! Thanks Chris! However, I'm with Aaron on where this
belongs, your link above really should be integrated into or at least an
addendum to the IR Language Reference,
http://llvm.cs.uiuc.edu/docs/LangRef.html
unless you're keeping it o...
2020 Jan 14
2
sizeof implementation: how to get size as a constantInt?
I'm implementing c style "sizeof()", and I did as
http://nondot.org/sabre/LLVMNotes/SizeOf-OffsetOf-VariableSizedStructs.txt
illuarstrated,
and it works find, here's an example of my implementation:
auto *p = builder.CreateGEP(structTy,
llvm::ConstantPointerNull::get(pointerTy),
constint1);
auto *size = builder.CreatePtrToInt(p, llvm::IntegerType::get...
2010 May 08
0
[LLVMdev] does llvm have some way to get the size of data type
Hello! You can do this:
http://nondot.org/sabre/LLVMNotes/SizeOf-OffsetOf-VariableSizedStructs.txt
On Fri, May 7, 2010 at 8:26 PM, Gang.Yao <ttoole9 at gmail.com> wrote:
> Hi:
>
> just like the c function sizeof(). I would avoid the usage of the c
> function call, and expect something like llvm
> intrinsic or some class providing this functionality.
>
> Does some...
2011 Dec 08
1
[LLVMdev] GetElementPtr
On Thu, Dec 8, 2011 at 2:37 PM, Ryan Taylor <ryta1203 at gmail.com> wrote:
> Thanks.
>
> So basically then this operation is not target-independent like the docs
> suggest?
>
>
> On Thu, Dec 8, 2011 at 1:23 PM, Eli Friedman <eli.friedman at gmail.com>wrote:
>
>> On Thu, Dec 8, 2011 at 11:49 AM, Ryan Taylor <ryta1203 at gmail.com> wrote:
>>
2011 Dec 08
0
[LLVMdev] GetElementPtr
...a frontend can generate
code using GEP's without worrying about how a given target actually
lays out structures. It isn't target-independent in the sense that
the actual computed offset in bytes isn't the same for every target.
See also http://nondot.org/sabre/LLVMNotes/SizeOf-OffsetOf-VariableSizedStructs.txt
.
-Eli
2011 Dec 08
0
[LLVMdev] GetElementPtr
...EP's without worrying about how a given target actually
>> lays out structures. It isn't target-independent in the sense that
>> the actual computed offset in bytes isn't the same for every target.
>> See also
>> http://nondot.org/sabre/LLVMNotes/SizeOf-OffsetOf-VariableSizedStructs.txt
>> .
>>
>> -Eli
>
>
2005 Jun 25
0
[LLVMdev] variable sized structs in LLVM
...e this:
...
> Chris you should maybe add this example to the getelementptr documentation.
This isn't really appropriate for the reference manual, but I added it to
the "Source Language Implementation Notes" of my web page here:
http://nondot.org/sabre/LLVMNotes/SizeOf-OffsetOf-VariableSizedStructs.txt
Hope this helps!
-Chris
--
http://nondot.org/sabre/
http://llvm.cs.uiuc.edu/
2008 May 22
0
[LLVMdev] How to handle size_t in front ends?
...; until the compilation target is fully known. These "late bound
> constants" could then be used to implement "sizeof(type)" and other
> constants whose value is different on different targets.
LLVM already does this.
http://www.nondot.org/sabre/LLVMNotes/SizeOf-OffsetOf-VariableSizedStructs.txt
— Gordon
2008 May 23
0
[LLVMdev] How to handle size_t in front ends?
On May 22, 2008, at 6:40 PM, Talin wrote:
>> LLVM already does this.
>>
>> http://www.nondot.org/sabre/LLVMNotes/SizeOf-OffsetOf-VariableSizedStructs.txt
>>
>> — Gordon
>>
> Is there a similar technique that would allow calculation of the
> alignment? (which is also required by the DWARF derived-type
> descriptor.)
There is more than one form of alignment. To find the struct field
alignment of something, you can...
2012 Nov 11
0
[LLVMdev] IR sizeof?
Does this help?
http://nondot.org/sabre/LLVMNotes/SizeOf-OffsetOf-VariableSizedStructs.txt
On 11 Nov 2012, at 10:52, edA-qa mort-ora-y <eda-qa at disemia.com<mailto:eda-qa at disemia.com>> wrote:
Is there a way to get the size of a type in the IR assembly code? I know
the size must be known since alloca and getelementptr both implicitly
use it, but I don't see any w...
2005 Jun 24
2
[LLVMdev] variable sized structs in LLVM
> This is almost exactly what you want to do. Please make the array be [0 x
> int] though, as it is undefined in llvm to access past the end of an array
> with non-zero length. I added a note about zero-length arrays here:
>
> http://llvm.cs.uiuc.edu/docs/LangRef.html#i_getelementptr
> http://llvm.cs.uiuc.edu/docs/LangRef.html#t_array
>
> As you mention above, you
2010 May 08
5
[LLVMdev] does llvm have some way to get the size of data type
Hi:
just like the c function sizeof(). I would avoid the usage of the c
function call, and expect something like llvm
intrinsic or some class providing this functionality.
Does someone have experience in this?
Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100507/056bae50/attachment.html>
2008 May 22
2
[LLVMdev] How to handle size_t in front ends?
Chris Lattner wrote:
> On Wed, 21 May 2008, Talin wrote:
>
>> On a related topic: The source-level debugging descriptors require you
>> to know up front what the sizeof pointer types are. Is there any hope of
>> the frontend remaining blissfully unaware of platform details?
>>
>
> I really don't know how to do this. The current debug info stuff
2010 Aug 15
2
[LLVMdev] "UNREACHABLE executed!" error?
On Sun, Aug 15, 2010 at 3:38 PM, Eric Christopher <echristo at apple.com> wrote:
>
> On Aug 15, 2010, at 2:34 PM, Nick Lewycky wrote:
>
>> Anton Korobeynikov wrote:
>>> Hello
>>>
>>>> I just noticed that my union seems to look like an array....is that actually
>>>> a union or do I have a problem somewhere?
>>> Yes. Unions are
2013 Jan 03
1
[LLVMdev] Does getelementptr get optimized in compile-time?
...If however the operands are all numerical values (eg the pointer operand is "null" and the others are numbers like "1") then it will be turned into a number by the optimizers.
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 i...
2012 Nov 11
4
[LLVMdev] IR sizeof?
Is there a way to get the size of a type in the IR assembly code? I know
the size must be known since alloca and getelementptr both implicitly
use it, but I don't see any way to get access to the size directly.
I know my final compiler will have to get the size itself, but I'm just
doing some simple tests directly in assembly now and am hoping there is
an easy way to get the size of a
2013 Apr 30
2
[LLVMdev] A new mechanism to compiler kernel modules using llvm: Defer type evaluation in clang?
...From LLVM's point of view, the design I described could be interpreted as:
"Implementing Portable sizeof, offsetof and Variable Sized
Structures in LLVM"
It's a random LLVM notes at:
http://nondot.org/sabre/LLVMNotes/
http://nondot.org/sabre/LLVMNotes/SizeOf-OffsetOf-VariableSizedStructs.txt
Basically the note wrote in there will solve main part of my problem,
only another problem
is structure field name need pass into IR file, I don't think it's a
hard technical problem, we have choose
many way to solve this, even put structure field name as comments into IR file.
Look,...
2010 Aug 15
0
[LLVMdev] "UNREACHABLE executed!" error?
...es.
>>
>> You can get equivalent behaviour in LLVM IR with the GEP trick[1] and
>> alloca'ing the right about of space, but there's no way at all to make it
>> match the API of a type.
>>
>> [1] -
>> http://nondot.org/sabre/LLVMNotes/SizeOf-OffsetOf-VariableSizedStructs.txt
>
> That is what I was referring to, I know it would not be a single
> instruction, but a CreateUnion in the IRBuilder or so could take a
> list of types and so forth and find out the max in the IR using the
> GEP trick an allocate an appropriate sized type that it returns for
&g...