similar to: [LLVMdev] question about GetElementPtr Instruction

Displaying 20 results from an estimated 5000 matches similar to: "[LLVMdev] question about GetElementPtr Instruction"

2002 Sep 26
2
[LLVMdev] question about GetElementPtr Instruction
You are correct, ubyte 2 simply means 3rd element of the structure. This quantity is always constant (it specifies the field number), so we could have used any signed or unsigned integer type for it instead of ubyte. UByte means we are limited to at most 256 structure fields but it also makes the bytecode representation more compact. (To remove this restriction, we may migrate to UInt in the
2002 Sep 23
2
[LLVMdev] Accessing constant indexes in GetElementPtr
> Also sprach Wojciech Stryjewski: > } Ok. Let's say I have a GetElementPtrInst that is used to access > structure > } elements. In this case the indexes will be constants and I want > to get the > } constant values as an a native C int. > } > } Now I can iterate over all the indexes with idx_begin(). I can cast > } all of the indexes to a ConstantIntegral. However,
2002 Sep 27
0
[LLVMdev] Another question about GetElementPtr Instruction
Hi, I've another question about getelementptr. So, in the twisted mind of my little pass, I have a statement like this: %reg228-mod = getelementptr %struct.SimpleStruct* %N.1, long 0 ; <%struct.SimpleStruct*> [#uses=2] I'm not sure of the semantics of %a = getelementptr %b, long 0. I want to think that it is some kind of weird identity (no-op), judging from the operand
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
2002 Sep 22
2
[LLVMdev] Accessing constant indexes in GetElementPtr
Ok. Let's say I have a GetElementPtrInst that is used to access structure elements. In this case the indexes will be constants and I want to get the constant values as an a native C int. Now I can iterate over all the indexes with idx_begin(). I can cast all of the indexes to a ConstantIntegral. However, I cannot cast the indexes to a ConstantSInt or ConstantUInt (cast<> throws an
2002 Sep 26
0
[LLVMdev] question about GetElementPtr Instruction
Dear LLVMdev, As far as I can tell, what the "ubyte 2" value really means is the 2+1'th member of the structure...regardless of whether that structure's 3rd element actually starts at (pointer to structure) + 3*sizeof(ubyte) or not. So, is there any semantic connection between "ubyte" as used in structure accesses and what getelementptr actually interprets it as? Or
2004 Apr 05
1
[LLVMdev] Two important changes to the getelementptr instruction
On Sun, 4 Apr 2004, Reid Spencer wrote: > Congrats on getting this taken care of finally. I know its something > you've wanted to do since 1.0. It certainly has been on the grand TODO list for a long time :) > I have one question. How does LLVM disambiguate between a uint used for > a structure and a uint used for an array? It depends on the operand number of the
2005 Nov 01
3
[LLVMdev] [fwd] Re: LLVM Compiler Infrastructure
Hi, Yiping! I am not sure of the answer to your question, but I am forwarding it to the LLVMdev list where I am sure someone will be able to answer you. Please send development questions directly to LLVMdev and you will get a response quicker, as it is read by many LLVM developers. ----- Forwarded message from Yiping Fan <fanyp at cs.ucla.edu> ----- Date: Mon, 31 Oct 2005 17:20:24 -0800
2007 Mar 01
2
[LLVMdev] Version 1.9 SSA form question
int %nlz10(uint %param.x) { %.t3 = shr uint %param.x, ubyte 1 ; <uint> [#uses=1] %.t4 = or uint %.t3, %param.x ; <uint> [#uses=2] %.t7 = shr uint %.t4, ubyte 2 ; <uint> [#uses=1] %.t8 = or uint %.t7, %.t4 ; <uint> [#uses=2] %.t11 = shr uint %.t8, ubyte 4 ; <uint> [#uses=1]
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 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
2005 Jul 29
1
[LLVMdev] How to define a function with multiple return values?
LegalizeDAG.cpp SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) { case ISD::RET: Tmp1 = LegalizeOp(Node->getOperand(0)); // Legalize the chain. switch (Node->getNumOperands()) { case 2: // ret val [skipped] case 1: // ret void [skipped] default: { // ret <values> [skipped] Does it imply that a ret instruction may
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
2005 Jun 13
2
[LLVMdev] problem compiling the cfrontend on Linux/PPC
> Okay, I took a closer look at your output. > > I was correct in that gccas is attempting to assemble a native PPC > assembly language file. However, this appears to be happening because > the assembly file is generated by the GCC Makefiles for libgcc2 (in > llvm-gcc/gcc/config/rs6000/t-ppccomm, I think). > > The first thing I would try is Marco's suggestion: add
2004 Jun 12
1
[LLVMdev] getelementptr results in seg-fault.
Hi! Hmm, ok. I'm using the 1.2 release. Found out that it worked when using long to index getelementptr, but not when using uint, int or ulong. But then I'll try with the CVS code instead. Thank you. , Tobias On Sat, 12 Jun 2004, Reid Spencer wrote: > Hi Tobias, > > I tried your test program on the latest CVS code. Everything worked > fine. > > Can you tell me which
2005 Nov 01
0
[LLVMdev] [fwd] Re: LLVM Compiler Infrastructure
> Now we got a small but annoying problem. When we get the following C > code to llvm-gcc, > > short test(int x) { > return (short) (x >> 10); > } > > It will generate the following LLVM code: > short %test(int %x) { > %x = cast int %x to uint ; <uint> [#uses=1] > %tmp.2 = shr uint %x, ubyte 10 ;
2005 Nov 02
1
[LLVMdev] [fwd] Re: LLVM Compiler Infrastructure
Chris, thank you for your reply. Our problem is that we don't assume an integer must have 32 bits. In our code generation, we can define an integer to be less than 32 bits. For example, 24 bits. In this case, by executing this LLVM code (my first example) on a 24-bit machine, let x = 0xFFFFFF, then we will get %tmp.2 = 0x003FFF, and %tmp.3 = 0x3FFF, which is positive. That is not correct
2004 May 03
0
[LLVMdev] Problems with getelementptr
On Mon, 3 May 2004, Anders Alexandersson wrote: > Hello! > > I'm having trouble with pointer traversing. I have a design as follows: > class -> map -> classFunctions > > Starting with a pointer to the class, I want to get a pointer to a > classFunction via a pointer to the map. Okay... > I can't get that function pointer! > > How shall I think to get
2007 Jan 14
0
[LLVMdev] Request documentation for global var syntax
On Thu, 11 Jan 2007, Schimmel, Mark wrote: > file://docs/LangRef.html#globalvars > > The section describing the definition of global vars discusses that you > can specify an alignment and can also specify a section. Could someone > provide an example that works in gccas in release 1.9 for both defining > which section the var is assigned to and defining the variables >