similar to: [LLVMdev] variable sized structs in LLVM

Displaying 20 results from an estimated 4000 matches similar to: "[LLVMdev] variable sized structs in LLVM"

2005 Jun 24
0
[LLVMdev] variable sized structs in LLVM
On Mon, 20 Jun 2005, Carl Friedrich Bolz wrote: > I'm having problems figuring out how to do variable sized structs in LLVM > (which are neccessary for PyPy's LLVM backend, on which I'm working). I'm > trying to do the equivalent of ... > in LLVM, where the items array can be arbitrarily long. I guess that the > struct definition should be something like: >
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
2005 Jun 20
0
[LLVMdev] variable sized structs in LLVM
Carl, The thing you're missing is that LLVM's primitive types have well known, fixed sizes that are not target dependent. A ulong is 8 bytes. A uint is 4 bytes. A ushort is 2 bytes. Etc. and always. There are also methods in LLVM to help you deal with the size of a type in bits and bytes. In particular you might want to note the following methods: Type::isSized Type::getPrimitiveSize
2004 Jul 07
2
[LLVMdev] Duplicate assignment in LLVM?
Hello, when I'm compiling test/Programs/SingleSource/UnitTests/2003-05-26-Shorts.c I get LLVM assembler which looks like: int %main(int %argc, sbyte** %argv) { entry: call void %__main( ) %tmp.11 = call ulong %getL( ) ; <ulong> [#uses=16] %tmp.3 = cast ulong %tmp.11 to long ; <long> [#uses= %tmp.5 = cast ulong %tmp.11 to
2004 Apr 04
2
[LLVMdev] Two important changes to the getelementptr instruction
Hi all, I just checked in a series of patches that makes some substantial changes to the LLVM getelementptr instruction. In particular, in LLVM 1.2 and earlier, the getelementptr instruction required index operands for structure types to be 'ubyte' constants and index operands for sequential types to be 'long' values. This had several problems, most notably that it was
2004 Apr 04
0
[LLVMdev] Two important changes to the getelementptr instruction
Hi Chris, Congrats on getting this taken care of finally. I know its something you've wanted to do since 1.0. I have one question. How does LLVM disambiguate between a uint used for a structure and a uint used for an array? My assumption is that LLVM is aware of the type of the thing being indexed all the way through the dereference so it doesn't really matter what index type is being
2004 Jul 07
2
[LLVMdev] Duplicate assignment in LLVM?
Reid Spencer wrote: > Volodya, > > I think you may need to update your CFE and rebuild. I compiled the test > using my local build and I didn't get the results you see below. I'm > also very surprised to see this output. The first %tmp.11 should have > been %tmp.1 .. not sure how it got corrupted. In any event, the > attachment is obviously generated by code that runs
2004 May 11
0
[LLVMdev] Problems accessing structs
Anders Alexandersson wrote: > Hello! > > I get some odd behaviour using my structs: > > "myKernelMap" = type {int (sbyte*)*, int ()*} > "Kernel" = type {"myKernelMap"*} > > The second member ( int()* ) is a pointer to the %getchar() function. > > I want to call getchar using this function: > > int
2004 May 11
2
[LLVMdev] Problems accessing structs
Hello! I get some odd behaviour using my structs: "myKernelMap" = type {int (sbyte*)*, int ()*} "Kernel" = type {"myKernelMap"*} The second member ( int()* ) is a pointer to the %getchar() function. I want to call getchar using this function: int "callmyKernelgetchar_kernel"("Kernel"* "myKernel") { "PTRMAP" =
2005 Mar 09
4
[LLVMdev] Recursive Types using the llvm support library
----- Original Message ----- From: "Chris Lattner" <sabre at nondot.org> To: "LLVM Developers Mailing List" <llvmdev at cs.uiuc.edu> Sent: Tuesday, March 08, 2005 6:31 PM Subject: Re: [LLVMdev] Recursive Types using the llvm support library > On Tue, 8 Mar 2005, Vladimir Merzliakov wrote: > >>>> An example where something really simple like the
2005 Feb 22
5
[LLVMdev] Area for improvement
I noticed that fourinarow is one of the programs in which LLVM is much slower than GCC, so I decided to take a look and see why that is so. The program has many loops that look like this: #define ROWS 6 #define COLS 7 void init_board(char b[COLS][ROWS+1]) { int i,j; for (i=0;i<COLS;i++) for (j=0;j<ROWS;j++) b[i][j]='.';
2005 Mar 21
0
[LLVMdev] Recursive Types using the llvm support library
On Wed, Mar 09, 2005 at 04:05:32PM +0300, Vladimir Merzliakov wrote: > >>Is assert(!NewSTy->isAbstract()) must pass after this line? > > > >In this case, yup. > > > I create test program and assert failed in it: > > { \2 *, sbyte * } How do I decode the \2 in this? I am creating types through this interface and I get quite a mess seen below. And this is
2005 Feb 22
0
[LLVMdev] Area for improvement
When I increased COLS to the point where the loop could no longer be unrolled, the selection dag code generator generated effectively the same code as the default X86 code generator. Lots of redundant imul/movl/addl sequences. It can't clean it up either. Only unrolling all nested loops permits it to be optimized away, regardless of code generator. Jeff Cohen wrote: > I noticed
2004 Sep 28
1
[LLVMdev] How could I hide the visible string?
Hi, Is there a way to modify the string such as char a or char b? Could I use the way like "Replace an instruction with another Value" in Programm Manual? In fact, what I am interested in is string with visible expression, not all string, and I am trying to hide the orignal string by using simple way like XOR.. Is there a way to reorder the basic blocks? Thanks. Qiuyu C Source
2004 Apr 14
1
[LLVMdev] Linking strncpy
Hi, I'm working on a CS326 compiler project, and I'm having some problems using string functions. Some LLVM programs produced are either aborting or giving incorrect results; however, if I disassemble the LLVM bytecode and recompile with GCC, everything works fine. I encountered the following error when running lli with '-force-interpreter' option: "Tried to execute an
2004 Jul 07
0
[LLVMdev] Duplicate assignment in LLVM?
Volodya, I think you may need to update your CFE and rebuild. I compiled the test using my local build and I didn't get the results you see below. I'm also very surprised to see this output. The first %tmp.11 should have been %tmp.1 .. not sure how it got corrupted. In any event, the attachment is obviously generated by code that runs quite differently because the virtual register names
2004 Apr 14
5
[LLVMdev] Linking strncpy
Chris, I'm fine with using JIT, but I'm trying to understand this problem: 1. My LLVM program does not produce correct results 2. Using llvm-dis, I disassemble the bytecode to C 3. I recompile using GCC and the program _works correctly_. The only odd thing is when I recompile with GCC, I see these messages: pal3.c:195: warning: conflicting types for built-in function `strcmp'
2005 Jun 09
1
[LLVMdev] gmake check failures on FreeBSD 5.4
FAIL: /usr/home/jeffc/llvm/obj/../test/Regression/Transforms/InstCombine/2004-11-27-SetCCForCastLargerAndConstant.ll: %Y = cast sbyte %SB to uint ; <uint> [#uses=1] %Y = cast sbyte %SB to int ; <int> [#uses=1] %Y = cast sbyte %SB to int ; <int> [#uses=1] %Y = cast ubyte %SB to uint ; <uint> [#uses=1] %Y = cast ubyte %SB to
2004 Dec 04
1
[LLVMdev] Question about writing a pass
Hi , I got a few for writing a pass. 1) Is it possible to use input parameters in command line ? For example, we got our own pass, ie. HELLO opt -load ../../Debug/lib/libHELLO.so -HELLO < hello.bc From the above command line, could we use some input parameter and we can read those parameter in Pass routine? 2) For splitting BB, the way what I did is to pick up instruction
2004 Aug 22
0
[LLVMdev] conditionally reduced intrinsics
> Ok, I am developing an intrinsic instruction and I have the codegen > working (and tested). However, some of the more complex cases of the > intrinsic are reducable to LLVM + simpler cases of the intrinsic. How > would I go about conditionally reducing the intrinsic? I could deal > with the issue in the codegen, but that gets ugly quickly. > > Andrew I suppose you could