- Mar 26, 2024
-
-
Cyndy Ishida authored
-
Peter Klausler authored
When encountering an unparsable !DIR$ compiler directive line, accept it as a whole source line and emit a warning that it is unrecognizable. Fixes https://github.com/llvm/llvm-project/issues/59107, https://github.com/llvm/llvm-project/issues/82212, and https://github.com/llvm/llvm-project/issues/82654.
-
Daniel Chen authored
[Flang] Support for passing procedure pointer, reference to a function that returns a procedure pointer to structure constructor. (#86533) This PR fixes `not yet implemented: procedure pointer component in structure constructor` as shown in the following test case. ``` MODULE M TYPE :: DT PROCEDURE(Fun), POINTER, NOPASS :: pp1 END TYPE CONTAINS INTEGER FUNCTION Fun(Arg) INTEGER :: Arg Fun = Arg END FUNCTION END MODULE PROGRAM MAIN USE M IMPLICIT NONE TYPE (DT) :: v2 PROCEDURE(FUN), POINTER :: pp2 v2 = DT(pp2) v2 = DT(bar()) CONTAINS FUNCTION BAR() RESULT(res) PROCEDURE(FUN), POINTER :: res END END ``` -
Luke Lau authored
Building on #86248, we can also narrow the width of a mul of zexts. This is specifically legal because on RVV we always extend to the next power of 2 width, and multiplying two N bit integers produces a maximum value of 2\*N bits. So as long as we keep an inner zext of 2\*N, we will have enough space for the multiply and won't overflow. Alive2 proof: https://alive2.llvm.org/ce/z/XteYyb
-
Nick Desaulniers authored
The usage of __builtin_unreachable after calls to quick_exit were distressing. If a function is properly marked [[noreturn]] then __builtin_unreachable is not necessary. Looking into this further, we seem to have header only implementations for CPU targets. The inline nature of these functions is curious; we're going to exit, it doesn't matter if we need to pay the call of a function or not. If we just make these functions have distinct TUs rather than be header only, we can clean up the cmake rules for quick_exit which were different between CPU and GPU. Remove darwin support for quick_exit. This isn't being tested, and we can bring it back when necessary.
-
Simon Pilgrim authored
[X86] combineConcatVectorOps - concatenate FADD/FSUB/FMUL ops if we don't increase the number of INSERT_SUBVECTOR nodes. FADD/FSUB/FMUL are usually less port-bound than INSERT_SUBVECTOR, so only concatenate if it reduces the instruction count and doesn't introduce extra INSERT_SUBVECTOR nodes.
-
Simon Pilgrim authored
[X86] Add fadd/fsub/fmul tests showing failure to concat operands together and perform as a wider vector We don't want to concat fadd/fsub/fmul if both operands would need concatenating (as the fp op is usually cheaper than the concat), but if at least one operand is free to concat (i.e. constant or extracted from a wider vector), then we should try to concat the fp op.
-
Florian Hahn authored
Add a new PtrAdd opcode to VPInstruction that corresponds to IRBuilder::CreatePtrAdd, which creates a GEP with source element type i8. This is then used to model scalarizing VPWidenPointerInductionRecipe by introducing scalar-steps to model the index increment followed by a PtrAdd. Note that PtrAdd needs to be able to generate code for only the first lane or for all lanes. This may warrant introducing a separate recipe for scalarizing that can be created without relying on the underlying IR. Depends on https://github.com/llvm/llvm-project/pull/80271 PR: https://github.com/llvm/llvm-project/pull/83068
-
Rafael Ubal authored
- Revamped lowering conversion pattern for `tosa.reshape` to handle previously unsupported combinations of dynamic dimensions in input and output tensors. The lowering strategy continues to rely on pairs `tensor.collapse_shape` + `tensor.expand_shape`, which allow for downstream fusion with surrounding `linalg.generic` ops. - Fixed bug in canonicalization pattern `ReshapeOp::fold()` in `TosaCanonicalizations.cpp`. The input and result types being equal is not a sufficient condition for folding. If there is more than 1 dynamic dimension in the input and result types, a productive reshape could still occur. - This work exposed the fact that bufferization does not properly handle a `tensor.collapse_shape` op producing a 0D tensor from a dynamically shaped one due to a limitation in `memref.collapse_shape`. While the proper way to address this would involve releasing the `memref.collapse_shape` restriction and verifying correct bufferization, this is left as possible future work. For now, this scenario is avoided by casting the `tosa.reshape` input tensor to a static shape if necessary (see `inferReshapeInputType()`. - An extended set of tests are intended to cover relevant conversion paths. Tests are named using pattern `test_reshape_<rank>_{up|down|same}_{s2s|s2d|d2s|d2d}_{explicit|auto}[_empty][_identity]`, where: - `<rank>` is the input rank (e.g., 3d, 6d) - `{up|down|same}` indicates whether the reshape increases, decreases, or retains the input rank. - `{s2s|s2d|d2s|d2d}` indicates whether reshape converts a statically shaped input to a statically shaped result (`s2s`), a statically shaped input to a dynamically shaped result (`s2d`), etc. - `{explicit|auto}` is used to indicate that all values in the `new_shape` attribute are >=0 (`explicit`) or that a -1 placeholder value is used (`auto`). - `empty` is used to indicate that `new_shape` includes a component set to 0. - `identity` is used when the input and result shapes are the same. -
Julian Nagele authored
These tests show invalid tbaa.struct metadata that is currently accepted in preparation for a change to the IR Verifier that will then reject it. PR: https://github.com/llvm/llvm-project/pull/86167
-
Akira Hatanaka authored
Revert "[CodeGen][arm64e] Add methods and data members to Address, which are needed to authenticate signed pointers (#67454)" (#86674) This reverts commit 8bd1f911. It appears that the commit broke msan bots.
-
Stefan Gränitz authored
Using remove() on DeclContext::lookup_result list invalidates iterators. This assertion failure was one (fortunate) symptom: ``` clang/include/clang/AST/DeclBase.h:1337: reference clang::DeclListNode::iterator::operator*() const: Assertion `Ptr && "dereferencing end() iterator"' failed. ```
-
Christian Sigg authored
This matches the CMake targets and reduces the number of headers that need to be included in multiple targets.
-
Tim Creech authored
This change: - Updates the existing Clang User's Manual section on SPGO so that it describes how to use llvm-profgen to perform SPGO on Windows. This is new functionality implemented in #83972. - Fixes a minor typo in the existing llvm-profgen invocation example. - Adds an LLVM release note on this new functionality in llvm-profgen.
-
Carlos Seo authored
Added a new variant of the CHECK() function that takes a custom message as a parameter. This is useful for more meaninful error messages when the compiler is expected to crash. Fixes #78931
-
David Green authored
Similar to #80829 for GlobalISel.
-
Alexey Bataev authored
Need to include initial sext/zext/trunc nodes to the list of the demoted root values to correctly calculate the cost and handle the vectorization.
-
Hui authored
Fixes #83600
-
Il-Capitano authored
Currently patchpoints can only have two result types, `void` and `i64`. This limits the result to general purpose registers. This patch makes `patchpoint.i64` an overloadable intrinsic, allowing result values that can fit in a single register (e.g. integers, pointers, floats).
-
Yingwei Zheng authored
This patch passes APInt by const reference in m_SpecificInt instead of by value. Specifically, it refactors `m_SpecificInt(uint64_t V)` to avoid APInt construction and dangling reference. I believe it is safe to pass the APInt by const reference into `m_SpecificInt` even if it is a temporary. See also https://en.cppreference.com/w/cpp/language/lifetime > All temporary objects are destroyed as the last step in evaluating the [full-expression](https://en.cppreference.com/w/cpp/language/expressions#Full-expressions) that (lexically) contains the point where they were created Compile-time impact: https://llvm-compile-time-tracker.com/compare.php?from=d1f182c895728d89c5c3d198b133e212a5d9d4a3&to=7edf459b95ab2be33b70ec67faf87b3b8cc84f09&stat=instructions:u
-
Zahira Ammarguellat authored
Fixed the printing of templated argument list and added test case.
-
Yingwei Zheng authored
This patch removes APIs that creating NUW neg. It is a trivial case because `sub nuw 0, X` always gets simplified into zero. I believe there is no optimization opportunities in the real-world applications that we can take advantage of the nuw flag. Motivated by https://github.com/llvm/llvm-project/pull/84792#discussion_r1524891134. Compile-time improvement: https://llvm-compile-time-tracker.com/compare.php?from=d1f182c895728d89c5c3d198b133e212a5d9d4a3&to=da7b7478b7cbb32c09d760f6b8d0e67901e0d533&stat=instructions:u
-
Jie Fu authored
llvm-project/clang/lib/Sema/SemaDecl.cpp:11653:20: error: unused variable 'OldMVKind' [-Werror,-Wunused-variable] MultiVersionKind OldMVKind = OldFD->getMultiVersionKind(); ^ 1 error generated. -
ycdtosa authored
This attribute tells the compiler that the variable must have its exit-time destructor run, so it makes sense that it would silence the warning telling users that an exit-time destructor is required. Fixes https://github.com/llvm/llvm-project/issues/68686
-
Shourya Goel authored
Fixes: #85286
-
Jacek Caban authored
It's similar to #86535, but for export specified in .def files.
-
Joseph Huber authored
Summary: We have a plugin singleton that implements the Plugin interface. This then spawns separate device and kernels. Previously when these needed to reach into the global singleton they would use the `PluginTy::get` routine to get access to it. In the future we will move away from this as the lifetime of the plugin will be handled by `libomptarget` directly. This patch removes uses of this inside of the plugin implementaion themselves by simply keeping a reference to the plugin inside of the device. The external `__tgt_rtl` functions still use the global method, but will be removed later.
-
Jacek Caban authored
Testing with MSVC link.exe showed that it respects such options, while LLD currently discards them.
-
Sander de Smalen authored
Similar to how we protected FP/fixed-vector arguments and results from calls, we should do the same for arguments/results from locally-streaming functions such that those are not spilled/filled as ZPR registers. This may cause a small regression (additional spills/fills), which is addressed by #85386.
-
Alexandros Lamprineas authored
The latest ACLE allows it and further clarifies the following in regards to the combination of the two attributes: "If the `default` matches with another explicitly provided version in the same translation unit, then the compiler can emit only one function instead of the two. The explicitly provided version shall be preferred." ("default" refers to the default clone here) https://github.com/ARM-software/acle/pull/310 -
Nazım Can Altınova authored
Fixes #83844. This PR adds callbacks to mark futex syscalls as blocking. Unfortunately we didn't have a mechanism before to mark syscalls as a blocking call, so I had to implement it, but it mostly reuses the `BlockingCall` implementation [here](https://github.com/llvm/llvm-project/blob/96819daa3d095cf9f662e0229dc82eaaa25480e8/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp#L362-L380). The issue includes some information but this issue was discovered because Rust uses futexes directly. So most likely we need to update Rust as well to use these callbacks. Also see the latest comments in #85188 for some context. I also sent another PR #84162 to mark `pthread_*_lock` calls as blocking.
-
Nazım Can Altınova authored
Fixes #83561. When a thread is blocked on a mutex and we send an async signal to that mutex, it never arrives because tsan thinks that `pthread_mutex_lock` is not a blocking function. This patch marks `pthread_*_lock` functions as blocking so we can successfully deliver async signals like `SIGPROF` when the thread is blocked on them. See the issue also for more details. I also added a test, which is a simplified version of the compiler explorer example I posted in the issue. Please let me know if you have any other ideas or things to improve! Happy to work on them. Also I filed #83844 which is more tricky because we don't have a libc wrapper for `SYS_futex`. I'm not sure how to intercept this yet. Please let me know if you have ideas on that as well. Thanks!
-
Simon Pilgrim authored
-
Simon Pilgrim authored
Fixes issue where AVX1 targets weren't matching 256-bit AVGCEILU cases.
-
Simon Pilgrim authored
Noticed while trying to compare splat vs per-element shift perf stats for #39424 Confirmed with uops.info
-
Michal Paszkowski authored
-
Michal Paszkowski authored
-
Simon Pilgrim authored
Handle the case where we've ended up inserting back into the source vector we extracted the subvector from.
-
Victor Perez authored
Add operation mapping to the LLVM `llvm.experimental.constrained.fptrunc.*` intrinsic. The new operation implements the new `LLVM::FPExceptionBehaviorOpInterface` and `LLVM::RoundingModeOpInterface` interfaces. --------- Signed-off-by:Victor Perez <victor.perez@codeplay.com>
-
Thomas Symalla authored
Revert "Update amdgpu_gfx functions to use s0-s3 for inreg SGPR arguments on targets using scratch instructions for stack #78226" (#86273) Reverts llvm/llvm-project#81394 This reverts commit 3ac243bc. It is not handling RSrc registers s0-s3 correctly. This leads to a broken test, where it expects s0-s3 as function argument and uses it as RSrc register as well. We need to re-visit the patch, but apparently we only want to have s0-s3 as argument registers if we don't need them as RSrc registers.
-