Lines Matching refs:GEP
2 The Often Misunderstood GEP Instruction
12 `GetElementPtr <LangRef.html#getelementptr-instruction>`_ (GEP) instruction.
13 Questions about the wily GEP instruction are probably the most frequently
15 out the sources of confusion and show that the GEP instruction is really quite
21 When people are first confronted with the GEP instruction, they tend to relate
23 indexing and field selection. GEP closely resembles C array indexing and field
27 What is the first index of the GEP instruction?
46 provide the GEP instruction with two index operands. The first operand indexes
62 computation. The second operand to the GEP instruction must be a value of a
63 pointer type. The value of the pointer is provided directly to the GEP
81 In this "C" example, the front end compiler (Clang) will generate three GEP
83 function argument ``P`` will be the second operand of each of these GEP
103 In each case the second operand is the pointer through which the GEP instruction
117 These GEP instructions are simply making address computations from the base
129 directly to the GEP instructions.
135 the pointer that results from these GEP instructions would produce undefined
143 This question arises most often when the GEP instruction is applied to a global
152 The GEP above yields a ``ptr`` by indexing the ``i32`` typed field of the
161 #. Point #1 is evidenced by noticing the type of the second operand of the GEP
165 ``%MyStruct``. Since the second argument to the GEP instruction must always
172 What is dereferenced by GEP?
178 memory in any way. That's what the Load and Store instructions are for. GEP is
195 This cannot be expressed in a single GEP instruction, because it requires
205 In this case, the structure does not contain a pointer and the GEP instruction
209 Why don't GEP x,0,0,1 and GEP x,1 alias?
214 If you look at the first indices in these GEP instructions you find that they
230 Why do GEP x,1,0,0 and GEP x,1 alias?
235 These two GEP instructions will compute the same address because indexing
247 Can GEP index into vector elements?
260 How is GEP different from ``ptrtoint``, arithmetic, and ``inttoptr``?
270 doesn't do this. With GEP you can avoid this problem.
272 Also, GEP carries additional pointer aliasing rules. It's invalid to take a GEP
278 And, GEP is more concise in common cases.
284 I'm writing a backend for a target which needs custom lowering for GEP. How do I do this?
287 You don't. The integer computation implied by a GEP is target-independent.
289 trees involving ADD, MUL, etc., which are what GEP is lowered into. This has the
292 GEP does use target-dependent parameters for the size and layout of data types,
296 fix a lot of code in the backend, with GEP lowering being only a small piece of
302 GEPs don't natively support VLAs. LLVM's type system is entirely static, and GEP
307 ``X[a*m+b*n+c]``, so that it appears to the GEP as a single-dimensional array
326 operand to the GEP. Indices greater than the number of elements in the
348 With the ``inbounds`` keyword, the result value of the GEP is undefined if the
354 address of allocated and sufficiently aligned memory. But the GEP itself is only
370 Can I do GEP with a different pointer type than the type of the underlying object?
374 pointer type. The types in a GEP serve only to define the parameters for the
386 You can compute an address that way, but if you use GEP to do the add, you can't
399 of GEP's special aliasing rules do not apply to pointers computed from ptrtoint,
405 As with arithmetic on null, you can use GEP to compute an address that way, but
423 What happens if a GEP computation overflows?
426 If the GEP lacks the ``inbounds`` keyword, the value is the result from
431 If the GEP has the ``inbounds`` keyword, the result value is undefined (a "trap
432 value") if the GEP overflows (i.e. wraps around the end of the address space).
460 Why is GEP designed this way?
463 The design of GEP has the following goals, in rough unofficial order of
470 particular, GEP is a cornerstone of LLVM's `pointer aliasing
502 emit a GEP with the base pointer casted to a simple address-unit pointer, using
504 sufficient to preserve the pointer aliasing guarantees that GEP provides.
513 #. The GEP instruction never accesses memory, it only provides pointer
516 #. The second operand to the GEP instruction is always a pointer and it must be
519 #. There are no superfluous indices for the GEP instruction.