DirectXShaderCompiler/tools
Jeff Noyle 59cef25eb9
PIX: Synthesize dbg.value for global-backed arrays embedded in non-const global statics (#5223)
In some cases, arrays embedded within an HLSL global static will be backed by an llvm global variable, rather than an alloca or a set of discrete values.
In those cases, there will be no dbg.value or dbg.declare statements that will allow PIX to associate stores to those globals with the HLSL variable.
But it's possible to stitch the storage to the HLSL variable and emit the dbg.value (and "fake" alloca/stores that PIX's debug instrumentation uses for tracking changes to values during execution).
Prior to this work, PIX had no visibility into non-const global statics at all. Now, PIX can see most things, inlcluding the above-described class of embedded arrays. However, more work remains:
-dynamic indexing of the arrays is not considered
-arrays that have been reduced to 1-dimensional equivalents are not covered
The first two will be tackled next. The last will probably be left until and unless requested by a PIX customer.

In brief, this change walks the global variables and compares types, offsets and sizes to determine where arrays might be embedded within other global variables. Maps are constructed to go from a global member's name to the actual member's offset/size, and from the HLSL DIGlobalVariable to the per-function DILocalVariable "alias" or "mirror" of that global (which are denoted by the "global." name prefix) . This allows the "fake" alloca/store and dbg.declares to be emitted for any store to a GEP operand that references those embedded arrays. (If no other members of the HLSL global are accessed, then there will be no DILocalVariable for the new dbg.declares to be associated with, so a new DILocalVariable must be emitted.)
2023-05-18 16:36:36 -07:00
..
clang PIX: Synthesize dbg.value for global-backed arrays embedded in non-const global statics (#5223) 2023-05-18 16:36:36 -07:00
dsymutil
dxexp Cleanup Windows code to conform to stricter C++ 17 compiler (#4804) 2022-11-22 15:31:36 -06:00
llc
lli
llvm-as Enable building LLVM testing tools (#4023) 2021-10-21 11:31:31 -05:00
llvm-bcanalyzer
llvm-c-test
llvm-config
llvm-cov
llvm-cxxdump
llvm-diff
llvm-dis Fix crash for llvm-dis for windows build. (#4471) 2022-05-23 16:53:25 -07:00
llvm-dwarfdump
llvm-extract
llvm-link
llvm-lto
llvm-mc
llvm-mcmarkup
llvm-nm
llvm-objdump Rename 'module' to 'hModule' for C++20 compat (#2667) 2020-03-01 18:12:31 -08:00
llvm-pdbdump Make correct/consistent include capitalization (#1269) 2018-05-10 10:47:52 -07:00
llvm-profdata
llvm-readobj
llvm-rtdyld
llvm-shlib
llvm-size
llvm-stress Fallthrough (#4843) 2022-12-09 10:13:56 -08:00
llvm-symbolizer Make correct/consistent include capitalization (#1269) 2018-05-10 10:47:52 -07:00
lto
macho-dump
msbuild
obj2yaml
opt [opt] initialize HLSL passes with SetupRegistryPassForHLSL (#5217) 2023-05-16 13:35:15 -07:00
verify-uselistorder
yaml2obj
CMakeLists.txt Enable building LLVM testing tools (#4023) 2021-10-21 11:31:31 -05:00
LLVMBuild.txt Remove LTO and ArgumentPromotion passes (#4078) 2021-11-12 18:46:58 -08:00