@@ -32,7 +32,7 @@ Every register class (int, float, and vector) has its own LRU and they
3232are stored together in an array: ` lrus ` . An LRU is represented similarly
3333to a ` VRegSet ` : it's a circular, doubly-linked list based on a vector.
3434
35- The last PReg in an LRU is the least- recently allocated PReg:
35+ The last PReg in an LRU is the least recently allocated PReg:
3636
3737most recently used PReg (head) -> 2nd MRU PReg -> ... -> LRU PReg
3838
@@ -103,11 +103,11 @@ Some invariants that remain true throughout execution:
103103
1041041 . During processing, the allocation of a VReg at any point in time
105105as indicated in ` vreg_allocs ` changes exactly twice or thrice.
106- Initially it is set to none. When it's allocated, it is
106+ Initially, it is set to none. When it's allocated, it is
107107changed to that allocation. After this, it doesn't change unless
108108it's evicted or spilled across a block boundary;
109109if it is, then its current allocation will change to its dedicated
110- spillslot. After this, it doesn't change again until it's definition
110+ spillslot. After this, it doesn't change again until its definition
111111is reached and it's deallocated, during which its ` vreg_allocs `
112112entry is set to none. The only exception is block parameters that
113113are never used: these are never allocated.
@@ -125,7 +125,7 @@ virtual registers will be in their dedicated spillslots.
125125# Instruction Allocation
126126
127127To allocate a single instruction, the first step is to reset the
128- ` available_pregs ` sets to all allocated PRegs.
128+ ` available_pregs ` sets to all allocatable PRegs.
129129
130130Next, the selection phase is carried out for all operands with
131131fixed register constraints: the registers they are constrained to use are
@@ -188,22 +188,22 @@ On the other hand, if the VReg's current allocation is not within
188188constraints, the selection and eviction phases are carried out for
189189non-fixed operands. First, a set of PRegs that can be drawn from is
190190created from ` available_pregs ` . For early uses and late defs,
191- this draw-from set is the early set or late set respectively.
191+ this draw-from set is the early set or late set, respectively.
192192For late uses and early defs, the draw-from set is an intersection
193193of the available early and late sets (because a PReg used for a late
194194use can't be reassigned to another operand in the early phase;
195195likewise, a PReg used for an early def can't be reassigned to another
196196operand in the late phase).
197197The LRU for the VReg's regclass is then traversed from the end to find
198- the least- recently used PReg in the draw-from set. Once a PReg is found,
198+ the least recently used PReg in the draw-from set. Once a PReg is found,
199199it is marked as the most recently used in the LRU, unavailable in the
200200` available_pregs ` sets, and whatever VReg was in it before is evicted.
201201
202- The assignment phase is carried out next: the final allocation for the
202+ The assignment phase is carried out next. The final allocation for the
203203operand is set to the selected register.
204204
205205If the newly allocated operand has not been allocated before, that is,
206- this is the first use/def of the VReg encountered, the VReg is
206+ this is the first use/def of the VReg encountered; the VReg is
207207inserted into ` live_vregs ` and marked as the value in the allocated
208208PReg in ` vreg_in_preg ` .
209209
@@ -230,7 +230,7 @@ Reused inputs are handled by creating a new operand with a fixed register
230230constraint to use whatever register was assigned to the reuse def.
231231
232232Because of the way reuse operands and reused inputs are handled, when
233- selecting a register for an early use operand with a fixed constraint,
233+ selecting a register for an early- use operand with a fixed constraint,
234234the PReg is also marked as unavailable in the ` available_pregs ` late
235235set if the operand is a reused input. And when selecting a register
236236for reuse def operands, the selected register is marked as unavailable
0 commit comments