Commit Graph

520475 Commits

Author SHA1 Message Date
Schrodinger ZHU Yifan
e6cf5d2863 Reapply "[libc][windows] start time API implementation (#117775)" (#118886) 2024-12-05 18:21:03 -05:00
Congcong Cai
63dfe70b22 [clang-tidy][NFC] move AST_MATCHER to anonymous namespace in InfiniteLoopCheck (#118820) 2024-12-06 06:46:03 +08:00
Maryam Moghadas
68e75eebec [PPC] Custom lower ssubo for i64 (#118711)
This is a follow-up patch to improve the codegen for ssubo node for i64
in 64-bit mode by custom lowering.
2024-12-05 17:22:44 -05:00
Sergei Barannikov
426aecb7e9 [libunwind] Fix a typo in debug print (#118856) 2024-12-06 01:22:14 +03:00
Nick Desaulniers
7329086d4e [libc][docs] stub out assert, errno, and locale (#118852)
[libc][docs] stub out assert, errno, and locale

These were the remaining c89 library headers (besides string.h and
stdlib.h; I
will split strings.rst in a follow up commit).

The macro support detection in docgen doesn't quite work for some of
these
headers. Add the stubs for these headers for now, and fix up docgen
later.

See the "NIST publication":
Link: https://www.open-std.org/jtc1/sc22/wg14/www/projects.html
2024-12-05 14:20:03 -08:00
Nick Desaulniers
a9aff440d9 [libc][docs] reorganize documentation (#118836)
This commit does a few things:
* creates libc/docs/headers/ and moves all user API related headers under it.
* updates paths and docgen
* updates the top level index to put these headers under a new "Implementation
  Status" tab.
* rename some of the files to be foo.rst for foo.h (except strings, which is
  currently a mix of string.h and stdlib.h)
* update the heading of some files to be in the form foo.h.
2024-12-05 13:54:09 -08:00
Owen Anderson
cfa582e8aa SimplifyLibCalls: Use default globals address space when building new global strings. (#118729)
Writing a test for this transitively exposed a number of places in
BuildLibCalls where
we were failing to propagate address spaces properly, which are
additionally fixed.
2024-12-06 10:51:14 +13:00
Vitaly Buka
6f21401ae9 Remove fixme about BFD and Android
Follow up to #118858
2024-12-05 13:23:50 -08:00
Kazu Hirata
dbd920b290 Reapply [memprof] Update YAML traits for writer purposes (#118720)
For Frames, we prefer the inline notation for the brevity.

For PortableMemInfoBlock, we go through all member fields and print
out those that are populated.

This iteration works around the unavailability of
ScalarTraits<uintptr_t> on macOS.
2024-12-05 13:19:19 -08:00
Tristan Ross
3a7d1b5c16 [libc] Include CheckCXXCompilerFlag when checking compiler features (#118862)
Includes `CheckCXXCompilerFlag` so when building LLVM libc is built
standalone, it actually works and doesn't complain about
`check_cxx_compiler_flag` not being defined.
2024-12-05 15:12:36 -06:00
Owen Anderson
698d832185 DataLayout: Fix latent issues with getMaxIndexSizeInBits (#118740)
Because it was implemented in terms of getMaxIndexSize, it was always
rounding the values up to a multiple of 8. Additionally, it was using
the PointerSpec's BitWidth rather than its IndexBitWidth, which was
self-evidently incorrect.

Since getMaxIndexSize was only used by getMaxIndexSizeInBits, and its
name and function seem niche and somewhat confusing, go ahead and remove
it until a concrete need for it arises.
2024-12-06 10:01:59 +13:00
Craig Topper
1d3f9f8862 [SelectionDAG] Stop storing EVTs in a function scoped static std::set. (#118715)
EVTs potentially contain a Type * that points into memory owned by an
LLVMContext. Storing them in a function scoped static means they may
outlive the LLVMContext they point to.

This std::set is used to unique single element VT lists containing a
single extended EVT. Single element VT list with a simple EVT are
uniqued by a separate cache indexed by the MVT::SimpleValueType enum. VT
lists with more than one element are uniqued by a FoldingSet owned by
the SelectionDAG object.

This patch moves the single element cache into SelectionDAG so that it
will be destroyed when SelectionDAG is destroyed.

Fixes #88233
2024-12-05 12:56:36 -08:00
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 0adff0af20.

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 51a5b77b57 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