| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When lowering predicate permute builtins we incorrectly assume only
the typically "active" bits for the specified element type play a
role with all other bits zero'd. This is not the case because all
bits are significant, with the element type specifying how they
are grouped:
b8 - permute using a block size of 1 bit
b16 - permute using a block size of 2 bits
b32 - permute using a block size of 4 bits
b64 - permute using a block size of 8 bits
The affected builtins are svrev, svtrn1, svtrn2, svuzp1, svuzp2,
svzip1 and svzip2.
This patch adds new intrinsics to support these operations and
changes the builtin lowering code to emit them. The b8 case remains
unchanged because for that operation the existing intrinsics work
as required and their support for other predicate types has been
maintained as useful if only as a way to test the correctness of
their matching ISD nodes that code generation relies on.
Differential Revision: https://reviews.llvm.org/D142065
(cherry picked from commit 26b79ca3fafc525225090646d42837368b3763c3)
|
|
|
|
|
|
|
|
|
|
|
| |
This is an alternative to D141074 to fix the problem by adjusting
the precision control dynamically.
Reviewed By: icedrocket
Differential Revision: https://reviews.llvm.org/D142178
(cherry picked from commit 11fb09ec0afa8620bba44f374763e2ad64332e2e)
|
|
|
|
|
|
|
|
|
|
| |
Indexed profiles already have a sorted and uniqued binary ID list, and
due to this, duplicates are harmless in the list of binary IDs found,
since it's set_differenced from the list in the indexed profile.
Differential Revision: https://reviews.llvm.org/D136702
(cherry picked from commit 0a51eeda1ef43d0f9a73ed2ac15f602262943ea1)
|
|
|
|
|
|
| |
Differential Revision: https://reviews.llvm.org/D136702
(cherry picked from commit 0eb01a9c4581a24c163f3464cebdb20534fbda35)
|
|
|
|
|
|
| |
Differential Revision: https://reviews.llvm.org/D136702
(cherry picked from commit 9977b65ae240b2cc0dc512fe488b0063e51a517b)
|
|
|
|
|
|
|
|
| |
Reviewed By: gulfem
Differential Revision: https://reviews.llvm.org/D136702
(cherry picked from commit a3b0dde4edb93248f74d86c63b0ae108854004e6)
|
|
|
|
|
|
|
|
| |
Reviewed By: kstoimenov
Differential Revision: https://reviews.llvm.org/D142561
(cherry picked from commit 3348699221339870d668930171e9fd58a60acc89)
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The constexpr validation parsed parts of the format string that didn't
belong to the specific replacement field.
Fixes https://llvm.org/PR60536
Reviewed By: #libc, ldionne
Differential Revision: https://reviews.llvm.org/D143402
(cherry picked from commit ac44dadcbea52e14aab20c0d590d4ec00d615a93)
|
|
|
|
| |
(cherry picked from commit e302c04cfa10908858401a4845d6a9c773d6735f)
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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 f1c4f927f7c15b5efdc3589c050fd0513bf6b303)
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
(cherry picked from commit 140bc411b245260680d90fd981635317b261ef0e)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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 f85a9a6452e8f49f9768d66a86434a88a5891614)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
According to the IR verifier, "Declaration[s] may not be in a Comdat!"
This is a re-commit of 76b3f0b4d5a0b8c54147c4c73a30892bbca76467 and
87d7838202267a011639fcbf97263556ccf091dc 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 50ca8b3e8726180a74fcbc4611893f19189b97c0)
|
|
|
|
|
|
|
|
|
|
|
| |
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 578d507359c6b4ad44f10dc6da6d8328e9743f31)
|
|
|
|
|
|
|
|
|
| |
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 18a2975b57830a231e2b8f0299969edfc4f8477c)
|
|
|
|
|
|
|
|
|
|
|
|
| |
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 a51ad873bfc9f3ccf7971efce4c5f0a543ee3d5a)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
`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 8d2d8e022e3c709a17b97d351b529e40ac28f4df)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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 08c915fa76ef91efa16df0676ed69e4fb360989f)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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 9c4591d7f3acaa00318900bdba4b4ba26c99c666)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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 8998fa6c14f1e19957858aa0e4b592d62ae56041)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
mbrtoc8() are present.
When support for declaring the c8rtomb() and mbrtoc8() functions within the
std namespace was added in commit 7e7013c5d4b1b3996c8dba668c5a94bb33b2999b,
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 cf93a3dd512e4912181f05790992c760378c8893)
|
|
|
|
|
|
|
| |
As pointed out by maskray.
Fixes: 8ab762557fb057af1a3015211ee116a975027e78
(cherry picked from commit ca50897a763c7dd0ec7c9b3ec003eeca802c5525)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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: 52ce6776cf98e993c6ec04ae54b52e1354fff917
See: 136f77805fd89cd30e69b3d1204fbf7efedd9a12
Closes: https://github.com/llvm/llvm-project/issues/60394
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D143322
(cherry picked from commit 8ab762557fb057af1a3015211ee116a975027e78)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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 e685bde1e0b0dcfeb1619b434a5dce3c755b9631)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- 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 0eff46f87f16772f93bdc584865e945162aff170)
|
|
|
|
|
|
|
|
|
| |
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 c32022ad260aa1e6f485c5a6820fa9973f3b108e)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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 5cd554303ead0f8891eee3cd6d25cb07f5a7bf67)
|
|
|
|
| |
(cherry picked from commit 003f2b379d52832171eaa6272e3a2b1cabcd6f4e)
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The patch
430b397f6715d4d2f2569716c93fcd6292ace3dc ("[libc++] Granularize <type_traits> includes in <iterator>") missed some exports in the modulemap with became apparent in the reverting commit 12cb1cb3720d.
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 a7f8ddc4e2e3dac4c123ed8db1704f2753db5722)
|
|
|
|
|
|
|
|
|
| |
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 c2b3986e39bc812806ef25684c57609798e00513)
|
|
|
|
|
|
| |
Reviewed By: asb
Differential Revision: https://reviews.llvm.org/D142094
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
and vsetvlmax
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
| |
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 cdd44e2c85542d152aef19cfd1d2ad451d774935)
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
| |
0a51bc731bcc2c27e4fe97957a83642d93d989be 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 79571aa2103c95760a07e3549d8636379e4948f0)
|
|
|
|
|
|
|
|
| |
Fix #60248.
Reviewed By: jhuber6
Differential Revision: https://reviews.llvm.org/D142819
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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 42e371b174d4407ec5805010c2ecfef9c086b5c2)
|
|
|
|
|
|
| |
Reviewed By: Ulrich Weigand
Differential Revision: https://reviews.llvm.org/D142987
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
CCs"
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 0276fa89d7a4dbe73105c9148f947716b3d8f17f.
(cherry picked from commit faac9f215962982bdbc613e15715822568204203)
|
|
|
|
|
|
|
|
|
|
|
|
| |
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 2e3153059c268700d4b399a8cbba28e9c2514e09)
|
|
|
|
|
|
| |
Reviewed By: #libc, ldionne, tstellar
Differential Revision: https://reviews.llvm.org/D142873
|
| |
|
|
|
|
| |
This reverts commit b67c16ff6af557174e498d6d82df9936e333f3d6.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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 0bdde9dfb9b1dbfabee147c196db820e1f5dca1f)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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 6185246f4f62345d0cfdaef62da7e15b01d52557)
|