Re: [Mesa-dev] [PATCH V2 01/10] nir: evaluate if condition uses inside the if branches

2018-07-18 Thread Connor Abbott
On Thu, Jul 19, 2018 at 10:24 AM, Timothy Arceri wrote: > On 19/07/18 12:02, Connor Abbott wrote: >> >> Why not do the more general thing, and evaluate the condition in every >> block dominated by the then and else blocks? That should handle the >> loop and non-loop cases. > > > Can you explain

Re: [Mesa-dev] [PATCH V2 01/10] nir: evaluate if condition uses inside the if branches

2018-07-18 Thread Timothy Arceri
On 19/07/18 12:02, Connor Abbott wrote: Why not do the more general thing, and evaluate the condition in every block dominated by the then and else blocks? That should handle the loop and non-loop cases. Can you explain what the advantage would be in doing that? Is it just likely to reduce

Re: [Mesa-dev] [PATCH V2 01/10] nir: evaluate if condition uses inside the if branches

2018-07-18 Thread Connor Abbott
Why not do the more general thing, and evaluate the condition in every block dominated by the then and else blocks? That should handle the loop and non-loop cases. On Thu, Jul 19, 2018 at 8:06 AM, Timothy Arceri wrote: > Since we know what side of the branch we ended up on we can just > replace

[Mesa-dev] [PATCH V2 01/10] nir: evaluate if condition uses inside the if branches

2018-07-18 Thread Timothy Arceri
Since we know what side of the branch we ended up on we can just replace the use with a constant. All helped shaders are from Unreal Engine 4 besides one shader from Dirt Showdown. V2: make sure we do evaluation when condition is used in else with a single block (we were checking for blocks