[Mesa-dev] [PATCH 3/4] i965/vs: Add simple dead code elimination.

Dan McCabe zen3d.linux at gmail.com
Fri Aug 19 10:58:55 PDT 2011


On 08/18/2011 01:23 PM, Kenneth Graunke wrote:
> On 08/18/2011 12:02 PM, Matt Turner wrote:
>> On Thu, Aug 18, 2011 at 2:38 PM, Eric Anholt<eric at anholt.net>  wrote:
>>> +   bool progress = true;
>>> +   while (progress) {
>>> +      progress = false;
>>> +      progress = dead_code_eliminate() || progress;
>>
>> || progress is always false, though maybe it's just written like that
>> to match the style of the code.
>>
>> I'd have just written this as
>>
>> bool progress;
>> do {
>>      progress = dead_code_eliminate();
>> } while (progress)
>>
>> Matt
>
> The idea is that we'll add more passes later, so eventually, progress
> won't just be false.  Using the do-while loop is probably clearer though.

If that's the case (that we'll add more passes later), this should have 
been noted in the commit msg. It would have prevented people from 
scratching their heads about the logic.

> _______________________________________________
> 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