This uses the common compiler passes abstraction to help radv avoid fixed cost compiler overheads. This uses a linked list per thread stored in thread local storage, with an entry in the list for each target machine.
This should remove all the fixed overheads setup costs of creating the pass manager each time.
This takes a demo app time to compile the radv meta shaders on nocache and exit from 1.7s to 1s. It also has been reported to take the startup time of uncached shaders on RoTR from 12m24s to 11m35s (Alex)
v2: fix llvm6 build, inline emit function, handle multiple targets in one thread
v3: rebase and port onto new structure
v4: rename some vars (Bas)
v5: drag all code into radv for now, we can refactor it out later for radeonsi if we make it shareable
v6: use a bit more C++ in the wrapper
v7: logic bugs fixed so it actually runs again.
v8: rebase on top of radeonsi changes.
v9: drop some C++ headers, cleanup list entry
v10: use pop_back (didn't have enough caffeine)
6f3aee40f9 radv: using tls to store llvm related info and speed up compiles (v10)
src/amd/vulkan/Makefile.sources | 2 +
src/amd/vulkan/meson.build | 2 +
src/amd/vulkan/radv_debug.h | 1 +
src/amd/vulkan/radv_device.c | 1 +
src/amd/vulkan/radv_llvm_helper.cpp | 140 ++++++++++++++++++++++++++++++++++++
src/amd/vulkan/radv_nir_to_llvm.c | 27 +------
src/amd/vulkan/radv_shader.c | 10 ++-
src/amd/vulkan/radv_shader_helper.h | 44 ++++++++++++
8 files changed, 199 insertions(+), 28 deletions(-)