520563 Commits

Author SHA1 Message Date
Louis Dionne
2393ab65ed
[libc++] Fix unintended ABI break in associative containers with reference comparators (#118685)
While reference comparators are a terrible idea and it's not entirely
clear whether they are supported, fixing the unintended ABI break is
straightforward so we should do it as a first step.

Fixes #118559
2024-12-05 15:56:00 -05:00
Alex MacLean
6018820c48
[NVPTX] Fix lowering of i1 SETCC (#115035)
Add DAG legalization support for expanding i1 SETCC nodes using
appropriate logical operations to simulate integer comparisons. Use
these expansions to handle i1 SETCC in NVPTX.

fixes #58428 and #57405
2024-12-05 12:54:24 -08:00
Louis Dionne
e84f79e925 [libc++][docs] Use --show-all in the sample command-line to run benchmarks
It's really not useful at all to run benchmarks without --show-all since
you don't get the benchmark output. And since --show-all is the suggested
default way to run benchmarks, it's not necessary anymore to mention it
right below.
2024-12-05 15:52:02 -05:00
Luke Quinn
22774bbea1
[RISCV][GISel] Add Zfa FP legalization and full tests for 9 insn (#118723)
ceil, floor, round, roundeven, trunc, rint, nearbyint, maximum, minimum.
2024-12-05 12:49:07 -08:00
Peng Liu
a821937b6d
[libc++][test] Refactor increasing_allocator (#115671)
The increasing_allocator<T> class, originally introduced to test shrink_to_fit()
for std::vector, std::vector<bool>, and std::basic_string, has duplicated
definitions across several test files. Given the potential utility of this
class for capacity-related tests in various sequence containers, this patch
refactors the definition of increasing_allocator<T> into a single, reusable
location.
2024-12-05 15:44:05 -05:00
Joseph Huber
9fd052a122 Revert "[libc][windows] start time API implementation (#117775)"
This reverts commit 0adff0af20c7d9bae8bd8bdf402506c10369ead1.

Breaks the GPU build
2024-12-05 14:43:06 -06:00
Vitaly Buka
0550480fe6
Disable test broken by #117624 (#118858)
The test fails after #117624
https://lab.llvm.org/buildbot/#/builders/186/builds/4581
2024-12-05 12:33:50 -08:00
Mateusz Mikuła
8a6f1abe16
[LLD] [COFF] Print a warning when using /dependentloadflag without load config (#117400)
As per request in https://github.com/llvm/llvm-project/pull/113814.
2024-12-05 22:28:38 +02:00
Kareem Ergawy
c54616ea48
Revert "[OpenMP][OMPIRBuilder] Add delayed privatization support for wsloop (#118463)" (#118848) 2024-12-05 20:49:13 +01:00
Philip Reames
66a0a08133
[RISCV] Extract spread(2,4,8) shuffle lowering from interleave(2) (#118822)
This is a prep patch for improving spread(4,8) shuffles. I also think it
improves the readability of the existing code, but the primary
motivation is simply staging work.
2024-12-05 11:32:27 -08:00
Aaron Ballman
91354fb146
[C++20] Destroying delete can cause a type to be noexcept when deleting (#118687)
Given a `noexcept` operator with an operand that calls `delete`, Clang
was not considering whether the selected `operator delete` function was
a destroying delete or not when inspecting whether the deleted object
type has a throwing destructor. Thus, the operator would return `false`
for a type with a potentially throwing destructor even though that
destructor would not be called due to the destroying delete. Clang now
takes the kind of delete operator into consideration.

Fixes #118660
2024-12-05 14:26:33 -05:00
Craig Topper
2214e02378 [RISCV] Fix typos in RISCVVLOptimizer.cpp. NFC 2024-12-05 11:17:55 -08:00
LLVM GN Syncbot
2c397fae28 [gn build] Port 51a5b77b57ab 2024-12-05 19:11:29 +00:00
Schrodinger ZHU Yifan
0adff0af20
[libc][windows] start time API implementation (#117775)
Add a `clock_gettime` emulation layer and use it to implement the `time`
entrypoint.

For windows, the monotonic clock is emulated using `QPC`.
The realtime clock is emulated using `GetSystemTimePreciseAsFileTime`.
2024-12-05 14:08:27 -05:00
Rashmi Mudduluru
51a5b77b57
[Webkit Checkers] Introduce a Webkit checker for memory unsafe casts (#114606)
This PR introduces a new checker
`[alpha.webkit.MemoryUnsafeCastChecker]` that warns all downcasts from a base type to a derived type.

rdar://137766829
2024-12-05 11:01:27 -08:00
erichkeane
cb6a02abe2 [OpenACC] Implement 'worker' clause for combined constructs
This is very similar to 'gang', except with fewer restrictions, and only an
interaction with 'num_workers', plus disallowing 'gang' and 'worker' in
its associated statement.  This patch implements this, the same as how
'gang' implemented it.
2024-12-05 10:43:52 -08:00
Alex Langford
abb6919a63
[lldb] Add additional assertions to TestVTableValue.test_overwrite_vtable (#118719)
If this test fails, you're likely going to see something like "Assertion
Error: A != B" which doesn't really give much explanation for why this
failed.

Instead of ignoring the error, we should assert that it succeeded. This
will lead to a better error message, for example:
`AssertionError: 'memory write failed for 0x102d7c018' is not success`
2024-12-05 10:38:23 -08:00
Chandler Carruth
1e5c1a342e
Make the CHECK lines here resistent to chandlerc (#118736)
Specifically, usernames containing `handle`, such as `chandlerc`, often
end up in paths, including the path of this test file which contains the
word `overflow`. Combined, they create a match for `handle.*overflow` in
the filename on my system (but likely not many others), leading this
test to mysteriously fail for unfortunate usernames like mine. =D

No discussion of the amount of time I spent debugging this please. =[
2024-12-05 10:17:15 -08:00
dklochkov-intel
6b0785390d
[SYCL] Change SYCL version according to standard (#114790)
Version of SYCL was changed according to the latest agreement:
The lower 2 digits are not formally specified, but we plan to use these
to identify the month in which we submit the specification for
ratification, which is similar to the C++ macro __cplusplus.

Since the SYCL 2020 specification was submitted for ratification in
December of 2020, the macro's value is now 202012 for SYCL 2020.
see PR for details 
https://github.com/KhronosGroup/SYCL-Docs/pull/634
2024-12-05 10:16:45 -08:00
Louis Dionne
8ab2730c0a [libc++] Rename test job for restarting preempted jobs 2024-12-05 13:14:07 -05:00
Pravin Jagtap
2469984144
[AMDGPU][NFC] Delete duplicate decl and impl defines. (#118843) 2024-12-05 23:36:39 +05:30
Craig Topper
41c33cbf36 [RISCV][GISel] Enable support for ArrayType arguments if the element type is also supported.
This allows us to handle small coerced structs that are passed as
[2 x i64]. This is one of the last big reasons for -O0 fallbacks
in some of my testing.
2024-12-05 09:42:05 -08:00
wwwatermiao
409edc64d1
[AArch64][SME] Fix bug on SMELd1St1 (#118109)
Patch[1] has update intrinsic interface for ld1/st1, while based on
ARM's document, "If the intrinsic also has a vnum argument, the ZA slice
number is calculated by adding vnum to slice.". But the "vnum" did not
work for our realization now, this patch fix this point.


[1]ee31ba0dd9
2024-12-05 14:39:02 -03:00
Max191
3da843bae1
[mlir] Add ValueBoundsOpInterfaceImpl for scf.forall (#118817)
Adds a ValueBoundsOpInterface implementation for scf.forall ops. The
implementation supports bounding for both induction variables, results,
and block args of the forall op. Induction variables are given upper and
lower bounds based on the lower and upper loop bounds, and dimensions of
the results and init block arguments are constrained to be equal to the
matching dims of the shared_outs operand.

Signed-off-by: Max Dawkins <maxdawkins19@gmail.com>
Co-authored-by: Max Dawkins <maxdawkins19@gmail.com>
2024-12-05 09:37:08 -08:00
Slava Zakharin
cc46d0bee9
[flang] Expand SUM(DIM=CONSTANT) into an hlfir.elemental. (#118556)
An array SUM with the specified constant DIM argument
may be expanded into hlfir.elemental with a reduction loop
inside it processing all elements of the specified dimension.
The expansion allows further optimization of the cases like
`A=SUM(B+1,DIM=1)` in the optimized bufferization pass
(given that it can prove there are no read/write conflicts).
2024-12-05 09:36:12 -08:00
Slava Zakharin
3f0cc068ce
[flang] Assume matching shapes in elemental assignment with non-realloc lhs. (#118552)
The optimized bufferization pass cannot optimize very simple cases of
elemental
assignments, because of the suboptimal checks order. This patch relies
on the fact that in a legal program the lhs and rhs of an assignment
have matching shapes, when lhs is not an allocatable and rhs is a result
of an elemental array operation.
2024-12-05 09:34:32 -08:00
Pravin Jagtap
b8c4fb00e6
[AMDGPU] Add hazard tests for cvt scale of fp4. (#118813) 2024-12-05 23:02:23 +05:30
John Harrison
0964328c29
[lldb] Fix the SocketTest failure on unsupported hosts (#118673)
The test `SocketTest::TCPListen0MultiListenerGetListeningConnectionURI`
is failing on hosts that do not map `localhost` to both an ipv4 and ipv6
address. For example this build
https://lab.llvm.org/buildbot/#/builders/195/builds/1909.

To fix this, I added a helper to validate if the host has an /etc/hosts
entry for both ipv4 and ipv6, otherwise we skip the test.
2024-12-05 09:08:17 -08:00
Schrodinger ZHU Yifan
245f26a3d3
[libc] revert all process_mrelease changes (#118650)
Revert as its test is unstable.
https://github.com/llvm/llvm-project/issues/118057
2024-12-05 11:58:37 -05:00
Valentin Clement (バレンタイン クレメン)
83ccaad473
[flang][cuda] Use async id for device stream allocation (#118733)
When stream is specified use cudaMallocAsync with the specified stream
2024-12-05 08:57:10 -08:00
Luke Lau
b6c0f1bfa7
[RISCV] Clear vill for whole vector register moves in vsetvli insertion (#118283)
This is an alternative to #117866 that works by demanding a valid vtype
instead of using a separate pass.

The main advantage of this is that it allows coalesceVSETVLIs to just
reuse an existing vsetvli later in the block.

To do this we need to first transfer the vsetvli info to some arbitrary
valid state in transferBefore when we encounter a vector copy. Then we
add a new vill demanded field that will happily accept any other known
vtype, which allows us to coalesce these where possible.

Note we also need to check for vector copies in computeVLVTYPEChanges,
otherwise the pass will completely skip over functions that only have
vector copies and nothing else.

This is one part of a fix for #114518. We still need to check if there's
other cases where vector copies/whole register moves that are inserted
after vsetvli insertion.
2024-12-06 00:48:05 +08:00
Kazu Hirata
bda02096d3
[ProfileData] Add InstrProfWriter::writeBinaryIds (NFC) (#118754)
The patch makes InstrProfWriter::writeImpl less monolithic by adding
InstrProfWriter::writeBinaryIds to serialize binary IDs.  This way,
InstrProfWriter::writeImpl can simply call the new function instead of
handling all the details within writeImpl.
2024-12-05 08:39:27 -08:00
Nick Desaulniers
fdb90cef75
[libc][docgen] update to POSIX.1-2024 (#118717)
The recently ratified POSIX.1-2024 is newer than POSIX.1-2017.
2024-12-05 08:23:40 -08:00
Brox Chen
e7412a5035
[AMDGPU][True16][CodeGen] uaddsat/usubsat sdag for true16 format (#118708)
uaddsat and usubsat SDAG codeGen pattern for True16 format witth
V_ADD/SUB_NC_U16
2024-12-05 11:02:53 -05:00
Maurice Heumann
27eaa8a40e
[InstCombine] Prevent infinite loop with two shifts (#118806)
The following pattern: `(C2 << X) << C1` will usually be transformed
into `(C2 << C1) << X`, essentially swapping `X` and `C1`.

However, this should only be done when `C1` is an immediate constant,
otherwise thiscan lead to both constants being swapped forever.

This fixes #118798.
2024-12-05 16:57:27 +01:00
Krzysztof Parzyszek
8a90b5b317 [flang][test] Change re.I to flags=re.I in re.sub
Follow-up to da6099c9ad. As a positional argument, the `re.I` was in
place of `count`, not `flags`.
2024-12-05 09:41:40 -06:00
Michael Maitland
34a076c46f
[RISCV][NFC] Don't set UnrollAndJamInnerLoopThreshold in getUnrollingPreferences (#118572)
This has no effect since its the default value used in
llvm::gatherUnrollingPreferences.
2024-12-05 10:41:19 -05:00
David CARLIER
97fd435eea
[rtsan] intercept accept4 syscall. (#117278) 2024-12-05 07:37:26 -08:00
Chris White
d457100a81
[Clang] Fix -Wunused-private-field false negative with defaulted comparison operators (#116871)
Fix -Wunused-private-field incorrectly suppressing warnings for friend
defaulted comparison operators. The warning should only be suppressed
when the defaulted comparison is a class member function.

Fixes #116270
2024-12-05 16:32:48 +01:00
Zahira Ammarguellat
f59b600c21
[NFC] Complete proper copying and resource cleanup in classes. (#118655)
Provide, where missing, a copy constructor, a copy assignment operator
or a destructor to prevent potential issues that can arise.
2024-12-05 10:16:51 -05:00
Nikita Popov
2bd3174226 [SCCP] Add tests for gep nuw inference (NFC) 2024-12-05 16:10:13 +01:00
Nikita Popov
d09632ba81
[InstCombine] Remove nusw handling in ptrtoint of gep fold (NFCI) (#118804)
Now that #111144 infers gep nuw, we no longer have to repeat the
inference in this fold.
2024-12-05 15:59:35 +01:00
Kai Nacke
3bd3fa6428
[NFC][SystemZ] Use SExt for signed constants (#118803)
Use SExt instead of ZExt in XForms which produce a signed value. This is
only to make it clear that the XForm handles a signed value.
2024-12-05 09:49:37 -05:00
Mikhail R. Gadelha
59a9e4d8a4
[RISCV] Update matchSplatAsGather to convert vectors if they have different sizes (#117878)
This patch updates the matchSplatAsGather function so we can handle vectors of different sizes. The goal is to improve the code gen for @llvm.experimental.vector.match on RISCV.

Currently, we use a scalar extract and splat instead of vrgather, and the patch changes that.
2024-12-05 11:47:02 -03:00
Samira Bazuzi
f7e8be7c66
Skip escaped newlines before checking for whitespace in Lexer::getRawToken. (#117548)
The Lexer used in getRawToken is not told to keep whitespace, so when it
skips over escaped newlines, it also ignores whitespace, regardless of
getRawToken's IgnoreWhiteSpace parameter. 

Instead of letting this case fall through to lexing, check
for whitespace after skipping over any escaped newlines.
2024-12-05 09:37:46 -05:00
erichkeane
3a4b9f3891 [OpenACC] Implement 'gang' clause for Combined Constructs
This one is a bit complicated, as it has some interesting interactions,
as 'gang' Sema is required to look at its containing compute construct.
Except in the case of a combined construct, they are the same. This
resulted in a large refactor of the checking code for CheckGangExpr,
plus some additional work on the diagnostics for its interaction with
'num_gangs' and 'vector'/'worker'.
2024-12-05 06:35:36 -08:00
Nikita Popov
707e08917d [LoopVectorize] Restore cost check lines in test (NFC)
Accidentally dropped these while updating the test.
2024-12-05 15:24:44 +01:00
Nikita Popov
f7685af4a5 [InstCombine] Move gep of phi fold into separate function
This makes sure that an early return during this fold doesn't end
up skipping later gep folds.
2024-12-05 15:20:56 +01:00
Pravin Jagtap
d25d040541
[AMDGPU][NFC] Autogenerate gfx950 hazard tests. (#118794) 2024-12-05 19:43:18 +05:30
Ilya Biryukov
f1d81dbd05
[ASTWriter] Do not allocate source location space for module maps used only for textual headers (#116374)
This is a follow up to #112015 and it reduces the unnecessary
duplication of source locations further.

We do not need to allocate source location space in the serialized PCMs
for module maps used only to find textual headers. Those module maps are
never referenced from anywhere in the serialized ASTs and are re-read in
other compilations.
This change should not affect correctness of Clang compilations or
clang-scan-deps in any way.

We do need the InputFile entry in the serialized AST because
clang-scan-deps relies on it. The previous patch introduced a mechanism
to do exactly that.

We have found that to finally remove any duplication of module maps we
use internally in our build system.
2024-12-05 15:08:38 +01:00