- Jan 28, 2023
-
-
Joseph Huber authored
The `OpenMPOpt` pass is pivotal to the performance of many OpenMP offloading programs. When we perform non-LTO builds with OpenMP we used to link the OpenMP deviceRTL individually for each TU. This lead to us getting an additional attributor run on the combined runtime and user code. When we used LTO we lost a run and suffered a large performance degradation. This patch simply adds in the extra `OpenMPOpt` pass that we miss into the LTO pipeline. This patch fixes the performance regression shown in applications that used OpenMP offloading in LTO mode. Previously, this wasn't legal to do as we could emit new runtime calls into the module. That was fixed by D142646. Depends on D142646 Fixes https://github.com/llvm/llvm-project/issues/60300 Reviewed By: jdoerfert Differential Revision: https://reviews.llvm.org/D142650 (cherry picked from commit 6185246f)
-
Aaron Ballman authored
This was a mistake from e7300e75 (https://reviews.llvm.org/D133574) caused by us accidentally tracking an older copy of the C DR list for DR496. The text in https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2396.htm#dr_496 makes it clear that subobjects are allowed, which means member and array access expressions are allowed. This backs out the changes from the previous commit that relate to this diagnostic. (cherry picked from commit 63d6b8be)
-
Alexey Lapshin authored
The llvm::parallelFor() uses threads created by ThreadPoolExecutor as well as main thread. The index for the main thread matches with the index for the first thread created by ThreadPoolExecutor. It results in that getThreadIndex returns the same value for different threads. To avoid thread index clashing - do not use main thread for llvm::parallelFor(): parallel::TaskGroup TG; for (; Begin + TaskSize < End; Begin += TaskSize) { TG.spawn([=, &Fn] { for (size_t I = Begin, E = Begin + TaskSize; I != E; ++I) Fn(I); }); } for (; Begin != End; ++Begin) <<<< executed by main thread. Fn(Begin); <<<< return; <<<< Differential Revision: https://reviews.llvm.org/D142317 (cherry picked from commit 10a796a0) -
Erich Keane authored
Fixes: #60323 https://github.com/llvm/llvm-project/issues/60323 The problem is that we are profiling the 'Expr' components directly, however when they contain an unresolved lookup, those canonicalize identically. The result was the two versions of calls to 'go' were canonicalized identically. This patch fixes this by ensuring we consider the declaration the constraint is attached to, when possible. When not, we skip the diagnostic. The result is that we are relaxing our diagnostic in some cases (Of which I couldn't come up with a reproducer), such that we might see overflows when evaluating constraints that depend on themselves in a way that they are not attached to a declaration directly, such as if they are nested requirements, though the hope is this won't be a problem, since the 'parent' named constraint would catch this. I'm hopeful that the 'worst case' is that we catch recursion 'later' in the process, instead of immediately. (cherry picked from commit 42667563)
-
Tom Stellard authored
libclc requires using cmake files to detect the LLVM installation instead of llvm-config so we need to update our cmake invocation. Reviewed By: thieta Differential Revision: https://reviews.llvm.org/D142716 (cherry picked from commit 683b83ab)
-
Tom Stellard authored
Reviewed By: thieta Differential Revision: https://reviews.llvm.org/D142718 (cherry picked from commit 8040e3a4)
-
Tom Stellard authored
Reviewed By: thieta Differential Revision: https://reviews.llvm.org/D142719 (cherry picked from commit 9f307a02)
-
Tom Stellard authored
Reviewed By: thieta Differential Revision: https://reviews.llvm.org/D142720 (cherry picked from commit 409f42b1)
-
Tom Stellard authored
Reviewed By: thieta Differential Revision: https://reviews.llvm.org/D142598 (cherry picked from commit 57b491b5)
-
- Jan 27, 2023
-
-
Shilei Tian authored
When `N` is 1024, `int result[N][N]` is obviously large stack that Windows cannot support... Fix #60326. Reviewed By: jdoerfert Differential Revision: https://reviews.llvm.org/D142684 (cherry picked from commit 544f8c7f)
-
Erich Keane authored
It seems that the sugaring patches had some pretty significant interdependencies, and at least one issue exists that requires part of the concept-sugaring patch. I don't believe this to have anything to do with the increased compile-times that were seen, so hopefully this will fix our problems without further regressions. See https://reviews.llvm.org/rG12cb1cb3720de8d164196010123ce1a8901d8122 for discussion. Differential Revision: https://reviews.llvm.org/D142500 (cherry picked from commit 228462f7)
-
Tom Stellard authored
Reviewed By: amyk, dim, hans Differential Revision: https://reviews.llvm.org/D142417 (cherry picked from commit 00904881)
-
Haojian Wu authored
This reverts commit e70ca7b3 and the followup patch "[clang] Fix the location of UsingTypeLoc" (ebbeb164). The patch causes an incorrect lookup result: ``` namespace ns { struct Foo { };} using ns::Foo; void test() { struct Foo { } k; // the type of k refers to ns::Foo, rather than the local Foo! } ``` (cherry picked from commit e400c63c)
-
Simon Pilgrim authored
The macro _mm_test_all_ones(V) was defined as _mm_testc_si128((V), _mm_cmpeq_epi32((V), (V))) - which could cause side effects depending on the source of the V value. The _mm_cmpeq_epi32((V), (V)) trick was just to materialize an all-ones value, which can be more safely generated with _mm_set1_epi32(-1) . Fixes #60006 Differential Revision: https://reviews.llvm.org/D142477 (cherry picked from commit c9b28233)
-
Arsen Arsenović authored
GCC rejects ABI tags on non mangled functions, as they would otherwise be a no-op. This commit replaces such instances with equivalent _LIBCPP_HIDE_FROM_ABI constants but without ABI tags attached. .../include/c++/v1/__support/musl/xlocale.h:28:68: error: 'abi_tag' attribute applied to extern "C" declaration 'long long int strtoll_l(const char*, char**, int, locale_t)' 28 | strtoll_l(const char *__nptr, char **__endptr, int __base, locale_t) { | ^ Bug: https://bugs.gentoo.org/869038 Reviewed By: #libc, ldionne Differential Revision: https://reviews.llvm.org/D142415 -
Siu Chi Chan authored
This change fixes an issue introduced by https://reviews.llvm.org/D140315. A new unit test was added to validate the search for the device libraries being placed in Clang's resource directory; however, the test didn't take into account that certain platforms use lib64 for 64-bit library directory. Differential Revision: https://reviews.llvm.org/D142506 Change-Id: I9c31a4f08fbc383350d82d6aba01987a3ef63e51 (cherry picked from commit 56184bb3)
-
- Jan 25, 2023
-
-
Tom Stellard authored
-
Kazu Hirata authored
If we know that x is nonzero and not a power of 2, then llvm::findLastSet(x) + 1 is the index of the bit just above the highest set bit in x. That is, 1 << (llvm::findLastSet(x) + 1) is the same as llvm::bit_ceil(x). Since llvm::bit_ceil is a nop on a power of 2, we can unconditionally call llvm::bit_ceil. The end result actually matches the comment.
-
Kazu Hirata authored
If x is known to be nonzero, findLastSet(x) returns the index of the highest set bit counting from the LSB, so 1 << findLastSet(x) is the same as llvm::bit_floor(x).
-
Min-Yih Hsu authored
Sometimes memory addresses are treated as immediate values. Thus immediate operands have to be relocatable. Differential Revision: https://reviews.llvm.org/D137902
-
Min-Yih Hsu authored
32-bit immediates require special cares because they go across the normal word (16 bits) boundaries. This patch also fixes some incorrect disassembler test cases. Differential Revision: https://reviews.llvm.org/D142080
-
Min-Yih Hsu authored
Just like the encoder directive for variable-length instructions, this patch adds a new decoder directive to allow custom decoder function on an operand. Right now, due to the design of DecoderEmitter each operand can only have a single custom decoder in a given instruction. Differential Revision: https://reviews.llvm.org/D142079
-
Shivam Gupta authored
zero-call-used-regs pass generate an xor instruction to help mitigate return-oriented programming exploits via zeroing out used registers. But in this below test case with -g option there is dbg.value instruction associating the register with the debug-info description of the formal parameter d, which makes the register appear used, therefore it zero the register edi in -g case and makes binary different from without -g option. The pass should be looking only at the non-debug uses. $ cat test.c char a[]; int b; __attribute__((zero_call_used_regs("used"))) char c(int d) { *a = ({ int e = d; b; }); } This fixes https://github.com/llvm/llvm-project/issues/57962. Differential Revision: https://reviews.llvm.org/D138757 -
Douglas Yung authored
This reverts commit de122cb9. This change causes assertion failures in many of our internal tests. I have filed #60280 for this issue.
-
Carlos Galvez authored
This reverts commit 4240c914. The current solution won't work since getLocalOrGlobal does not support returning a vector. More work needs to be put into ensuring both the local and global way of setting the options are available during the transition period.
-
Mehdi Amini authored
-
Peter Rong authored
This rewrite fixes https://github.com/llvm/llvm-project/issues/59316. Previously LowerSwitch uses int64_t, which will crash on case branches using integers with more than 64 bits. Using APInt fixes this problem. This patch also includes a test Reviewed By: RKSimon Differential Revision: https://reviews.llvm.org/D140747
-
Joshua Cao authored
As discussed in https://github.com/llvm/llvm-project/issues/59901 This change is not NFC. There is one SCEV and EarlyCSE test that have an improved analysis/optimization case. Rest of the tests are not failing. I've mostly only added cleanup to SCEV since that is where this issue started. As a follow up, I believe there is more cleanup opportunity in SCEV and other affected passes. There could be cases where there are missed registerAssumption of guards, but this case is not so bad because there will be no miscompilation. AssumptionCacheTracker should take care of deleted guards. Differential Revision: https://reviews.llvm.org/D142330
-
Shilei Tian authored
In Clang, in order to determine the type of `omp_allocator_handle_t`, Clang checks the type of those predefined allocators. The first one it checks is `omp_null_allocator`. If the language is C, and the system is 64-bit, what Clang gets is a `int`, instead of an enum of size 8, given the fact how we define `omp_allocator_handle_t` in `omp.h`. If the allocator is captured by a region, let's say a parallel region, the allocator will be privatized. Because Clang deems `omp_allocator_handle_t` as an `int`, it will first cast the value returned by the runtime library (for `libomp` it is a `void *`) to `int`, and then in the outlined function, it casts back to `omp_allocator_handle_t`. This two casts completely shaves the first 32-bit of the pointer value returned from `libomp`, and when the private "new" pointer is fed to another runtime function `__kmpc_allocate()`, it causes segment fault. That is the root cause of PR54082. I have no idea why `-fno-pic` could hide this bug. In this patch, we detect `omp_allocator_handle_t` using roughly the same method as `omp_event_handle_t`, by looking it up into the identifier table. Fix #54082. Reviewed By: ABataev Differential Revision: https://reviews.llvm.org/D142297
-
Jordan Rupprecht authored
LLDB only supports Python3 now, so the `six` shim for Python2 is no longer necessary. Reviewed By: JDevlieghere Differential Revision: https://reviews.llvm.org/D142140
-
Arthur Eubanks authored
Otherwise we may be inserting a decl into a DeclContext that's not fully defined yet. This simplifies/removes some clang AST node creation code. Instead, use clang::printTemplateArgumentList(). Reviewed By: Michael137 Differential Revision: https://reviews.llvm.org/D142413
-
Joseph Huber authored
Summary: This test has a negative check for an extra file. it turns out that sometimes the temp name can match it. Be more specific with it.
-
Shilei Tian authored
When `libomp` is initialized, it creates a temp file in `/dev/shm` to store registration flag. Some systems, like Android, don't have `/dev/shm`, then this feature is disabled by the macro `KMP_USE_SHM`, though most Linux distributions have that. However, some customized distribution, such as the one reported in https://github.com/llvm/llvm-project/issues/53955, doesn't support it either. It causes a core dump. In this patch, if it is the case, we will try to create a temporary file in `/tmp`, and if it still doesn't make it, then we error out. Note that we don't consider in this patch if the temporary directory has been set to `TMPDIR` in this patch. If `/tmp` is not accessible, we error out. Fix #53955. Reviewed By: jdoerfert Differential Revision: https://reviews.llvm.org/D142175
-
Owen Pan authored
To prevent potential bugs in situations where we want to peek the next non-comment token. Differential Revision: https://reviews.llvm.org/D142412
-
Louis Dionne authored
This changes the mechanism for verbose termination (again!) to make it support compile-time customization in addition to link-time customization, which is important for users who need fine-grained control over what code gets generated around sites that call the verbose termination handler. This concern had been raised to me both privately by prospecting users and in https://llvm.org/D140944, so I think it is clearly worth fixing. We still support _LIBCPP_AVAILABILITY_CUSTOM_VERBOSE_ABORT_PROVIDED for a limited time since the same functionality can be achieved by overriding the _LIBCPP_VERBOSE_ABORT macro. Differential Revision: https://reviews.llvm.org/D141326
-
Tom Stellard authored
The stage1 and stage2 builds aren't packaged, so we only need to build enough of the toolchain to build the next phase. Reviewed By: thieta, amyk Differential Revision: https://reviews.llvm.org/D141552
-
Muhammad Omair Javaid authored
This patch remove xfail decorator from builtins/Unit/trampoline_setup_test.c as it is passing on Windows/AArch64 nowz. It is being skipped in code with __clang__ not defined. https://lab.llvm.org/buildbot/#/builders/120/builds/3873
-
Craig Topper authored
If we're extracting an element and inserting into a undef vector with the same number of elements, we can use the original vector. This pattern occurs around reductions that have been cascaded together. This can be generalized to wider/narrow vectors by using insert_subvector/extract_subvector, but we don't have lit tests for that case currently. We can also support non-undef before by using a slide or vmv.v.v Reviewed By: reames Differential Revision: https://reviews.llvm.org/D142264
-
yronglin authored
Remove __unexpected namespace. Reviewed By: philnik, #libc, ldionne Differential Revision: https://reviews.llvm.org/D141947
-
Jez Ng authored
This is what ld64 does, and also what we already do for most of the other load commands. I'm not aware of a good way to test this, but I don't think it really matters. Differential Revision: https://reviews.llvm.org/D141462
-