- Mar 05, 2024
-
-
Matthias Springer authored
One-Shot Bufferize currently does not support loops where a yielded value bufferizes to a buffer that is different from the buffer of the region iter_arg. In such a case, the bufferization fails with an error such as: ``` Yield operand #0 is not equivalent to the corresponding iter bbArg scf.yield %0 : tensor<5xf32> ``` One common reason for non-equivalent buffers is that an op on the path from the region iter_arg to the terminator bufferizes out-of-place. Ops that are analyzed earlier are more likely to bufferize in-place. This commit adds a new heuristic that gives preference to ops that are reachable on the reverse SSA use-def chain from a region terminator and are within the parent region of the terminator. This is expected to work better than the existing heuristics for loops where an iter_arg is written to multiple times within a loop, but only one write is fed into the terminator. Current users of One-Shot Bufferize are not affected by this change. "Bottom-up" is still the default heuristic. Users can switch to the new heuristic manually. This commit also turns the "fuzzer" pass option into a heuristic, cleaning up the code a bit.
-
- Mar 04, 2024
-
-
Timm Bäder authored
... when the pointer is an unknown size array.
-
cor3ntin authored
The man pages do not depend on the doc present in markdown files, so they can be built without myst_parser. Doing so might allow llvm distributions to have less development dependencies. As we do not have the ennvironment to test these configuration, this capability is provided on a best-effort basis. This restores a capability accidentally lost in #65664.
-
James Westwood authored
When code for M class architecture was compiled with AAPCS and PAC enabled, the frame pointer, r11, was not pushed to the stack adjacent to the link register. Due to PAC being enabled, r12 was placed between r11 and lr. This patch fixes this by adding an extra case to the already existing code that splits the GPR push in two when R11 is the frame pointer and certain paremeters are met. The differential revision for this previous change can be found here: https://reviews.llvm.org/D125649. This now ensures that r11 and lr are pushed in a separate push instruction to the other GPRs when PAC and AAPCS are enabled, meaning the frame pointer and link register are now pushed onto the stack adjacent to each other.
-
Vyacheslav Levytskyy authored
This PR is to add support for the SPIR-V extension SPV_INTEL_bfloat16_conversion (https://github.com/KhronosGroup/SPIRV-Registry/blob/main/extensions/INTEL/SPV_INTEL_bfloat16_conversion.asciidoc) and OpenCL extension cl_intel_bfloat16_conversions (https://registry.khronos.org/OpenCL/extensions/intel/cl_intel_bfloat16_conversions.html).
-
Niwin Anto authored
When induction variable are used outside the loop body, tail folding by masking mis-compiles, because for users outside of the loop the final value of the induction is computed separately from the vector loop. Fixes https://github.com/llvm/llvm-project/issues/76069 Fixes https://github.com/llvm/llvm-project/issues/51677
-
Kareem Ergawy authored
Extends current support for delayed privatization during translation to LLVM IR. This adds support for one-block `firstprivate` `omp.private` ops.
-
Vyacheslav Levytskyy authored
This PR is to add explicit support for SPV_KHR_float_controls (https://github.com/KhronosGroup/SPIRV-Registry/blob/main/extensions/KHR/SPV_KHR_float_controls.asciidoc). This extension is included into SPIR-V after version 1.4, but in case of lower versions it is to be included explicitly and OpExtension must be present in the module with `OpExtension "SPV_KHR_float_controls"`. This PR fixes this issue and fixes the test case test/CodeGen/SPIRV/exec_mode_float_control_khr.ll to account for a version lower than 1.4.
-
Vyacheslav Levytskyy authored
This PR is to fix a way how SPIR-V Backend describes legality of OpBitcast instruction and how it is validated on a step of instruction selection. Instead of checking a size of virtual registers (that makes no sense due to lack of guarantee of direct relations between size of virtual register and bit width associated with the type size), this PR allows to legalize OpBitcast without size check and postpones validation to the instruction selection step. As an example, let's consider the next example that was copied as is from a bigger test suite: ``` %355:id(s16) = G_BITCAST %301:id(s32) %303:id(s16) = ASSIGN_TYPE %355:id(s16), %349:type(s32) %644:fid(s32) = G_FMUL %645:fid, %646:fid %301:id(s32) = ASSIGN_TYPE %644:fid(s32), %40:type(s32) ``` Without the PR this leads to a crash with complains to an illegal bitcast, because %355 is s16 and %301 is s32. However, we must check not virtual registers in this case, but types of %355 and %301, i.e., %349:type(s32) and %40:type(s32), which are perfectly well compatible in a sense of OpBitcast in this case. In a test case that is a part of this PR OpBitcast is legal, being applied for `OpTypeInt 16` and `OpTypeFloat 16`, but would not be legalized without this PR due to virtual registers defined as having size 16 and 32.
-
Vyacheslav Levytskyy authored
This PR is to add vector reduction instructions according to https://llvm.org/docs/GlobalISel/GenericOpcode.html#vector-reduction-operations and widen in such a way a range of successful supported conversions, covering new cases of vector reduction instructions which IRTranslator is unable to resolve. By legalizing vector reduction instructions we introduce a new instruction patterns that should be addressed, including patterns that are delegated to pre-legalize step. To address this problem, a new pass is added that is to bring newly generated instructions after legalization to an aspect required by instruction selection. Expected overheads for existing cases is minimal, because a new pass is working only with newly introduced instructions, otherwise it's just a additional code traverse without any actions.
-
Nikita Popov authored
-
Mirko Brkušanin authored
-
Guillaume Chatelet authored
Umbrella bug #83182
-
Dani authored
sign-return-address and similar module attributes should be propagated to the function level before got merged because module flags may contradict and this information is not recoverable. Generated code will match with the normal linking flow. Refactored version of (#80640). Run the attribute copy only during IRMove.
-
NagyDonat authored
This comment-only change fixes a typo, clarifies some comments and includes some thoughts about the difficulties in resolving a certain FIXME.
-
Ingo Müller authored
This macro is obsolete since the landing of #82486 but was forgotten to be removed from the BUILD files.
-
Matthias Springer authored
The dialect conversion uses a `SingleEraseRewriter` to ensure that an op/block is not erased twice. This can happen during the "commit" phase when an unresolved materialization is inserted into a block and the enclosing op is erased by the user. In that case, the unresolved materialization should not be erased a second time later in the "commit" phase. This problem cannot happen during "rollback", so ops/block can be erased directly without using the rewriter. With this change, the `SingleEraseRewriter` is used only during "commit"/"cleanup". At that point, the dialect conversion is guaranteed to succeed and no rollback can happen. Therefore, it is not necessary to store the number of erased IR objects (because we will never "reset" the rewriter to previous a previous state).
-
sinan authored
Add R_AARCH64_JUMP26 implementation for createRelocation, which could significantly reduce the number of failed scan-refs cases if we perform bolt on a selective range of functions.
-
Matthias Springer authored
When a block signature is converted during dialect conversion, a `BlockTypeConversionRewrite` object is stored in the stack of rewrites. Such an object represents multiple steps: - Splitting the old block, i.e., creating a new block and moving all operations over. - Rewriting block arguments. - Erasing the old block. We have dedicated `IRRewrite` objects that represent "creating a block", "moving an op" and "erasing a block". This commit reuses those rewrite objects, so that there is less work to do in `BlockTypeConversionRewrite::rollback` and `BlockTypeConversionRewrite::commit`/`cleanup`. Note: This change is in preparation of adding listener support to the dialect conversion. The less work is done in a `commit` function, the fewer notifications will have to be sent.
-
Balázs Kéri authored
Revert "[clang][analyzer] Change default value of checker option in unix.StdCLibraryFunctions. (#80457)" This reverts commit 7af4e8bc.
-
Jacques Pienaar authored
gcc7 fix didn't work (but unfortunately didn't get a notification and forgot to check), this should hopefully address the ambiguous overload. I can't repro locally/trying to create docker image for testing.
-
Balázs Kéri authored
Default value of checker option `ModelPOSIX` is changed to `true`. Documentation is updated.
-
Shengchen Kan authored
The instruction-size limit of 15 bytes still applies to APX instructions. Note that it is possible for an EVEX-encoded legacy instruction to reach the 15-byte instruction length limit: 4 bytes of EVEX prefix + 1 byte of opcode + 1 byte of ModRM + 1 byte of SIB + 4 bytes of displacement + 4 bytes of immediate = 15 bytes in total, e.g. ``` addq $184, -96, %rax # encoding: [0x62,0xf4,0xfc,0x18,0x81,0x04,0x25,0xa0,0xff,0xff,0xff,0xb8,0x00,0x00,0x00] ``` If we added a segment prefix like fs, the length would be 16. In such a case, no additional (ASIZE or segment override) prefix can be used. To help users find this issue earlier, especially for assembler users, we change the internal compiler error to error in this patch. Diagnostic is aligned with GAS https://sourceware.org/bugzilla/show_bug.cgi?id=31323
-
Valentin Clement (バレンタイン クレメン) authored
The FIR dialect has been initiated before many interfaces have been introduced to MLIR. This patch expose the FIR to LLVM patterns in a `populateFIRToLLVMConversionPatterns` function. The idea is to be able to add the `ConvertToLLVMPatternInterface`. This is not directly possible since the FIR dialect does not currently use the table infrastructure for its definition. Follow up patches will move the FIR dialect definition to table gen and then implement the interface.
-
jeanPerier authored
It is randomly failing in windows pre-merge checks and causing noise in Github PRs. Not clear why it is crashing on windows, issue opened: https://github.com/llvm/llvm-project/issues/83534
-
Ben Shi authored
-
Sameer Sahasrabuddhe authored
Original commit 79889734. Perviously reverted in commit a2afcd57. LLVM function calls carry convergence control tokens as operand bundles, where the tokens themselves are produced by convergence control intrinsics. This patch implements convergence control tokens in MIR as follows: 1. Introduce target-independent ISD opcodes and MIR opcodes for convergence control intrinsics. 2. Model token values as untyped virtual registers in MIR. The change also introduces an additional ISD opcode CONVERGENCECTRL_GLUE and a corresponding machine opcode with the same spelling. This glues the convergence control token to SDNodes that represent calls to intrinsics. The glued token is later translated to an implicit argument in the MIR. The lowering of calls to user-defined functions is target-specific. On AMDGPU, the convergence control operand bundle at a non-intrinsic call is translated to an explicit argument to the SI_CALL_ISEL instruction. Post-selection adjustment converts this explicit argument to an implicit argument on the SI_CALL instruction.
-
Luke Lau authored
Previously we incorrectly removed the scalar load store pair here assuming it was dead, when it actually aliased with the memset. This showed up as a miscompile on SPEC CPU 2017 when compiling with -mrvv-vector-bits, and was only triggered by the changes in #75531. This was fixed in #83017, but this patch adds a test case for this specific miscompile. For reference, the incorrect codegen was: vsetvli a1, zero, e8, m4, ta, ma vmv.v.i v8, 0 vs4r.v v8, (a0) addi a1, a0, 80 vsetivli zero, 16, e8, m1, ta, ma vmv.v.i v8, 0 vs1r.v v8, (a1) addi a0, a0, 64 vs1r.v v8, (a0)
-
Exile authored
```bool evalCall(const CallEvent &Call, CheckerContext &C)``` is corret form. Co-authored-by:miaozhiyuan <miaozhiyuan@feysh.com>
-
Matt Arsenault authored
31295bbe reverted the original patch. Submit part of the test that happens to not hit the sanitizer error, which covers the instructions I more need test coverage for.
-
Matthias Springer authored
This commit adds a new `ConversionConfig` struct that allows users to customize the dialect conversion. This configuration is similar to `GreedyRewriteConfig` for the greedy pattern rewrite driver. A few existing options are moved to this objects, simplifying the dialect conversion API. This is a re-upload of #82250. The Windows build breakage was fixed in #83768. This reverts commit 60fbd605.
-
Matthias Springer authored
`AllocaOpConversion` takes an `ArrayRef<Operation *>`, but the underlying `SmallVector<Operation *>` was dead by the time the pattern ran.
-
Michal Paszkowski authored
This pull request aims to remove any dependency on OpenCL/SPIR-V type information in LLVM IR metadata. While, using metadata might simplify and prettify the resulting SPIR-V output (and restore some of the information missed in the transformation to opaque pointers), the overall methodology for resolving kernel parameter types is highly inefficient. The high-level strategy is to assign kernel parameter types in this order: 1. Resolving the types using builtin function calls as mangled names must contain type information or by looking up builtin definition in SPIRVBuiltins.td. Then: - Assigning the type temporarily using an intrinsic and later setting the right SPIR-V type in SPIRVGlobalRegistry after IRTranslation - Inserting a bitcast 2. Defaulting to LLVM IR types (in case of pointers the generic i8* type or types from byval/byref attributes) In case of type incompatibility (e.g. parameter defined initially as sampler_t and later used as image_t) the error will be found early on before IRTranslation (in the SPIRVEmitIntrinsics pass).
-
David Majnemer authored
While we don't use SVE2 as a fallback for missing NEON instructions for BF16, it is confusing to break symmetry with fp16. While we are here, add a comment explaining how BF16 immediates work.
-
Daniel Martinez authored
#81434 Replaced some C headers with C++ ones Co-authored-by:Daniel Martinez <danielmartinez@cock.li>
-
Shilei Tian authored
This patch adds the support for `STRICT_BF16_TO_FP` and `STRICT_FP_TO_BF16`.
-
Shilei Tian authored
This reverts commit b0c158bd. The changes in `compiler-rt` broke tests.
-
Nathan Ridge authored
When resolving names inside templates that implement recursive compile-time functions (e.g. waldo<N>::type is defined in terms of waldo<N-1>::type), HeuristicResolver could get into an infinite recursion, specifically one where resolveDependentNameType() can be called recursively with the same DependentNameType*. To guard against this, HeuristicResolver tracks, for each external call into a HeuristicResolver function, the set of DependentNameTypes that it has seen, and bails if it sees the same DependentNameType again. To implement this, a helper class HeuristicResolverImpl is introduced to store state that persists for the duration of an external call into HeuristicResolver (but does not persist between such calls). Fixes https://github.com/clangd/clangd/issues/1951
-
Shilei Tian authored
This patch adds the support for `STRICT_BF16_TO_FP` and `STRICT_FP_TO_BF16`.
-
Phoebe Wang authored
We try to only use X32 for gnux32 triple tests.
-