Initial support for loop unrolling.
authorStephen McGroarty <stephen@codeplay.com>
Wed, 14 Feb 2018 17:03:12 +0000 (17:03 +0000)
committerSteven Perron <31666470+s-perron@users.noreply.github.com>
Wed, 14 Feb 2018 20:44:38 +0000 (15:44 -0500)
commitdd8400e15077e640043b096d7634976d72fe2f8a
treecfa19eb756ff1a666ab0e6826cc8864feaf2350f
parent229ebc06657c1c2186d2ec3dc0add54d82d93c98
Initial support for loop unrolling.

This patch adds initial support for loop unrolling in the form of a
series of utility classes which perform the unrolling. The pass can
be run with the command spirv-opt --loop-unroll. This will unroll
loops within the module which have the unroll hint set. The unroller
imposes a number of requirements on the loops it can unroll. These are
documented in the comments for the LoopUtils::CanPerformUnroll method in
loop_utils.h. Some of the restrictions will be lifted in future patches.
16 files changed:
Android.mk
include/spirv-tools/optimizer.hpp
source/opt/CMakeLists.txt
source/opt/dominator_tree.h
source/opt/ir_builder.h
source/opt/loop_descriptor.cpp
source/opt/loop_descriptor.h
source/opt/loop_unroller.cpp [new file with mode: 0644]
source/opt/loop_unroller.h [new file with mode: 0644]
source/opt/loop_utils.h
source/opt/optimizer.cpp
source/opt/passes.h
test/opt/loop_optimizations/CMakeLists.txt
test/opt/loop_optimizations/unroll_assumptions.cpp [new file with mode: 0644]
test/opt/loop_optimizations/unroll_simple.cpp [new file with mode: 0644]
tools/opt/opt.cpp