- Feb 15, 2023
-
-
Valentin Clement authored
This patch updates the code added in D143888 to avoid overwriting some part of the types when updating it for unlimited polymorphic types. Reviewed By: jeanPerier, PeteSteinfeld Differential Revision: https://reviews.llvm.org/D143995
-
Matt Arsenault authored
Ignore the multiple use heuristics of the default implementation, and report cost based on inline immediates. This is mostly interesting for -0 vs. 0. Gets a few small improvements. fneg_fadd_0_f16 is a small regression. We could probably avoid this if we handled folding fneg into div_fixup.
-
Matt Arsenault authored
-
Matt Arsenault authored
This requires the denormal mode to definitively be IEEE handling.
-
Matthias Springer authored
`restrict` is similar to the C++ restrict keyword. Results of `to_tensor` that have the `restrict` attribute are guaranteed to not alias any other `to_tensor` result (after bufferization). Note: Since `to_memref` ops are not supported by One-Shot Bufferize and all bufferizable ops follow DPS rules (i.e., the buffer of the result is the buffer of an operand or an alias thereof), the buffer of a `to_tensor` op that has the `restrict` attribute is always an entirely "new" buffer that is not aliasing with the future buffer of any tensor value in the entire program. This makes such `to_tensor` ops "safe" from a bufferization perspective; they cannot cause RaW conflicts. Differential Revision: https://reviews.llvm.org/D144021
-
Sander de Smalen authored
Some places in the code have checks for isa<ScalableVectorType> and use that to bail out of the code. It's also possible to look directly at the allocated type-size and check if the size is scalable. This means it's possible to also support other scalable types that are not vectors (i.e. TargetExtType). This is split out from D136861.
-
Meghan Denny authored
Fixes https://github.com/llvm/llvm-project/issues/56496. As mentioned in the issue, new functions LLVMArrayType2 and LLVMGetArrayLength2 are created so as to not break the old API. The old methods are then marked as deprecated and callers are updated. Differential Revision: https://reviews.llvm.org/D143700
-
Andrzej Warzynski authored
This patch simply adds `vectorize_nd_extract` (that's currently only used for the `vectorize` Op) to `masked_vectorize`. A test is added to verify that it works as expected - it prevents the masked vectorisation of `tensor.extract`, which is currently not supported. Differential Revision: https://reviews.llvm.org/D142634
-
Max Kazantsev authored
Currently we use 'tmp', which is also a keyword for FileCheck. It leads to this annoying warning whenever a script for auto-generation of checks is used. It is especially annoying that it happens to every test affected by metarenamer. Just use another prefix for metarenamed names to avoid this. Differential Revision: https://reviews.llvm.org/D144001 Reviewed By: nikic
-
Balázs Kéri authored
Warnings and notes of checker alpha.unix.StdLibraryFunctionArgs are improved. Previously one warning and one note was emitted for every finding, now one warning is emitted only that contains a detailed description of the found issue. Reviewed By: Szelethus Differential Revision: https://reviews.llvm.org/D143194
-
Fangrui Song authored
Following recent changes to remove non-core legacy passes.
-
Lorenzo Chelini authored
Introduce a pattern to 'push down' a `tensor.unpack` through a `tensor.pad`. The propagation happens if the unpack does not touch the padded dimensions. Reviewed By: hanchung Differential Revision: https://reviews.llvm.org/D143907
-
Craig Topper authored
If we have both an nsw and nuw flag, we would see the nsw flag first and only handle signed comparisons. This patch ignores the nsw flag if the comparison isn't signed. Reviewed By: nikic Differential Revision: https://reviews.llvm.org/D143766
-
Adrian Kuegel authored
-
Ingo Müller authored
When changing IR in a RewriterPattern, all changes must go through the rewriter. There are several convenience functions in RewriterBase that help with high-level modifications, such as replaceAllUsesWith for Values, but there is currently none to do the same task for Blocks. Reviewed By: mehdi_amini, ingomueller-net Differential Revision: https://reviews.llvm.org/D142525
-
Mehdi Amini authored
This may be seen as a hack, but it allows for any piece of MLIR to be able to end up with DWARF debug info through LLVM. Assuming the operations in the function have location such as FileLineCol, this provides backtraces with line tables and allows to step in a debugger. That makes this pass a perfect companion to -snapshot-op-locations It was also the default behavior of MLIR to LLVM IR translation until MLIR got support for proper debug info attributes. Differential Revision: https://reviews.llvm.org/D144069
-
Adrian Kuegel authored
-
Diego Caballero authored
Support for masking static shapes was already implemented in the past but not enabled so this patch is just removing a pre-condition check and adding some tests with static shapes. Reviewed By: ThomasRaoux Differential Revision: https://reviews.llvm.org/D143937
-
Diego Caballero authored
This patch adds support for masked vector.gather ops using the vector.mask representation. It includes the implementation of the MaskableOpInterface, Linalg vectorizer support and lowering to LLVM. Reviewed By: ThomasRaoux Differential Revision: https://reviews.llvm.org/D143939
-
Diego Caballero authored
This patch adds support for masking vector.contract ops with the vector.mask approach. This also includes the lowering of vector.contract through the vector.outerproduct path to LLVM. For now, this only adds support for one of the many potential flavors of vector.contract/vector.outerproduct but unsupported cases will fail gratefully. Reviewed By: ThomasRaoux Differential Revision: https://reviews.llvm.org/D143965
-
Diego Caballero authored
This patch adds the conversion patterns to lower masked reduction operations to the corresponding vp intrinsics in LLVM. Reviewed By: ftynse Differential Revision: https://reviews.llvm.org/D142177
-
Fangrui Song authored
Following recent changes to remove non-core features of the legacy PM/optimization pipeline.
-
Kazu Hirata authored
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
-
Kazu Hirata authored
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
-
Kazu Hirata authored
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
-
Jie Fu authored
/home/jiefu/llvm-project/mlir/lib/Dialect/SparseTensor/Transforms/Sparsification.cpp:279:33: error: comparison of integers of different signs: 'int64_t' (aka 'long') and 'const mlir::sparse_tensor::Level' (aka 'const unsigned long') [-Werror,-Wsign-compare] assert(env.op().getRank(&t) == lvlRank); ~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~ /usr/include/assert.h:93:27: note: expanded from macro 'assert' (static_cast <bool> (expr) \ ^~~~ 1 error generated. /home/jiefu/llvm-project/mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorRewriting.cpp:788:29: error: comparison of integers of different signs: 'int64_t' (aka 'long') and 'const mlir::sparse_tensor::Dimension' (aka 'const unsigned long') [-Werror,-Wsign-compare] assert(srcRTT.getRank() == dimRank); ~~~~~~~~~~~~~~~~ ^ ~~~~~~~ /usr/include/assert.h:93:27: note: expanded from macro 'assert' (static_cast <bool> (expr) \ ^~~~ /home/jiefu/llvm-project/mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorRewriting.cpp:810:31: error: comparison of integers of different signs: 'int64_t' (aka 'long') and 'const mlir::sparse_tensor::Dimension' (aka 'const unsigned long') [-Werror,-Wsign-compare] assert(srcRTT.getRank() == dimRank); ~~~~~~~~~~~~~~~~ ^ ~~~~~~~ /usr/include/assert.h:93:27: note: expanded from macro 'assert' (static_cast <bool> (expr) \ ^~~~ 2 errors generated. -
LLVM GN Syncbot authored
-
Piyou Chen authored
RISC-V vector instruction has register overlapping constraint for certain instructions, and will cause illegal instruction trap if violated, we use early clobber to model this constraint, but it can't prevent register allocator allocated same or overlapped if the input register is undef value, so convert IMPLICIT_DEF to temporary pseudo could prevent that happen, it's not best way to resolve this. Ideally we should model the constraint right, but before we model the constraint right, it's the approach to prevent that happen. See also: https://github.com/llvm/llvm-project/issues/50157 Reviewed By: craig.topper Differential Revision: https://reviews.llvm.org/D129735
-
Piyou Chen authored
Reviewed By: kito-cheng Differential Revision: https://reviews.llvm.org/D137763
-
Chuanqi Xu authored
Required in https://reviews.llvm.org/D137526. And it is indeed odd that LexTest depends on ClangFrontend.
-
Lang Hames authored
The existing Create method took a path to the ORC runtime and created a StaticLibraryDefinitionGenerator for it. The new overload takes a std::unique_ptr<DefinitionGenerator> directly instead. This provides more flexibility when constructing MachOPlatforms. E.g. The runtime archive can be embedded in a special section in the ORC controller executable or library, rather than being on-disk. This is the ELFNixPlatform equivalent of the MachOPlatform change in be2fc577.
-
wren romano authored
This change adds a new `SparseTensorType` class for making the "dim" vs "lvl" distinction more overt, and for abstracting over the differences between sparse-tensors and dense-tensors. In addition, this change also adds new type aliases `Dimension`, `Level`, and `FieldIndex` to make code more self-documenting. Although the diff is very large, the majority of the changes are mechanical in nature (e.g., changing types to use the new aliases, updating variable names to match, etc). Along the way I also made many variables `const` when they could be; the majority of which required only adding the keyword. A few places had conditional definitions of these variables, requiring actual code changes; however, that was only done when the overall change was extremely local and easy to extract. All these changes are included in the current patch only because it would be too onerous to split them off into a separate patch. Reviewed By: aartbik Differential Revision: https://reviews.llvm.org/D143800
-
Chuanqi Xu authored
Add a test to ensure that the clang-scan-deps won't crash due to the unexpected use of clang modules.
-
Owen Pan authored
-
Peiming Liu authored
UnpackOp Converter used to create reallocOp unconditionally, but it might cause issue when the requested memory size is smaller than the actually storage. Reviewed By: aartbik Differential Revision: https://reviews.llvm.org/D144065
-
chenglin.bi authored
For the pattern `(zext i1 X) + (sext i1 Y)`, the constant range is [-1, 1]. We can simplify the pattern by logical operations. Like: ``` (zext i1 X) + (sext i1 Y) == -1 --> ~X & Y (zext i1 X) + (sext i1 Y) == 0 --> ~(X ^ Y) (zext i1 X) + (sext i1 Y) == 1 --> X & ~Y ``` And other predicates can the combination of these results: ``` (zext i1 X) + (sext i1 Y)) != -1 --> X | ~Y (zext i1 X) + (sext i1 Y)) s> -1 --> X | ~Y (zext i1 X) + (sext i1 Y)) u< -1 --> X | ~Y (zext i1 X) + (sext i1 Y)) s> 0 --> X & ~Y (zext i1 X) + (sext i1 Y)) s< 0 --> ~X & Y (zext i1 X) + (sext i1 Y)) != 1 --> ~X | Y (zext i1 X) + (sext i1 Y)) s< 1 --> ~X | Y (zext i1 X) + (sext i1 Y)) u> 1 --> ~X & Y ``` All alive proofs: https://alive2.llvm.org/ce/z/KmgDpF https://alive2.llvm.org/ce/z/fLwWa9 https://alive2.llvm.org/ce/z/ZKQn2P Fix: https://github.com/llvm/llvm-project/issues/59666 Reviewed By: spatel Differential Revision: https://reviews.llvm.org/D143373 -
Liren Peng authored
During the SeparateConstOffsetFromGEP pass, a - b and b - a will be considered equivalent in some instances. An example- the IR contains: BB1: %add = add %a, 511 br label %BB2 BB2: %sub2 = sub %b, %a br label %BB3 BB3: %sub1 = sub %add, %b %gep = getelementptr float, ptr %p, %sub1 Step 1 in the SeparateConstOffsetFromGEP pass, after split constant index: BB1: %add = add %a, 511 br label %BB2 BB2: %sub2 = sub %b, %a br label %BB3 BB3: %sub.t = sub %a, %b %gep.base = getelementptr float, ptr %p, %sub.t %gep = getelementptr float, ptr %gep.base, 511 Step 2, after reuniteExts: BB1: br label %BB2 BB2: %sub2 = sub %b, %a br label %BB3 BB3: %gep.base = getelementptr float, ptr %p, %sub2 %gep = getelementptr float, ptr %gep.base, 511 Obviously, reuniteExts treated a - b and b - a as equivalent. This patch fixes that. Reviewed By: nikic, spatel Differential Revision: https://reviews.llvm.org/D143542 -
chenglin.bi authored
-
Liren Peng authored
We need such a flag to check whether the transformation is correct if LowerGEP was enabled. Reviewed By: nikic, arsenm, spatel Differential Revision: https://reviews.llvm.org/D143980
-
Fangrui Song authored
-