- Jun 28, 2022
-
-
Patrick Walton authored
This commit modifies the AsmPrinter to avoid emitting any zero-sized symbols to the .debug_aranges table, by rounding their size up to 1. Entries with zero length violate the DWARF 5 spec, which states: > Each descriptor is a triple consisting of a segment selector, the beginning > address within that segment of a range of text or data covered by some entry > owned by the corresponding compilation unit, followed by the non-zero length > of that range. In practice, these zero-sized entries produce annoying warnings in lld and cause GNU binutils to truncate the table when parsing it. Other parts of LLVM, such as DWARFDebugARanges in the DebugInfo module (specifically the appendRange method), already avoid emitting zero-sized symbols to .debug_aranges, but not comprehensively in the AsmPrinter. In fact, the AsmPrinter does try to avoid emitting such zero-sized symbols when labels aren't involved, but doesn't when the symbol to emitted is a difference of two labels; this patch extends that logic to handle the case in which the symbol is defined via labels. Furthermore, this patch fixes a bug in which `available_externally` symbols would cause unpredictable values to be emitted into the `.debug_aranges` table under certain circumstances. In practice I don't believe that this caused issues up until now, but the root cause of this bug--an invalid DenseMap lookup--triggered failures in Chromium when combined with an earlier version of this patch. Therefore, this patch fixes that bug too. This is a revised version of diff D126257, which was reverted due to breaking tests. The now-reverted version of this patch didn't distinguish between symbols that didn't have their size reported to the DwarfDebug handler and those that had their size reported to be zero. This new version of the patch instead restricts the special handling only to the symbols whose size is definitively known to be zero. Reviewed By: dblaikie Differential Revision: https://reviews.llvm.org/D126835
-
Louis Dionne authored
Also, improve the test for nasty macros to define min and max, so this will be caught in the future. Differential Revision: https://reviews.llvm.org/D128655
-
Min-Yih Hsu authored
This patch memorize compatible LLVM types in `LLVM::isCompatibleType` in order to avoid redundant works. This is especially useful when the size of program is big and there are multiple occurrences of some deeply nested LLVM struct types, in which case we can gain quite some speedups with this patch. Differential Revision: https://reviews.llvm.org/D127918
-
Min-Yih Hsu authored
This patch adds three new LLVM intrinsic operations: llvm.intr.vastart/copy/end. And its translation from LLVM IR. This effectively removes a restriction, imposed by 0126dcf1, where non-external functions in LLVM dialect cannot be variadic. At that time it was not clear how LLVM intrinsics are going to be modeled, which indirectly affects va_start/copy/end, the core intrinsics used in variadic functions. But since we have LLVM intrinsics as normal MLIR operations, it's not a problem anymore. Differential Revision: https://reviews.llvm.org/D127540
-
Snehasish Kumar authored
Add a check to detect that the profiled binary was build with position independent code. Add a test with a pie binary to which can be reused later when support is added. Also clean up the error messages with trailing colons. Reviewed By: tejohnson Differential Revision: https://reviews.llvm.org/D128564
-
Michał Górny authored
Sponsored by: The FreeBSD Foundation
-
gbreynoo authored
We did not properly handle using CREATETHIN in an MRI script and attempting to use ADDLIB to add the contents of a regular archive. This fix outputs a meaningful error message in this case and provides some more testing. Differential Revision: https://reviews.llvm.org/D128067
-
Aaron Ballman authored
MSVC was issuing "illegal conversion; more than one user-defined conversion has been implicitly applied" as a warning on this code. Explicitly calling .str() causes a StringRef to be materialized so that a second user-defined conversion is not required.
-
Chi Chun Chen authored
-
- Jun 27, 2022
-
-
Aaron Ballman authored
This solves a format specifier warning for char32_t being converted to an unsigned integer type, and multiple format specifier warnings for size_t being converted to long.
-
Mark de Wever authored
-
Jay Foad authored
Differential Revision: https://reviews.llvm.org/D128517
-
Frederic Cambus authored
Differential Revision: https://reviews.llvm.org/D128620
-
Ritanya B Bharadwaj authored
Implementing target in_reduction by wrapping target task with host task with in_reduction and if clause. This is in compliance with OpenMP 5.0 section: 2.19.5.6. So, this ``` for (int i=0; i<N; i++) { res = res+i } ``` will become ``` #pragma omp task in_reduction(+:res) if(0) #pragma omp target map(res) for (int i=0; i<N; i++) { res = res+i } ``` Reviewed By: ABataev Differential Revision: https://reviews.llvm.org/D125669 -
Michał Górny authored
Implement support for the "t" action that is used to stop a thread. Normally this action is used only in non-stop mode. However, there's no technical reason why it couldn't be also used in all-stop mode, e.g. to express "resume all threads except ..." (`t:...;c`). While at it, add a more complete test for vCont correctly resuming a subset of program's threads. Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.llvm.org/D126983
-
Andrzej Warzynski authored
Support for optimisation flags in LLVM Flang was originally added in https://reviews.llvm.org/D128043. That patch focused on LLVM middle-end/optimisation pipelines. With this patch, Flang will additionally configure LLVM backend pass pipelines accordingly. This behavior is consistent with Clang. New hook is added to translate compiler optimisation flags (e.g. `-O3`) into backend optimisation level: `getCGOptLevel`. Identical hooks are available in Clang and LLVM. In other words, the meaning of these optimisation flags remains consistent with other sub-projects that use LLVM backends. Differential Revision: https://reviews.llvm.org/D128050
-
Matthias Springer authored
Differential Revision: https://reviews.llvm.org/D128651
-
Nikita Popov authored
The global ctor evaluator currently handles by checking whether the memset memory is already zero, and skips it in that case. However, it only actually checks the first byte of the memory being set. This patch extends the code to check all bytes being set. This is done byte-by-byte to avoid converting undef values to zeros in larger reads. However, the handling is still not completely correct, because there might still be padding bytes (though probably this doesn't matter much in practice, as I'd expect global variable padding to be zero-initialized in practice). Mostly fixes https://github.com/llvm/llvm-project/issues/55859. Differential Revision: https://reviews.llvm.org/D128532
-
Lewuathe authored
Add complex.arg op which calculates the angle of complex number. The op name is inspired by the function carg in libm. See: https://sourceware.org/newlib/libm.html#carg Differential Revision: https://reviews.llvm.org/D128531
-
Nikita Popov authored
-
Matthias Springer authored
This change updates all remaining bufferization patterns (except for scf.while) and the remaining bufferization infrastructure to infer the memory space whenever possible instead of falling back to "0". (If a default memory space is set in the bufferization options, we still fall back to that value if the memory space could not be inferred.) Differential Revision: https://reviews.llvm.org/D128423
-
Than McIntosh authored
Add a missing "#if !SANITIZER_GO" guard for a call to DumpProcessMap in the Finalize hook (needed to build an updated Go race detector syso image). Reviewed By: dvyukov Differential Revision: https://reviews.llvm.org/D128641
-
Matthias Springer authored
Add a failure return value and bufferization options argument. This is to keep a subsequent change smaller. Differential Revision: https://reviews.llvm.org/D128278
-
Phoebe Wang authored
This is split from D113107 to address #56204 and https://discourse.llvm.org/t/how-to-build-compiler-rt-for-new-x86-half-float-abi/63366 Reviewed By: zahiraam, rjmccall, bkramer Differential Revision: https://reviews.llvm.org/D128571
-
Louis Dionne authored
-
Florian Hahn authored
-
Louis Dionne authored
It turns out that the Docker images on CI instances are not updated based on what's in this file, but instead when a new image is pushed to ldionne/libcxx-builder on DockerHub. So this is effectively useless.
-
Javier Setoain authored
These intrinsics will be needed to convert between fixed-length vectors and scalable vectors. This operation will be needed for VLS (vector-length specific) vectorization, when interfacing with vector functions or intrinsics that take scalable vectors as operands in a context where the length of our vectors is known or assumed at compile time, but we still want to generate scalable vector instructions. Differential Revision: https://reviews.llvm.org/D127100
-
Koakuma authored
On SPARC, leaf function optimization omits the register window sliding (and the associated register name changes). This might result in miscompilation of procedures containing inline assembly, as some of the register constraints used may interfere with the register usage of optimized functions, so we disable leaf procedure optimization on those procedures to prevent it from happening. This is a continuation of patch D102342 by @LemonBoy, the original comment is reproduced below: > Leaf functions allow the compiler to omit the setup and teardown of a frame pointer, therefore avoiding the exchange of the in/out register. According to the SPARC architecture manual every reference to %i0-%i5 should be replaced with %o0-o5, if the target register is already in use a further remapping step to %g1-%g7 is required to free the output register. > > Add a simple check to make sure not to stomp on any output register that's already in use. Reviewed By: dcederman Differential Revision: https://reviews.llvm.org/D128263
-
Lucas Prates authored
Currently the a AAPCS compliant frame record is not always created for functions when it should. Although a consistent frame record might not be required in some cases, there are still scenarios where applications may want to make use of the call hierarchy made available trough it. In order to enable the use of AAPCS compliant frame records whilst keep backwards compatibility, this patch introduces a new command-line option (`-mframe-chain=[none|aapcs|aapcs+leaf]`) for Aarch32 and Thumb backends. The option allows users to explicitly select when to use it, and is also useful to ensure the extra overhead introduced by the frame records is only introduced when necessary, in particular for Thumb targets. Reviewed By: efriedma Differential Revision: https://reviews.llvm.org/D125094
-
Valentin Clement authored
These tests were left behind or only partially upstreamed during the lower code upstreaming. This patch is part of the upstreaming effort from fir-dev branch. Reviewed By: PeteSteinfeld Differential Revision: https://reviews.llvm.org/D128634 Co-authored-by:
Kiran Chandramohan <kiran.chandramohan@arm.com> Co-authored-by:
Jean Perier <jperier@nvidia.com>
-
Tim Northover authored
Deciding to load an arbitrary global based on whether the entire module is being built for long calls is pretty clearly spurious, and in fact the existing indirect logic is sufficient.
-
Nikita Popov authored
-
Matt Arsenault authored
-
LLVM GN Syncbot authored
-
Louis Dionne authored
Previously, we'd use raw pointers when the debug mode was enabled, which means we wouldn't get out-of-range checking with std::span's iterators. This patch introduces a new class called __bounded_iter which can be used to wrap iterators and make them carry around bounds-related information. This allows iterators to assert when they are dereferenced outside of their bounds. As a fly-by change, this commit removes the _LIBCPP_ABI_SPAN_POINTER_ITERATORS knob. Indeed, not using a raw pointer as the iterator type is useful to avoid users depending on properties of raw pointers in their code. This is an alternative to D127401. Differential Revision: https://reviews.llvm.org/D127418
-
Louis Dionne authored
Differential Revision: https://reviews.llvm.org/D128455
-
Valentin Clement authored
These tests were left behind during the upstreaming of parts lowering. This patch is part of the upstreaming effort from fir-dev branch. Reviewed By: jeanPerier Differential Revision: https://reviews.llvm.org/D128632 Co-authored-by:
V Donaldson <vdonaldson@nvidia.com> Co-authored-by:
Jean Perier <jperier@nvidia.com> Co-authored-by:
Eric Schweitz <eschweitz@nvidia.com>
-
Wei Yi Tee authored
When a `nullptr` is assigned to a pointer variable, it is wrapped in a `ImplicitCastExpr` with cast kind `CK_NullTo(Member)Pointer`. This patch assigns singleton pointer values representing null to these expressions. For each pointee type, a singleton null `PointerValue` is created and stored in the `NullPointerVals` map of the `DataflowAnalysisContext` class. The pointee type is retrieved from the implicit cast expression, and used to initialise the `PointeeLoc` field of the `PointerValue`. The `PointeeLoc` created is not mapped to any `Value`, reflecting the absence of value indicated by null pointers. Reviewed By: gribozavr2, sgatev, xazax.hun Differential Revision: https://reviews.llvm.org/D128056
-
Nicolas Vasilache authored
An optional thread_dim_mapping index array attribute specifies for each virtual thread dimension, how it remaps 1-1 to a set of concrete processing element resources (e.g. a CUDA grid dimension or a level of concrete nested async parallelism). At this time, the specification is backend-dependent and is not verified by the op, beyond being an index array attribute. It is the reponsibility of the lowering to interpret the index array in the context of the concrete target the op is lowered to, or to ignore it when the specification is ill-formed or unsupported for a particular target. Differential Revision: https://reviews.llvm.org/D128633
-