- Mar 28, 2024
-
-
Sergio Afonso authored
This patch performs several cleanups with the main purpose of normalizing the code patterns used to trigger codegen for MLIR OpenMP operations and making the processing of clauses and constructs independent. The following changes are made: - Clean up unused `directive` argument to `ClauseProcessor::processMap()`. - Move general helper functions in OpenMP.cpp to the appropriate section of the file. - Create `gen<OpName>Clauses()` functions containing the clause processing code specific for the associated OpenMP construct. - Update `gen<OpName>Op()` functions to call the corresponding `gen<OpName>Clauses()` function. - Sort calls to `ClauseProcessor::process<ClauseName>()` alphabetically, to avoid inadvertently relying on some arbitrary order. Update some tests that broke due to the order change. - Normalize `genOMP()` functions so they all delegate the generation of MLIR to `gen<OpName>Op()` functions following the same pattern. - Only process `nowait` clause on `TARGET` constructs if not compiling for the target device. A later patch can move the calls to `gen<OpName>Clauses()` out of `gen<OpName>Op()` functions and passing completed clause structures instead, in preparation to supporting composite constructs. That will make it possible to reuse clause processing for a given leaf construct when appearing alone or in a combined or composite construct, while controlling where the associated code is produced.
-
- Mar 27, 2024
-
-
Sergio Afonso authored
This patch updates Flang lowering to use the new set of OpenMP clause operand structures and their groupings into directive-specific sets of clause operands. It simplifies the passing of information from the clause processor and the creation of operations. The `DataSharingProcessor` is slightly modified to not hold delayed privatization state. Instead, optional arguments are added to `processStep1` which are only passed when delayed privatization is used. This enables using the clause operand structure for `private` and removes the need for the ad-hoc `DelayedPrivatizationInfo` structure. The processing of the `schedule` clause is updated to process the `chunk` modifier rather than requiring two separate calls to the `ClauseProcessor`. Lowering of a block-associated `ordered` construct is updated to emit a TODO error if the `simd` clause is specified, since it is not currently supported by the `ClauseProcessor` or later compilation stages. Removed processing of `schedule` from `omp.simdloop`, as it doesn't apply to `simd` constructs.
-
Sergio Afonso authored
This patch introduces a set of composable structures grouping the MLIR operands associated to each OpenMP clause. This makes it easier to keep the MLIR representation for the same clause consistent throughout all operations that accept it. The relevant clause operand structures are grouped into per-operation structures using a mixin pattern and used to define new operation constructors. These constructors can be used to avoid having to get the order of a possibly large list of operands right. Missing clauses are documented as TODOs, as well as operands which are part of the relevant operation's operand structure but cannot be attached to the associated operation yet, due to missing op arguments to its MLIR definition. A follow-up patch will update Flang lowering to make use of these structures, simplifying the passing of information from clause processing to operation- generating functions and also simplifying the creation of operations through the use of the new operation constructors.
-
Jacek Caban authored
[llvm-dlltool][llvm-lib][COFF] Don't override NONAME exports with demangled ARM64EC symbols. (#86722)
-
Jacek Caban authored
#78772 added similar support for .def file parser and import library writer. This PR adds missing bits in LLD to propagate EXPORTAS name and allow it in `/export` parser. This is syntax is used by MSVC for ARM64EC `__declspec(dllexport)` handling.
-
Luke Lau authored
Note we can't use vwaddu.wv because it will get combined away with #78403
-
Julian Nagele authored
Adds logic to the IR verifier that checks whether !tbaa.struct nodes are well-formed. That is, it checks that the operands of !tbaa.struct nodes are in groups of three, that each group of three operands consists of two integers and a valid tbaa node, and that the regions described by the offset and size operands are non-overlapping. PR: https://github.com/llvm/llvm-project/pull/86709
-
zhongyunde 00443407 authored
add restrict reassoc for the powi(X,Y) / X according the discuss on PR69998.
-
zhongyunde 00443407 authored
-
Jack Styles authored
When `+sve` is passed in the command line, if the Architecture being targeted is V8.6A/V9.1A or later, `+f32mm` is also added. This enables FEAT_32MM, however at the time of writing no CPU's support this. This leads to the FEAT_32MM instructions being compiled for CPU's that do not support them. This commit removes the automatic enablement, however the option is still able to be used by passing `+f32mm`.
-
Luke Lau authored
Unlike add, sub and mul, we don't have widening instructions for div, rem and logical ops, so we don't have any test coverage if we were to extend combineBinOpOfZExts to handle them. Adding tests coincidentally revealed that logical ops are already narrowed as a generic DAG combine via DAGCombiner::hoistLogicOpWithSameOpcodeHands. So we don't actually need to run combineBinOpOfZExts on them.
-
ShihPo Hung authored
Changes in Recommit: Add an additional check on sign/zero extend to the same type. Original message: Use the destination data type to measure the LMUL size for latency/throughput cost
-
Alina Sbirlea authored
-
Jianjian Guan authored
Inline a callee if its target-features are a subset of the callers target-features.
-
Vitaly Buka authored
-
Yeting Kuo authored
For targets with Zcb, this patch makes llvm generate more compress c.lb/lbu/lh/lhu/sb/sh instructions.
-
Carlos Alberto Enciso authored
As part of the WebAssembly support work https://github.com/llvm/llvm-project/pull/85566 The README.txt is a bit odd since it only lists issues and problems without talking about what works. It’s also hard to read on the GitHub web view. - Convert to Markdown and linking to the command docs https://llvm.org/docs/CommandGuide/llvm-debuginfo-analyzer - Rename some left 'elf reader' to 'DWARF reader'.
-
Christian Sigg authored
Move `GPUOpsLowering.cpp` from `//mlir:GPUCommonTransforms` to `//mlir:GPUToGPURuntimeTransforms` to match the CMake setup. Ideally, header files should be used by only one target, but this is hard because CMake is less strict with headers (no layering check). But even with bazel, headers should only be exported once in the `hdrs` attribute. Other targets may use them in the `srcs` attribute to avoid circular dependencies.
-
ShihPo Hung authored
This reverts commit 7545c635 as it's failing on the Linux bots.
-
Craig Topper authored
This an alternative to #84935 to fix the miscompile, but not be optimal. The immediate for cm.push/pop must be a multiple of 16. For RVE, it might not be. It's not easy to increase the stack size without messing up cfa directives and maybe other things. This patch rounds the stack size down to a multiple of 16 before clamping it to 48. This causes an extra addi to be emitted to handle the remainder. Once this commited, I can commit #84989 to add verification for these instructions being generated with valid offsets.
-
Craig Topper authored
From the spec | Instruction | Register | Cannot Overlap | | ----------- | -------- | -------------- | | vaes*.vs | vs2 | vd | | vsm4r.vs | vs2 | vd | | vsha2c[hl] | vs1, vs2 | vd | | vsha2ms | vs1, vs2 | vd | | sm3me | vs2 | vd | | vsm3c | vs2 | vd |
-
Shilei Tian authored
-
Shilei Tian authored
-
Jeremy Day authored
Fixes https://github.com/llvm/llvm-project/issues/83046 There is a race condition when calling `GetFileAttributesW` that can cause it to return `ERROR_ACCESS_DENIED` on a path which exists, which is unexpected for callers using this function to check for file existence by passing `AccessMode::Exist`. This was manifesting as a compiler crash on Windows downstream in the Swift compiler when using the `-index-store-path` flag (more information in https://github.com/apple/llvm-project/issues/8224). I looked for alternate APIs to avoid bringing in `shlwapi.h`, but didn't see any good candidates. I'm not tied at all to this solution, any feedback and alternative approaches are more than welcome.
-
Craig Topper authored
This allows the asm printer to print the stack spill/reload messages.
-
Teresa Johnson authored
Restructure the handling of edges that become empty during the cloning process. Instead of removing them as they become empty (no context ids and alloc type), do this once after all cloning is complete. This has no effect on the cloning result, but prepares for a follow on change that does improve the cloning. The structural change here reduces the diffs for the follow on change, which would be much more difficult with the previous handling.
-
Shih-Po Hung authored
Use the destination data type to measure the LMUL size for latency/throughput cost
-
Oleksandr "Alex" Zinenko authored
Transform op trait verification calls `getEffects`, and since trait verification runs before op verification, this call cannot assume the op to be valid. However, the operand getters now return a `TypedValue` that unconditionally casts the value to the expected type, leading to an assertion failure. Use the untyped mechanism instead. Fixes #84701.
-
Matthias Springer authored
This commit adds a helper function that dumps the constraint set and the mapping of columns to values/dims. For debugging only. Example output: ``` ========== Columns: (column dim value) 0 1 linalg.fill (result 0) 1 1 tensor.extract_slice (result 0) 2 n/a affine.min (result 0) 3 n/a scf.for (bbarg 0) 4 n/a func.func (bbarg 2) Constraint set: Domain: 0, Range: 1, Symbols: 4, Locals: 0 6 constraints (None None None None None const) 1 -1 0 0 0 0 = 0 0 1 -1 0 0 0 = 0 0 0 -1 -1 1 0 >= 0 0 0 -1 0 0 4 >= 0 0 0 0 1 0 0 >= 0 0 0 0 -1 1 -1 >= 0 ========== ```
-
Enna1 authored
This patch replaces the `SANITIZER_WORDSIZE / 2` with `sizeof(CompactPtrT) * 8`, replaces hardcoded `4` with `kCompactPtrScale` in assertion.
-
Changpeng Fang authored
We should not manually get the types of the loading data. Instead, we can get the types from the intrinsics directly.
-
Michael Maitland authored
These cases in particular are done as a precommit to support legalization, regbank selection, and instruction selection for extends, splat vectors, and integer compares in #85938.
-
Pavel Kosov authored
…i_check This causes __cfi_check, just as __cfi_check_fail, to get the proper target-specific attributes, in particular uwtable for unwind table generation. Previously, nounwind attribute could be inferred for __cfi_check, which caused it to lose its unwind table even with -funwind-table option. ~~ Huawei RRI, OS Lab Co-authored-by:Nikolai Kholiavin <kholiavin.nikolai@huawei-partners.com>
-
Michael Maitland authored
G_VSCALE should be lowered using VLENB. If the type is not sXLen it should be lowered using a G_VSCALE on the narrow type and a G_MUL. regbank select and instruction select are straightforward so we really only need to add tests to show it works.
-
Aart Bik authored
This fixes an "infinite" loop bug, where the incoming IR was repeatedly rewritten while adding identical cast operations. The test for compatible types should include the notion of an encoding. If it differs, then a naive fusion into the consumer is invalid.
-
SevenIsSeven authored
This commit(https://github.com/llvm/llvm-project/pull/84738 ) introduced following compile warning then treated-as-error in MSVC build. >>>"'^': unsafe mix of type 'unsigned int' and type 'bool' in operation" --------- Co-authored-by:
Seven <Seven.Li@amd.com>
-
Vadim Paretsky authored
This PR adds loop collapse tests ported from MSVC. --------- Co-authored-by:Vadim Paretsky <b-vadipa@microsoft.com>
-
Alex MacLean authored
While a stack size large enough to cause this truncation to be a problem would certainly cause other issues and not produce a valid program anyway, this cast is triggering our Coverity static analysis. Removing it seems cleaner.
-
Craig Topper authored
There were 3 temporaries that just renamed the 3 well name arguments to the function to Tmp1-3. Looks like this was done when the code was extracted from elsewhere into a separate function 15 years ago.
-
Xiangyang (Mark) Guo authored
getCost() expects that isVariable() is true. https://github.com/llvm/llvm-project/blob/main/llvm/include/llvm/Analysis/InlineCost.h#L146 Co-authored-by:
helloguo <helloguo@meta.com>
-