Re: [Mesa-dev] [PATCH 10/13] nir: add helper for cloning loops

2016-08-29 Thread Jason Ekstrand
I don't think anyone is trying to throw away phi's... I think what Connor is proposing is more a better interface to this cloning operation than anything else. Instead of having a separate list of phi's, you can just pre-populate the remap table before doing the clone. For the first loop iteratio

Re: [Mesa-dev] [PATCH 10/13] nir: add helper for cloning loops

2016-08-29 Thread Timothy Arceri
On Mon, 2016-08-29 at 21:06 -0400, Connor Abbott wrote: > So, you've noticed that your method of handling phi's while cloning > doesn't handle phi's that point to other phi's in the same block. > Particularly, something like: > > a = phi(b, ...) > b = phi(a, ...) > > which is supposed to swap a a

Re: [Mesa-dev] [PATCH 10/13] nir: add helper for cloning loops

2016-08-29 Thread Connor Abbott
So, you've noticed that your method of handling phi's while cloning doesn't handle phi's that point to other phi's in the same block. Particularly, something like: a = phi(b, ...) b = phi(a, ...) which is supposed to swap a and b each iteration. Here's a better strategy which should be simpler th

[Mesa-dev] [PATCH 10/13] nir: add helper for cloning loops

2016-08-28 Thread Timothy Arceri
--- src/compiler/nir/nir.h | 3 +++ src/compiler/nir/nir_clone.c | 64 +++- 2 files changed, 60 insertions(+), 7 deletions(-) diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h index 0ab3ebc..9083bd0 100644 --- a/src/compiler/nir/nir.h +++