OSDN Git Service

Optimizer optimization
authorAlexis Hetu <sugoi@google.com>
Wed, 13 Jun 2018 20:21:34 +0000 (16:21 -0400)
committerAlexis Hétu <sugoi@google.com>
Thu, 14 Jun 2018 17:24:58 +0000 (17:24 +0000)
commita5ac650d2031ef1ccdd4d35aa8fb57d1b55dbee9
treeda916e6ba20f16f6583656929a63c505d9abbd76
parent170766a36bd7efac2f95d89eb0ff74e2e3d0dcd9
Optimizer optimization

Optimizer::optimizeStoresInSingleBasicBlock() was taking an extremely long time due to
looping through all the instructions of a single basic block at every iteration. By
creating a much smaller list of only load/store operations the first time a single basic
block is encountered and reusing that list when the same block is encountered again,
this function now runs ~10X faster.

In my test case:
out/Default/cc_unittests --gtest_filter=ImageBackgroundFilter.BackgroundFilterRotated_GL
The sw::optimize function went from taking almost 16s to roughly 1.5s.

Bug b/67872293

Change-Id: I7e2e2aa8dc1bf2663988fb59b58d72d9ee986e36
Reviewed-on: https://swiftshader-review.googlesource.com/19408
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
src/Reactor/Optimizer.cpp