508358 Commits

Author SHA1 Message Date
Joseph Huber
101acff2e5
[libc] Define 'size_t' in time.h and uchar.h (#103441)
Summary:
The standard says the following: The <time.h> header shall define the
clock_t, size_t, time_t, types as described in <sys/types.h>. I couldn't
find one for `uchar.h` but it needs it once we define things like
`mbrtoc8`.
2024-08-13 16:02:43 -05:00
Joseph Huber
6cd37eb5de
[libc] Fix INFINITY being defined as a double (#103445)
Summary:
If the implementation supports floating-point infinities, the macro
INFINITY expands to constant expression of type float which evaluates to
positive or unsigned infinity.

Currently this is a double, this makes it a float.
2024-08-13 16:02:18 -05:00
Louis Dionne
3bda18e482 [libc++] Add status-tracking CSV file update to git-blame-ignore-revs 2024-08-13 17:01:21 -04:00
Louis Dionne
99c5615f5f [libc++][NFC] Add missing separators in status-tracking CSV files 2024-08-13 17:01:21 -04:00
Steven Wu
29314b4b27 Revert "[CMake] Fix DynamicLibraryTests exports symbol when plugins are enabled (#102941)"
This reverts commit a9604cd3212beb6cdb41a79f248723140ab9939d.

The export list in unit-tests will break sanitizer build since that
requires more symbols than listed in the export file.
2024-08-13 13:59:12 -07:00
Louis Dionne
e80bc77774 [libc++] Normalize how we track the meeting at which a paper of LWG issue was voted
This uses the same values as we use in the Github project that tracks
Standards conformance.
2024-08-13 16:58:24 -04:00
Craig Topper
7ec9fa0373 [RISCV][GISel] Group the vector load/store legalizer actions together. 2024-08-13 13:49:19 -07:00
Louis Dionne
29e51f827b
[libc++] Simplify the implementation of LWG2762 (noexcept for unique_ptr) (#102032)
I had originally made some comments in https://reviews.llvm.org/D128214
that were followed when we implemented LWG2762. I don't understand why I
made these comments anymore, but either way it seems like I was wrong
since using `unique_ptr<void>::operator*` should be ill-formed. All
other implementations also make that ill-formed.
2024-08-13 16:18:01 -04:00
Joseph Huber
ad6558c334
[runtimes] Fix not correctly searching target builtins directories (#103311)
Summary:
Enabling `compiler-rt` only worked previously if we had it in the
default target. This is because we didn't extract the path carefully.
This patch fixes that by getting the correct path and appending it,
instead of just the project name.
2024-08-13 14:47:08 -05:00
Snehasish Kumar
1ccd7ab8b6
Enhance TLI detection of __size_returning_new lib funcs. (#102391)
Previously the return types of __size_returning_new variants were not
validated based on their members. This patch checks the members
manually, also generalizes the size_t checks to be based on the module
instead of being hardcoded. 

As requested in followup comment on
https://github.com/llvm/llvm-project/pull/101564.
2024-08-13 12:44:10 -07:00
Owen Pan
ee2359968f
[clang-format] Fix annotation of braces enclosing stringification (#102998)
Fixes #102937.
2024-08-13 12:39:33 -07:00
Michael Buch
28050e1b0b
[lldb][DWARFASTParser] Don't pass CompilerType by non-const reference in the DWARFASTParserClang APIs (#103245)
The `CompilerType` is just a wrapper around two pointers, and there is
no usage of the `CompilerType` where those are expected to change
underneath the caller.

To make the interface more straightforward to reason about, this patch
changes all instances of `CompilerType&` to `const CompilerType&` around
the `DWARFASTParserClang` APIs.

We could probably pass these by-value, but all other APIs don't, and
this patch just makes the parameter passing convention consistent with
the rest of the file.
2024-08-13 20:04:18 +01:00
Alexis Engelke
5b40a05d8f
[InstCombine] Don't look at ConstantData users
When looking at PHI operand for combining, only look at instructions and
arguments. The loop later iteraters over Arg's users, which is not
useful if Arg is a constant -- it's users are not meaningful and might
be in different functions, which causes problems for the dominates()
query.

Pull Request: https://github.com/llvm/llvm-project/pull/103302
2024-08-13 20:44:45 +02:00
Craig Topper
51bad732dc [SelectionDAG] Replace EVTToAPFloatSemantics with MVT/EVT::getFltSemantics. (#103001) 2024-08-13 11:35:28 -07:00
Craig Topper
ae466a61d3 [SelectionDAG] Add getFltSemantics to MVT and EVT. NFC
This will be used to replace SelectionDAG::EVTToAPFloatSemantics

A similar method exists in IR's Type class.
2024-08-13 11:35:27 -07:00
Tulio Magno Quites Machado Filho
0aa22dcd2f
[OpenMP][AArch64] Fix branch protection in microtasks (#102317)
Start __kmp_invoke_microtask with PACBTI in order to identify the
function as a valid branch target. Before returning, SP is
authenticated.
Also add the BTI and PAC markers to z_Linux_asm.S.

With this patch, libomp.so can now be generated with DT_AARCH64_BTI_PLT
when built with -mbranch-protection=standard.

The implementation is based on the code available in compiler-rt.
2024-08-13 15:34:41 -03:00
Helena Kotas
2c8bd4a729
[HLSL] Mark exported functions with "hlsl.export" attribute (#102275)
Marks exported functions with `"hlsl.export"` attribute. This
information will be later used by DXILFinalizeLinkage pass (coming soon)
to determine which functions should have internal linkage in the final
DXIL code.

Related to #llvm/llvm-project#92071
2024-08-13 11:09:36 -07:00
Yitzhak Mandelbaum
661dda9df1
[clang] Add frontend flag to enable support for broken external resugarers (#103219)
Forked from https://github.com/llvm/llvm-project/pull/102510 by
[mizvekov](https://github.com/mizvekov). Changes are captured as a fixup
commit.

There are some external projects that can't rely on our own sugar
propagation for templated entities, because they need to resugar types
which only exist within their framework, and so are entirely invisible
to our internal tooling.

This new flag is meant to prevent our transforms from removing any
Subst*
nodes.

For this, this is wired only to template type alias subsititutions.

Note that our AST does represent enough information to correctly
resugar template type alias, so any users of this are limited in their 
capacity to reconstruct the parameter substitutions fully.

---------

Co-authored-by: Matheus Izvekov <mizvekov@gmail.com>
2024-08-13 14:03:34 -04:00
Matt Arsenault
edded8d7b5
AMDGPU: Stop handling legacy amdgpu-unsafe-fp-atomics attribute (#101699)
This is now autoupgraded to annotate atomicrmw instructions in
old bitcode.
2024-08-13 22:02:25 +04:00
Mircea Trofin
6807ca8e93
[nfc][ctx_prof] Use one flag for the "use" scenario (#103377)
No need to have two flags, one for the thinlink and one for compilation.
2024-08-13 11:00:51 -07:00
Igor Kudrin
494eec0255
[lldb][NFCI] Simplify ProcessElfCore::GetAuxvData() (#102263)
There is no need to clone the content and set extraction properties
because `m_auxv` is already in the required form.
2024-08-13 10:55:28 -07:00
vporpo
00a4042212
[SandboxIR] Implement AtomicCmpXchgInst (#102710)
This patch implements sandboxir::AtomicCmpXchgInst which mirrors
llvm::AtomiCmpXchgInst.
2024-08-13 10:24:12 -07:00
Craig Topper
f58f92c213
[SelectionDAG] Move SelectionDAG::getAllOnesConstant out of line. NFC (#102995)
This function has to get the scalar size and create an APInt. I don't
think it belongs inline.
2024-08-13 10:15:16 -07:00
Craig Topper
dbe8a10c06
[TypePromotion] Use return value from SmallPtrSet::insert to avoid a call to SmallPtrSet::count. NFC (#103008) 2024-08-13 10:14:07 -07:00
Sergei Barannikov
b1aa0b0b88
[DataLayout] Remove clear and reset methods (NFC) (#102993)
`clear` was never necessary as it is always called on a fresh instance
of the class or just before freeing an instance's memory. `reset` is
effectively the same as the constructor.

Pull Reuquest: https://github.com/llvm/llvm-project/pull/102993
2024-08-13 20:10:35 +03:00
Steven Wu
f0ef1d3bae
[CompilerRT][Darwin] Silence the warnings for deprecated APIs (#102977)
Silence deprecated API warnings in compiler-rt on Darwin platforms.
2024-08-13 09:57:25 -07:00
Steven Wu
a9604cd321
[CMake] Fix DynamicLibraryTests exports symbol when plugins are enabled (#102941)
Exporting symbols from tools directory never worked with
`LLVM_EXPORT_SYMBOLS_FOR_PLUGINS=On`. When that options is on, only
symbols from the static library is linked is exported due to the export
symbols computation script. DynamicLibraryTests needs to export a symbol
from the tools/executable directory, so update it to use export list
instead.
2024-08-13 09:56:02 -07:00
Matt Arsenault
80c51fad3b
AtomicExpand: Regenerate baseline checks (#103063) 2024-08-13 20:43:39 +04:00
Adrian Prantl
7e236136ab [lldb] Skip libcxx tests with older versions of clang 2024-08-13 09:43:07 -07:00
OverMighty
b4c4c799ab
[libc][math] Fix missing LIBC_INLINE on exp_range_reduction() function (#103305)
See Buildbot failure:
https://lab.llvm.org/buildbot/#/builders/73/builds/3669.
2024-08-13 18:26:36 +02:00
Joseph Huber
dcc27ea41e
[LinkerWrapper] Always pass -flto if the linker supports it (#102972)
Summary;
Now that we use the linker to do LTO / device linking, we need to inform
the `clang` invocation to use `-flto` so it forwards arguments like
`-On` correctly.
2024-08-13 11:23:55 -05:00
Brox Chen
afd42fb303
[AMDGPU][True16][CodeGen] Support AND/OR/XOR and LDEXP True16 format (#102620)
Support AND/OR/XOR true16 and LDEXP true/fake16 format.

These instructions are previously implemented with fake16 profile.
Fixing the implementation.

Added a RA hint so that when using 16bit register in a 32bit
instruction, try to use the register directly without an extra 16bit
move

---------

Co-authored-by: guochen2 <guochen2@amd.com>
2024-08-13 12:23:39 -04:00
Mosè Giordano
248e885235
[compiler-rt] Define __STDC_FORMAT_MACROS to ensure PRId64 is available (#102980)
In
https://github.com/JuliaPackaging/Yggdrasil/pull/9246#issuecomment-2284894139
we ran into
```
[20:54:03] [ 65%] Building CXX object lib/scudo/standalone/CMakeFiles/RTScudoStandalone.x86_64.dir/timing.cpp.o
[20:54:03] cd /workspace/srcdir/compiler-rt-17.0.6.src/build/lib/scudo/standalone && /opt/bin/x86_64-linux-gnu-libgfortran5-cxx11/x86_64-linux-gnu-g++ --sysroot=/opt/x86_64-linux-gnu/x86_64-linux-gnu/sys-root/  -I/workspace/srcdir/compiler-rt-17.0.6.src/lib/scudo/standalone/../.. -I/workspace/srcdir/compiler-rt-17.0.6.src/lib/scudo/standalone/include -Wall -Wno-unused-parameter -O3 -DNDEBUG -m64 -Werror=conversion -Wall -Wextra -pedantic -g -nostdinc++ -fvisibility=hidden -fno-exceptions -Wno-pedantic -fno-lto -O3 -fno-omit-frame-pointer -DGWP_ASAN_HOOKS -std=c++17 -MD -MT lib/scudo/standalone/CMakeFiles/RTScudoStandalone.x86_64.dir/timing.cpp.o -MF CMakeFiles/RTScudoStandalone.x86_64.dir/timing.cpp.o.d -o CMakeFiles/RTScudoStandalone.x86_64.dir/timing.cpp.o -c /workspace/srcdir/compiler-rt-17.0.6.src/lib/scudo/standalone/timing.cpp
[...]
[20:54:03] In file included from /workspace/srcdir/compiler-rt-17.0.6.src/lib/scudo/standalone/timing.cpp:9:
[20:54:03] /workspace/srcdir/compiler-rt-17.0.6.src/lib/scudo/standalone/timing.h: In member function ‘void scudo::TimingManager::printImpl(scudo::ScopedString&, scudo::u32, scudo::u32)’:
[20:54:03] /workspace/srcdir/compiler-rt-17.0.6.src/lib/scudo/standalone/timing.h:182:21: error: expected ‘)’ before ‘PRId64’
[20:54:03]      Str.append("%14" PRId64 ".%" PRId64 "(ns) %-11s", Integral, Fraction, " ");
[20:54:03]                ~     ^~~~~~~
[20:54:03]                      )
[20:54:03] /workspace/srcdir/compiler-rt-17.0.6.src/lib/scudo/standalone/timing.h:182:16: warning: conversion lacks type at end of format [-Wformat=]
[20:54:03]      Str.append("%14" PRId64 ".%" PRId64 "(ns) %-11s", Integral, Fraction, " ");
[20:54:03]                 ^~~~~
[20:54:03] /workspace/srcdir/compiler-rt-17.0.6.src/lib/scudo/standalone/timing.h:182:16: warning: too many arguments for format [-Wformat-extra-args]
[20:54:03] /workspace/srcdir/compiler-rt-17.0.6.src/lib/scudo/standalone/timing.h:186:23: error: expected ‘)’ before ‘PRId64’
[20:54:03]      Str.append("%s (%" PRId64 ")\n", Timers[HandleId].Name, Occurrence);
[20:54:03]                ~       ^~~~~~~
[20:54:03]                        )
[20:54:03] /workspace/srcdir/compiler-rt-17.0.6.src/lib/scudo/standalone/timing.h:186:16: warning: spurious trailing ‘%’ in format [-Wformat=]
[20:54:03]      Str.append("%s (%" PRId64 ")\n", Timers[HandleId].Name, Occurrence);
[20:54:03]                 ^~~~~~~
```
when compiling compiler-rt with GCC 8. This was resolved by defining
`__STDC_FORMAT_MACROS`.
2024-08-13 09:22:11 -07:00
David Green
277ca48f2f [AArch64] Additional saddlv store tests. NFC
The select-intrinsic-uaddlv.mir test now lower via G_SADDLV / G_UADDLV so is no
longer needed.
2024-08-13 17:09:44 +01:00
SpencerAbson
fa9f6b5828
[AArch64][NEON] Add famax/famin codegen patterns (#103027)
- min(abs(a), abs(b)) -> famin(a, b), max(abs(a), abs(b))-> famax(a, b)

- Changes to LLVM
    - llvm/lib/Target/AArch64InstrInfo.td
	    - Add pattern for NEON types
     - +llvm/test/CodeGen/AArch64/aarch64-neon-faminmax.ll
	    - Add tests with and without +faminmax flag.
2024-08-13 17:06:02 +01:00
Vitaly Buka
ba400539e2
[Interp] Mark the test unsupported with Asan (#102859)
It's very flaky recently.

10 bulds are OK, then 3 failed:
https://lab.llvm.org/buildbot/#/builders/52/builds/1524
https://lab.llvm.org/buildbot/#/builders/52/builds/1525
https://lab.llvm.org/buildbot/#/builders/52/builds/1526
then 3 OK
https://lab.llvm.org/buildbot/#/builders/52/builds/1531
https://lab.llvm.org/buildbot/#/builders/52/builds/1532
then 2 green again

We need to stop to spam blame list by disabling the test,
and investigate later if Asan is valuable for the test.

Issue #102858
2024-08-13 09:01:06 -07:00
Han-Kuan Chen
246f345152
[SLP][REVEC] Make CastInst support vector instructions. (#103216) 2024-08-13 23:52:32 +08:00
Matt Arsenault
2d7a2c1212
AtomicExpand: Refactor atomic instruction handling (#102914)
Move the processing of an instruction into a helper function. Also
avoid redundant checking for all types of atomic instructions.
Including the assert, it was effectively performing the same check
3 times.
2024-08-13 19:51:53 +04:00
Jan Svoboda
55323ca6c8
[clang][deps] Only bypass scanning VFS for the module cache (#88800)
The scanning VFS doesn't cache stat failures of paths with no extension.
This was originally implemented to avoid caching the non-existence of
the modules cache directory that the modular scanner will eventually
create if it does not exist.

However, this prevents caching of the non-existence of all directories
and notably also header files from the standard C++ library, which can
lead to sub-par performance.

This patch adds an API to the scanning VFS that allows clients to
configure path prefix for which to bypass the scanning VFS and use the
underlying VFS directly.
2024-08-13 08:41:39 -07:00
Jan Svoboda
17dc43d623
[clang] Stop adjusting the module cache path (#102540)
This patch stops adjustments of the module cache path beyond what is
done in `ParseHeaderSearchArgs` (making it absolute and removing dots).
This enables more efficient implementation of the caching VFS in
https://github.com/llvm/llvm-project/pull/88800.
2024-08-13 08:39:11 -07:00
Matt Arsenault
1ae507d109
AMDGPU: Do not create phi user for atomicrmw with no uses (#103061) 2024-08-13 19:24:52 +04:00
Harini0924
03d51019d0
Add REQUIRES: shell to Tests Requiring Full Shell Functionality with lit Internal Shell (#102988)
This patch adds the `REQUIRES: shell` directive to compiler-rt's fuzzer
tests that require full shell functionality when using the lit internal
shell. These tests depend on features such as background processes,
signal handling, and session management, which are not supported by
lit's internal shell. The addition of this directive ensures that these
tests are only executed in environments that provide the necessary shell
capabilities.

**Details of the Change:**
The following considerations were addressed:
- **Background Processes (`&`):** The tests run commands in the
background using the `&` operator, which allows the shell to execute
commands concurrently without waiting for each one to finish. In a
standard Unix-like shell, this is a common feature that facilitates
multitasking. However, lit's internal shell does not fully support
background job control, which can lead to unpredictable behavior or test
failures. Without proper handling of background processes, subsequent
commands that depend on the status of these processes may not function
correctly.
- **Signal Handling (`kill -SIGUSR1`, `kill -SIGUSR2`, `kill
-SIGINT`):** These tests involve sending specific signals like
`SIGUSR1`, `SIGUSR2`, and `SIGINT` to running processes. These signals
are used to trigger certain behaviors in the processes, such as pausing,
resuming, or terminating. However, lit's internal shell may not handle
these signals properly—it might not send the signal correctly, or the
process might not respond as it should. This could lead to the test
failing, not because the process is incorrect, but because the shell
didn't manage the signals as required.
- **Session Management (`setsid`):** The tests use `setsid` to create
new sessions, detaching processes from their controlling terminal and
isolating them into their own process groups. However, the internal
shell in lit does not support session management features like `setsid`,
this can't correctly isolate and manage processes as required by these
tests.

This change is relevant for enabling the lit internal shell by default,
as outlined in [[RFC] Enabling the Lit Internal Shell by
Default](https://discourse.llvm.org/t/rfc-enabling-the-lit-internal-shell-by-default/80179)
2024-08-13 08:21:16 -07:00
Schrodinger ZHU Yifan
4371c79d45
[libc] Reapply ELF/LINK header changes (#102765)
This is based on @izaakschroeder previous patch but I only select macro
definitions for now. We need these definitions for VDSO work, which has
been delayed for a very long time.

Co-authored-by: Izaak Schroeder <izaak.schroeder@gmail.com>
2024-08-13 08:20:37 -07:00
Paul Walker
b89853b504 [LLVM] Fix whitespace issues in VPBlendRecipe::execute. 2024-08-13 15:12:33 +00:00
Lei Wang
0f28aa632c
[CSSPGO] Return error_code for missing probe profile (#102085)
We should undo this https://reviews.llvm.org/D102007 after undoing
https://reviews.llvm.org/D104477 to use missing probe to represent
unknown count, zero count and unknown count are different to profile
inference.

It only affects post-inline(linker) pipeline(with
`--overwrite-existing-weights` on ) and flow-sensitive FDO.
2024-08-13 08:12:04 -07:00
Philip Reames
d385485450 [SCEV] Autogenerate a test for ease of upcoming update 2024-08-13 08:09:47 -07:00
Daniel Kiss
ac26c661ea
[compiler-rt][SME] Correct .variant_pcs directives. (#103047) 2024-08-13 17:03:09 +02:00
Krzysztof Drewniak
d97df40f34
[mlir][AMDGPU] Relax restrictions on raw_buffer_load (#102229)
The buffer load operation might temporarily admit "illegal" types, like
i4, or types not yet known to the rewrite pattern (like f8E5M2) and then
be rewritten to legal types before lowering to LLVM. This patch removes
the verifier restriction that prevents this pattern. This harmonizes the
definition of `amdgpu.raw_buffer_load` with the definition of
`amdgpu.raw_buffer_store`.
2024-08-13 09:50:48 -05:00
OverMighty
560ed8ce3d
[libc][math][c23] Add expm1f16 C23 math function (#102387)
Part of #95250.
2024-08-13 16:48:28 +02:00
Yingwei Zheng
f364b2ee22
[LLVM] Don't peek through bitcast on pointers and gep with zero indices. NFC. (#102889)
Since we are using opaque pointers now, we don't need to peek through
bitcast on pointers and gep with zero indices.
2024-08-13 22:38:50 +08:00