@@ -10,8 +10,8 @@ Introduction
1010
1111This document seeks to dispel the mystery and confusion surrounding LLVM's
1212`GetElementPtr <LangRef.html#getelementptr-instruction >`_ (GEP) instruction.
13- Questions about the wily GEP instruction are probably the most frequently
14- occurring questions once a developer gets down to coding with LLVM. Here we lay
13+ Questions about the wily GEP instruction are probably the most frequent
14+ questions once a developer gets down to coding with LLVM. Here we lay
1515out the sources of confusion and show that the GEP instruction is really quite
1616simple.
1717
@@ -30,8 +30,8 @@ What is the first index of the GEP instruction?
3030Quick answer: The index stepping through the second operand.
3131
3232The confusion with the first index usually arises from thinking about the
33- GetElementPtr instruction as if it was a C index operator. They aren't the
34- same. For example, when we write, in "C" :
33+ GetElementPtr instruction as if it were a C index operator. They aren't the
34+ same. For example, when we write, in C :
3535
3636.. code-block :: c++
3737
@@ -62,7 +62,7 @@ The answer is simply because memory does not have to be accessed to perform the
6262computation. The second operand to the GEP instruction must be a value of a
6363pointer type. The value of the pointer is provided directly to the GEP
6464instruction as an operand without any need for accessing memory. It must,
65- therefore be indexed and requires an index operand. Consider this example:
65+ therefore, be indexed and requires an index operand. Consider this example:
6666
6767.. code-block :: c++
6868
@@ -285,7 +285,7 @@ I'm writing a backend for a target which needs custom lowering for GEP. How do I
285285-----------------------------------------------------------------------------------------
286286
287287You don't. The integer computation implied by a GEP is target-independent.
288- Typically what you'll need to do is make your backend pattern-match expressions
288+ Typically what you'll need to do is make your backend pattern-match expression
289289trees involving ADD, MUL, etc., which are what GEP is lowered into. This has the
290290advantage of letting your code work correctly in more cases.
291291
@@ -377,7 +377,7 @@ the underlying object.
377377
378378Furthermore, loads and stores don't have to use the same types as the type of
379379the underlying object. Types in this context serve only to specify memory size
380- and alignment. Beyond that there are merely a hint to the optimizer indicating
380+ and alignment. Beyond that they are merely a hint to the optimizer indicating
381381how the value will likely be used.
382382
383383Can I cast an object's address to integer and add it to null?
@@ -506,7 +506,7 @@ sufficient to preserve the pointer aliasing guarantees that GEP provides.
506506Summary
507507=======
508508
509- In summary, here's some things to always remember about the GetElementPtr
509+ In summary, here are some things to always remember about the GetElementPtr
510510instruction:
511511
512512
0 commit comments