RADV Driver Gets Faster Shader LLVM Compilation
The change is using thread-local storage (TLS) to store LLVM related information to avoid some fixed overhead costs. Airlie explained, "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."
The benefits should be noticeable with a Vulkan demo application dropping its shader compilation time from 1.7 seconds to 1.0 seconds. Or the start-up time on uncached shaders from Rise of the Tomb Raider dropped from 12 minutes, 24 seconds down to 11 minutes, 35 seconds.
This patch also adds a nothreadllvm RADV debug option for disabling the behavior. Details in this commit now within Mesa 18.2-dev.