Static initializers impact performance at load time.
Building latest from github and looking at static initializers shows the same TOGGLE* globals that are getting replicated in multiple compilands from the include/dxc/Support/DxcOptToggles.h header.
D:\DirectXShaderCompiler\VS\tools\clang\tools\dxcompiler\dxcompiler.dir\Release\dxcassembler.obj: [size = 40] hlsl::options::dynamic initializer for 'TOGGLE_DEBUG_NOPS'' D:\DirectXShaderCompiler\VS\tools\clang\tools\dxcompiler\dxcompiler.dir\Release\dxcassembler.obj: [size = 40] hlsl::options::dynamic initializer for 'TOGGLE_ENABLE_AGGRESSIVE_REASSOCIATION''
D:\DirectXShaderCompiler\VS\tools\clang\tools\dxcompiler\dxcompiler.dir\Release\dxcassembler.obj: [size = 40] hlsl::options::dynamic initializer for 'TOGGLE_GVN'' D:\DirectXShaderCompiler\VS\tools\clang\tools\dxcompiler\dxcompiler.dir\Release\dxcassembler.obj: [size = 40] hlsl::options::dynamic initializer for 'TOGGLE_LICM''
D:\DirectXShaderCompiler\VS\tools\clang\tools\dxcompiler\dxcompiler.dir\Release\dxcassembler.obj: [size = 40] hlsl::options::dynamic initializer for 'TOGGLE_LIFETIME_MARKERS'' D:\DirectXShaderCompiler\VS\tools\clang\tools\dxcompiler\dxcompiler.dir\Release\dxcassembler.obj: [size = 40] hlsl::options::dynamic initializer for 'TOGGLE_PARTIAL_LIFETIME_MARKERS''
D:\DirectXShaderCompiler\VS\tools\clang\tools\dxcompiler\dxcompiler.dir\Release\dxcassembler.obj: [size = 40] hlsl::options::dynamic initializer for 'TOGGLE_SINK'' D:\DirectXShaderCompiler\VS\tools\clang\tools\dxcompiler\dxcompiler.dir\Release\dxcassembler.obj: [size = 40] hlsl::options::dynamic initializer for 'TOGGLE_STRUCTURIZE_LOOP_EXITS_FOR_UNROLL''
D:\DirectXShaderCompiler\VS\tools\clang\tools\dxcompiler\dxcompiler.dir\Release\dxcassembler.obj: [size = 40] hlsl::options::dynamic initializer for 'TOGGLE_STRUCTURIZE_RETURNS'' D:\DirectXShaderCompiler\VS\tools\clang\tools\dxcompiler\dxcompiler.dir\Release\dxcompilerobj.obj: [size = 40] hlsl::options::dynamic initializer for 'TOGGLE_DEBUG_NOPS''
D:\DirectXShaderCompiler\VS\tools\clang\tools\dxcompiler\dxcompiler.dir\Release\dxcompilerobj.obj: [size = 40] hlsl::options::dynamic initializer for 'TOGGLE_ENABLE_AGGRESSIVE_REASSOCIATION'' D:\DirectXShaderCompiler\VS\tools\clang\tools\dxcompiler\dxcompiler.dir\Release\dxcompilerobj.obj: [size = 40] hlsl::options::dynamic initializer for 'TOGGLE_GVN''
D:\DirectXShaderCompiler\VS\tools\clang\tools\dxcompiler\dxcompiler.dir\Release\dxcompilerobj.obj: [size = 40] hlsl::options::dynamic initializer for 'TOGGLE_LICM'' D:\DirectXShaderCompiler\VS\tools\clang\tools\dxcompiler\dxcompiler.dir\Release\dxcompilerobj.obj: [size = 40] hlsl::options::dynamic initializer for 'TOGGLE_LIFETIME_MARKERS''
D:\DirectXShaderCompiler\VS\tools\clang\tools\dxcompiler\dxcompiler.dir\Release\dxcompilerobj.obj: [size = 40] hlsl::options::dynamic initializer for 'TOGGLE_PARTIAL_LIFETIME_MARKERS'' D:\DirectXShaderCompiler\VS\tools\clang\tools\dxcompiler\dxcompiler.dir\Release\dxcompilerobj.obj: [size = 40] hlsl::options::dynamic initializer for 'TOGGLE_SINK''
D:\DirectXShaderCompiler\VS\tools\clang\tools\dxcompiler\dxcompiler.dir\Release\dxcompilerobj.obj: [size = 40] hlsl::options::dynamic initializer for 'TOGGLE_STRUCTURIZE_LOOP_EXITS_FOR_UNROLL'' D:\DirectXShaderCompiler\VS\tools\clang\tools\dxcompiler\dxcompiler.dir\Release\dxcompilerobj.obj: [size = 40] hlsl::options::dynamic initializer for 'TOGGLE_STRUCTURIZE_RETURNS''
D:\DirectXShaderCompiler\VS\tools\clang\tools\dxcompiler\dxcompiler.dir\Release\DXCompiler.obj: [size = 40] hlsl::options::dynamic initializer for 'TOGGLE_DEBUG_NOPS'' D:\DirectXShaderCompiler\VS\tools\clang\tools\dxcompiler\dxcompiler.dir\Release\DXCompiler.obj: [size = 40] hlsl::options::dynamic initializer for 'TOGGLE_ENABLE_AGGRESSIVE_REASSOCIATION''
D:\DirectXShaderCompiler\VS\tools\clang\tools\dxcompiler\dxcompiler.dir\Release\DXCompiler.obj: [size = 40] hlsl::options::dynamic initializer for 'TOGGLE_GVN'' D:\DirectXShaderCompiler\VS\tools\clang\tools\dxcompiler\dxcompiler.dir\Release\DXCompiler.obj: [size = 40] hlsl::options::dynamic initializer for 'TOGGLE_LICM''
D:\DirectXShaderCompiler\VS\tools\clang\tools\dxcompiler\dxcompiler.dir\Release\DXCompiler.obj: [size = 40] hlsl::options::dynamic initializer for 'TOGGLE_LIFETIME_MARKERS'' D:\DirectXShaderCompiler\VS\tools\clang\tools\dxcompiler\dxcompiler.dir\Release\DXCompiler.obj: [size = 40] hlsl::options::dynamic initializer for 'TOGGLE_PARTIAL_LIFETIME_MARKERS''
D:\DirectXShaderCompiler\VS\tools\clang\tools\dxcompiler\dxcompiler.dir\Release\DXCompiler.obj: [size = 40] hlsl::options::dynamic initializer for 'TOGGLE_SINK'' D:\DirectXShaderCompiler\VS\tools\clang\tools\dxcompiler\dxcompiler.dir\Release\DXCompiler.obj: [size = 40] hlsl::options::dynamic initializer for 'TOGGLE_STRUCTURIZE_LOOP_EXITS_FOR_UNROLL''
D:\DirectXShaderCompiler\VS\tools\clang\tools\dxcompiler\dxcompiler.dir\Release\DXCompiler.obj: [size = 40] hlsl::options::dynamic initializer for 'TOGGLE_STRUCTURIZE_RETURNS'' D:\DirectXShaderCompiler\VS\tools\clang\tools\dxcompiler\dxcompiler.dir\Release\dxcfilesystem.obj: [size = 40] hlsl::options::dynamic initializer for 'TOGGLE_DEBUG_NOPS''
D:\DirectXShaderCompiler\VS\tools\clang\tools\dxcompiler\dxcompiler.dir\Release\dxcfilesystem.obj: [size = 40] hlsl::options::dynamic initializer for 'TOGGLE_ENABLE_AGGRESSIVE_REASSOCIATION'' D:\DirectXShaderCompiler\VS\tools\clang\tools\dxcompiler\dxcompiler.dir\Release\dxcfilesystem.obj: [size = 40] hlsl::options::dynamic initializer for 'TOGGLE_GVN''
D:\DirectXShaderCompiler\VS\tools\clang\tools\dxcompiler\dxcompiler.dir\Release\dxcfilesystem.obj: [size = 40] hlsl::options::dynamic initializer for 'TOGGLE_LICM'' D:\DirectXShaderCompiler\VS\tools\clang\tools\dxcompiler\dxcompiler.dir\Release\dxcfilesystem.obj: [size = 40] hlsl::options::dynamic initializer for 'TOGGLE_LIFETIME_MARKERS''
D:\DirectXShaderCompiler\VS\tools\clang\tools\dxcompiler\dxcompiler.dir\Release\dxcfilesystem.obj: [size = 40] hlsl::options::dynamic initializer for 'TOGGLE_PARTIAL_LIFETIME_MARKERS'' D:\DirectXShaderCompiler\VS\tools\clang\tools\dxcompiler\dxcompiler.dir\Release\dxcfilesystem.obj: [size = 40] hlsl::options::dynamic initializer for 'TOGGLE_SINK''
D:\DirectXShaderCompiler\VS\tools\clang\tools\dxcompiler\dxcompiler.dir\Release\dxcfilesystem.obj: [size = 40] hlsl::options::dynamic initializer for 'TOGGLE_STRUCTURIZE_LOOP_EXITS_FOR_UNROLL'' D:\DirectXShaderCompiler\VS\tools\clang\tools\dxcompiler\dxcompiler.dir\Release\dxcfilesystem.obj: [size = 40] hlsl::options::dynamic initializer for 'TOGGLE_STRUCTURIZE_RETURNS''
While this is true, I'm going to mark this as dormant since the team is focused on adding hlsl support to clang. We'd welcome PRs that address this issue.
Static initializers impact performance at load time.
Building latest from github and looking at static initializers shows the same TOGGLE* globals that are getting replicated in multiple compilands from the include/dxc/Support/DxcOptToggles.h header.
D:\DirectXShaderCompiler\VS\tools\clang\tools\dxcompiler\dxcompiler.dir\Release\dxcassembler.obj: [size = 40] hlsl::options::
dynamic initializer for 'TOGGLE_DEBUG_NOPS'' D:\DirectXShaderCompiler\VS\tools\clang\tools\dxcompiler\dxcompiler.dir\Release\dxcassembler.obj: [size = 40] hlsl::options::
dynamic initializer for 'TOGGLE_ENABLE_AGGRESSIVE_REASSOCIATION'' D:\DirectXShaderCompiler\VS\tools\clang\tools\dxcompiler\dxcompiler.dir\Release\dxcassembler.obj: [size = 40] hlsl::options::dynamic initializer for 'TOGGLE_GVN'' D:\DirectXShaderCompiler\VS\tools\clang\tools\dxcompiler\dxcompiler.dir\Release\dxcassembler.obj: [size = 40] hlsl::options::
dynamic initializer for 'TOGGLE_LICM'' D:\DirectXShaderCompiler\VS\tools\clang\tools\dxcompiler\dxcompiler.dir\Release\dxcassembler.obj: [size = 40] hlsl::options::dynamic initializer for 'TOGGLE_LIFETIME_MARKERS'' D:\DirectXShaderCompiler\VS\tools\clang\tools\dxcompiler\dxcompiler.dir\Release\dxcassembler.obj: [size = 40] hlsl::options::
dynamic initializer for 'TOGGLE_PARTIAL_LIFETIME_MARKERS'' D:\DirectXShaderCompiler\VS\tools\clang\tools\dxcompiler\dxcompiler.dir\Release\dxcassembler.obj: [size = 40] hlsl::options::dynamic initializer for 'TOGGLE_SINK'' D:\DirectXShaderCompiler\VS\tools\clang\tools\dxcompiler\dxcompiler.dir\Release\dxcassembler.obj: [size = 40] hlsl::options::
dynamic initializer for 'TOGGLE_STRUCTURIZE_LOOP_EXITS_FOR_UNROLL'' D:\DirectXShaderCompiler\VS\tools\clang\tools\dxcompiler\dxcompiler.dir\Release\dxcassembler.obj: [size = 40] hlsl::options::dynamic initializer for 'TOGGLE_STRUCTURIZE_RETURNS'' D:\DirectXShaderCompiler\VS\tools\clang\tools\dxcompiler\dxcompiler.dir\Release\dxcompilerobj.obj: [size = 40] hlsl::options::
dynamic initializer for 'TOGGLE_DEBUG_NOPS'' D:\DirectXShaderCompiler\VS\tools\clang\tools\dxcompiler\dxcompiler.dir\Release\dxcompilerobj.obj: [size = 40] hlsl::options::dynamic initializer for 'TOGGLE_ENABLE_AGGRESSIVE_REASSOCIATION'' D:\DirectXShaderCompiler\VS\tools\clang\tools\dxcompiler\dxcompiler.dir\Release\dxcompilerobj.obj: [size = 40] hlsl::options::
dynamic initializer for 'TOGGLE_GVN'' D:\DirectXShaderCompiler\VS\tools\clang\tools\dxcompiler\dxcompiler.dir\Release\dxcompilerobj.obj: [size = 40] hlsl::options::dynamic initializer for 'TOGGLE_LICM'' D:\DirectXShaderCompiler\VS\tools\clang\tools\dxcompiler\dxcompiler.dir\Release\dxcompilerobj.obj: [size = 40] hlsl::options::
dynamic initializer for 'TOGGLE_LIFETIME_MARKERS'' D:\DirectXShaderCompiler\VS\tools\clang\tools\dxcompiler\dxcompiler.dir\Release\dxcompilerobj.obj: [size = 40] hlsl::options::dynamic initializer for 'TOGGLE_PARTIAL_LIFETIME_MARKERS'' D:\DirectXShaderCompiler\VS\tools\clang\tools\dxcompiler\dxcompiler.dir\Release\dxcompilerobj.obj: [size = 40] hlsl::options::
dynamic initializer for 'TOGGLE_SINK'' D:\DirectXShaderCompiler\VS\tools\clang\tools\dxcompiler\dxcompiler.dir\Release\dxcompilerobj.obj: [size = 40] hlsl::options::dynamic initializer for 'TOGGLE_STRUCTURIZE_LOOP_EXITS_FOR_UNROLL'' D:\DirectXShaderCompiler\VS\tools\clang\tools\dxcompiler\dxcompiler.dir\Release\dxcompilerobj.obj: [size = 40] hlsl::options::
dynamic initializer for 'TOGGLE_STRUCTURIZE_RETURNS'' D:\DirectXShaderCompiler\VS\tools\clang\tools\dxcompiler\dxcompiler.dir\Release\DXCompiler.obj: [size = 40] hlsl::options::dynamic initializer for 'TOGGLE_DEBUG_NOPS'' D:\DirectXShaderCompiler\VS\tools\clang\tools\dxcompiler\dxcompiler.dir\Release\DXCompiler.obj: [size = 40] hlsl::options::
dynamic initializer for 'TOGGLE_ENABLE_AGGRESSIVE_REASSOCIATION'' D:\DirectXShaderCompiler\VS\tools\clang\tools\dxcompiler\dxcompiler.dir\Release\DXCompiler.obj: [size = 40] hlsl::options::dynamic initializer for 'TOGGLE_GVN'' D:\DirectXShaderCompiler\VS\tools\clang\tools\dxcompiler\dxcompiler.dir\Release\DXCompiler.obj: [size = 40] hlsl::options::
dynamic initializer for 'TOGGLE_LICM'' D:\DirectXShaderCompiler\VS\tools\clang\tools\dxcompiler\dxcompiler.dir\Release\DXCompiler.obj: [size = 40] hlsl::options::dynamic initializer for 'TOGGLE_LIFETIME_MARKERS'' D:\DirectXShaderCompiler\VS\tools\clang\tools\dxcompiler\dxcompiler.dir\Release\DXCompiler.obj: [size = 40] hlsl::options::
dynamic initializer for 'TOGGLE_PARTIAL_LIFETIME_MARKERS'' D:\DirectXShaderCompiler\VS\tools\clang\tools\dxcompiler\dxcompiler.dir\Release\DXCompiler.obj: [size = 40] hlsl::options::dynamic initializer for 'TOGGLE_SINK'' D:\DirectXShaderCompiler\VS\tools\clang\tools\dxcompiler\dxcompiler.dir\Release\DXCompiler.obj: [size = 40] hlsl::options::
dynamic initializer for 'TOGGLE_STRUCTURIZE_LOOP_EXITS_FOR_UNROLL'' D:\DirectXShaderCompiler\VS\tools\clang\tools\dxcompiler\dxcompiler.dir\Release\DXCompiler.obj: [size = 40] hlsl::options::dynamic initializer for 'TOGGLE_STRUCTURIZE_RETURNS'' D:\DirectXShaderCompiler\VS\tools\clang\tools\dxcompiler\dxcompiler.dir\Release\dxcfilesystem.obj: [size = 40] hlsl::options::
dynamic initializer for 'TOGGLE_DEBUG_NOPS'' D:\DirectXShaderCompiler\VS\tools\clang\tools\dxcompiler\dxcompiler.dir\Release\dxcfilesystem.obj: [size = 40] hlsl::options::dynamic initializer for 'TOGGLE_ENABLE_AGGRESSIVE_REASSOCIATION'' D:\DirectXShaderCompiler\VS\tools\clang\tools\dxcompiler\dxcompiler.dir\Release\dxcfilesystem.obj: [size = 40] hlsl::options::
dynamic initializer for 'TOGGLE_GVN'' D:\DirectXShaderCompiler\VS\tools\clang\tools\dxcompiler\dxcompiler.dir\Release\dxcfilesystem.obj: [size = 40] hlsl::options::dynamic initializer for 'TOGGLE_LICM'' D:\DirectXShaderCompiler\VS\tools\clang\tools\dxcompiler\dxcompiler.dir\Release\dxcfilesystem.obj: [size = 40] hlsl::options::
dynamic initializer for 'TOGGLE_LIFETIME_MARKERS'' D:\DirectXShaderCompiler\VS\tools\clang\tools\dxcompiler\dxcompiler.dir\Release\dxcfilesystem.obj: [size = 40] hlsl::options::dynamic initializer for 'TOGGLE_PARTIAL_LIFETIME_MARKERS'' D:\DirectXShaderCompiler\VS\tools\clang\tools\dxcompiler\dxcompiler.dir\Release\dxcfilesystem.obj: [size = 40] hlsl::options::
dynamic initializer for 'TOGGLE_SINK'' D:\DirectXShaderCompiler\VS\tools\clang\tools\dxcompiler\dxcompiler.dir\Release\dxcfilesystem.obj: [size = 40] hlsl::options::dynamic initializer for 'TOGGLE_STRUCTURIZE_LOOP_EXITS_FOR_UNROLL'' D:\DirectXShaderCompiler\VS\tools\clang\tools\dxcompiler\dxcompiler.dir\Release\dxcfilesystem.obj: [size = 40] hlsl::options::
dynamic initializer for 'TOGGLE_STRUCTURIZE_RETURNS''Truncating output due to size limit