- Nov 01, 2023
-
-
Wenju He authored
If function return value's type is pointer, we can try to collect flat address expression from it. This PR also fixes noop_ptrint_pair_ce2 in noop-ptrint-pair.ll in #70611
-
Serge Pavlov authored
C language standard defined library functions `iszero`, `issignaling` and `issubnormal`, which did not have counterparts among clang builtin functions. This change adds new functions: __builtin_iszero __builtin_issubnormal __builtin_issignaling They provide builtin implementation for the missing standard functions. Pull request: https://github.com/llvm/llvm-project/pull/69041 -
Davide Italiano authored
The discriminator can only pack 16 bits, so anything exceeding that value will cause the packing code to crash. Emit a diagnostic and skip the optimization instead.
-
Mehdi Amini authored
-
Mehdi Amini authored
-
Mehdi Amini authored
The IR is valid, but UB: there is an out-of-bound index for the position to insert inside the vector. We should just ignore this in the folder. Fixes #70884
-
Mehdi Amini authored
-
Mehdi Amini authored
This make sure that an invalid negative dimension is ignored and stays dynamic instead of crashing the compiler. Fixes #70887
-
Yingwei Zheng authored
This PR exposes four APIs to C/OCaml bindings for `TargetMachine`: ``` /** Enable fast-path instruction selection. */ void LLVMSetTargetMachineFastISel(LLVMTargetMachineRef T, LLVMBool Enable); /** Enable global instruction selection. */ void LLVMSetTargetMachineGlobalISel(LLVMTargetMachineRef T, LLVMBool Enable); /** Set abort behaviour when global instruction selection fails to lower/select * an instruction. */ void LLVMSetTargetMachineGlobalISelAbort(LLVMTargetMachineRef T, LLVMGlobalISelAbortMode Mode); /** Enable the MachineOutliner pass. */ void LLVMSetTargetMachineMachineOutliner(LLVMTargetMachineRef T, LLVMBool Enable); ``` Fixes #70666. -
Med Ismail Bennani authored
This reverts commit 3c727a95 because it introduced some test failures: https://lab.llvm.org/buildbot/#/builders/68/builds/62638 ``` ******************** Failed Tests (5): lldb-api :: functionalities/postmortem/elf-core/TestLinuxCore.py lldb-api :: functionalities/postmortem/mach-core/TestMachCore.py lldb-api :: functionalities/postmortem/netbsd-core/TestNetBSDCore.py lldb-api :: functionalities/unwind/noreturn/module-end/TestNoReturnModuleEnd.py lldb-api :: tools/lldb-dap/coreFile/TestDAP_coreFile.py ``` Signed-off-by:
Med Ismail Bennani <ismail@bennani.ma>
-
Matthias Springer authored
- Implement `SubsetOpInterface`, `SubsetExtractionOpInterface`, `SubsetInsertionOpInterface` for `vector.transfer_read` and `vector.transfer_write`. - Move all tensor subset hoisting test cases from `Linalg` to `loop-invariant-subset-hoisting.mlir`. (Removing 1 duplicate test case.)
-
Kazu Hirata authored
-
Med Ismail Bennani authored
-
Qiu Chaofan authored
-
Johannes Doerfert authored
The KernelEnvironment is for compile time information about a kernel. It allows the compiler to feed information to the runtime. The KernelLaunchEnvironment is for dynamic information *per* kernel launch. It allows the rutime to feed information to the kernel that is not shared with other invocations of the kernel. The first use case is to replace the globals that synchronize teams reductions with per-launch versions. This allows concurrent teams reductions. More uses cases will follow, e.g., per launch memory pools. Fixes: https://github.com/llvm/llvm-project/issues/70249
-
Matthias Springer authored
The majority of subset ops operate on hyperrectangular subsets. This commit adds a new optional interface method (`getAccessedHyperrectangularSlice`) that can be implemented by such subset ops. If implemented, the other `operatesOn...` interface methods of the `SubsetOpInterface` do not have to be implemented anymore. The comparison logic for hyperrectangular subsets (is disjoint/equivalent) is implemented with `ValueBoundsOpInterface`. This makes the subset hoisting more powerful: simple cases where two different SSA values always have the same runtime value can now be supported.
-
Kazu Hirata authored
-
Matthias Springer authored
Improve the bypass analysis for loop-like ops. Until now, loop-like ops were treated like any other non-subset ops: they prevent hoisting of any sort because the analysis does not know which parts of a tensor init operand are accessed by the loop-like op. With this change, the analysis can look into loop-like ops and analyze which subset they are operating on.
-
anemet authored
This is achieved by calling add_mlir_interface. The issue manifests as ArithOpsInterfaces.h.inc not being available when a pass includes something like MemRef.h which includes Arith.h. Tested with check-mlir.
-
Matthias Springer authored
Add a loop-invariant subset hoisting pass to `mlir/Interfaces`. This pass hoist loop-invariant tensor subsets (subset extraction and subset insertion ops) from loop-like ops. Extraction ops are moved before the loop. Insertion ops are moved after the loop. The loop body operates on newly added region iter_args (one per extraction-insertion pair). This new pass will be improved in subsequent commits (to support more cases/ops) and will eventually replace `Linalg/Transforms/SubsetHoisting.cpp`. In contrast to the existing Linalg subset hoisting, the new pass is op interface-based (`SubsetOpInterface` and `LoopLikeOpInterface`).
-
Matthias Springer authored
There is currently an op interface for subset insertion ops (`SubsetInsertionOpInterface`), but not for subset extraction ops. This commit adds `SubsetExtractionOpInterface` to `mlir/Interfaces`, as well as a common dependent op interface: `SubsetOpInterface`. - `SubsetOpInterface` is for ops that operate on tensor subsets. It provides interface methods to check if two subset ops operate on equivalent or disjoint subsets. Ops that implement this interface must implement either `SubsetExtractionOpInterface` or `SubsetInsertionOpInterface`. - `SubsetExtractionOpInterface` is for ops that extract from a tensor at a subset. E.g., `tensor.extract_slice`, `tensor.gather`, `vector.transfer_read`. Current implemented only on `tensor.extract_slice`. - `SubsetInsertionOpInterface` is for ops that insert into a destination tensor at a subset. E.g., `tensor.insert_slice`, `tensor.parallel_insert_slice`, `tensor.scatter`, `vector.transfer_write`. Currently only implemented on `tensor.insert_slice`, `tensor.parallel_insert_slice`. Other changes: - Rename `SubsetInsertionOpInterface.td` to `SubsetOpInterface.td`. - Add helper functions to `ValueBoundsOpInterface.cpp` for checking whether two slices are disjoint. The new interfaces will be utilized by a new "loop-invariant subset hoisting" transformation. (This new transform is roughly what `Linalg/Transforms/SubsetHoisting.cpp` is doing, but in a generic and interface-driven way.)
-
SiHuaN authored
[Flang][OpenMP] Correctly handling continuation lines with Fixed Source Form Conditional Compilation Sentinels (#70309) Fixes #67947 --------- Co-authored-by:
SiHuaN <liyongtai@iscas.ac.cn> Co-authored-by:
Leandro Lupori <leandro.lupori@gmail.com>
-
Maksim Levental authored
This PR fixes the `I32ElementsAttr` and `I64ElementsAttr` builders and tests them through the `python_test` dialect.
-
Min-Yih Hsu authored
Most of the FP constants supported by FLI are positive. For negative FP constants X whose positive values is supported by FLI, we can use `(FNEG (FLI -X))` to materialize X.
-
Matthias Springer authored
No ownership is assumed for memref results of ops that implement none of the relevant interfaces and have no memref operands. This fixes #68948.
-
Craig Topper authored
-
Peter Collingbourne authored
These tests do not need to be updated when making changes to the API.
-
Matthias Braun authored
Optimize metadata query code: - Avoid `DenseMap::operator[]` in situations where it is known that the key exists in the map. Instead use `DenseMap::at()`/ `DenseMap::find()->second`. This avoids code-bloat and bad inlining decisions for the unused insertion/growing code in `operator[]`. - Avoid a redundant `Value::hasMetadata()` check. - Move the `KindID == LLVMContext::MD_dbg` case to `Instruction::getMetadata` and check it first assuming that it can be constant folded after inlining in many situations. The motivation for this change is a regression triggered by e3cf80c5 which could attributed to the compiler inlining the insertion part of `DenseMap::operator[]` in more cases while unbeknownst to a compiler (without PGO) that code is never used in this context. This change improves performance and eliminates difference before and after that change in my measurements.
-
Matthias Springer authored
Expose loop results, which correspond to the region iter_arg values that are returned from the loop when there are no more iterations. Exposing loop results is optional because some loops (e.g., `scf.while`) do not have a 1-to-1 mapping between region iter_args and op results. Also add additional helper functions to query tied results/iter_args/inits.
-
Aart Bik authored
Rather than extending sparsifier codegen with higher order non-permutations, we follow the path of rewriting linalg generic ops into higher order operations. That way, code generation will simply work out of the box. This is a very first proof-of-concept rewriting of that idea.
-
Jakub Kuderski authored
Remove outdated content. Suggested by @dcaballe in https://github.com/llvm/llvm-project/pull/70673.
-
Peter Klausler authored
As an extension, accept the redundant use of the CONTIGUOUS attribute when applied to scalars and to simply contiguous objects, with a portability warning.
-
Kazu Hirata authored
This patch fixes: mlir/test/lib/IR/TestBytecodeRoundtrip.cpp:403:10: error: unused variable 'status' [-Werror,-Wunused-variable]
-
Will Hawkins authored
After changes to <expected>, more test files are now properly formatted.
-
Fangrui Song authored
-
Fangrui Song authored
This change is for AArch32 and not strictly needed, but it ensures that we follow the model that direct accesses are only emitted for dso_local and we do not need TargetMachine::shouldAssumeDSOLocal to force dso_local for a dso_preemptable variable. There is no behavior change to the arm/arm64 configurations listed in commit 5888dee7.
-
Matteo Franciolini authored
When emitting bytecode, clients can specify a target dialect version to emit in `BytecodeWriterConfig`. This exposes a target dialect version to the DialectBytecodeWriter, which can be queried by name and used to back-deploy attributes, types, and properties.
-
Fangrui Song authored
The ELF code from https://reviews.llvm.org/D112811 emits LDRLIT_ga_pcrel when `TM.isPositionIndependent()` but uses a different condition `Subtarget.isGVIndirectSymbol(GV)` (aka dso_preemptable on ELF targets). This would cause incorrect access for dso_preemptable `__stack_chk_guard` with the static relocation model. Regarding whether `__stack_chk_guard` gets the dso_local specifier, https://reviews.llvm.org/D150841 switched to `M.getDirectAccessExternalData()` (implied by "PIC Level") instead of `TM.getRelocationModel() == Reloc::Static`. The result is that when non-zero "PIC Level" is used with static relocation model (e.g. -fPIE/-fPIC LTO compiles with -no-pie linking), `__stack_chk_guard` accesses are incorrect. ``` ldr r0, .LCPI0_0 ldr r0, [r0] ldr r0, [r0] // incorrectly dereferences __stack_chk_guard ... .LCPI0_0: .long __stack_chk_guard ``` To fix this, for dso_preemptable `__stack_chk_guard`, emit a GOT PIC code sequence like for -fpic using `LDRLIT_ga_pcrel`: ``` ldr r0, .LCPI0_0 .LPC0_0: add r0, pc, r0 ldr r0, [r0] ldr r0, [r0] ... LCPI0_0: .Ltmp0: .long __stack_chk_guard(GOT_PREL)-((.LPC0_0+8)-.Ltmp0) ``` Technically, `LDRLIT_ga_abs` with `R_ARM_GOT_ABS` could be used, but `R_ARM_GOT_ABS` does not have GNU or integrated assembler support. (Note, `.LCPI0_0: .long __stack_chk_guard@GOT` produces an `R_ARM_GOT_BREL`, which is not desired). This patch fixes #6499 while not changing behavior for the following configurations: ``` run arm.linux.nopic --target=arm-linux-gnueabi -fno-pic run arm.linux.pie --target=arm-linux-gnueabi -fpie run arm.linux.pic --target=arm-linux-gnueabi -fpic run armv6.darwin.nopic --target=armv6-apple-darwin -fno-pic run armv6.darwin.dynamicnopic --target=armv6-apple-darwin -mdynamic-no-pic run armv6.darwin.pic --target=armv6-apple-darwin -fpic run armv7.darwin.nopic --target=armv7-apple-darwin -mcpu=cortex-a8 -fno-pic run armv7.darwin.dynamicnopic --target=armv7-apple-darwin -mcpu=cortex-a8 -mdynamic-no-pic run armv7.darwin.pic --target=armv7-apple-darwin -mcpu=cortex-a8 -fpic run arm64.darwin.pic --target=arm64-apple-darwin ```
-
Adrian Prantl authored
In the rare case that an Xcode installation is damaged, this output could contain clues to further diagnose the issue. rdar://117698630
-
Fangrui Song authored
llvm/test/LTO/ARM/ssp-static-reloc.ll is more about using the static relocation model with "PIC Level" and unrelated to the LTO infrastructure. Move the test. Update stack_guard_remat.ll to clearly test "PIC Level" with the relevant relocation models.
-