511942 Commits

Author SHA1 Message Date
joaosaffran
1bfc3d0de5
Implementing asfloat using bit_cast (#108686)
This PR is implementing `asfloat` for HLSL.

Fixes: #70098

Co-authored-by: Joao Saffran <jderezende@microsoft.com>
2024-09-16 14:42:52 -04:00
Joshua Baehring
e5271fef8f
[scudo] Update secondary cache time-based release logic (#107507)
Secondary cache entries are now released to the OS from least recent to
most recent entries. This helps to avoid unnecessary scans of the cache
since entries ready to be released (specifically, entries that are
considered old relative to the configurable release interval) will
always be at the tail of the list of committed entries by the LRU
ordering. For this same reason, the `OldestTime` variable is no longer
needed to indicate when releases are necessary so it has been removed.
2024-09-16 11:33:03 -07:00
Heejin Ahn
4b4dbaaede
[WebAssembly] Rename eh-assembly.s to -legacy.s (#108747)
The plan was to make `eh-assembly.s` contain both the legacy and the new
tests, but the new tests require `--no-type-check` because the type
checker for the new EH is in progress. In case this drags on further
than expected, this renames the current file to `-legacy.s` in order to
follow the current naming scheme in `test/CodeGen/WebAssembly`.

After landing this first, `eh-assembly-new.s` in #108668 will be renamed
to `eh-assembly.s`.
2024-09-16 11:29:24 -07:00
Heejin Ahn
d8ee96c500
[WebAssembly] Add indentations to annotations.s (#108790)
Given that the instructions here are all control flow instructions,
adding indentations seem to make it easier to read.
2024-09-16 11:29:09 -07:00
Зишан Мирза
000a3f0a54
[libc][c11] implement ctime (#107285)
This is an implementation of `ctime` and includes `ctime_r`.

According to documentation, `ctime` and `ctime_r` are defined as the
following:

```c
char *ctime(const time_t *timep);
char *ctime_r(const time_t *restrict timep, char buf[restrict 26]);
```

closes #86567
2024-09-16 11:27:11 -07:00
Vitaly Buka
0ea0e3a1b6
[sanitizer] Add CHECK that static TLS info is ready (#108684)
There is possibility of
static_tls_begin is set and static_tls_end is not yet

The test reproduces the case.
Stack trace looks like this:
* `MsanThread::Init`
* `SetThreadStackAndTls`
* `GetThreadStackAndTls`
* `GetThreadStackTopAndBottom`
* `pthread_getattr_np`
* `realloc`
* `__sanitizer_malloc_hook`
* TLS access
* `___interceptor___tls_get_addr`
* `DTLS_on_tls_get_addr`

The issue is that `SetThreadStackAndTls` implementation
stores `tls_begin` before `GetThreadStackTopAndBottom`,
and `tls_end` after. So we have partially initialized
state in `DTLS_on_tls_get_addr`.
2024-09-16 11:21:08 -07:00
Farzon Lotfi
8ee685e601
[NFC][DirectX] fix intrinsics that need IntrNoMem and test typo (#108852)
In the process of adding scalarization support for DirectX target
intrinsics I found that intrinsics that weren't marked with `IntrNoMem`
did not get removed by
`RecursivelyDeleteTriviallyDeadInstructionsPermissive`. So this change
is to make it more clear that our intrinsics don't have side effects.

I only added `IntrNoMem` to the intrinics in `IntrinsicsDirectX.td` I
was involved with. There a potentially a few other cases that might
warrant this attribute, but will need input on the others.
2024-09-16 14:19:29 -04:00
kadir çetinkaya
04d71ea11b
[Format] Dont treat LBrace after extends/implements as initializer list (#108524)
This extends the fix in https://github.com/llvm/llvm-project/pull/106242
for other derived class types.
2024-09-16 20:18:39 +02:00
Rainer Orth
9ec1f65814 Revert "[NFC][sanitizer] Simplify ifdef"
Breaks the [Solaris/sparcv9](https://lab.llvm.org/buildbot/#/builders/13/builds/2219) and [Solaris/amd64](https://lab.llvm.org/staging/#/builders/120/builds/1770) builds.

This reverts commit c21909a530f438bcc942c11e6d7b875bb28a028a.
2024-09-16 20:14:54 +02:00
Louis Dionne
83bb7318ca
[clang][NFC] Add missing space in -Wunsafe-buffer-usage documentation (#107905)
That missing space was causing the whole sentence to be rendered
incorrectly in the resulting HTML.
2024-09-16 14:12:34 -04:00
Craig Topper
aaa0f4d382
[RISCV][Docs] Remove Zvbb, Zvbc and Zvk* from experimental C intrinsics section of RISCVUsage.rst. NFC (#108718)
These are no longer experimental after
051054e6f74303bc880221e88671745f363964cc. I left the section because we
will be adding intrinsics for Zvkgs and Zvbc32e.
2024-09-16 11:12:09 -07:00
LLVM GN Syncbot
a40b36f28e [gn build] Port 5c348f692a8d 2024-09-16 18:01:43 +00:00
Vitaly Buka
d3014e1f3b
[NFC][sanitizer] Use RTLD_DEFAULT for _dl_get_tls_static_info (#108723)
We don't intercept this one, no reason to use RTLD_NEXT.

Co-authored-by: Sam Elliott <quic_aelliott@quicinc.com>
2024-09-16 11:00:13 -07:00
Sam Elliott
f0787edc5e [RISCV][docs] Explain Relaxation Default
As requested in follow-up comments on #108592.
2024-09-16 10:52:25 -07:00
David Green
960c975acd
[AArch64] Expand scmp/ucmp vector operations with sub (#108830)
Unlike scalar, where AArch64 prefers expanding scmp/ucmp with select,
under Neon we can use the arithmetic expansion to generate fewer
instructions. Notably it also prevents the scalarization of vselect
during vector-legalization.
2024-09-16 18:44:52 +01:00
nebulark
f5ba3e1fa6
[CodeView] Flatten cmd args in frontend for LF_BUILDINFO (#106369) 2024-09-16 19:29:42 +02:00
Thorsten Schütt
5c348f692a
[GlobalIsel] Canonicalize G_ICMP (#108755)
As a side-effect, we start constant folding icmps.

Split out from https://github.com/llvm/llvm-project/pull/105991.
2024-09-16 19:25:34 +02:00
Max191
08efa23083
[mlir] Allow multi-result ops in reshape fusion (#108576)
Fusion of reshapes by collapsing patterns were restricted to single
result operations, but the implementation supports multi result ops.
This PR removes the restriction, since it is not necessary.
2024-09-16 13:06:38 -04:00
Aaron Ballman
c0719d8c08
[Policy] Replace "code owners" with "maintainers" (#107384)
This replaces the previous Code Owners section of our developer policy
with a new section for Maintainers. It also updates most of the places
we mention "code owner" in the documentation (it does not update the
files named `Code Owners.rst` or similar because those should be updated
when the subprojects add their `Maintainers.rst` file).

The wording was taken from what was proposed in the RFC (including all
suggested amendments from folks on the thread).

Please see the RFC for more details:

https://discourse.llvm.org/t/rfc-proposing-changes-to-the-community-code-ownership-policy/80714/
2024-09-16 13:05:03 -04:00
Alexey Bataev
18ef467d73 [SLP]Fix PR108709: postpone buildvector clustered nodes, if required
The "clustered" nodes for buildvector nodes must be postponed in
accordance with the global flag, otherwise it may cause crash because of
the dependency between phi nodes.
2024-09-16 09:53:46 -07:00
Vitaly Buka
69f3244da7
[NFC][sanitizer] Switch to gnu_get_libc_version (#108724)
`gnu_get_libc_version` unlike `confstr` is not
intercepted. We should be able to use this
function earier.

Looks like we use `confstr` staring from
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60038
but there is no specific reason to refer it over
`gnu_get_libc_version`.
2024-09-16 09:53:19 -07:00
Valentin Clement (バレンタイン クレメン)
bc54e5636f
[flang][cuda] Add new entry points function for data transfer (#108244)
Add new entry points for more complex data transfer involving
descriptors. These functions will be called when converting
`cuf.data_transfer` operations.
2024-09-16 09:45:44 -07:00
Alexey Bataev
f564a48f0e [SLP]Fix PR108700: correctly identify id of the operand node
If the operand node for truncs is not created during construction, but
one of the previous ones is reused instead, need to correctly identify
its index, to correctly emit the code.

Fixes https://github.com/llvm/llvm-project/issues/108700
2024-09-16 09:44:47 -07:00
Pavel Skripkin
4c6f313cb3
[analyzer] [MallocChecker] suspect all release functions as candidate for suppression (#104599)
Current MalloChecker logic suppresses FP caused by refcounting only for
C++ destructors. The same pattern occurs a lot in C in objects with
intrusive refcounting. See #104229 for code example.

To extend current logic to C, suspect all release functions as candidate
for suppression.

Closes: #104229
2024-09-16 19:44:13 +03:00
Kolya Panchenko
b592917eec
[LV] Added verification of EVL recipes (#107630) 2024-09-16 11:58:29 -04:00
Nikolas Klauser
01df775dc4
[libc++] Take the ABI break for std::list's pointer UB unconditionally (#100585)
This ABI break only affects fancy pointer which have a different value
representation when pointing to a base of T instead of T itself. This
seems like a rather small set of fancy pointers, which themselves
already represent a very small niche. This patch swaps a pointer to T
with a pointer to base of T in a few library-internal types.
2024-09-16 11:55:33 -04:00
Jeff Bailey
50985d23e5
[libc][nfc] Fix typo in header generation message. (#108813)
Fix a typo in the header generation message.

Before:
Generating header from
/home/vscode/llvm-project/llvm/../libc/newhdrgen/yaml/ctype.yaml and
/home/vscode/llvm-project/libc/include/ctype.h.def

After:
Generating header ctype.h from
/home/vscode/llvm-project/llvm/../libc/newhdrgen/yaml/ctype.yaml and
/home/vscode/llvm-project/libc/include/ctype.h.def
2024-09-16 16:53:43 +01:00
A. Jiang
94e7c0b051
[libc++] Remove get_temporary_buffer and return_temporary_buffer (#100914)
Works towards P0619R4 / #99985.

The use of `std::get_temporary_buffer` and `std::return_temporary_buffer`
are replaced with `unique_ptr`-based RAII buffer holder.

Escape hatches:
- `_LIBCPP_ENABLE_CXX20_REMOVED_TEMPORARY_BUFFER` restores
`std::get_temporary_buffer` and `std::return_temporary_buffer`.

Drive-by changes:
- In `<syncstream>`, states that `get_temporary_buffer` is now removed,
because `<syncstream>` is added in C++20.
2024-09-16 11:53:05 -04:00
Timm Baeder
0bc8168070
[clang][bytecode] Fix reinterpret_casts from pointer to non-pointers (#108811)
We need to be a little more careful here with whether or nor we are able
to do the cast at all or not.
2024-09-16 17:35:38 +02:00
Slava Zakharin
b9198a1731
[flang][runtime] Fixed include directories for Float128Math files. (#108466)
When building FortranRuntime out of tree on aarch64, the list of include
directories for the files comming from FortranFloat128MathILib
has to contain flang/runtime. I did this via
INTERFACE_INCLUDE_DIRECTORIES property.
2024-09-16 08:18:33 -07:00
Joseph Huber
0f723eb671 [Clang] Add locale variants to libc offload wrappers
Summary:
These need to be present now that the GPU "supports" them (only for the
default POSIX locale).
2024-09-16 09:57:47 -05:00
Jake Egan
53d60398ef
[CMake] Use old DynamicLibrary symbol behavior on AIX for now (#108692)
New behavior broke the AIX bot, so fall back to the old behavior on AIX
for now to give time to investigate
2024-09-16 10:57:06 -04:00
Aaron Ballman
5cead0cb0b
Revert "Fix OOM in FormatDiagnostic" (#108838)
Reverting due to build failures found in #108187
2024-09-16 10:49:17 -04:00
Sam Elliott
76a85b0e2f
[RISCV][docs] GP Relaxation and Small Data Limit (#108592)
As discussed in this week's RISC-V sync-up, we said we would add
documentation about these options, and how they work.
2024-09-16 15:41:07 +01:00
Vakhurin Sergei
e5d255607d
Fix OOM in FormatDiagnostic (#108187)
Resolves: #70930 (and probably latest comments from
https://github.com/clangd/clangd/issues/251)
by fixing racing for the shared `DiagStorage` value which caused messing
with args inside the storage and then formatting the following message
with `getArgSInt(1)` == 2:
```
def err_module_odr_violation_function : Error<
  "%q0 has different definitions in different modules; "
  "%select{definition in module '%2'|defined here}1 "
  "first difference is "
```
which causes `HandleSelectModifier` to go beyond the `ArgumentLen` so
the recursive call to `FormatDiagnostic` was made with `DiagStr` >
`DiagEnd` that leads to infinite `while (DiagStr != DiagEnd)`.

**The Main Idea:**
Reuse the existing `DiagStorageAllocator` logic to make all
`DiagnosticBuilder`s having independent states.
Also, encapsulating the rest of state (e.g. ID and Loc) into
`DiagnosticBuilder`.

**TODO (if it will be requested by reviewer):**
- [x] add a test (I have no idea how to turn a whole bunch of my
proprietary code which leads `clangd` to OOM into a small public
example.. probably I must try using
[this](https://github.com/llvm/llvm-project/issues/70930#issuecomment-2209872975)
instead)
- [x] [`Diag.CurDiagID !=
diag::fatal_too_many_errors`](https://github.com/llvm/llvm-project/pull/108187#pullrequestreview-2296395489)
- [ ] ? get rid of `DiagStorageAllocator` at all and make
`DiagnosticBuilder` having they own `DiagnosticStorage` coz it seems
pretty small so should fit the stack for short-living
`DiagnosticBuilder` instances
2024-09-16 10:30:53 -04:00
jeanPerier
e6618aae43
[flang] fix ignore_tkr(tk) with character dummy (#108168)
The test code with ignore_tkr(tk) on character dummy passed by
fir.boxchar<> was crashing the compiler in [an
assert](2afe678f0a/flang/lib/Optimizer/Dialect/FIRType.cpp (L632))
in `changeElementType`.

It makes little sense to call changeElementType on a fir.boxchar since
this type is lossy (the shape is not part of it). Just skip it in the
code dealing with ignore(tk) when hitting this case
2024-09-16 16:27:11 +02:00
Louis Dionne
165f0e80f6
[libc++][modules] Don't error when including <wchar.h> or <wctype.h> without wide character support (#108639)
Instead, make the headers empty like we do for all the other carve-outs.
2024-09-16 10:21:50 -04:00
goussepi
79c4ece75f
[tsan] Allow unloading of ignored libraries (#105660)
Allows unloading and reloading of ignored libraries. We don't attempt to
reuse or free memory of unloaded library. So TSan will assert if an
ignored library is reloaded 128 times.

Co-authored-by: Vitaly Buka <vitalybuka@gmail.com>
2024-09-16 15:12:46 +01:00
Congcong Cai
b3470c3d7a
[clang][NFC] declare internal linkage function static (#108759)
Detected by `misc-use-internal-linkage`
2024-09-16 22:02:38 +08:00
Sergio Afonso
e0e93c3f76
[Frontend][OpenMP] Follow compound construct clause restrictions (#107853)
This patch removes from the list of allowed clauses for a handful of
compound constructs those that are specifically disallowed by the OpenMP
spec. In particular, the following restrictions are followed:
- (regarding combined constructs) If _directive-name-A_ is `target`, the
`copyin` clause must not be specified.
- (regarding composite constructs) If _directive-name-A_ is
`distribute`, the `ordered` clause must not be specified.

These restrictions are listed in the OpenMP Specification version 5.2,
sections 17.4 and 17.5. Since it's a similar case as PR #90754, I'm
adding people involved in that decision as reviewers here.
2024-09-16 15:02:11 +01:00
Rahul Joshi
adb7004514
[LLVM][CLange] Rename NodeType::Record to NodeType::Rec (#108826)
Fixes build failure by avoiding conflicting with `Record` class name.
2024-09-16 06:59:36 -07:00
Kazu Hirata
f4a3309c9a
[IPO] Avoid repeated hash lookups (NFC) (#108796) 2024-09-16 06:44:34 -07:00
Kazu Hirata
6f52c1e6b1
[OpenACC] Avoid repeated hash lookups (NFC) (#108795) 2024-09-16 06:43:58 -07:00
Kazu Hirata
9159179451
[Format] Avoid repeated hash lookups (NFC) (#108794) 2024-09-16 06:43:26 -07:00
Kazu Hirata
e509e8777a
[SCF] Avoid repeated hash lookups (NFC) (#108793) 2024-09-16 06:42:51 -07:00
Rahul Joshi
0e948bfd31
[NFC][clang][TableGen] Remove redundant llvm:: namespace qualifier (#108627)
Remove llvm:: from .cpp files, and add "using namespace llvm" if needed.
2024-09-16 06:35:34 -07:00
Rahul Joshi
a06d84abd3
[NFC][Clang][TableGen] Refactor ClangASTNodesEmitter (#108580)
Change macroName() to accept a StringRef to avoid extra string copy. 
Simplify ASTNode comparison function.
Use equal_range() instead of calling lower_bound() and upper_bound()
separately for std::multimap.
No need to use std::make_pair.
2024-09-16 06:34:56 -07:00
David Green
823eab2bd5 [AArch64] Add a selection for vector scmp/ucmp tests. NFC 2024-09-16 14:25:15 +01:00
Haojian Wu
abe964aa47
[clang] Don't emit bogus dangling diagnostics when [[gsl::Owner]] and [[clang::lifetimebound]] are used together. (#108280)
In the GSL analysis, we don't track the `this` object if the conversion
is not from gsl::owner to gsl pointer, we want to be conservative here
to avoid triggering false positives.

Fixes #108272
2024-09-16 15:21:33 +02:00
Oleksandr T.
ed4a2a108e
[Clang] handle invalid close location in static assert declaration (#108701)
Fixes #108687
2024-09-16 08:58:50 -04:00