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

Kenneth Graunke kenneth at whitecape.org
Thu Aug 18 13:23:27 PDT 2011


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.


More information about the mesa-dev mailing list