Skip to content

Commit 0adfeb1

Browse files
[llvm] Proofread GetElementPtr.rst (#160239)
1 parent c2fe408 commit 0adfeb1

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

llvm/docs/GetElementPtr.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ Introduction
1010

1111
This 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
1515
out the sources of confusion and show that the GEP instruction is really quite
1616
simple.
1717

@@ -30,8 +30,8 @@ What is the first index of the GEP instruction?
3030
Quick answer: The index stepping through the second operand.
3131

3232
The 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
6262
computation. The second operand to the GEP instruction must be a value of a
6363
pointer type. The value of the pointer is provided directly to the GEP
6464
instruction 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

287287
You 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
289289
trees involving ADD, MUL, etc., which are what GEP is lowered into. This has the
290290
advantage of letting your code work correctly in more cases.
291291

@@ -377,7 +377,7 @@ the underlying object.
377377

378378
Furthermore, loads and stores don't have to use the same types as the type of
379379
the 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
381381
how the value will likely be used.
382382

383383
Can 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.
506506
Summary
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
510510
instruction:
511511

512512

0 commit comments

Comments
 (0)