- Feb 07, 2023
-
-
Jonas Hahnfeld authored
According to the IR verifier, "Declaration[s] may not be in a Comdat!" This is a re-commit of 76b3f0b4 and 87d78382 with updates to the test: * Force emission of the extra-module, to trigger the bug after D138264, by providing a second symbol @g, and making the comdat nodeduplicate. (Technically only one is needed, but two should be safer.) * Name the comdat $f to avoid failure on Windows: LLVM ERROR: Associative COMDAT symbol 'c' does not exist. * Mark the test as UNSUPPORTED on macOS, MachO doesn't support COMDATs. Differential Revision: https://reviews.llvm.org/D142443 (cherry picked from commit 50ca8b3e)
-
Johannes Doerfert authored
There were missing checks in the aligned region code, copy-paste errors (= usage of the IsReachedFromAlignedBarrierOnly value instead of IsReachingAlignedBarrierOnly value on the forward pass), and a missing update of the call state for sync declarations and definitions. Partially fixes https://github.com/llvm/llvm-project/issues/60425 (cherry picked from commit 578d5073)
-
Johannes Doerfert authored
Before we might have ended up queriying the AAExecutionDomain of a different function, which resulted in wrong optimistic results. Partially fixes https://github.com/llvm/llvm-project/issues/60425 (cherry picked from commit 18a2975b)
-
Johannes Doerfert authored
We improved our simplification and this exposed a bug in the store elimination. A load that had dead uses and assume uses was thought to be used by assumes only. Consequently we also deleted the "dead use users". This was a problem because a dead use just means we will not use the load there. The user might still be needed. Exposed by OvO, reported by @ye-luo. (cherry picked from commit a51ad873)
-
Rainer Orth authored
`test-release.sh` is too silent in some cases: - Only the build proper is run verbosely, but `check-all` is not. - `lit` is run without `-v`, so in case of failures one cannot see what's actually wrong. This patch fixes both issues, running all `${MAKE}` invocations with `$Verbose` (except for `${MAKE} install` where it would only add noise), and running `lit` with `-v`. Tested on `x86_64-pc-linux-gnu` and `arm64-apple-darwin21.6`. Differential Revision: https://reviews.llvm.org/D143249 (cherry picked from commit 8d2d8e02) -
Fangrui Song authored
Fix https://github.com/llvm/llvm-project/issues/60392 ``` // a.cc void raise() { throw 42; } bool foo() { try { raise(); } catch (int) { return true; } return false; } int main() { foo(); } ``` ``` clang++ --target=x86_64-linux-gnu -fno-pic -mcmodel=large -no-pie -fuse-ld=lld -z notext a.cc -o a && ./a clang++ --target=aarch64-linux-gnu -fno-pic -no-pie -fuse-ld=lld -Wl,--dynamic-linker=/usr/aarch64-linux-gnu/lib/ld-linux-aarch64.so.1 -Wl,-rpath=/usr/aarch64-linux-gnu/lib -z notext a.cc -o a && ./a ``` Both commands fail because we produce a dynamic relocation for R_X86_64_64/R_AARCH64_ABS64 in .eh_frame which will be adjusted to a wrong offset by `SectionBase::getOffset` after D122459. Since GNU ld uses a canonical PLT entry instead of a dynamic relocation for .eh_frame, we follow suit as well to avoid the issue. Mips has an ABI issue (https://github.com/llvm/llvm-project/issues/5837) and we don't implement GNU ld's DW_EH_PE_absptr conversion. mips64-eh-abs-reloc.s wants a dynamic relocation, so keep the original behavior for EM_MIPS. Differential Revision: https://reviews.llvm.org/D143136 (cherry picked from commit 08c915fa)
-
Joseph Huber authored
There were intemittent errors in the linker wrapper when using the sanitizers in parallel. First, this is because the `TempFiles` global was not guarded when creating a new file. Second, even though the `Args` list is passed as const, the internal state is mutable when adding a string. So that needs to be guarded too. Fixes https://github.com/llvm/llvm-project/issues/60437 Reviewed By: tianshilei1992 Differential Revision: https://reviews.llvm.org/D142985 (cherry picked from commit 9c4591d7)
-
- Feb 06, 2023
-
-
Joe Loser authored
The current behavior for AMX macros is: ``` gcc -march=native -dM -E - < /dev/null | grep TILE clang -march=native -dM -E - < /dev/null | grep TILE ``` which is not ideal. Change `__AMXTILE__` and friends to `__AMX_TILE__` (i.e. have an underscore in them). This makes GCC and Clang agree on the naming of these AMX macros to simplify downstream user code. Fix this for `__AMXTILE__`, `__AMX_INT8__`, `__AMX_BF16__`, and `__AMX_FP16__`. Differential Revision: https://reviews.llvm.org/D143094 (cherry picked from commit 8998fa6c)
-
Tom Honermann authored
When support for declaring the c8rtomb() and mbrtoc8() functions within the std namespace was added in commit 7e7013c5, internal glibc macros were used to determine if C2X extensions are enabled. Specifically, a check for whether `__GLIBC_USE` is defined and whether `__GLIBC_USE(ISOC2X)` is non-0 was added. `__GLIBC_USE` is an internal detail of the glibc implementation that may be changed or removed in the future potentially leading to inconsistency or compilation failures. This change removes the use of the internal glibc macro to avoid such problems. Unfortunately, without another mechanism to determine if C2X extensions are enabled, this removal will result in inconsistent declarations of the c8rtomb() and mbrtoc8() functions; when C++ char8_t support is not enabled, but C2X extensions are, these functions will be declared in the global namespace but not in the std namespace. This situation will improve when C23 support is finalized and the check can be re-implemented using `__STDC_VERSION__`. (cherry picked from commit cf93a3dd)
-
Sam James authored
Without this, if hardening measures like FORTIFY_SOURCE are are in /etc/clang/*.cfg, many sanitizer tests will die before the sanitizer can trap the problem being tested, because e.g. the _chk variants of common functions will abort first. This gets the number of failing tests down from 42->3 for me (and the remaining 3 are unrelated). See: 52ce6776 See: 136f7780 Closes: https://github.com/llvm/llvm-project/issues/60394 Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D143322 (cherry picked from commit 8ab76255)
-
eopXD authored
The LLVM now supports v0.11 of the RVV intrinsics. Users can use the macro `riscv_v_intrinsic` to distinguish what kind of intrinsics is supported in the compiler. Please refer to tag descriptions under https://github.com/riscv-non-isa/rvv-intrinsic-doc/tags Reviewed By: kito-cheng, asb Differential Revision: https://reviews.llvm.org/D143051 (cherry picked from commit e685bde1)
-
Jonas Paulsson authored
- Global vector variables expose the vector ABI through their alignments only if they are >=16 bytes in size. - Vectors passed between functions expose the vector ABI only if they are <=16 bytes in size. LLVM test suite builds with gcc/clang now give the same gnu attributes emitted. Reviewed By: Ulrich Weigand Differential Revision: https://reviews.llvm.org/D141409 (cherry picked from commit 0eff46f8)
-
Jonathan Peyton authored
Do not check for version symbol support if the necessary linker flag is not supported. Differential Revision: https://reviews.llvm.org/D143200 (cherry picked from commit c32022ad)
-
Khem Raj authored
Pass -D_FILE_OFFSET_BITS=64 to compiler flags on 32bit glibc based systems. This will make sure that 64bit versions of LFS functions are used e.g. seek will behave same as lseek64. Also revert [1] partially because this added a cmake test to detect lseek64 but then forgot to pass the needed macro to actual compile, this test was incomplete too since libc implementations like musl has 64bit off_t by default on 32bit systems and does not bundle[2] -D_LARGEFILE64_SOURCE under -D_GNU_SOURCE like glibc, which means the compile now fails on musl because the cmake check passes but we do not have _LARGEFILE64_SOURCE defined. Using the *64 function was transitional anyways so use -D_FILE_OFFSET_BITS=64 instead [1] https://github.com/llvm/llvm-project/commit/8db7e5e4eed4c4e697dc3164f2c9351d8c3e942b [2] https://git.musl-libc.org/cgit/musl/commit/?id=25e6fee27f4a293728dd15b659170e7b9c7db9bc Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D139752 (cherry picked from commit 5cd55430)
-
Fangrui Song authored
(cherry picked from commit 003f2b37)
-
Mark de Wever authored
The patch 430b397f ("[libc++] Granularize <type_traits> includes in <iterator>") missed some exports in the modulemap with became apparent in the reverting commit 12cb1cb3. This fixes the issue by updating the modulemap. Note that the Clang ICE is not fixed by this change. Reviewed By: #libc, ldionne Differential Revision: https://reviews.llvm.org/D142690 (cherry picked from commit a7f8ddc4)
-
varconst authored
This is in anticipation of https://isocpp.org/files/papers/D2770R0.html, which is ABI-breaking for `join_view`. Differential Revision: https://reviews.llvm.org/D142520 (cherry picked from commit c2b3986e)
-
eopXD authored
Reviewed By: asb Differential Revision: https://reviews.llvm.org/D142094
-
eopXD authored
This commit adds prefix for the overloaded RVV intrinsics. This is the 3rd commit of a patch-set to add __riscv_ for all RVV intrinsics. This follows the naming guideline under riscv-c-api-doc to add the `__riscv_` suffix for all RVV intrinsics. Pull Request: riscv-non-isa/riscv-c-api-doc#31 riscv-non-isa/rvv-intrinsic-doc#189 Depends on D142644. Reviewed By: kito-cheng Differential Revision: https://reviews.llvm.org/D142697
-
eopXD authored
This commit adds prefix for the non-overloaded RVV intrinsics. This is the 2nd commit of a patch-set to add __riscv_ for all RVV intrinsics. This follows the naming guideline under riscv-c-api-doc to add the `__riscv_` suffix for all RVV intrinsics. Pull Request: riscv-non-isa/riscv-c-api-doc#31 riscv-non-isa/rvv-intrinsic-doc#189 Depends on D142085. Reviewed By: kito-cheng Differential Revision: https://reviews.llvm.org/D142644
-
eopXD authored
This commit adds prefix for intrinsics that are defined through `HeaderCode` under `riscv_vector.td`. This is the 1st commit of a patch-set to add `__riscv_` for all RVV intrinsics. This follows the naming guideline under riscv-c-api-doc to add the `__riscv_` suffix for all RVV intrinsics. Pull Request: riscv-non-isa/riscv-c-api-doc#31 riscv-non-isa/rvv-intrinsic-doc#189 Depends on D142016. Reviewed By: kito-cheng Differential Revision: https://reviews.llvm.org/D142085
-
eopXD authored
This patch works towards the simplification proposal [0] of Nick Knight. After this patch, we have reduced the hierarchy of intrinsics from two sets (non-policy and policy) into a single set, with a general assumption that policy behavior is agnostic unless specified. [0] https://gist.github.com/nick-knight/6cb0b74b351a25323dfb1821d3a269b9 Pull Request: riscv-non-isa/rvv-intrinsic-doc#186. Depends on D141796. Reviewed By: craig.topper, kito-cheng Differential Revision: https://reviews.llvm.org/D142016
-
eopXD authored
The object is now correct by construction. This is the 15th commit of a patch-set that aims to change the default policy for RVV intrinsics from TAMU to TAMA. Please refer to the cover letter in the 1st commit (D141573) for an overview. Depends on D141793. Reviewed By: craig.topper Differential Revision: https://reviews.llvm.org/D141796
-
- Feb 03, 2023
-
-
Iain Sandoe authored
This addresses part of https://github.com/llvm/llvm-project/issues/60079 The test for external functions was not considering function templates. Differential Revision: https://reviews.llvm.org/D142704 (cherry picked from commit cdd44e2c)
-
David Green authored
Currently negative architecture features passes to clang like -Xclang -target-feature -Xclang -v9.3a will end up _enabling_ dependant target features (like FEAT_MOPS). This patch fixes that by ensuring we don't enable dependant target features when !Enabled. Fixes #60375 Differential Revision: https://reviews.llvm.org/D142963
-
Aaron Ballman authored
0a51bc73 added a new API to libclang but forgot to bump the minor version number. There is no reasonable way to test this change, hence the lack of test coverage. (cherry picked from commit 79571aa2)
-
Shilei Tian authored
Fix #60248. Reviewed By: jhuber6 Differential Revision: https://reviews.llvm.org/D142819
-
- Feb 02, 2023
-
-
Erich Keane authored
As came up in the discussion on https://reviews.llvm.org/rG12cb1cb3720de8d164196010123ce1a8901d8122 We were asserting because the attempt to print a note found that our source range for a immediately declared constraint (as a part of Parameter Mapping Substitution) wasn't in order. However, it doesn't really make sense to have the location of this be the whole list of template arguments, as that would result in the range being: bool func(std::thing<char*> auto foo) {} ^^^^^^^^^^^^^^^ Even if done correctly. Instead, this patch makes the range be just 'foo' in this case (or a pointer right after 'auto' if unnamed). (cherry picked from commit 42e371b1)
-
Jonas Paulsson authored
Reviewed By: Ulrich Weigand Differential Revision: https://reviews.llvm.org/D142987
-
- Feb 01, 2023
-
-
Hans Wennborg authored
This caused Chromium to crash, see comment on the code review. > Currently both calling conventions preserve registers that are used to > store a return value. This causes the returned value to be lost: > > define i32 @bar() { > %1 = call preserve_mostcc i32 @foo() > ret i32 %1 > } > > define preserve_mostcc i32 @foo() { > ret i32 2 > ; preserve_mostcc will restore %rax, > ; whatever it was before the call. > } > > This contradicts the current documentation (preserve_allcc "behaves > identical to the `C` calling conventions on how arguments and return > values are passed") and also breaks [[clang::preserve_most]]. > > This change makes CSRs be preserved iff they are not used to store a > return value (e.g. %rax for scalars, {%rax:%rdx} for __int128, %xmm0 > for double). For void functions no additional registers are > preserved, i.e. the behaviour is backward compatible with existing > code. > > Differential Revision: https://reviews.llvm.org/D141020 This reverts commit 0276fa89. (cherry picked from commit faac9f21) -
Ivan Kosarev authored
https://reviews.llvm.org/D142405 made this function relying on the LLVM_NATIVE_ARCH be defined, which is not necessarily the case for third-party projects that include LLVM as their part. Reviewed By: beanz Differential Revision: https://reviews.llvm.org/D142610 (cherry picked from commit 2e315305)
-
Konstantin Varlamov authored
Reviewed By: #libc, ldionne, tstellar Differential Revision: https://reviews.llvm.org/D142873
-
- Jan 31, 2023
-
-
Fangrui Song authored
-
- Jan 28, 2023
-
-
Tom Stellard authored
This reverts commit b67c16ff.
-
Joseph Huber authored
The `OpenMPOpt` pass contains optimizations that generate new calls into the OpenMP runtime. This causes problems if we are in a state where the runtime has already been linked statically. Generating these new calls will result in them never being resolved. We should indicate if we are in a "post-link" LTO phase and prevent OpenMPOpt from generating new runtime calls. Generally, it's not desireable for passes to maintain state about the context in which they're called. But this is the only reasonable solution to static linking when we have a pass that generates new runtime calls. Reviewed By: jdoerfert Differential Revision: https://reviews.llvm.org/D142646 (cherry picked from commit 0bdde9df)
-
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)
-