- Mar 04, 2024
-
-
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.
-
Fangrui Song authored
My #80527 mentioned that `InstalledDir` was weird in the -canonical-prefixes mode. #70817 was a workaround to find the libc++ include path for a symlinked clang. After #80527, `InstalledDir` was identical to `Dir` and was subsequently removed, the code change #70817 can be reverted.
-
Phoebe Wang authored
Fixes: #83358
-
Fangrui Song authored
Follow-up to #80527.
-
Matthias Springer authored
This commit fixes a bug in a dialect conversion. Currently, when a block is replaced via a signature conversion, the block is erased during the "commit" phase. This is problematic because the block arguments may still be referenced internal data structures of the dialect conversion (`mapping`). Blocks should be treated same as ops: they should be erased during the "cleanup" phase. Note: The test case fails without this fix when running with ASAN, but may pass when running without ASAN.
-
Yeting Kuo authored
[ScalarizeMaskedMemIntrin] Use pointer alignment from pointer of masked.compressstore/expandload. (#83519) Previously we used Align(1) for all scalarized load/stores from masked.compressstore/expandload. For targets not supporting unaligned accesses, it make backend need to split aligned large width loads/stores to byte loads/stores. To solve this performance issue, this patch preserves the alignment of base pointer after scalarizing.
-
-
Lu Weining authored
This patch aims to solve Firefox issue: https://bugzilla.mozilla.org/show_bug.cgi?id=1882301 Similar to 616289ed. Currently LoongArch uses an ll.[wd]/sc.[wd] loop for ATOMIC_CMP_XCHG. Because the comparison in the loop is full-width (i.e. the `bne` instruction), we must sign extend the input comparsion argument. Note that LoongArch ISA manual V1.1 has introduced compare-and-swap instructions. We would change the implementation (return `ANY_EXTEND`) when we support them.
-
Po-yao Chang authored
An immediate colon signifeis that the range-format-spec contains only range-underlying-spec. This patch allows this code to compile and run: ```c++ std::println("{::<<9?}", std::span<const char>{"Hello", sizeof "Hello"}); ``` -
David Majnemer authored
We can use a small amount of integer arithmetic to round FP32 to BF16 and extend BF16 to FP32. While a number of operations still require promotion, this can be reduced for some rather simple operations like abs, copysign, fneg but these can be done in a follow-up. A few neat optimizations are implemented: - round-inexact-to-odd is used for F64 to BF16 rounding. - quieting signaling NaNs for f32 -> bf16 tries to detect if a prior operation makes it unnecessary.
-