- Aug 10, 2023
-
-
Patrick O'Neill authored
Currently LLVM emits Ztso code for fences, loads, and stores (behind an experimental flag) [1]. This patch updates the mapping and implements support for LR/SC and AMO ops. This updated mapping is compatible with the RVWMO ABI present in the psABI. Additional context can be found in the psABI pull request [2]. [1] https://reviews.llvm.org/D143076 [2] https://github.com/riscv-non-isa/riscv-elf-psabi-doc/pull/391 Differential Revision: https://reviews.llvm.org/D155517
-
Philip Reames authored
This reverts commit 660b740e. Crash reported in the review thread post commit. Reverting while investigating.
-
-
Alexey Bataev authored
If the reduced values is constant-foldable and was folded to a constant during previous transformations, need to excluded it from the list of the reduced values-instructions as non-matchable.
-
Luke Lau authored
Looks like this FIXME was already taken off during the original patch in https://reviews.llvm.org/D104921
-
Sean Fertile authored
Set the ReplaceFlags variable to false, since there is code meant only for the ADDItocHi/ADDItocL nodes. This has the side effect of disabling the peephole when the load/store instruction has a non-zero offset. This patch also fixes retrieving the `ImmOpnd` node from the AIX small code model pseduos and does the same for the register operand node. This allows cleaning up the later calls to replaceOperands. Finally move calculating the MaxOffset into the code guarded by ReplaceFlags as it is only used there and the comment is specific to the ELF ABI. Fixes https://github.com/llvm/llvm-project/issues/63927 Differential Revision: https://reviews.llvm.org/D155957
-
Tom Eccles authored
Differential Revision: https://reviews.llvm.org/D157106
-
Krzysztof Drewniak authored
This reverts commit 7c349c36. Per discussion at https://reviews.llvm.org/rG7c349c369847dc2f1736efb9c90d03521cd44a90 and elsewhere, the lowering to LLVM defined here isn't what it should be and the fastmath flag usage isn't correct, so `arith.is_nan` and `arith.is_inf` cannot exist in their current form. It's unclear if those operations should be introduced in the future, since they make the dialect more complex and don't add any expressive power. Further discussion may be moved to an RFC (or I'll drop this patch). Differential Revision: https://reviews.llvm.org/D157543
-
Jay Foad authored
This was an oversight when the GFX11 early release VGPRs optimization was reimplemented in D153279. Sending the DEALLOC_VGPRS message is a performance optimization so there is no need to do it at -O0. In addition it makes some kinds of post mortem debugging hard or impossible, since VGPR values are no longer available to inspect at the s_endpgm instruction. Differential Revision: https://reviews.llvm.org/D157599
-
Martin Erhart authored
[mlir][bufferization] Add pattern to BufferDeallocationSimplification pass that removes unnecessary retain values Adds a pattern that removes memrefs from the `retained` list which are guaranteed to not alias any memref in the `memrefs` list. The corresponding result value can be replaced with `false` in that case according to the operation description. When applied after BufferDeallocation, this can considerably reduce the overhead that needs to be added during the lowering of the dealloc operation to check for aliasing (especially when there is only one element in the `memref` list and all `retained` values can be removed). Depends on D157398 Reviewed By: springerm Differential Revision: https://reviews.llvm.org/D157407
-
Alexey Bataev authored
-
Nicolas Vasilache authored
This revision adds a `transform.apply_conversion_patterns.func.func_to_llvm` transformation. It is unclear at this point whether this should be spelled out as a standalone transformation or whether it should resemble `transform.apply_conversion_patterns.dialect_to_llvm "fun"`. This is dependent on how we want to handle the type converter creation. In particular the current implementation exhibits the fact that `transform.apply_conversion_patterns.memref.memref_to_llvm_type_converter` was not rich enough and did not match the LowerToLLVMOptions. Keeping those options in sync across all the passes that lower to LLVM is very error prone. Instead, we should have a single `to_llvm_type_converter`. Differential Revision: https://reviews.llvm.org/D157553
-
Bjorn Pettersson authored
Differential Revision: https://reviews.llvm.org/D157551
-
Bjorn Pettersson authored
Differential Revision: https://reviews.llvm.org/D157550
-
Bjorn Pettersson authored
The convenience methods that now are marked as deprecated are no long used in-tree. The getInt8PtrTy helper is however still used in many places, so it is not marked as deprecated to make it possible to build LLVM with -Werror. Differential Revision: https://reviews.llvm.org/D156741
-
Martin Erhart authored
Adds a pass that can be run after buffer deallocation to simplify the deallocation operations. In particular, there are patterns that need alias information and thus cannot be added as a regular canonicalization pattern. This initial commit moves an incorrect canonicalization pattern from over to this new pass and fixes it by querying the alias analysis for the additional information it needs to be correct (there must not by any potential aliasing memref in the retain list other than the currently mached one). Also, improves this pattern by considering the `extract_strided_metadata` operation which is inserted by the deallocation pass by default. Reviewed By: springerm Differential Revision: https://reviews.llvm.org/D157398
-
wangpc authored
We need unsigned integer here. Fixes #64534 Reviewed By: eopXD Differential Revision: https://reviews.llvm.org/D157476
-
Simon Pilgrim authored
Add bitcast handling to the existing insert_subvector(src, extract_subvector(sub)) pattern, and recognise undef src cases to allow us to detect vector widening patterns.
-
Louis Dionne authored
It seems like this one was forgotten and we were still using a raw std::abort(). Differential Revision: https://reviews.llvm.org/D157446
-
Louis Dionne authored
We were defining the function in locale.cpp, and we actually had two overloads for it. This is pretty confusing given that one was static and not exported from the dylib, and the other one was. Instead, use the vanilla __throw_runtime_error function everywhere even though that adds a tiny bit of code duplication. Differential Revision: https://reviews.llvm.org/D155008
-
Louis Dionne authored
The libc++ builders do not have the capacity to serve both libc++ and Clang CI needs. We initially used the libc++ builders when adding pre-commit CI for Clang as an experiment, however this setup has been problematic for libc++ for a long time. It makes libc++ CI turnaround way too slow, which has been a frequent source of frustration. We didn't want to make this change before the release to avoid rocking the boat too much in such an important time, however now that the release has been cut, we need to make this change. This will shift the traffic for Clang pre-commit CI from the libc++ builders to the builders that have been used for Clang pre-commit CI defined outside of Clang's BuildKite pipeline. Differential Revision: https://reviews.llvm.org/D157324
-
Kadir Cetinkaya authored
This reverts commit d031ff38. See https://reviews.llvm.org/D154503#4576393 for a reproducer and details.
-
Matthias Springer authored
Functions that materialize IR or convert types can be const. Caching data structures inside the TypeConverter are marked as `mutable`. Differential Revision: https://reviews.llvm.org/D157597
-
Matthias Springer authored
A conversion target is not needed. In a partial dialect conversion, ops are rewritten when possible. The dialect conversion succeeds if there are no illegal ops in the resulting IR. Differential Revision: https://reviews.llvm.org/D157595
-
Matthias Springer authored
Also add extra test cases for partial/full conversion. Differential Revision: https://reviews.llvm.org/D157594
-
Victor Kingi authored
This patch allows propagation of the R family of options to the backend where a separate patch will implement the optimization remark printing. This patch was created to address the comment about splitting into smaller patches in https://reviews.llvm.org/D156320. Reviewed By: awarzynski, tblah, kiranchandramohan Differential Revision: https://reviews.llvm.org/D157410
-
Aleksandr Popov authored
This reverts commit aa603c41. Revert due to LLVM Buildbot failure
-
Aaron Ballman authored
https://github.com/llvm/llvm-project/commit/5d8aaad4452f60ba8902e921d9bed606713a8f26 removed the warning group as the functionality is no longer a GNU extension. However, users have asked for the warning group to be supported so that code transitioning from Clang 16 to Clang 17 has an easier migration path when compiling with -Werror. This patch restores the warning group, but as an ignored warning group because the functionality is now always considered to be a C extension rather than a GNU extension. This allows users to do: -Werror -pedantic -Wno-gnu-empty-intializer -Wno-c2x-extensions to silence the diagnostics in both Clang 16 and Clang 17. Fixes https://github.com/llvm/llvm-project/issues/64357 Differential Revision: https://reviews.llvm.org/D157503
-
Aleksandr Popov authored
Differential Revision: https://reviews.llvm.org/D157491
-
Paul Walker authored
Whilst sub-optimial, it's better than the current selection failure. Fixes: #64406 Differential Revision: https://reviews.llvm.org/D157406
-
Sergio Afonso authored
This reverts commit f48969f9. Differential Revision: https://reviews.llvm.org/D157493
-
Markus Böck authored
Structured control flow ops have proven very useful for many transformations doing analysis on conditional flow and loops. Doing these transformations on CFGs requires repeated analysis of the IR possibly leading to more complicated or less capable implementations. With structured control flow, a lot of the information is already present in the structure. This patch therefore adds a transformation making it possible to lift arbitrary control flow graphs to structured control flow operations. The algorithm used is outlined in https://dl.acm.org/doi/10.1145/2693261. The complexity in implementing the algorithm was mostly spent correctly handling block arguments in MLIR (the paper only addresses the control flow graph part of it). Note that the transformation has been implemented fully generically and does not depend on any dialect. An interface implemented by the caller is used to construct any operation necessary for the transformation, making it possible to create an interface implementation purpose fit for ones IR. For the purpose of testing and due to likely being a very common scenario, this patch adds an interface implementation lifting the control flow dialect to the SCF dialect. Note the use of the word "lifting". Unlike other conversion passes, this pass is not 100% guaranteed to convert all ControlFlow ops. Only if the input region being transformed contains a single kind of return-like operations is it guaranteed to replace all control flow ops. If that is not the case, exactly one control flow op will remain branching to regions terminating with a given return-like operation (e.g. one region terminates with `llvm.return` the other with `llvm.unreachable`). Differential Revision: https://reviews.llvm.org/D156889
-
Markus Böck authored
In essentially all occurrences of adaptor constructions in the codebase, an instance of the op is available and only a different value range is being used. Nevertheless, one had to perform the ritual of calling and pass `getAttrDictionary()`, `getProperties` and `getRegions` manually. This patch changes that by teaching TableGen to generate a new constructor in the adaptor that is constructable using `GenericAdaptor(valueRange, op)`. The (discardable) attr dictionary, properties and the regions are then taken directly from the passed op, with only the value range being taken from the first parameter. This simplifies a lot of code and also guarantees that all the various getters of the adaptor work in all scenarios. Differential Revision: https://reviews.llvm.org/D157516
-
Markus Böck authored
The verifier incorrectly passed the region number of the predecessor region instead of the successor region to `getSuccessorOperands`. This went unnoticed since all upstream `RegionBranchTerminatorOpInterface` implementations did not make use of the `index` parameter. Adding an assert to e.g. `scf.condition` to make sure the index is valid or adding a region terminator that passes different operands to different successors immediately causes the verifier to fail as it suddenly gets incorrect types. This patch fixes the implementation to correctly pass the successor region index. Differential Revision: https://reviews.llvm.org/D157507
-
Tobias Gysi authored
This revision changes some typed pointer tests to opaque pointer tests and improves the stack save/restore tests to verify the import and export of intrinsics with different address spaces works. Reviewed By: zero9178 Differential Revision: https://reviews.llvm.org/D157585
-
Sergio Afonso authored
This patch improves the implementation of a recent function filtering workaround to address problems uncovered by D154247. In particular, the problem was related to the removal of functions called from within target regions. Since target regions have to remain until LLVM IR is generated, removing these functions from MLIR results in undefined references any time there are calls to them in a target region. This patch modifies the MLIR function filtering pass to make these functions "external" rather than removing them. This way, the processing and lowering of MLIR functions that will eventually be discarded is still prevented, but no calls to undefined functions remain either. Additionally, the approach of just filtering host-only functions during device compilation, and not filtering device-only functions during host compilation, is maintained. This is because code generation for device-only functions is required for host fallback to work. Depends on D156988 Differential Revision: https://reviews.llvm.org/D155827
-
Martin Storsjö authored
Since https://reviews.llvm.org/D157058 in libc++, the base template for char_traits has been removed - it is only provided for char, wchar_t, char8_t, char16_t and char32_t. (Thus, to use basic_string with a type other than those, we'd need to supply suitable traits ourselves.) For this particular use, a vector works just as well as basic_string. Differential Revision: https://reviews.llvm.org/D157589
-
Florian Hahn authored
Limit the information stored in VPDerivedIVRecipe to the ingredients really needed.
-
Tom Eccles authored
Add support for reasoning about operations with recursive memory effects to CSE. The recursive effects are gathered by a helper function. I decided to allow returning duplicates from the helper function because there's no benefit to spending the computation time to remove them in the existing use case. Differential Revision: https://reviews.llvm.org/D156805
-
Florian Hahn authored
Explicitly pass InductionKind and InductionBinOp to emitTransformedIndex. Only those values are needed from the induction descriptor. This makes explicit what is needed for the function and allows future use cases where the a full induction descriptor object is not available.
-