aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/BinaryFormat
AgeCommit message (Collapse)AuthorFilesLines
4 days[Object] Parsing and dumping of SFrame FDEs (#149828)Pavel Labath1-0/+33
Also known as Function Description Entries. The entries occupy a contiguous piece of the section, so the code is mostly straight-forward. For more information about the SFrame unwind format, see the [specification](https://sourceware.org/binutils/wiki/sframe) and the related [RFC](https://discourse.llvm.org/t/rfc-adding-sframe-support-to-llvm/86900).
14 days[Object] Beginnings of SFrame parser and dumper (#147294)Pavel Labath2-0/+38
This PR adds the SFrameParser class and uses it from llvm-readobj to dump the section contents. Currently, it only supports parsing the SFrame section header. Other parts of the section will be added in follow-up patches. llvm-readobj uses the same sframe flag syntax as GNU readelf, but I have not attempted match the output format of the tool. I'm starting with the "llvm" output format because it's easier to generate and lets us tweak the format to make it useful for testing the generation code. If needed, support for the GNU format could be added by overriding this functionality in the GNU ELF Dumper. For more information, see the [sframe specification](https://sourceware.org/binutils/wiki/sframe) and the related [RFC](https://discourse.llvm.org/t/rfc-adding-sframe-support-to-llvm/86900).
2025-07-03[NFC][HLSL][DirectX] Let `HLSLRootSignature` reuse the `dxbc` defined enums ↵Finn Plummer1-0/+69
(#145986) This pr removes the redundancy of having the same enums defined in both the front-end and back-end of handling root signatures. Since there are many more uses of the enum in the front-end of the code, we will adhere to the naming conventions used in the front-end, to minimize the diff. The macros in `DXContainerConstants.def` are also touched-up to be consistent and to have each macro name follow its respective definition in d3d12.h and searchable by name [here](https://learn.microsoft.com/en-us/windows/win32/api/d3d12/). Additionally, the many `getEnumNames` are moved to `DXContainer` from `HLSLRootSignatureUtils` as they we will want them to be exposed publicly anyways. Changes for each enum follow the pattern of a commit that will make the enum definition in `DXContainer` adhere to above listed naming conventions, followed by a commit to actually use that enum in the front-end. Resolves https://github.com/llvm/llvm-project/issues/145815
2025-06-17[llvm] minor fixes for clang-cl Windows DLL build (#144386)Andrew Rogers1-0/+12
## Purpose This patch makes a minor changes to LLVM and Clang so that LLVM can be built as a Windows DLL with `clang-cl`. These changes were not required for building a Windows DLL with MSVC. ## Background The Windows DLL effort is tracked in #109483. Additional context is provided in [this discourse](https://discourse.llvm.org/t/psa-annotating-llvm-public-interface/85307), and documentation for `LLVM_ABI` and related annotations is found in the LLVM repo [here](https://github.com/llvm/llvm-project/blob/main/llvm/docs/InterfaceExportAnnotations.rst). ## Overview Specific changes made in this patch: - Remove `constexpr` fields that reference DLL exported symbols. These symbols cannot be resolved at compile time when building a Windows DLL using `clang-cl`, so they cannot be `constexpr`. Instead, they are made `const` and initialized in the implementation file rather than at declaration in the header. - Annotate symbols now defined out-of-line with `LLVM_ABI` so they are exported when building as a shared library. - Explicitly add default copy assignment operator for `ELFFile` to resolve a compiler warning. ## Validation Local builds and tests to validate cross-platform compatibility. This included llvm, clang, and lldb on the following configurations: - Windows with MSVC - Windows with Clang - Linux with GCC - Linux with Clang - Darwin with Clang
2025-06-04[llvm] Remove unused includes (NFC) (#142733)Kazu Hirata1-1/+0
These are identified by misc-include-cleaner. I've filtered out those that break builds. Also, I'm staying away from llvm-config.h, config.h, and Compiler.h, which likely cause platform- or compiler-specific build failures.
2025-04-16[DirectX] adding support in obj2yaml and yaml2obj to root constants (#127840)joaosaffran1-0/+20
Adding support for Root Constant in MC, Object and obj2yaml and yaml2obj, this PR adds: - new structures to dxbc definition. - serialize and desirialize logic from dxcontainer to yaml - tests validating against dxc - adding support to multiple parts. Closes: https://github.com/llvm/llvm-project/issues/126633 --------- Co-authored-by: joaosaffran <joao.saffran@microsoft.com>
2025-03-26[llvm-ifs] Handle more e_machine values for --target (#128559)Roland McGrath1-0/+65
This adds ELF::convertTripleArchTypeToEMachine and uses it in llvm-ifs. It handles many more Triple::ArchType values than the old code, though not all since I couldn't quickly discern what all the mappings are.
2025-02-06[llvm][DebugInfo] Add new DW_AT_APPLE_enum_kind to encode enum_extensibility ↵Michael Buch1-0/+21
(#124752) When creating `EnumDecl`s from DWARF for Objective-C `NS_ENUM`s, the Swift compiler tries to figure out if it should perform "swiftification" of that enum (which involves renaming the enumerator cases, etc.). The heuristics by which it determines whether we want to swiftify an enum is by checking the `enum_extensibility` attribute (because that's what `NS_ENUM` pretty much are). Currently LLDB fails to attach the `EnumExtensibilityAttr` to `EnumDecl`s it creates (because there's not enough info in DWARF to derive it), which means we have to fall back to re-building Swift modules on-the-fly, slowing down expression evaluation substantially. This happens around https://github.com/swiftlang/swift/blob/4b3931c8ce437b3f13f245e6423f95c94a5876ac/lib/ClangImporter/ImportEnumInfo.cpp#L37-L59 To speed up Swift exression evaluation, this patch proposes encoding the C/C++/Objective-C `enum_extensibility` attribute in DWARF via a new `DW_AT_APPLE_ENUM_KIND`. This would currently be only used from the LLDB Swift plugin. But may be of interest to other language plugins as well (though I haven't come up with a concrete use-case for it outside of Swift). I'm open to naming suggestions of the various new attributes/attribute constants proposed here. I tried to be as generic as possible if we wanted to extend it to other kinds of enum properties (e.g., flag enums). The new attribute would look as follows: ``` DW_TAG_enumeration_type DW_AT_type (0x0000003a "unsigned int") DW_AT_APPLE_enum_kind (DW_APPLE_ENUM_KIND_Closed) DW_AT_name ("ClosedEnum") DW_AT_byte_size (0x04) DW_AT_decl_file ("enum.c") DW_AT_decl_line (23) DW_TAG_enumeration_type DW_AT_type (0x0000003a "unsigned int") DW_AT_APPLE_enum_kind (DW_APPLE_ENUM_KIND_Open) DW_AT_name ("OpenEnum") DW_AT_byte_size (0x04) DW_AT_decl_file ("enum.c") DW_AT_decl_line (27) ``` Absence of the attribute means the extensibility of the enum is unknown and abides by whatever the language rules of that CU dictate. This does feel like a big hammer for quite a specific use-case, so I'm happy to discuss alternatives. Alternatives considered: * Re-using an existing DWARF attribute to express extensibility. E.g., a `DW_TAG_enumeration_type` could have a `DW_AT_count` or `DW_AT_upper_bound` indicating the number of enumerators, which could imply closed-ness. I felt like a dedicated attribute (which could be generalized further) seemed more applicable. But I'm open to re-using existing attributes. * Encoding the entire attribute string (i.e., `DW_TAG_LLVM_annotation ("enum_extensibility((open))")`) on the `DW_TAG_enumeration_type`. Then in LLDB somehow parse that out into a `EnumExtensibilityAttr`. I haven't found a great API in Clang to parse arbitrary strings into AST nodes (the ones I've found required fully formed C++ constructs). Though if someone knows of a good way to do this, happy to consider that too.
2024-12-10[PowerPC][AIX] Emit PowerPC version for XCOFF (#113214)Amy Kwan1-0/+59
This PR emits implements the ability to emit the PPC version for both assembly and object files on AIX.
2024-08-30[DirectX] Replace ResourceFlag enum with struct fields (#106617)Xiang Li1-10/+0
Remove the enum about ResourceFlag. Add struct ResourceFlags which save the resource flags with bool fields. This will get better yaml dump. For #103275
2024-08-29[DirectX] add enum for PSV resource type/kind/flag. (#106227)Xiang Li1-0/+30
Add ResourceType, ResourceKind and ResourceFlag enum class for PSV resource. This is for #103275
2024-08-20[AArch64][MachO] Add ptrauth ABI version to arm64e cpusubtype. (#104650)Ahmed Bougacha1-0/+18
In a mach_header, the cpusubtype is a 32-bit field, but it's split in 2 subfields: - the low 24 bits containing the cpu subtype proper, (e.g., CPU_SUBTYPE_ARM64E 2) - the high 8 bits containing a capability field used for additional feature flags. Notably, it's only the subtype subfield that participates in fat file slice discrimination: the caps are ignored. arm64e uses the caps subfield to encode a ptrauth ABI version: - 0x80 (CPU_SUBTYPE_PTRAUTH_ABI) denotes a versioned binary - 0x40 denotes a kernel-ABI binary - 0x00-0x0F holds the ptrauth ABI version This teaches the basic obj tools to decode that (or ignore it when unneeded). It also teaches the MachO writer to default to emitting versioned binaries, but with a version of 0 (and without the kernel ABI flag). Modern arm64e requires versioned binaries: a binary with 0x00 caps in cpusubtype is now rejected by the linker and everything after. We can live without the sophistication of specifying the version and kernel ABI for now. Co-authored-by: Francis Visoiu Mistrih <francisvm@apple.com>
2024-06-07[lldb] Encode operands and arity in Dwarf.def and use them in LLDB. (#94679)Jonas Devlieghere1-4/+30
This PR extends Dwarf.def to include the number of operands and the arity (the number of entries on the DWARF stack). - The arity is used in LLDB's DWARF expression evaluator. - The number of operands is unused, but is present in the table to avoid confusing the arity with the operands. Keeping the latter up to date should be straightforward as it maps directly to a table present in the DWARF standard.
2024-06-07[DebugInfo] Add DW_OP_LLVM_extract_bits (#93990)John Brawn1-0/+6
This operation extracts a number of bits at a given offset and sign or zero extends them, which is done by emitting it as a left shift followed by a right shift. This is being added for use in clang for C++ structured bindings of bitfields that have offset or size that aren't a byte multiple. A new operation is being added, instead of shifts being used directly, as it makes correctly handling it in optimisations (which will be done in a later patch) much easier.
2024-04-29[BinaryFormat] Adjust OSABI functions and add unittestsFangrui Song1-8/+7
Adjust #89280: * ELFOSABI_LINUX is a historical alias that should not be used in new code. readelf -h displays "UNIX - GNU" instead of "Linux". * "OS" is inappropriate. Some values are architecture-specific, e.g. ELFOSABI_ARM. * Drop lowercase, which seems a job of the caller. Add some unittests. Pull Request: https://github.com/llvm/llvm-project/pull/90270
2024-04-26Implement the DWARF 6 language and version attributes. (#89980)Adrian Prantl1-0/+10
This patch adds DWARF constants for DW_AT_language_name and DW_AT_language_version to Dwarf.def and Dwarf.h. While the DWARF 6 spec is not finalized, the constants are published on the DWARF website and considered stable, with idea being that the list published on dwarfstd.org is the authoritative source that is being continuously updated between DWARF revisions, as new languages are being developed. https://dwarfstd.org/languages-v6.html My main motivation for adding this is to use in https://github.com/llvm/llvm-project/pull/89981
2024-04-18adds conversion functions for EI_OSABI in elf (#89280)Fred Grim1-0/+80
These are needed to populate elf headers in core files. This is part of implementing process save-core in lldb
2024-01-16[clang][Driver] Don't ignore -gmodules .gch files (#77711)Michael Spencer1-0/+2
A previous commit (82f75ed) made clang ignore .gch files that were not Clang AST files. This broke `-gmodules`, which embeds the Clang AST into an object file containing debug info. This changes the probing to detect any file format recognized by `llvm::identify_magic()` as potentially containing a Clang AST. Previous PR: https://github.com/llvm/llvm-project/pull/69204
2024-01-04[AMDGPU] Add dynamic LDS size implicit kernel argument to CO-v5 (#65273)Chaitanya1-0/+1
"hidden_dynamic_lds_size" argument will be added in the reserved section at offset 120 of the implicit argument layout. Add "isDynamicLDSUsed" flag to AMDGPUMachineFunction to identify if a function uses dynamic LDS. hidden argument will be added in below cases: - LDS global is used in the kernel. - Kernel calls a function which uses LDS global. - LDS pointer is passed as argument to kernel itself.
2023-12-13[LLVM] Add file magic detection for SPIR-V files. (#75363)Joseph Huber1-0/+8
Summary: More SPIR-V related patches are being upstreamed. We should add support to detect when a binary file is SPIR-V. This will be used in the future when support for SPIR-V is added to the offloading runtime or more support for bundling. The magic number is described in the official documentation: https://registry.khronos.org/SPIR-V/specs/1.0/SPIRV.html#Magic. Notably, SPIR-V files are streams of 32-bit words. This means that the magic numbers differ depending on the endianness. Here we simply check the strandard and byte-reversed versions.
2023-12-11[llvm] Use StringRef::{starts,ends}_with (NFC) (#74956)Kazu Hirata1-3/+3
This patch replaces uses of StringRef::{starts,ends}with with StringRef::{starts,ends}_with for consistency with std::{string,string_view}::{starts,ends}_with in C++20. I'm planning to deprecate and eventually remove StringRef::{starts,ends}with.
2023-12-03[llvm] Stop including map (NFC)Kazu Hirata1-1/+0
Identified with clangd.
2023-11-28[MsgPack] Handle Expected<T> errors in document reader (#73183)Emma Pilkington1-1/+7
This was causing an assert on invalid in the modified test case.
2023-11-11[llvm] Stop including llvm/ADT/DenseMapInfo.h (NFC)Kazu Hirata1-1/+0
Identified with clangd.
2023-10-05[DX] Add support for program signatures (#67346)Chris B1-0/+30
For DirectX, program signatures are encoded into three different binary sections depending on if the signature is for inputs, outputs, or patches. All three signature types use the same data structure encoding so they can share a lot of logic. This patch adds support for reading and writing program signature data as both yaml and binary data. Fixes #57743 and #57744
2023-10-05Reland "[HIP] Support compressing device binary"Yaxun (Sam) Liu1-0/+11
Original PR: https://github.com/llvm/llvm-project/pull/67162 The commit was reverted due to UB detected by santizer: https://lab.llvm.org/buildbot/#/builders/238/builds/5955 clang/lib/Driver/OffloadBundler.cpp:1012:25: runtime error: load of misaligned address 0xaaaae2d90e7c for type 'const uint64_t' (aka 'const unsigned long'), which requires 8 byte alignment It was fixed by using memcpy instead of dereferencing int* casted from unaligned char*.
2023-10-05Revert "[HIP] Support compressing device binary (#67162)"Yaxun (Sam) Liu1-11/+0
This reverts commit a1e81d2ead02e041471ec2299d7382f80c4dbba6. Revert "Fix test hip-offload-compress-zlib.hip" This reverts commit ba01ce60665848478ba4e76190907153a8c26fe9. Revert due to sanity fail at https://lab.llvm.org/buildbot/#/builders/5/builds/37188 https://lab.llvm.org/buildbot/#/builders/238/builds/5955 /b/sanitizer-aarch64-linux-bootstrap-ubsan/build/llvm-project/clang/lib/Driver/OffloadBundler.cpp:1012:25: runtime error: load of misaligned address 0xaaaae2d90e7c for type 'const uint64_t' (aka 'const unsigned long'), which requires 8 byte alignment 0xaaaae2d90e7c: note: pointer points here bc 00 00 00 94 dc 29 9a 89 fb ca 2b 78 9c 8b 8f 77 f6 71 f4 73 8f f7 77 73 f3 f1 77 74 89 77 0a ^ #0 0xaaaaba125f70 in clang::CompressedOffloadBundle::decompress(llvm::MemoryBuffer const&, bool) /b/sanitizer-aarch64-linux-bootstrap-ubsan/build/llvm-project/clang/lib/Driver/OffloadBundler.cpp:1012:25 #1 0xaaaaba126150 in clang::OffloadBundler::ListBundleIDsInFile(llvm::StringRef, clang::OffloadBundlerConfig const&) /b/sanitizer-aarch64-linux-bootstrap-ubsan/build/llvm-project/clang/lib/Driver/OffloadBundler.cpp:1089:7 Will reland after fixing it.
2023-10-04[HIP] Support compressing device binary (#67162)Yaxun (Sam) Liu1-0/+11
Add option -f[no-]offload-compress to clang to enable/disable compression of device binary for HIP. By default it is disabled. Add option -compress to clang-offload-bundler to enable compression of offload bundle. By default it is disabled. When enabled, zstd or zlib is used for compression when available. When disabled, it is NFC compared to previous behavior. The same offload bundle format is used as before. Clang-offload-bundler automatically detects whether the input file to be unbundled is compressed and the compression method and decompress if necessary.
2023-08-16Re-land [DX] Add support for PSV signature elementsChris Bieneman1-0/+31
The pipeline state data captured in the PSV0 section of the DXContainer file encodes signature elements which are read by the runtime to map inputs and outputs from the GPU program. This change adds support for generating and parsing signature elements with testing driven through the ObjectYAML tooling. Reviewed By: bogner Differential Revision: https://reviews.llvm.org/D157671 Initially landed as 8c567e64f808f7a818965c6bc123fedf7db7336f, and reverted in 4d800633b2683304a5431d002d8ffc40a1815520. ../llvm/include/llvm/BinaryFormat/DXContainerConstants.def ../llvm/test/ObjectYAML/DXContainer/PSVv1-amplification.yaml ../llvm/test/ObjectYAML/DXContainer/PSVv1-compute.yaml ../llvm/test/ObjectYAML/DXContainer/PSVv1-domain.yaml ../llvm/test/ObjectYAML/DXContainer/PSVv1-geometry.yaml ../llvm/test/ObjectYAML/DXContainer/PSVv1-vertex.yaml ../llvm/test/ObjectYAML/DXContainer/PSVv2-amplification.yaml ../llvm/test/ObjectYAML/DXContainer/PSVv2-compute.yaml ../llvm/test/ObjectYAML/DXContainer/PSVv2-domain.yaml ../llvm/test/ObjectYAML/DXContainer/PSVv2-geometry.yaml ../llvm/test/ObjectYAML/DXContainer/PSVv2-vertex.yaml
2023-08-16Revert "[DX] Add support for PSV signature elements"Chris Bieneman1-31/+0
This reverts commit 8c567e64f808f7a818965c6bc123fedf7db7336f.
2023-08-16[DX] Add support for PSV signature elementsChris Bieneman1-0/+31
The pipeline state data captured in the PSV0 section of the DXContainer file encodes signature elements which are read by the runtime to map inputs and outputs from the GPU program. This change adds support for generating and parsing signature elements with testing driven through the ObjectYAML tooling. Reviewed By: bogner Differential Revision: https://reviews.llvm.org/D157671
2023-06-19[DebugInfo] Add DW_OP_LLVM_user extension pointScott Linder1-0/+34
The extension codespace for DWARF expressions (DW_OP_LLVM_{lo,hi}_user) has shrunk over time, as no extension is ever "retired" in practice. To facilitate future extensions, this patch reserves one open opcode as an extension point (0xfe), which is followed by a ULEB128-encoded SubOperation, and then by the subop's operands. There is some prior-art, namely DW_OP_AARCH64_operation (see https://github.com/ARM-software/abi-aa/blob/edd7460d87493fff124b8b5713acf71ffc06ee91/aadwarf64/aadwarf64.rst#45dwarf-expression-operations). This version makes some different tradeoffs, opting to use a ULEB128 for the subop encoding for future-proofing. Reviewed By: #debug-info, dblaikie Differential Revision: https://reviews.llvm.org/D147271
2023-04-21[llvm-lib] [llvm-readobj] [llvm-cvtres] Add Support for ARM64X object files.Jacek Caban1-0/+5
Similar to D125411, but for ARM64X. ARM64X PE binaries are hybrids containing both ARM64EC and pure ARM64 variants in one file. They are usually linked by passing separate ARM64EC and ARM64 object files to linker. Linked binaries use ARM64 machine and contain additional CHPE metadata in their load config. CHPE metadata support is not part of this patch, I plan to send that later. Using ARM64X as a machine type of object files themselves is somewhat ambiguous, but such files are allowed by MSVC. It treats them as ARM64 or ARM64EC object, depending on the context. Such objects can be produced with cvtres.exe -machine:arm64x. Reviewed By: efriedma Differential Revision: https://reviews.llvm.org/D148517
2023-04-20[MsgPack] Add support for writing binary ELF doc nodesMartin Dinkov1-0/+10
Will be used for a front-end compiler https://github.com/GPUOpen-Drivers/llpc to insert a binary blob value into AMDGPU PAL metadata. Differential Revision: https://reviews.llvm.org/D148607 Change-Id: I90685883d1478335937218e6b1a569b1b26dc05a
2023-02-22[TextAPI] Add support for TBDv5 Files to nm & tapi-diffCyndy Ishida1-2/+5
This includes handling of new attributes for symbols & rpath. In the event that an older format file is compared to tbd_v5, ignore these new attributes. Reviewed By: ributzka Differential Revision: https://reviews.llvm.org/D144529
2023-02-14Use llvm::bit_cast (NFC)Kazu Hirata1-2/+4
2023-02-10[DebugInfo] Handle missed DW_FORM_addrx3 and DW_FORM_strx3 casesBenjamin Maxwell1-0/+1
This fixes a few places where the addrx3 and strx3 forms were missed. Previously this meant if one of these forms appeared somewhere various errors could occur. This now also adds an extra test case for the addrx3 form (which previously failed). Differential Revision: https://reviews.llvm.org/D143488
2023-02-07[NFC][TargetParser] Remove llvm/ADT/Triple.hArchibald Elliott2-2/+2
I also ran `git clang-format` to get the headers in the right order for the new location, which has changed the order of other headers in two files.
2023-02-07[NFC][TargetParser] Remove llvm/Support/ARMTargetParser.hArchibald Elliott1-1/+1
2023-01-05[AMDGPU] Add .uniform_work_group_size metadata to v5Vang Thao1-0/+3
Amdgpu kernel with function attribute "uniform-work-group-size"="true" requires uniform work group size (i.e. each dimension of global size is a multiple of corresponding dimension of work group size). hipExtModuleLaunchKernel allows to launch HIP kernel with non-uniform workgroup size, which makes it necessary for runtime to check and enforce uniform workgroup size if kernel requires it. To let runtime be able to enforce that, this metadata is needed to indicate that the kernel requires uniform workgroup size. Reviewed By: kzhuravl, arsenm Differential Revision: https://reviews.llvm.org/D141012
2022-12-20[Support] Move TargetParsers to new componentArchibald Elliott1-0/+1
This is a fairly large changeset, but it can be broken into a few pieces: - `llvm/Support/*TargetParser*` are all moved from the LLVM Support component into a new LLVM Component called "TargetParser". This potentially enables using tablegen to maintain this information, as is shown in https://reviews.llvm.org/D137517. This cannot currently be done, as llvm-tblgen relies on LLVM's Support component. - This also moves two files from Support which use and depend on information in the TargetParser: - `llvm/Support/Host.{h,cpp}` which contains functions for inspecting the current Host machine for info about it, primarily to support getting the host triple, but also for `-mcpu=native` support in e.g. Clang. This is fairly tightly intertwined with the information in `X86TargetParser.h`, so keeping them in the same component makes sense. - `llvm/ADT/Triple.h` and `llvm/Support/Triple.cpp`, which contains the target triple parser and representation. This is very intertwined with the Arm target parser, because the arm architecture version appears in canonical triples on arm platforms. - I moved the relevant unittests to their own directory. And so, we end up with a single component that has all the information about the following, which to me seems like a unified component: - Triples that LLVM Knows about - Architecture names and CPUs that LLVM knows about - CPU detection logic for LLVM Given this, I have also moved `RISCVISAInfo.h` into this component, as it seems to me to be part of that same set of functionality. If you get link errors in your components after this patch, you likely need to add TargetParser into LLVM_LINK_COMPONENTS in CMake. Differential Revision: https://reviews.llvm.org/D137838
2022-12-16[BinaryFormat] Use std::optional instead of llvm::Optional (NFC)Kazu Hirata1-1/+1
This is part of an effort to migrate from llvm::Optional to std::optional: https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
2022-12-13[AMDGPU] Add `.workgroup_processor_mode` to v5 MDPierre van Houtryve1-0/+2
Adds Workgroup Processor Mode (WGP) to the HSA Metadata for Code Object v5/GFX10+. The field is already present as an asm directive and in the compute program resource register but is also needed in the MD. Reviewed By: kzhuravl Differential Revision: https://reviews.llvm.org/D139931
2022-12-06[llvm] Don't include STLForwardCompat.h (NFC)Kazu Hirata1-1/+0
STLForwardCompat.h defines remove_cvref and remove_cvref_t. These source files use neither one of those.
2022-12-05[DebugInfo] llvm::Optional => std::optionalFangrui Song1-3/+4
https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
2022-12-02[llvm] Use std::nullopt instead of None (NFC)Kazu Hirata1-6/+6
This patch mechanically replaces None with std::nullopt where the compiler would warn if None were deprecated. The intent is to reduce the amount of manual work required in migrating from Optional to std::optional. This is part of an effort to migrate from llvm::Optional to std::optional: https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
2022-11-17[BinaryFormat] Add LoongArchWANG Xuerui1-0/+3
Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D138018
2022-10-27[ObjectYAML] Add support for DXContainer HASHChris Bieneman1-1/+6
DXContainer files contain a part that has an MD5 of the generated shader. This adds support to the ObjectYAML tooling to expand the hash part data and hash iteself in preparation for adding hashing support to DirectX code generation. Reviewed By: python3kgae Differential Revision: https://reviews.llvm.org/D136632
2022-09-29[NFC] Refactor DXContainer to support more partsChris Bieneman2-0/+26
This patch refactors some of the DXContainer Object and YAML code to make it easier to add more part parsing. DXContainer has a whole bunch of constant values, so I've added a DXContainerConstants.def file which will grow with constant definitions, but starts with just part identifiers. I've also added a utility to parse the part magic string into an enum, and converted the code to use that utility and the enum instead of the part literal string. Reviewed By: lhames Differential Revision: https://reviews.llvm.org/D133980
2022-09-28[iwyu] Move <cmath> out of llvm/Support/MathExtras.hserge-sans-paille1-0/+2
Interestingly, MathExtras.h doesn't use <cmath> declaration, so move it out of that header and include it when needed. No functional change intended, but there's no longer a transitive include fromMathExtras.h to cmath.