[PATCH 2/5] d3dcompiler: Compute liveness ranges for variables.
Zebediah Figura
zfigura at codeweavers.com
Wed Apr 1 13:33:42 CDT 2020
On 4/1/20 1:32 PM, Matteo Bruni wrote:
> On Mon, Mar 30, 2020 at 4:54 AM Zebediah Figura <z.figura12 at gmail.com> wrote:
>>
>> @@ -2641,7 +2726,8 @@ struct bwriter_shader *parse_hlsl(enum shader_type type, DWORD major, DWORD mino
>> goto out;
>> }
>>
>> - index_instructions(entry_func->body, 1);
>> + /* Index 0 means unused; index 1 means function entry, so start at 2. */
>> + index_instructions(entry_func->body, 2);
>
> Do we need to reserve a special value for function entry?
>
An instruction can both consume values and produce them, so a
variable/node with liveness 4-5 and another with 5-6 can be allocated to
the same register. Hence a variable written at function entry needs to
have a first_write index before any reads. This seemed like the most
natural way to do that, though I welcome other suggestions.
More information about the wine-devel
mailing list