- Jul 26, 2022
-
-
Alexander Shaposhnikov authored
Add assert for AtomicRMW: Ordering != AtomicOrdering::Unordered (https://github.com/llvm/llvm-project/blob/main/llvm/lib/IR/Verifier.cpp#L3944) and adjust expandAtomicStore accordingly. Test plan: 1/ ninja check-llvm check-clang check-lld 2/ Bootstrapped LLVM/Clang pass tests Differential revision: https://reviews.llvm.org/D130457
-
Fabian Parzefall authored
Rather than iterating over the whole function from the start until no internal calls are found, process each block only once and continue processing after splitting. This version of the function also does not seemingly invalidate iterators from within the loop. Reviewed By: maksfb Differential Revision: https://reviews.llvm.org/D130436
-
Fangrui Song authored
This compensates for 8f0c901c which enabled -Wunused-command-line-argument for unimplemented -mtune= in the generic code. Ignoring -mtune= appears to be longstanding and the error-free behavior in the presence of -Werror is unfortunately relied on by the Linux kernel's arm and powerpc ports. Ignore the warnings for the upcoming 15.0.0 branch and will implement functionality to fill the test gap soon. Link: https://github.com/ClangBuiltLinux/linux/issues/1674
-
lipracer authored
ArrayRef<Value> can implicit convert to ValueRange,when we call TypeRange(SmallVector<Value>) is ambiguity. TypeRange(ValueRange values) TypeRange(ArrayRef<Value> values) Reviewed By: rriddle, Mogball Differential Revision: https://reviews.llvm.org/D129475
-
lipracer authored
When we apply parent patch : https://reviews.llvm.org/D129475 The prompt I get with the clang compiler is: ValueRange is imcomplete type,ValueRange is a forward declaration in the file TypeRange.h, and the file OperationSupport.h already includes the file TypeRange.h.The class TypeRange and the class ValueRange depend on each other. Reviewed By: rriddle, Mogball Differential Revision: https://reviews.llvm.org/D130332
-
Augie Fackler authored
We no longer need specialized knowledge of these allocator functions in this file since we have the correct attributes available now. As far as I can tell the changes in the attributor tests are due to things getting more consistent on alloc-family once we remove the static list entries. The two test changes in NewGVN merit extra scrutiny: NewGVN appears to be _extremely_ sensitive to the inaccessiblememonly for reasons that are beyond me. As a result, I had-enumerated all the attributes on allocation functions in those two tests instead of using -inferattrs. I assumed that the two -disable-simplify-libcalls tests there no longer are sensible since the function declaration now includes all the relevant attributes. Differential Revision: https://reviews.llvm.org/D130107
-
Augie Fackler authored
As my goal is to remove at least _some_ functions from the static list in MemoryBuiltins.cpp, these tests either need to run inferattrs or statically declare these attributes to keep passing. A couple of tests had alternate cases which are no longer meaningful, e.g. `malloc-load-removal.ll`. Differential Revision: https://reviews.llvm.org/D123087
-
John Ericson authored
`ExtendPath` needs to be moved from internal to external CMake if it is to be used to `AddLLVM`. See, for example, the failure in https://lab.llvm.org/buildbot#builders/61/builds/29940 This reverts commit 5acd3764.
-
John Ericson authored
If `CMAKE_INSTALL_BINDIR` is a different absolute path per project, as it is with NixOS when we install every package to its own prefix, the old way fails when the absolute path gets prepended with `CMAKE_INSTALL_PREFIX`. Using `extend_path` from the install-time script isn't really possible, so we just make the caller responsible for making the path absolute instead. Also fix one stray `bin` -> `CMAKE_INSTALL_BINDIR` Reviewed By: sebastian-ne Differential Revision: https://reviews.llvm.org/D101070
-
John Ericson authored
Firstly, we we make an additional GNUInstallDirs-style variable. With NixOS, for example, this is crucial as we want those to go in `${dev}/lib/cmake` not `${out}/lib/cmake` as that would a cmake subdir of the "regular" libdir, which is installed even when no one needs to do any development. Secondly, we make *Config.cmake robust to absolute package install paths. We for NixOS will in fact be passing them absolute paths to make the `${dev}` vs `${out}` distinction mentioned above, and the GNUInstallDirs-style variables are suposed to support absolute paths in general so it's good practice besides the NixOS use-case. Thirdly, we make `${project}_INSTALL_PACKAGE_DIR` CACHE PATHs like other install dirs are. Reviewed By: sebastian-ne Differential Revision: https://reviews.llvm.org/D117973 -
Joseph Huber authored
A previous patch removed the need to set the auxiliary architecture as it was no longer needed for the clang invocation after moving to using the clang frontend. However, this had a second use of preventing unsupported host architectures from building the device runtime. This caused failures when trying to build on 32-bit hosts for example. Fixes #56699 Reviewed By: tianshilei1992 Differential Revision: https://reviews.llvm.org/D130509
-
Roy Sundahl authored
Extension of D127929 rdar://80997227 Differential Revision: https://reviews.llvm.org/D130499
-
Daniel Bertalan authored
This flag was introduced in ld64-609. It instructs the linker to link to a static library while treating its symbols as if they had hidden visibility. This is useful when building a dylib that links to static libraries but we don't want the symbols from those to be exported. Closes #51505 This reland adds bitcode file handling, so we won't get any compile errors due to BitcodeFile::forceHidden being unused. Differential Revision: https://reviews.llvm.org/D130473
-
Siva Chandra Reddy authored
-
Andrew Brown authored
Only Emscripten supports dynamic linking with threads. To use thread-local storage for other targets, this change defaults to the `localexec` model. Differential Revision: https://reviews.llvm.org/D130053
-
Siva Chandra Reddy authored
Reviewed By: lntue Differential Revision: https://reviews.llvm.org/D130459
-
Matt Arsenault authored
Introduce a flag like for some of the other target heuristic controls to help with experimentation.
-
Matt Arsenault authored
Set the priorities consistently to number of registers in the tuple - 1. Previously we started at 1, and also tried to give SGPR higher values than VGPRs. There's no point in assigning SGPRs higher values now that those are allocated in a separate regalloc run. This avoids overflowing the 5 bits used for the class priority in the allocation heuristic for 32 element tuples. This avoids some cases where smaller registers unexpectedly get prioritized over larger.
-
Joseph Huber authored
We previously used the `noinline` attributes to specify some defintions which should be kept alive in the runtime. These were then stripped immediately in the OpenMPOpt module pass. However, Since the changes in D130298, we not explicitly state which functions will have external visiblity in the bitcode library. Additionally the OpenMPOpt module pass should run before the inliner pass, so this shouldn't make a difference in whether or not the functions will be alive for the initial pass of OpenMPOpt. This should simplify the interface, and additionally save time spend on scanning funciton names for noinline. Reviewed By: jdoerfert Differential Revision: https://reviews.llvm.org/D130368
-
Sanjay Patel authored
We call tail-call-elim near the beginning of the pipeline, but that is too early to annotate calls that get added later. In the motivating case from issue #47852, the missing 'tail' on memset leads to sub-optimal codegen. I experimented with removing the early instance of tail-call-elim instead of just adding another pass, but that appears to be slightly worse for compile-time: +0.15% vs. +0.08% time. "tailcall" shows adding the pass; "tailcall2" shows moving the pass to later, then adding the original early pass back (so 1596886802 is functionally equivalent to 180b0439dc ): https://llvm-compile-time-tracker.com/index.php?config=NewPM-O3&stat=instructions&remote=rotateright Note that there was an effort to split the tail call functionality into 2 passes - that could help reduce compile-time if we find that this change costs more in compile-time than expected based on the preliminary testing: D60031 Differential Revision: https://reviews.llvm.org/D130374
-
Peter Klausler authored
[flang] Allow restricted specific intrinsic functions as implicitly-interfaced procedure pointer targets The predicate "CanBeCalledViaImplicitInterface()" was returning false for restricted specific intrinsic functions (e.g., SIN) because their procedure characteristics have the elemental attribute; this leads to a bogus semantic error when one attempts to use them as proc-targets in procedure pointer assignment statements when the left-hand side of the assignment is a procedure pointer with an implicit interface. However, these restricted specific intrinsic functions have always been allowed as special cases for such usage -- it is as if they are elemental when it is necessary for them to be so, but not when it's a problem. Differential Revision: https://reviews.llvm.org/D130386
-
Peter Klausler authored
An OPEN statement that implies closing a connection must invalidate the unit's frame buffer so as to prevent stale data from the old connection from being read into the newly-connected unit. Differential Revision: https://reviews.llvm.org/D130430
-
Daniel Bertalan authored
This reverts commit 4c79e1a3. Broke this bot: https://lab.llvm.org/buildbot/#builders/57/builds/20319
-
Daniel Bertalan authored
This flag was introduced in ld64-609. It instructs the linker to link to a static library while treating its symbols as if they had hidden visibility. This is useful when building a dylib that links to static libraries but we don't want the symbols from those to be exported. Closes #51505 Differential Revision: https://reviews.llvm.org/D130473
-
Craig Topper authored
InstCombine and SelectionDAG will tend to canonicalize these conditions to (setgt X, C-1). C-1 might be more costly to materialize than C would have been.
-
Kiran Chandramohan authored
Lower the Flang parse-tree containing OpenMP reductions to the OpenMP dialect. The OpenMP dialect models reductions with, 1) A reduction declaration operation that specifies how to initialize, combine, and atomically combine private reduction variables. 2) The OpenMP operation (like wsloop) that supports reductions has an array of reduction accumulator variables (operands) and an array attribute of the same size that points to the reduction declaration to be used for the reduction accumulation. 3) The OpenMP reduction operation that takes a value and an accumulator. This operation replaces the original reduction operation in the source. (1) is implemented by the `createReductionDecl` in OpenMP.cpp, (2) is implemented while creating the OpenMP operation, (3) is implemented by the `genOpenMPReduction` function in OpenMP.cpp, and called from Bridge.cpp. The implementation of (3) is not very robust. NOTE 1: The patch currently supports only reductions for integer type addition. NOTE 2: Only supports reduction in the worksharing loop. NOTE 3: Does not generate atomic combination region. NOTE 4: Other options for creating the reduction operation include a) having the reduction operation as a construct containing an assignment and then handling it appropriately in the Bridge. b) we can modify `genAssignment` or `genFIR(AssignmentStmt)` in the Bridge to handle OpenMP reduction but so far we have tried not to mix OpenMP and non-OpenMP code and this will break that. I will try (b) in a separate patch. NOTE 5: OpenMP dialect gained support for reduction with the patches: D105358, D107343. See https://discourse.llvm.org/t/rfc-openmp-reduction-support/3367 for more details. Reviewed By: awarzynski Differential Revision: https://reviews.llvm.org/D130077 Co-authored-by:
Peixin-Qiao <qiaopeixin@huawei.com>
-
Dmitri Gribenko authored
The latter way to abbreviate is a lot more common in the LLVM codebase. Reviewed By: sgatev, xazax.hun Differential Revision: https://reviews.llvm.org/D130423
-
Siva Chandra Reddy authored
This class will be used in future changes to construct simple strings. Reviewed By: michaelrj Differential Revision: https://reviews.llvm.org/D130334
-
Eric Li authored
Fix `MapLattice` API to return `std::pair<iterator, bool>`, allowing users to detect when an element has been inserted without performing a redundant map lookup. Differential Revision: https://reviews.llvm.org/D130497
-
Justin Brooks authored
The full code listing was fixed in fdaeb0c6 Reviewed By: dblaikie Differential Revision: https://reviews.llvm.org/D130217
-
Peter Klausler authored
When a procedure pointer is associated with a procedure target, f18 will emit hard error messages if the pointer is incompatible with the target in a way that would cause the program to not work if the procedure pointer were actually called. However, in the context of the ASSOCIATED() intrinsic, the compiler should not consider a query to be a compilation-time error if the pointer and the target are incompatible. The standard gives us sufficient wiggle room here to treat these cases as warnings. Attempts to use ASSOCIATED to test whether a procedure pointer is associated with a data object, or vice versa, remain errors. Differential Revision: https://reviews.llvm.org/D130384
-
Christopher Bate authored
This reverts commit 535b507b.
-
Corentin Jabot authored
-
Jean Perier authored
In flang pipeline, the inliner calls createCanonicalizerPass with the region simplification disabled. The inliner pass does canonicalization even if no inlining happens. After canonicalization, FIR lite region simplification must be called to get rid of unreachable regions. This code exposes the need to run SimplifyRegionLitePass after the inliner is called with FIR pipeline. Differential Revision: https://reviews.llvm.org/D130484
-
Mike Urbach authored
The minimum required version is now 3.19 due to the usage of some more recent features. Update the version check and error message accordingly. Also remove some logic that behaved differently before 3.18, since we can assume we are now on version 3.19+. Reviewed By: stella.stamenova Differential Revision: https://reviews.llvm.org/D130171
-
Warren Ristow authored
In D129523, it was noted that there is are some questionable naked casts from Instruction to BinaryOperator, which could be addressed by doing a dyn_cast directly to BinaryOperator, avoiding the need for the later cast. This cleans up that casting. Reviewed By: nikic, spatel, RKSimon Differential Revision: https://reviews.llvm.org/D130448
-
Vladislav Dzhidzhoev authored
Emission of constants having DebugLoc with line 0 causes significant increase of debug_line section size for some source files. To illustrate, we can compare section sizes of several files from llvm test-suite, built with SelectionDAG vs GlobalISel, on Aarch64 (macOS), using -O0 optimization level: | Source path | SDAG text sz | GISel text sz | SDAG debug_line sz | GISel debug_line sz | -------------------------------------------------------------- | ------------ | ------------- | ------------------ | -------------------- | `SingleSource/Regression/C/gcc-c-torture/execute/strlen-2.c` | 15320 | 660 | 14872 | 6340 | `SingleSource/Regression/C/gcc-c-torture/execute/20040629-1.c` | 33640 | 26300 | 2812 | 6693 | `SingleSource/Benchmarks/Misc/flops-4.c` | 1428 | 1196 | 594 | 1008 | `MultiSource/Benchmarks/MiBench/consumer-typeset/z31.c` | 2716 | 964 | 809 | 903 | `MultiSource/Benchmarks/Prolangs-C/gnugo/showinst.c` | 2534 | 2502 | 189 | 573 For instance, here is a fragment of `flops-4.c.o` debug line section dump ``` Address Line Column File ISA Discriminator Flags ------------------ ------ ------ ------ --- ------------- ------------- 0x0000000000000000 174 0 1 0 0 is_stmt 0x0000000000000010 0 0 1 0 0 0x0000000000000018 185 4 1 0 0 is_stmt prologue_end 0x000000000000001c 0 0 1 0 0 0x0000000000000024 186 4 1 0 0 is_stmt 0x000000000000002c 189 10 1 0 0 is_stmt 0x0000000000000030 0 0 1 0 0 0x0000000000000038 207 11 1 0 0 is_stmt 0x0000000000000044 208 11 1 0 0 is_stmt 0x0000000000000048 0 0 1 0 0 0x0000000000000058 210 10 1 0 0 is_stmt 0x000000000000005c 0 0 1 0 0 0x0000000000000060 211 10 1 0 0 is_stmt 0x0000000000000064 0 0 1 0 0 0x000000000000006c 212 10 1 0 0 is_stmt 0x0000000000000070 0 0 1 0 0 0x000000000000007c 213 10 1 0 0 is_stmt 0x0000000000000080 0 0 1 0 0 0x0000000000000088 214 10 1 0 0 is_stmt 0x000000000000008c 0 0 1 0 0 0x0000000000000094 215 10 1 0 0 is_stmt ``` Lot of zero lines are produced by constants (global values) having DebugLoc with line 0. It seems that they're not significant for debugging experience. With the commit applied, total size of debug_line sections of llvm shared libraries has reduced by 2.5%. Change of debug line section size of files listed above: | Source path | GISel debug_line sz | Patch debug_line sz | -------------------------------------------------------------- | ------------------- | -------------------- | `SingleSource/Regression/C/gcc-c-torture/execute/strlen-2.c` | 6340 | 1465 | `SingleSource/Regression/C/gcc-c-torture/execute/20040629-1.c` | 6693 | 3782 | `SingleSource/Benchmarks/Misc/flops-4.c` | 1008 | 609 | `MultiSource/Benchmarks/MiBench/consumer-typeset/z31.c` | 903 | 841 | `MultiSource/Benchmarks/Prolangs-C/gnugo/showinst.c` | 573 | 190 Reviewed By: dblaikie Differential Revision: https://reviews.llvm.org/D127488
-
Peter Klausler authored
f18 intentionally does not support the spottily-implemented language extension in which one can pass NULL() for an allocatable dummy argument. This is perhaps a sanctioned side effect in other compilers of the fact that they pass distinct "base address" and "descriptor address" physical arguments. Make the error message in this case more specific to the circumstances, and add a note to Extensions.md to clarify that this behavior is intended. (We could, with some effort in lowering, support passing NULL for an INTENT(IN) allocatable dummy, but let's see whether such nonconforming usage appears in a real application before spending any more time on it.) Differential Revision: https://reviews.llvm.org/D130380
-
Vladislav Dzhidzhoev authored
`SmallDenseMap` constructor with reserve gets an arbitrary `NumInitBuckets` value and passes it below to `init` method. If `NumInitBuckets` is greater then `InlineBuckets`, then `SmallDenseMap` initializes to large representation passing `NumInitBuckets` below to `DenseMap` initialization. `DenseMap::initEmpty` method asserts that initial buckets count must be a power of 2. Proposed solution is to update `NumInitBuckets` value in `SmallDenseMap` constructor till the next power of 2. It should satisfy both `DenseMap` preconditions and required minimum buckets count for reservation. Reviewed By: atrick Differential Revision: https://reviews.llvm.org/D129825
-
Igor Zhukov authored
and use fallback only for C. It fixes the isssue with clang-cl: ``` #include <stdatomic.h> #include <stdbool.h> #ifdef __cplusplus #include <atomic> using namespace std; #endif int main() { atomic_bool b = true; } ``` ``` $ clang-cl /TC main.cpp # works ``` ``` $ clang-cl /TP /std:c++20 main.cpp stdatomic.h(70,6): error: conflicting types for 'atomic_thread_fence' void atomic_thread_fence(memory_order); ^ atomic(166,24): note: previous definition is here extern "C" inline void atomic_thread_fence(const memory_order _Order) noexcept { ... fatal error: too many errors emitted, stopping now [-ferror-limit=] 20 errors generated. ``` Many errors but `<stdatomic.h>` has many macros to built-in functions. ``` #define atomic_thread_fence(order) __c11_atomic_thread_fence(order) ``` and MSVC `<atomic>` has real functions. and the built-in functions are redefined. Reviewed By: #libc, aaron.ballman, Mordante Differential Revision: https://reviews.llvm.org/D130419
-