summaryrefslogtreecommitdiff
path: root/mlir/lib/Target/LLVM/ModuleToObject.cpp
AgeCommit message (Collapse)Author
2025-10-06[NFC][MLIR] Prefer triple overload of lookupTarget (#162187)Aiden Grossman
The overloads accepting a string will be deprecated soon, similar to other functions in TargetRegistry.
2025-07-05[mlir] Remove unused includes (NFC) (#147158)Kazu Hirata
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-03-12[TargetRegistry] Accept Triple in createTargetMachine() (NFC) (#130940)Nikita Popov
This avoids doing a Triple -> std::string -> Triple round trip in lots of places, now that the Module stores a Triple.
2025-03-06[IR] Store Triple in Module (NFC) (#129868)Nikita Popov
The module currently stores the target triple as a string. This means that any code that wants to actually use the triple first has to instantiate a Triple, which is somewhat expensive. The change in #121652 caused a moderate compile-time regression due to this. While it would be easy enough to work around, I think that architecturally, it makes more sense to store the parsed Triple in the module, so that it can always be directly queried. For this change, I've opted not to add any magic conversions between std::string and Triple for backwards-compatibilty purses, and instead write out needed Triple()s or str()s explicitly. This is because I think a decent number of them should be changed to work on Triple as well, to avoid unnecessary conversions back and forth. The only interesting part in this patch is that the default triple is Triple("") instead of Triple() to preserve existing behavior. The former defaults to using the ELF object format instead of unknown object format. We should fix that as well.
2024-12-17[MLIR] Add a BlobAttr interface for attribute to wrap arbitrary content and ↵Mehdi Amini
use it as linkLibs for ModuleToObject (#120116) This change allows to expose through an interface attributes wrapping content as external resources, and the usage inside the ModuleToObject show how we will be able to provide runtime libraries without relying on the filesystem.
2024-11-20[mlir][fix] Add callback functions for ModuleToObject (#116916)Zichen Lu
Here is the [merged MR](https://github.com/llvm/llvm-project/pull/116007) which caused a failure and [was reverted](https://github.com/llvm/llvm-project/pull/116811). Thanks to @joker-eph for the help, I fix it (miss constructing `ModuleObject` with callback functions in `mlir/lib/Target/LLVM/NVVM/Target.cpp`) and split unit tests from origin test which don't need `ptxas` to make the test runs more widely.
2024-11-19Revert "[MLIR] Add callback functions for ModuleToObject" (#116811)Mehdi Amini
Reverts llvm/llvm-project#116007 Bot is broken.
2024-11-19[MLIR] Add callback functions for ModuleToObject (#116007)Zichen Lu
In ModuleToObject flow, users may want to add some callback functions invoked with LLVM IR/ISA for debugging or other purposes.
2024-09-15[mlir] Reland 5a6e52d6ef96d2bcab6dc50bdb369662ff17d2a0 with update (NFC)JOE1994
Excluded updates to mlir/lib/AsmParser/Parser.cpp , which caused LIT failure "FAIL: MLIR::completion.test" on multiple buildbots.
2024-09-15Revert "[mlir] Nits on uses of llvm::raw_string_ostream (NFC)"JOE1994
This reverts commit 5a6e52d6ef96d2bcab6dc50bdb369662ff17d2a0. "FAIL: MLIR::completion.test" on multiple buildbots.
2024-09-15[mlir] Nits on uses of llvm::raw_string_ostream (NFC)JOE1994
* Strip calls to raw_string_ostream::flush(), which is essentially a no-op * Strip unneeded calls to raw_string_ostream::str(), to avoid excess indirection.
2023-11-03Refactor ModuleToObject to offer more flexibility to subclass (NFC)Mehdi Amini
Some specific implementation of the offload may want more customization, and even avoid using LLVM in-tree to dispatch the ISA translation to a custom solution. This refactoring makes it possible for such implementation to work without even configuring the target backend in LLVM. Reviewers: fabianmcg Reviewed By: fabianmcg Pull Request: https://github.com/llvm/llvm-project/pull/71165
2023-09-14[NFC][CodeGen] Change CodeGenOpt::Level/CodeGenFileType into enum classes ↵Arthur Eubanks
(#66295) This will make it easy for callers to see issues with and fix up calls to createTargetMachine after a future change to the params of TargetMachine. This matches other nearby enums. For downstream users, this should be a fairly straightforward replacement, e.g. s/CodeGenOpt::Aggressive/CodeGenOptLevel::Aggressive or s/CGFT_/CodeGenFileType::
2023-08-31[mlir] Prefer to use empty to check for emptiness (NFC)Jacques Pienaar
2023-08-08[mlir][Target][LLVM] Adds an utility class for serializing operations to ↵Fabian Mora
binary strings. **For an explanation of these patches see D154153.** Commit message: This patch adds the utility base class `ModuleToObject`. This class provides an interface for compiling module operations into binary strings, by default this class serialize modules to LLVM bitcode. Reviewed By: mehdi_amini Differential Revision: https://reviews.llvm.org/D154100
2023-08-08Revert "[mlir][Target][LLVM] Adds an utility class for serializing ↵Fabian Mora
operations to binary strings." This reverts commit c8e0364a4336569f91fe74dbc231beefc8793518.
2023-08-08[mlir][Target][LLVM] Adds an utility class for serializing operations to ↵Fabian Mora
binary strings. **For an explanation of these patches see D154153.** Commit message: This patch adds the utility base class `ModuleToObject`. This class provides an interface for compiling module operations into binary strings, by default this class serialize modules to LLVM bitcode. Reviewed By: mehdi_amini Differential Revision: https://reviews.llvm.org/D154100