194 Commits

Author SHA1 Message Date
Farzon Lotfi
6dfeea3f86
Revert "[DirectX] Add atan2 intrinsic and expand for DXIL backend (p1)" (#109842)
Reverts llvm/llvm-project#108865

Broke the Docs build
2024-09-24 14:11:14 -04:00
Tex Riddell
26029d77a5
[DirectX] Add atan2 intrinsic and expand for DXIL backend (p1) (#108865)
This change is part of this proposal:
https://discourse.llvm.org/t/rfc-all-the-math-intrinsics/78294

This preliminary work adds the intrinsic to llvm and expands using atan
intrinsic for DXIL backend, since DXIL has no atan2 op.

Part 1 for Implement the atan2 HLSL Function #70096.
2024-09-24 13:42:26 -04:00
S. Bharadwaj Yadavalli
3734fa8c72
[DXIL] Consume Metadata Analysis information in passes (#108034)
- Changed `DXILTranslateMetadata::translateMetadata()` to consume DXIL
Metadata Analysis information. Subsumed into `DXILTranslateMetedata.cpp`
the functionality in `DXILMetadata.*` files - that are hence deleted.
- Changed `DXILPrepare` pass to consume DXIL Metadata Analysis
information.
- Renamed `ModuleMetadataInfo::ShaderStage` to
`ModuleMetadataInfo::ShaderProfile` to better convey what it represents.
- Updated `unknown` target shader stage specification in triples of a
couple of tests.
- Added new tests for additional verification of `DXILTranslateMetadata`
pass functionality.
2024-09-23 19:00:20 -04:00
Sarah Spall
67518a44fe
[HLSL] Implement elementwise popcount (#108121)
Add new elementwise popcount builtin to support HLSL function
'countbits'.
elementwise popcount only accepts integer types.
Add hlsl intrinsic 'countbits'
Closes #99094
2024-09-18 08:19:52 -07:00
Farzon Lotfi
0f97b4824a
[Scalarizer][DirectX] Add support for scalarization of Target intrinsics (#108776)
Since we are using the Scalarizer pass in the backend we needed a way to
allow this pass to operate on Target intrinsics.
We achieved this by adding `TargetTransformInfo ` to the Scalarizer
pass. This allowed us to call a function available to the DirectX
backend to know if an intrinsic is a target intrinsic that should be
scalarized.
2024-09-17 11:35:42 -04:00
Xiang Li
981bb9dcc9
[DirectX] generate resource table for PSV part (#106607)
Use DXILResourceWrapperPass to build the resource table.

Since DXILResourceWrapperPass operates on LLVM intrinsics rather than
DXIL operations, add addPreserved for DXILResourceWrapperPass in the
passes before DXContainerGlobals

Fixes #103275
2024-09-12 20:41:20 -04:00
Farzon Lotfi
c05e29bff0
[LegacyPM][DirectX] Add legacy scalarizer back for use in the DirectX backend (#107427)
As discussed in this
[proposal](https://github.com/llvm/wg-hlsl/pull/62/files?short_path=ac6e592#diff-ac6e59276afe8016e307eedc5c835f534c0cb353707760b44df0fa9d905a5cf8).
We had to bring back the legacy pass manager interface for the
scalarizer pass. Two reasons for this:
1. The DirectX backend is still using the legacy pass manager
2. The new PM isn't hooked up in clang yet via `BackendUtil.cpp`'s
`AddEmitPasses` That means even if we add a `buildCodeGenPipeline` we
won't be able to benefit from the new pass manager's scalarizer pass
interface.

The remaining changes are hooking up the scalarizer pass to the DirectX
backend, updating the DirectX test cases,
and allowing the `optdriver` to not block the legacy invocation of the
scalarizer pass.

Future work still needs to be done to allow the scalarizer pass to
handle target specific intrinsics.

closes #105178
2024-09-12 15:53:50 -04:00
Joshua Batista
2d47a0baba
Add step builtins and step HLSL function to DirectX and SPIR-V backend (#106471)
This PR adds the step intrinsic and an HLSL function that uses it.
The SPIRV backend is also implemented.

Used https://github.com/llvm/llvm-project/pull/102683 as a reference.
Fixes https://github.com/llvm/llvm-project/issues/99157
2024-09-12 10:26:38 -07:00
Justin Bogner
3d129016b1
[DirectX] Preserve value names in DXILOpLowering. NFC (#108089)
If the value we're replacing has a name, we might as well preserve it.
2024-09-11 18:36:40 -07:00
Justin Bogner
34e20f18f0
[DirectX] Implement typedBufferLoad_checkbit (#108087)
This represents a typedBufferLoad that's followed by
"CheckAccessFullyMapped". It returns an extra `i1` representing that
value.

Fixes #108085
2024-09-11 16:24:38 -07:00
Tim Besard
49b57df161
DXIL: Use correct type ID when writing ValueAsMetadata. (#94337)
When emitting references to functions as part of `ValueAsMetadata`,
we currently emit the incorrect (typed) pointer, resulting in
crashes during deserialization. Avoid this by correctly mapping the
type during serialization.
2024-09-11 14:38:56 +02:00
Justin Bogner
90e841131a
[DirectX] Lower @llvm.dx.typedBufferStore to DXIL ops
The `@llvm.dx.typedBufferStore` intrinsic is lowered to `@dx.op.bufferStore`.

Pull Request: https://github.com/llvm/llvm-project/pull/104253
2024-09-10 10:33:57 -07:00
Justin Bogner
3f22756f39
[DirectX] Lower @llvm.dx.typedBufferLoad to DXIL ops
The `@llvm.dx.typedBufferLoad` intrinsic is lowered to `@dx.op.bufferLoad`.
There's some complexity here in translating to scalarized IR, which I've
abstracted out into a function that should be useful for samples, gathers, and
CBuffer loads.

I've also updated the DXILResources.rst docs to match what I'm doing here and
the proposal in llvm/wg-hlsl#59. I've removed the content about stores and raw
buffers for now with the expectation that it will be added along with the work.

Note that this change includes a bit of a hack in how it deals with
`getOverloadKind` for the `dx.ResRet` types - we need to adjust how we deal
with operation overloads to generate a table directly rather than proxy through
the OverloadKind enum, but that's left for a later change here.

Part of #91367

Pull Request: https://github.com/llvm/llvm-project/pull/104252
2024-09-09 13:21:22 -07:00
Tim Gymnich
5edede2db0
[DXIL] Add sign intrinsic part 2 (#101988)
makes progress on #70078

### Changes
- Added `int_dx_sign` intrinsic in `IntrinsicsDirectX.td`
- Added expansion for `int_dx_sign in `DXILIntrinsicExpansion.cpp`
- Added DXIL backend test case

### Related PRs
- https://github.com/llvm/llvm-project/pull/101987
- https://github.com/llvm/llvm-project/pull/101989
2024-09-05 12:46:14 -04:00
Justin Bogner
76be3a0024
[DirectX] Fix crash in DXILOpBuilder for vector types (#107334)
This function needs to return the "undefined" sigil for unknown types so
that the actual error handling triggers instead of a crash.
2024-09-04 22:12:01 -07:00
Xiang Li
eb2929d323
[DirectX] use DXILMetadataAnalysis to build PSVRuntimeInfo (#107101)
Replace the hardcoded values for compute shader in
DXContainer::addPipelineStateValidationInfo.
Still missing wave size.

Add preserved for previous passes so the information is not lost.

Fix https://github.com/llvm/wg-hlsl/issues/51
2024-09-04 21:59:42 -04:00
Nathan Gauër
afb6dafc6b
[clang][HLSL] Add WaveIsFirstLane() intrinsic (#103299)
This commits add the WaveIsFirstLane() hlsl intrinsinc. This intrinsic
uses the convergence intrinsincs for the SPIR-V backend. On the DXIL
side, I'm not sure what the strategy is for convergence, so I
implemented that like in DXC: a normal builtin function.

Signed-off-by: Nathan Gauër <brioche@google.com>
2024-09-04 11:27:03 +02:00
Damyan Pepper
24b6b82487
[NFC] Add llvm_unreachable to getRCPrefix (#106822) 2024-09-03 10:54:57 -07:00
Justin Bogner
87157ab0f6
[DirectX] Add resource handling to the DXIL pretty printer
Handle target extension type resources when printing resources to textual IR.

Pull Request: https://github.com/llvm/llvm-project/pull/104448
2024-08-26 17:42:24 -07:00
Justin Bogner
daa79232f7
[DirectX] Implement metadata lowering for resources
Generate metadata from target extension type based resources.

Part of #91366

Pull Request: https://github.com/llvm/llvm-project/pull/104447
2024-08-26 17:19:15 -07:00
Justin Bogner
58eec851cb
[DirectX] Move resource logic into PrettyPrinter and TranslateMetadata. NFC
Move the module level logic for resources into the pretty printer and translate
metadata passes rather than embedding them in the DXILResource helper. This
will make it easier to migrate towards the target extension type based approach
to resources.

Pull Request: https://github.com/llvm/llvm-project/pull/104446
2024-08-26 16:44:41 -07:00
Farzon Lotfi
ff5816ad29
[DirectX] Add all lowering (#105787)
- DXILIntrinsicExpansion.cpp: Modify `any` codegen expansion to work for
`all`
- DirectX\all.ll: Add test case

completes #88946
2024-08-26 13:40:11 -04:00
Justin Bogner
aa61925eac
[DirectX] Lower @llvm.dx.handle.fromBinding to DXIL ops
The `@llvm.dx.handle.fromBinding` intrinsic is lowered either to the
`CreateHandle` op or a pair of `CreateHandleFromBinding` and `AnnotateHandle`
ops, depending on the DXIL version. Regardless of the DXIL version we need to
emit metadata about the binding, but that's left to a separate change.

These DXIL ops all need to return the `%dx.types.Handle` type, but the llvm
intrinsic returns a target extension type. To facilitate changing the type of
the operation and all of its users, we introduce `%llvm.dx.cast.handle`, which
can cast between the two handle representations.

Pull Request: https://github.com/llvm/llvm-project/pull/104251
2024-08-23 12:58:12 -07:00
Greg Roth
319c7a42ba
[HLSL][SPIRV]Add SPIRV generation for HLSL dot (#104656)
This adds the SPIRV fdot, sdot, and udot intrinsics and allows them to
be created at codegen depending on the target architecture. This
required moving some of the DXIL-specific choices to DXIL instruction
expansion out of codegen and providing it with at a more generic fdot
intrinsic as well.

Removed some stale comments that gave the obsolete impression that type
conversions should be expected to match overloads.

The SPIRV intrinsic handling involves generating multiply and add
operations for integers and the existing OpDot operation for floating
point.

New tests for generating SPIRV float and integer dot intrinsics are
added as well as expanding HLSL tests to include SPIRV generation

Used new dot product intrinsic generation to implement normalize() in SPIRV

Incidentally changed existing dot intrinsic definitions to use
DefaultAttrsIntrinsic to match the newly added inrinsics

Fixes #88056
2024-08-22 11:13:52 -07:00
Justin Bogner
81ee38551f
[DirectX] Register a few DXIL passes with the new PM
This wires up dxil-op-lower, dxil-intrinsic-expansion, dxil-translate-metadata,
and dxil-pretty-printer to the new pass manager, both as a matter of future
proofing the backend and so that they can be used more flexibly in tests.

A few arbitrary tests are updated in order to test the new PM path, and we drop
the "print-dxil-resource-md" pass since it's redundant with the pretty printer.

Pull Request: https://github.com/llvm/llvm-project/pull/104250
2024-08-20 16:33:25 -07:00
Fangrui Song
c932a0eb2e [Driver,DXIL] Fix build 2024-08-20 12:09:41 -07:00
Justin Bogner
e56ad22b4a
[DirectX] Encapsulate DXILOpLowering's state into a class. NFC
This introduces an anonymous class "OpLowerer" to help with lowering DXIL ops,
and moves the DXILOpBuilder there instead of creating a new one for every
operation. DXILOpBuilder is also changed to own its IRBuilder, since that makes
it simpler to ensure that it isn't misused.

Pull Request: https://github.com/llvm/llvm-project/pull/104248
2024-08-20 10:51:32 -07:00
S. Bharadwaj Yadavalli
6a38e19c92
[HLSL] Implement support for HLSL intrinsic - saturate (#104619)
Implement support for HLSL intrinsic saturate.
Implement DXIL codegen for the intrinsic saturate by lowering it to DXIL
Op dx.saturate.
Implement SPIRV codegen by transforming saturate(x) to clamp(x, 0.0f,
1.0f).

Add tests for DXIL and SPIRV CodeGen.
2024-08-20 12:46:33 -04:00
Justin Bogner
f357fe371d
[DirectX] Disentangle DXIL.td's op types from LLVMType. NFC
LLVMType is both too broad and too narrow for defining DXIL operations, in
different ways. It's too broad in the sense that we don't need the full set of
MVTs - the set of types DXIL operations work on is much smaller. It's too
narrow in the sense that it's difficult to use it for the various fixed
structure types in DXIL, like `%dx.types.Handle` or `%dx.Types.ResRet.f32`.

Replace the usage of LLVMType in DXIL.td with DXILOpParamType, a simple class
that we can define an enum of types from. Further, use this to replace the
"ParameterKind" enum in DXILABI.h that has nothing to do with DXIL's ABI.

Pull Request: https://github.com/llvm/llvm-project/pull/104247
2024-08-19 10:09:46 -07:00
Justin Bogner
7d60f4648b
[DirectX] Differentiate between 0/1 overloads in the OpBuilder. NFC
DXIL operations that only have one signature behave one of two ways - either
they are always suffixed with a type like `dx.op.ThreadId.i32` and hence have
exactly one overload, or they're never suffixed like `dx.op.CreateHandle` and
hence have zero overloads.

Update DXIL.td for operations that have one overload and remove the hack in the
builder that was adjusting names for unoverloaded ops.

Pull Request: https://github.com/llvm/llvm-project/pull/104246
2024-08-19 09:55:15 -07:00
Greg Roth
cd3f48df82
[NFC][DXIL] move replace/erase in DXIL intrinsic expansion to caller (#104626)
All expansions end with replacing the previous inrinsic with the new
expansion and erasing the old one. By moving this operation to the
caller, these expansion functions can be called in more contexts and a
small amount of duplicated code is consolidated.

Pre-req for #88056
2024-08-16 17:11:16 -07:00
Justin Bogner
71d54faa65
[DirectX] Revert specialized createOp methods part of #101250
In 8cf85653b6f5 "[DirectX] Make DXILOpBuilder's API more useable" we introduced
specialized createOp methods for each DirectX op for convenience, but the API
is buggy and untested. It also isn't actually as useful as I imagined it would
be since we don't have argument names or const-ness represented in DXIL.td
currently. Remove these methods for now and we can reintroduce them if we
actually need them later.

Pull Request: https://github.com/llvm/llvm-project/pull/104245
2024-08-16 21:21:24 +02:00
Justin Bogner
f999b321d7
[DirectX] Add missing Analysis usage to DXILResourceMDWrapper
This analysis can't be used with other analyses if this isn't set.

Pull Request: https://github.com/llvm/llvm-project/pull/104244
2024-08-16 20:28:34 +02:00
Helena Kotas
db279c72f2
[HLSL] Change default linkage of HLSL functions to internal (#95331)
An HLSL function has internal linkage by default unless it is:
1. shader entry point function
2. marked with the `export` keyword
(https://github.com/llvm/llvm-project/issues/92812)
3. patch constant function (not implemented yet)

This PR adds a link-time pass `DXILFinalizeLinkage` that updates the
linkage of functions to make sure only shader entry points and exported
functions are visible from the module (have _program linkage_). All
other functions will be updated to have internal linkage.

Related spec update: microsoft/hlsl-specs#295

Fixes #llvm/llvm-project#92071
2024-08-16 10:32:10 -07:00
Justin Bogner
8107810cad
[DirectX] Use a more consistent pass name for DXILTranslateMetadata
This updates the "dxil-metadata-emit" pass flag to be spelled
"dxil-translate-metadata" to better match the pass name.

Pull Request: https://github.com/llvm/llvm-project/pull/104249
2024-08-15 12:16:52 +03:00
Joshua Batista
48809fafbc
Remove unused variable, and unneeded extract element instruction (#103489)
This PR removes an unneeded extract element instruction from codegen,
along with the variable that captured that instruction's return value.
2024-08-14 15:11:34 -07:00
Joshua Batista
1b2d11de93
Add normalize builtins and normalize HLSL function to DirectX and SPIR-V backend (#102683)
This PR adds the normalize intrinsic and an HLSL function that uses it.
The SPIRV backend is also implemented.

Used https://github.com/llvm/llvm-project/pull/101256 as a reference,
along with https://github.com/llvm/llvm-project/pull/102243
Fixes https://github.com/llvm/llvm-project/issues/99139
2024-08-13 15:15:19 -07:00
Joshua Batista
ed5b0e1e69
Add length builtins and length HLSL function to DirectX Backend (#101256)
This PR adds the length intrinsic and an HLSL function that uses it.
The SPIRV implementation is left for a future PR.
This PR addresses #99134, though some SPIR-V changes still need to be
made to complete the task. Below is how this PR addresses #99134.
- "Implement `length` clang builtin" was done by defining `HLSLL ength`
in Builtins.td
- "Link `length` clang builtin with hlsl_intrinsics.h" was done by using
the alias attribute to make `length` an alias of
`__builtin_hlsl_elementwise_length` in hlsl_intrinsics.h
- "Add sema checks for `length` to `CheckHLSLBuiltinFunctionCall` in
`SemaChecking.cpp` " was done, but in this case not in SemaChecking.cpp,
rather SemaHLSL.cpp. A case was added to the builtin to check for
semantic failures, and set `TheCall` up to have the right return type.
- "Add codegen for `length` to `EmitHLSLBuiltinExpr` in `CGBuiltin.cpp`"
was done. For scalars, fabs is emitted, otherwise, length is emitted.
- "Add codegen tests to `clang/test/CodeGenHLSL/builtins/length.hlsl`
was done to test that `length` in HLSL emits the right intrinsic.
- "Add sema tests to `clang/test/SemaHLSL/BuiltIns/length-errors.hlsl`"
was done to test for diagnostics emitted in SemaHLSL.cpp
- "Create the `int_dx_length` intrinsic in `IntrinsicsDirectX.td`" was
done. Specifying return types and parameter types was difficult, but
`idot` was used for reference, and `llvm\include\llvm\IR\Intrinsics.td`
contains all the ways to express return / parameter types.
- "Create an intrinsic expansion of `int_dx_length` in
`llvm/lib/Target/DirectX/DXILIntrinsicExpansion.cpp`" was done, and was
mostly derived by looking at `TranslateLength` in `HLOperationLower.cpp`
in the DXC codebase.
- "Create the `length.ll` and `length_errors.ll` tests in
`llvm/test/CodeGen/DirectX/`" was done by taking the DXIL output of
`clang/test/CodeGenHLSL/builtins/length.hlsl` and running `opt -S
-dxil-intrinsic-expansion` and ` opt -S -dxil-op-lower` on it, checking
for how the length intrinsic was either expanded or lowered.
- "Create the `int_spv_length` intrinsic in `IntrinsicsSPIRV.td`" was
done by copying `IntrinsicsDirectX.td`.

---------

Co-authored-by: Justin Bogner <mail@justinbogner.com>
2024-08-02 21:16:24 -07:00
Justin Bogner
8cf85653b6
[DirectX] Make DXILOpBuilder's API more useable
This adjusts the DXILOpBuilder API in a couple of ways:
1. Remove the need to call `getOverloadTy` before creating Ops
2. Introduce `tryCreateOp` to parallel `createOp` but propagate errors
3. Introduce specialized createOp methods for each DXIL Op

This will simplify usage of the builder in upcoming changes, and also allows us
to propagate errors via DiagnosticInfo rather than using fatal errors.

Pull Request: https://github.com/llvm/llvm-project/pull/101250
2024-08-02 15:13:16 -07:00
Justin Bogner
1c5f6cfc35
[DirectX] Rename backend DXIL resource analysis passes to DXILResourceMD*. NFC
These passes will be replaced soon as we move to the target extension based
resource handling in the DirectX backend, but removing them now before the
replacement stuff is all up and running would be very disruptive. However, we
do need to move these passes out of the way to avoid symbol conflicts with the
new DXILResourceAnalysis in the Analysis library.

Note: I tried an even simpler hack in #100698 but it doesn't really work. A
rename is the most expedient path forward here.

Pull Request: https://github.com/llvm/llvm-project/pull/101393
2024-07-31 17:29:15 -07:00
Justin Bogner
40940980bf
[DirectX] Simplify tablegen'd OpCode and OpClass enums
Pull Request: https://github.com/llvm/llvm-project/pull/101249
2024-07-30 23:14:34 -07:00
Justin Bogner
94da6bfb27
[DirectX] Simplify DXIL_OP_INTRINSIC_MAP tablegen'ed code
Rather than generate a map with a known name, just define the mapping
so the code that uses it can do what it needs.

Pull Request: https://github.com/llvm/llvm-project/pull/101248
2024-07-30 22:59:26 -07:00
S. Bharadwaj Yadavalli
cdfd884b0e
[DXIL] Add DXIL version-specific TableGen specification and implementation of DXIL Ops (#97593)
Update TableGen specification of DXIL Op records in DXIL.td per the
current design document.

- Facilitate specification of overloads, shader stage and attributes
predicated on DXIL Ops predicated DXIL version.

Implement functionality to consume in TableGen backend, DXILEmitter, the
above specification enhancements, and generate C++ code (in
(DXILOperations.inc) that represents properties of DXIL Ops, associated
type declarations and corresponding accessor functions.

Changes to DXIL Op Lowering pass to consume the DXIL Op representation
generated by the TableGen back end.

Add mtriple with the required shader model version to commandline of
tests.
2024-07-30 17:25:58 -04:00
James Y Knight
dfeb3991fb
Remove the x86_mmx IR type. (#98505)
It is now translated to `<1 x i64>`, which allows the removal of a bunch
of special casing.

This _incompatibly_ changes the ABI of any LLVM IR function with
`x86_mmx` arguments or returns: instead of passing in mmx registers,
they will now be passed via integer registers. However, the real-world
incompatibility caused by this is expected to be minimal, because Clang
never uses the x86_mmx type -- it lowers `__m64` to either `<1 x i64>`
or `double`, depending on ABI.

This change does _not_ eliminate the SelectionDAG `MVT::x86mmx` type.
That type simply no longer corresponds to an IR type, and is used only
by MMX intrinsics and inline-asm operands.

Because SelectionDAGBuilder only knows how to generate the
operands/results of intrinsics based on the IR type, it thus now
generates the intrinsics with the type MVT::v1i64, instead of
MVT::x86mmx. We need to fix this before the DAG LegalizeTypes, and thus
have the X86 backend fix them up in DAGCombine. (This may be a
short-lived hack, if all the MMX intrinsics can be removed in upcoming
changes.)

Works towards issue #98272.
2024-07-25 09:19:22 -04:00
Xiang Li
76e37b1a08
[DirectX] fix illegal behavior flag in module flags. (#96577)
For DXIL which is based on llvm 3.7, max supported behavior flag for
module flags is 6.

The commit will check all module flags, for behavior flag > 6, change it
to 2 (Warning).
    
This is to fix the behavior flag part for #96912.
2024-07-12 18:46:22 -04:00
Fangrui Song
6e93e37fe9 [MC] Remove unneeded MC*AsmBackend::fixupNeedsRelaxation overrides
Follow-up to 88c0a8258800bbc72e7c0b0586436d4a1c62a260
("[MC] Make MCAsmBackend::fixupNeedsRelaxation not pure virtual").
2024-07-01 13:54:08 -07:00
Fangrui Song
7d17114c6b [DirectX] Add missing includes after #97023 2024-06-28 09:38:37 -07:00
Nikita Popov
9df71d7673
[IR] Add getDataLayout() helpers to Function and GlobalValue (#96919)
Similar to https://github.com/llvm/llvm-project/pull/96902, this adds
`getDataLayout()` helpers to Function and GlobalValue, replacing the
current `getParent()->getDataLayout()` pattern.
2024-06-28 08:36:49 +02:00
Damyan Pepper
141bea8c3c
[DirectX] Add stub PSV0 section (#96712)
Direct3D requires a PSV0 section to be present in the DXContainer in
order to be able to load and use the shader.

This change adds a minimal stub PSV0, with some hard-coded values, that
are just enough to unblock loading into Direct3D.

Contributes to #90129
2024-06-26 11:15:34 -07:00
Nikita Popov
5cd0ba30f5
Reapply [IR] Lazily initialize the class to pass name mapping (NFC) (#96321) (#96462)
On MSVC the `this` uses inside `decltype` require a lambda capture. On
clang they result in an unused capture warning instead. Add the capture
and suppress the warning with `(void)this`.

-----

Initializing this map is somewhat expensive (especially for O0), so we
currently only do it if certain flags are used. I would like to make use
of it for crash dumps (#96078), where we don't know in advance whether
it will be needed or not.

This patch changes the initialization to a lazy approach, where a
callback is registered that does the actual initialization. The
callbacks will be run the first time the pass name is requested.

This way there is no compile-time impact if the mapping is not used.
2024-06-24 15:00:11 +02:00