- Dec 07, 2023
-
-
Matthias Springer authored
-
antangelo authored
[clang] Exclude non-template classes when checking if constraint refers to containing template arguments (#74265) When checking if the constraint uses any enclosing template parameters for [temp.friend]p9, if a containing record is used as argument, we assume that the constraint depends on enclosing template parameters without checking if the record is templated. The reproducer from the bug is included as a test case. Fixes #71595
-
Craig Topper authored
This instruction produces a 32-bit sign extended value if the SEW is less than or equal to 32.
-
dong jianqiang authored
Adds a warning, issued by the clang semantic analysis. The patch warns on switch which don't have the default branch. This is a counterpart of gcc's Wswitch-default.
-
Owen Pan authored
Fixed #41854.
-
Johannes Doerfert authored
Reverts llvm/llvm-project#74360 As I wrote in the analysis of #74360: Since https://github.com/llvm/llvm-project/commit/bc4e0c048aa3cd940b0cea787014c7e8680e5040 we will not add PluginAdaptors into the container of all plugin adaptors before the plugin is not ready. The error is thereby gone. When and old HSA loads other libraries they can call register_image but that will simply not register the image with the plugin we are currently initializing. That seems like reasonable behavior, thought it is good to keep in mind if we ever want a kernel library (@jhuber6 @mjklemm). We can still have a standalone kernel library though or load it late after all plugins are setup (which seems reasonable). I did not expect one our tests actually doing exactly what this will not allow anymore, at least when you use rocm <5.5.0. Need to figure out if we want this behavior (for rocm <5.5.0).
-
Peiming Liu authored
-
Matthias Springer authored
The `ForallRewriter` pattern used to generate invalid IR: ``` mlir/test/Dialect/SparseTensor/GPU/gpu_combi.mlir:0:0: error: 'scf.for' op expects region #0 to have 0 or 1 blocks mlir/test/Dialect/SparseTensor/GPU/gpu_combi.mlir:0:0: note: see current operation: "scf.for"(%8, %2, %9) ({ ^bb0(%arg5: index): // ... "scf.yield"() : () -> () ^bb1(%10: index): // no predecessors "scf.yield"() : () -> () }) : (index, index, index) -> () ``` This commit fixes tests such as `mlir/test/Dialect/SparseTensor/GPU/gpu_combi.mlir` when verifying the IR after each pattern application (#74270). -
Matthias Springer authored
`createQuickSort` used to generate invalid IR: ``` "func.func"() <{function_type = (index, index, memref<?xindex>, memref<?xf32>, memref<?xi32>) -> (), sym_name = "_sparse_qsort_0_1_index_coo_1_f32_i32", sym_visibility = "private"}> ({ ^bb0(%arg0: index, %arg1: index, %arg2: memref<?xindex>, %arg3: memref<?xf32>, %arg4: memref<?xi32>): %0:2 = "scf.while"(%arg0, %arg1) ({ ^bb0(%arg5: index, %arg6: index): // ... "scf.condition"(%3, %arg5, %arg6) : (i1, index, index) -> () }, { ^bb0(%arg5: index, %arg6: index): // ... %7:2 = "scf.if"(%6) ({ %8 = "arith.cmpi"(%2, %3) <{predicate = 7 : i64}> : (index, index) -> i1 // ... "scf.yield"(%9#0, %9#1) : (index, index) -> () %10 = "arith.constant"() <{value = 0 : index}> : () -> index }, { "scf.yield"(%arg5, %arg5) : (index, index) -> () }) : (i1) -> (index, index) "scf.yield"(%7#0, %7#1) : (index, index) -> () }) : (index, index) -> (index, index) "func.return"() : () -> () }) : () -> () within split at mlir/test/Dialect/SparseTensor/buffer_rewriting.mlir:76 offset :11:1: error: 'scf.yield' op must be the last operation in the parent block ``` This commit fixes tests such as `mlir/test/Dialect/SparseTensor/buffer_rewriting.mlir` when verifying the IR after each pattern application (#74270). -
Yaxun (Sam) Liu authored
The test fails intermittently due to non-unique file name %T. Use %t based file names instead. Fixes: https://github.com/llvm/llvm-project/issues/74472
-
Matthias Springer authored
Op verifiers should verify only local properties of an op. The dynamic sizes of a `tensor.generate` op should not be verified. Dynamic sizes that have a negative constant value should not prevent the `tensor.generate` op from verifying. Also share some code between the `tensor.empty` and `tensor.generate` "dynamic dim -> static dim" canonicalization patterns. Remove the `invalid-canonicalize.mlir` file and move the test case to `canonicalize.mlir`. Canonicalization no longer produces IR that does not verify (and leaves the op as is).
-
Lang Hames authored
Pointer jump stubs content was incorrectly using 1-byte alignment. This bug flew under the radar because the ordinary instruction streams (and aligned section starts) usually left the block 4-byte aligned anyway. The bug was observed when an out-of-tree pass introduced new content with arbitrary sizes into the text section. No testcase yet: We don't have a good way to replicate the perturbation that was caused by the out-of-tree pass.
-
Justin Bogner authored
RWBuffer doesn't have a default type in dxc's implementation, so it shouldn't have one in clang either. Reviewers: llvm-beanz, python3kgae Reviewed By: python3kgae, llvm-beanz Pull Request: https://github.com/llvm/llvm-project/pull/71265
-
Matthias Springer authored
The partial bufferization framework has been replaced with One-Shot Bufferize. SCF-specific canonicalization patterns for `to_memref`/`to_tensor` are no longer needed.
-
Fangrui Song authored
-
Justin Bogner authored
If a template is defined via an external AST source, it won't have a location. When we emit warnings about misusing such templates we shouldn't emit a "template is declared here" warning with no location, as that's just confusing. Reviewers: llvm-beanz, erichkeane, AaronBallman Reviewed By: erichkeane, AaronBallman Pull Request: https://github.com/llvm/llvm-project/pull/71264
-
Johannes Doerfert authored
-
Finn Plummer authored
Add missing constant propogation folder for LeftShiftLogical, RightShift[Logical|Arithmetic]. Implement additional folding when Shift value is 0. This helps for readability of lowered code into SPIR-V. Part of work for #70704
-
Johannes Doerfert authored
Before we expected all symbols in the device image to be backed up with data that we could read. However, uninitialized values are not. We now check for this case and avoid reading random memory. This also replaces the correct readGlobalFromImage call with a isSymbolInImage check after https://github.com/llvm/llvm-project/pull/74550 picked the wrong one. Fixes: https://github.com/llvm/llvm-project/issues/74582
-
Valentin Clement (バレンタイン クレメン) authored
`*` is not friendly to the MLIR attribute parser and will fail to be parsed. Switch the `*` enum representation to `star`.
-
Johannes Doerfert authored
We probably should use a temporary name, but having stable names helps debugging.
-
Johannes Doerfert authored
Remove `DelayedBinDesc` as it is not necessary since https://github.com/llvm/llvm-project/commit/bc4e0c048aa3cd940b0cea787014c7e8680e5040. See https://github.com/llvm/llvm-project/pull/74360#issuecomment-1843603736 for details.
-
Felipe de Azevedo Piovezan authored
These tests started passing after this PR landed: https://github.com/llvm/llvm-project/pull/74580
-
Christopher Di Bella authored
The reorganisation assists with identifying information that's relevant to the reader by using sections, note/warning blocks, and highlighted lists. Some rewording was necessary to fit the new structure and some to improve flow. Changes to the intention of the documentation have not been made. --------- Co-authored-by:Will Hawkins <whh8b@obs.cr>
-
Philip Reames authored
getOptionVisibilityMask already returns options::FlangOption in FlangMode, so this assignment is entirely pointless.
-
Craig Topper authored
Original message: We still have to keep the noCommonBitsSet call to handle multiple reassociations in one pass. We'll lose the flag on the first reassociation.
-
Johannes Doerfert authored
By default we now only look for the plugins we build, but the user can overwrite that with `LIBOMPTARGET_PLUGINS_TO_LOAD="cuda,amdgpu,x86_64"`
-
Michael Buch authored
This commit reverts the changes in https://github.com/llvm/llvm-project/pull/71780 and all of its follow-up patches. We got reports of the `.debug_names/.debug_gnu_pubnames/gdb_index/etc.` sections growing by a non-trivial amount for some large projects. While GCC emits definitions for static data member constants into the Names index, they do so *only* for explicitly `constexpr` members. We were indexing *all* constant-initialized const-static members, which is likely where the significant size difference comes from. However, only emitting explicitly `constexpr` variables into the index doesn't seem like a good way forward, since from clang's perspective `const`-static integrals are `constexpr` too, and that shouldn't be any different in the debug-info component. Also, as new code moves to `constexpr` instead of `const` static for constants, such solution would just delay the growth of the Names index. To prevent the size regression we revert to not emitting definitions for static data-members that have no location. To support access to such constants from LLDB we'll most likely have to have to make LLDB find the constants by looking at the containing class first.
-
Aart Bik authored
Removes at in favor of curr; also makes method delegates consistent
-
Lang Hames authored
Replaces an llvm::cast that assumed that all Binary instances were either Archive or MachOUniversalBinary instances with a dyn_cast. The cast was triggering an assert in StaticLibraryDefinitionGenerator::Load if that method was given a path or MemoryBuffer containing a relocatable object file. Switching to dyn_cast causes the operation to error out with a bad-format error as expected. Fixes rdar://119262300
-
Craig Topper authored
This reverts commit 78964457. Looks like I didn't rebase this correctly before commit
-
Craig Topper authored
We still have to keep the noCommonBitsSet call to handle multiple reassociations in one pass. We'll lose the flag on the first reassociation.
-
Craig Topper authored
-
Andrzej Warzyński authored
-
Andrzej Warzyński authored
The current vectorization of 1D depthwise convolutions in Linalg is _sub-optimal_ for tensor with a low number of channel dimensions, e.g.: ```mlir linalg.depthwise_conv_1d_nwc_wc {dilations = dense<1> : vector<1xi64>, strides = dense<1> : vector<1xi64>} ins(%input, %filter : tensor<1x8x3xi8>, tensor<1x3xi8>) outs(%output : tensor<1x8x3xi8>) -> tensor<1x8x3xi8> ``` That's due to the fact that ultimately (i.e. at LLVM level), vectorization happens along the trailing dimension (i.e. the channel dimension). In this case it leads to vectors with 3 elements (or worse, if there's e.g. only 1 channel dimension). For comparison, a 128 bit wide vector registers can hold 16 x i8. Instead, this patch adds an option to flatten/collapse the channel dimension into the width dimension of the input/filter/output using `vector.shape_cast` operation: ```mlir %sc_input = vector.shape_cast %input : vector<1x8x3xi8> to vector<1x24xi8> %sc_output = vector.shape_cast %output : vector<1x8x3xi8> to vector<1x24xi8> %b_filter = vector.broadcast %filter : vector<3xi8> to vector<1x8x3xi8> %sc_filter = vector.shape_cast %b_filter : vector<1x8x3xi8> to vector<1x24xi8> ``` This new vectorization mode is implemented in `depthwiseConv` by inserting `vector.shape_cast` Ops before and after `depthwiseConv1dSliceAsMulAcc` is invoked. It can be selected through e.g. a transform dialect attribute: ```mlir transform.structured.vectorize_children_and_apply_patterns %conv {flatten_1d_depthwise_conv} ``` A forthcoming patch will implement a strategy to automatically switch between the two implementations, depending on the shape of the input tensors. Co-authored by: Bradley Smith <bradley.smith@arm.com> -
Aart Bik authored
This adds a consistent usage with `at` for everything that refers to the current loop nesting. This cleans up some redundant legacy code from when we were still using topSort inside sparsifier code.
-
LLVM GN Syncbot authored
-
Oskar Wirga authored
I discovered two issues for when a CFI dispatch table entry is used as a direct call. # Inlining There is the possibility that the dispatch table entry contains only a single function pointer: ``` ; Function Attrs: naked nocf_check define private void @.cfi.jumptable() #6 align 8 { entry: call void asm sideeffect "jmp ${0:c}@plt\0Aint3\0Aint3\0Aint3\0A", "s"(ptr @_Z7throw_ei) unreachable } ``` If this function is inlined, the unreachable follows and ruins the containing function. # Exception Handling The dispatch table is always marked NoUnwind. This is fine if the entries are never used directly, but if a direct call is used which the containing function expects to throw, it will no longer throw and the exception handling code will be lost. -
Piotr Zegar authored
To avoid compiler errors on some platforms introduced by #66583, now using std::vector to pass list of matchers into main matcher, and removed static variable as it could introduce some other issues.
-
Julian Schmidt authored
Finds constants and function calls to math functions that can be replaced with c++20's mathematical constants from the 'numbers' header and offers fix-it hints. Does not match the use of variables with that value, and instead, offers a replacement at the definition of those variables.
-