OSDN Git Service

glsl: use set for copy propagation kills
authorTimothy Arceri <tarceri@itsqueeze.com>
Fri, 17 Mar 2017 13:40:56 +0000 (00:40 +1100)
committerTimothy Arceri <tarceri@itsqueeze.com>
Sat, 18 Mar 2017 03:21:09 +0000 (14:21 +1100)
commitbf8bc6190e79b4312da08a4a5e8f3c3ec129162f
tree428efa52e2d4c5ec05ddb09fc7e8aef70fcc0862
parent9e42b93f338d73d5bb97279060cedef70622c1d0
glsl: use set for copy propagation kills

Previously each time we saw a variable we just created a duplicate
entry in the list. This is particularly bad for loops were we add
everything twice, and then throw nested loops into the mix and the
list was growing expoentially.

This stops the glsl-vs-unroll-explosion test which has 16 nested
loops from reaching the tests mem usage limit in this pass. The
test now hits the mem limit in opt_copy_propagation_elements()
instead.

I suspect this was also part of the reason this pass can be so
slow with some shaders.

Reviewed-by: Thomas Helland <thomashelland90@gmail.com>
src/compiler/glsl/opt_copy_propagation.cpp