- Feb 08, 2023
-
-
Jonas Hahnfeld authored
(cherry picked from commit e302c04c)
-
Jonas Hahnfeld authored
The Language Reference says that aliases can have available_externally linkage if their aliasee is an available_externally global value. Using this kind of aliases resulted in crashes during code generation, filter them out (the same that the AsmPrinter also filters out GlobalVariables in emitSpecialLLVMGlobal(); Functions are discarded in the machine pass infrastructure). Differential Revision: https://reviews.llvm.org/D142352 (cherry picked from commit f1c4f927)
-
Joseph Huber authored
Summary: The logic here is to add the `.cubin` temporary file if we had to create a new filename to handle it. Unfortuantely the logic was wrong because we compare `const char *` values here. This logic seems to have been wrong for some time, but was never noticed since we never used the relocatable output.
-
Krzysztof Parzyszek authored
(cherry picked from commit 140bc411)
-
- Feb 07, 2023
-
-
Bill Wendling authored
If a struct/enum type used in a record doesn't have a forward decl / def, an implicit one is injected into the struct. This stops clang from randomizing the structure in some situations---i.e. when the struct contains only function pointers. So we accept forward decls so they don't prevent randomization. Fixes 60349 Reviewed By: MaskRay, nickdesaulniers Differential Revision: https://reviews.llvm.org/D143300 (cherry picked from commit f85a9a64)
-
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.
-