[Mesa-dev] [PATCH] nouveau: Use targ in nv50_ir_generate_code

Ilia Mirkin imirkin at alum.mit.edu
Mon Aug 31 09:23:49 PDT 2015


On Mon, Aug 31, 2015 at 12:21 PM, Tobias Klausmann
<tobias.johannes.klausmann at mni.thm.de> wrote:
>
>
> On 31.08.2015 17:19, Marcos Paulo de souza wrote:
>>
>> ping :)
>>
>> Em 27-08-2015 12:59, Marcos Paulo de Souza escreveu:
>>>
>>> instead of call prog->getTarget(), since the target never change in prog.
>
>
> It is not changing now, don't know if it will in the future. Using
> prog->getTarget() may save us from hassling with this piece of code again.
> Plus it is more explicit to read in my eyes.

but... targ gets used *right above* each one of those instances.
Changing the target on a program object would be insanity.

>
>
>>>
>>> Signed-off-by: Marcos Paulo de Souza <marcos.souza.org at gmail.com>
>>> ---
>>>   src/gallium/drivers/nouveau/codegen/nv50_ir.cpp | 6 +++---
>>>   1 file changed, 3 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir.cpp
>>> b/src/gallium/drivers/nouveau/codegen/nv50_ir.cpp
>>> index cce6055..1dad098 100644
>>> --- a/src/gallium/drivers/nouveau/codegen/nv50_ir.cpp
>>> +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir.cpp
>>> @@ -1195,7 +1195,7 @@ nv50_ir_generate_code(struct nv50_ir_prog_info
>>> *info)
>>>         prog->print();
>>>        targ->parseDriverInfo(info);
>>> -   prog->getTarget()->runLegalizePass(prog, nv50_ir::CG_STAGE_PRE_SSA);
>>> +   targ->runLegalizePass(prog, nv50_ir::CG_STAGE_PRE_SSA);
>>>        prog->convertToSSA();
>>>   @@ -1203,7 +1203,7 @@ nv50_ir_generate_code(struct nv50_ir_prog_info
>>> *info)
>>>         prog->print();
>>>        prog->optimizeSSA(info->optLevel);
>>> -   prog->getTarget()->runLegalizePass(prog, nv50_ir::CG_STAGE_SSA);
>>> +   targ->runLegalizePass(prog, nv50_ir::CG_STAGE_SSA);
>>>        if (prog->dbgFlags & NV50_IR_DEBUG_BASIC)
>>>         prog->print();
>>> @@ -1212,7 +1212,7 @@ nv50_ir_generate_code(struct nv50_ir_prog_info
>>> *info)
>>>         ret = -4;
>>>         goto out;
>>>      }
>>> -   prog->getTarget()->runLegalizePass(prog, nv50_ir::CG_STAGE_POST_RA);
>>> +   targ->runLegalizePass(prog, nv50_ir::CG_STAGE_POST_RA);
>>>        prog->optimizePostRA(info->optLevel);
>>
>>
>>
>
> Greetings,
> Tobias
>
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list