Commit Graph

472567 Commits

Author SHA1 Message Date
Jonas Devlieghere
1034688d58
[lldb] Re-enable TestVSCode_disconnect on Darwin
The test was disabled because it failed on the sanitized bot. I'm not
able to reproduce that locally. The test uses timeouts which could
explain why it was failing in the past.

Let's re-enable it and see what happens. If it fails again on
GreenDragon, rather than disabling it on Darwin altogether, we should
either increase the timeouts or skip it when run under ASan.
2023-08-25 11:02:38 -07:00
Kazu Hirata
636269f4fc [CodeGen] Fix a warning
This patch fixes:

  llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp:3540:9: error: default
  label in switch which covers all enumeration values
  [-Werror,-Wcovered-switch-default]
2023-08-25 11:00:52 -07:00
Samuel Thibault
1cfcc36812 [libc++] Fix GNU/Hurd build
GNU/Hurd does have clock_gettime, it just doesn't define _POSIX_TIMERS because its support for timers is not complete.

Reviewed By: #libc, Mordante

Differential Revision: https://reviews.llvm.org/D158584
2023-08-25 19:54:54 +02:00
Michael Halkenhaeuser
9300b6de3c [OpenMP][OMPT] Add OMPT support for generic-elf-64bit plugin
Fixes: https://github.com/llvm/llvm-project/issues/64487
Connect OMPT during plugin initialization and enable corresponding tests.
Avoid linking OMPT when corresponding support is disabled.

Depends on D158542

Reviewed By: tianshilei1992

Differential Revision: https://reviews.llvm.org/D158543
2023-08-25 13:53:11 -04:00
Daniel Paoliello
e7294dbc85 Fix llvm/test/DebugInfo/COFF/jump-table.ll
Fix `llvm/test/DebugInfo/COFF/jump-table.ll` by adding `REQUIRES` clauses for all architectures used by the test.
2023-08-25 10:50:07 -07:00
Johannes Doerfert
a01398156a [OpenMPOpt][FIX] Ensure to propagate information about parallel regions
Before, we checked the parallel region only once, and ignored updates in
the KernelInfo for the parallel region that happened later. This caused
us to think nested parallel sections are not present even if they are,
among other things.
2023-08-25 10:46:56 -07:00
Khem Raj
01a92f06f2 [llvm-exegesis] Use mmap2 when mmap is unavailable to fix riscv32 build
Some 32-bit architectures don't have mmap and define mmap2 instead.
E.g. on riscv32 we may get

```
| /mnt/b/yoe/master/build/tmp/work-shared/llvm-project-source-17.0.0-r0/git/llvm/tools/llvm-exegesis/lib/X86/Target.cpp:1116:19: error: use of undeclared identifier 'SYS_mmap'
|  1116 |   generateSyscall(SYS_mmap, MmapCode);
|       |                   ^
| /mnt/b/yoe/master/build/tmp/work-shared/llvm-project-source-17.0.0-r0/git/llvm/tools/llvm-exegesis/lib/X86/Target.cpp:1134:19: error: use of undeclared identifier 'SYS_mmap'
|  1134 |   generateSyscall(SYS_mmap, GeneratedCode);                                                                                                                                       |       |                   ^
| 1 warning and 2 errors generated.
```

Co-Authored-By: Fangrui Song <i@maskray.me>
Differential Revision: https://reviews.llvm.org/D158375
2023-08-25 10:43:00 -07:00
Erik Desjardins
66ec5df3a7 [ConstraintElim] fix crash with large constants in mul nsw
Another case of https://github.com/llvm/llvm-project/issues/55085.

The added test would trip an assertion due to calling `getSExtValue()` on a value that doesn't fit in int64_t.

Differential Revision: https://reviews.llvm.org/D158810
2023-08-25 13:20:02 -04:00
Daniel Paoliello
8d0c3db388 Emit the CodeView S_ARMSWITCHTABLE debug symbol for jump tables
The CodeView `S_ARMSWITCHTABLE` debug symbol is used to describe the layout of a jump table, it contains the following information:

* The address of the branch instruction that uses the jump table.
* The address of the jump table.
* The "base" address that the values in the jump table are relative to.
* The type of each entry (absolute pointer, a relative integer, a relative integer that is shifted).

Together this information can be used by debuggers and binary analysis tools to understand what an jump table indirect branch is doing and where it might jump to.

Documentation for the symbol can be found in the Microsoft PDB library dumper: 0fe89a942f/cvdump/dumpsym7.cpp (L5518)

This change adds support to LLVM to emit the `S_ARMSWITCHTABLE` debug symbol as well as to dump it out (for testing purposes).

Reviewed By: efriedma

Differential Revision: https://reviews.llvm.org/D149367
2023-08-25 10:19:17 -07:00
Lei Huang
5adac8bebc [PowerPC] Exclude frexp(long double) on linux
PowerPC on linux currently don't have support for lowering long double for
frexp().  Removing the tests until implementation is provided.

Reviewed By: #libc, amyk, Mordante

Differential Revision: https://reviews.llvm.org/D158547
2023-08-25 12:17:51 -05:00
Félix Cloutier
04e6178ae9
[Sema] tolerate more promotion matches in format string checking
It's been reported that when using __attribute__((format)) on non-variadic
functions, certain values that normally get promoted when passed as variadic
arguments now unconditionally emit a diagnostic:

```c
void foo(const char *fmt, float f) __attribute__((format(printf, 1, 2)));
void bar(void) {
	foo("%g", 123.f);
	//   ^ format specifies type 'double' but the argument has type 'float'
}
```

This is normally not an issue because float values get promoted to doubles when
passed as variadic arguments, but needless to say, variadic argument promotion
does not apply to non-variadic arguments.

While this can be fixed by adjusting the prototype of `foo`, this is sometimes
undesirable in C (for instance, if `foo` is ABI). In C++, using variadic
templates, this might instead require call-site fixing, which is tedious and
arguably needless work:

```c++
template<typename... Args>
void foo(const char *fmt, Args &&...args) __attribute__((format(printf, 1, 2)));
void bar(void) {
	foo("%g", 123.f);
	//   ^ format specifies type 'double' but the argument has type 'float'
}
```

To address this issue, we teach FormatString about a few promotions that have
always been around but that have never been exercised in the direction that
FormatString checks for:

* `char`, `unsigned char` -> `int`, `unsigned`
* `half`, `float16`, `float` -> `double`

This addresses issue https://github.com/llvm/llvm-project/issues/59824.
2023-08-25 10:14:01 -07:00
Jorge Pinto Sousa
41818ce150 [clang-tidy] Access checks not done classes derived of std::array
Index accessing checks are not performed for derived classes of
of `std::array`, as only `std::array` itself and its aliases
seems to be checked.

This patch aims to extend it for derived classes such as:
```
template<class T, size_t N>
class DerivedArray : public std::array<T, N> {};
```

Reviewed By: PiotrZSL

Differential Revision: https://reviews.llvm.org/D156624
2023-08-25 17:09:04 +00:00
Craig Topper
e9e458418f [AggressiveInstCombine] Improve line breaks in comment. NFC
The comments contain IR where some instructions don't fit in
80 columns. The extra part of the line was placed in front of
the next IR instruction instead of on its own line.
2023-08-25 10:08:23 -07:00
Hao Jin
1561495cd1 [flang][driver] Mark -L as visible in Flang
Reviewed By: awarzynski

Differential Revision: https://reviews.llvm.org/D158763
2023-08-25 13:01:49 -04:00
Rishabh Bali
2dc6281b98 [libc++]Declaring '__asign_view__' as a non noexcept function
`__assign_view__` is declared as a noexcept function in `libcxx/include/__filesystem/path.h` however internally it calls `std::basic_string<char>::basic_string<char>(std::string_view)` which is not a noexcept function this may lead to a `std::terminate()` call when allocation of a new string fails.

Fixes : https://github.com/llvm/llvm-project/issues/64858

Reviewed By: Mordante, #libc

Differential Revision: https://reviews.llvm.org/D158826
2023-08-25 18:26:22 +02:00
Chia-hung Duan
4f76810d48 [scudo] Detach the hooks from Scudo's internal implementation
Move the invocation of hooks from Scudo internal to wrapper_c.cpp and
wrapper_c_bionic.cpp respectively. Therefore, Scudo's core algorithm
doesnt need to worry about the reentrant of hooks and leave the caring
of reentrant to the hook users.

Reviewed By: hctim, cferris, chelfi

Differential Revision: https://reviews.llvm.org/D152188
2023-08-25 16:19:56 +00:00
Will Dietz
91b3ca3966 llvm_gtest: install to appropriate locations.
Reviewed By: tstellar

Differential Revision: https://reviews.llvm.org/D158607
2023-08-25 11:09:48 -05:00
Arthur Eubanks
9eb1e8247c [gn build] Add missing dependency to clang-fuzzer-dictionary 2023-08-25 09:08:10 -07:00
Mark de Wever
ea82a822d9 [libc++] Adds string_view constructor overload
Implements
- P2697R1 Interfacing bitset with string_view

Depends on D153192

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D153201
2023-08-25 17:56:27 +02:00
Yaxun (Sam) Liu
b8a9c50f22 [AMDGPU] Add target feature gws to clang
Reviewed by: Matt Arsenault

Differential Revision: https://reviews.llvm.org/D158367
2023-08-25 11:50:47 -04:00
Nathan Ridge
1994e1173b [clangd] Avoid null result in FindRecordTypeAt()
Fixes https://github.com/clangd/clangd/issues/1743

Differential Revision: https://reviews.llvm.org/D158851
2023-08-25 11:50:19 -04:00
Slava Zakharin
cccf4d6e4a [flang] Skip OPTIONAL arguments in LoopVersioning.
This patch fixes multiple tests failing with segfault due to accessing
absent argument box before the loop versioning check.
The absent arguments might be treated as contiguous for the purpose
of loop versioning, but this is not done in this patch.

Reviewed By: PeteSteinfeld

Differential Revision: https://reviews.llvm.org/D158800
2023-08-25 08:33:49 -07:00
Yolanda Chen
291101aa8e [WebAssembly] Optimize vector shift using a splat value from outside block
The vector shift operation in WebAssembly uses an i32 shift amount type, while
the LLVM IR requires binary operator uses the same type of operands. When the
shift amount operand is splated from a different block, the splat source will
not be exported and the vector shift will be unrolled to scalar shifts. This
patch enables the vector shift to identify the splat source value from the other
block, and generate expected WebAssembly bytecode when lowering.

Reviewed By: tlively

Differential Revision: https://reviews.llvm.org/D158399
2023-08-25 08:13:27 -07:00
Guray Ozen
52b93d2fe2 [mlir][nvgpu] remove duplicated pattern (nfc)
Differential Revision: https://reviews.llvm.org/D158847
2023-08-25 17:12:58 +02:00
Yitzhak Mandelbaum
c783258150 [clang][tooling] Fix name range-selector to handle TypeLocs correctly.
Previously, where `name` was applied to a template-specialization TypeLoc, it
returned the entire specialization (name, brackets, args) rather than just the
name identifier. With this change, exactly the name token is selected.

Differential Revision: https://reviews.llvm.org/D158771
2023-08-25 14:44:43 +00:00
Jonas Devlieghere
50b127613a [lldb] Qualify auto in the lldb driver (NFC)
The LLVM coding guidelines say to "[u]se auto & for values and auto *
for pointers unless you need to make a copy."
2023-08-25 07:40:37 -07:00
Renato Golin
e994c5dc8d [NFC] Remove old email 2023-08-25 16:34:22 +01:00
Philip Reames
0b98c356b5 [RISCV] Restructure i1 insert/extract element costing [nfc-ish]
These get expanded through i8, so let's just model that directly instead of looking at the expanded code and trying to fit that into the flow. This results in slightly better costs for constant indices today (we can remove the add), but is mostly focused on making future changes easier.

Differential Revision: https://reviews.llvm.org/D158770
2023-08-25 07:28:56 -07:00
Tue Ly
8ca614aa22 [libc][math] Implement double precision exp2 function correctly rounded for all rounding modes.
Implement double precision exp2 function correctly rounded for all
rounding modes.  Using the same algorithm as double precision exp function in
https://reviews.llvm.org/D158551.

Reviewed By: zimmermann6

Differential Revision: https://reviews.llvm.org/D158812
2023-08-25 10:15:08 -04:00
Matthias Springer
e3373c6c83 [mlir][memref] Fix crash in SubViewReturnTypeCanonicalizer
`SubViewReturnTypeCanonicalizer` is used by `OpWithOffsetSizesAndStridesConstantArgumentFolder`, which folds constant SSA value (dynamic) sizes into static sizes. The previous implementation crashed when a dynamic size was folded into a static `1` dimension, which was then mistaken as a rank reduction.

Differential Revision: https://reviews.llvm.org/D158721
2023-08-25 16:01:49 +02:00
Pavel Kosov
742fa941f2 [llvm-exegesis] Skip codegen of known-invalid snippets
On some targets, not all types of instruction operands are currently
handled. Instead of stopping the whole llvm-exegesis run because of any
instruction opcode that is not fully supported, write a per-opcode error
message and proceed to other opcodes. This improves the reliability of
--opcode-index=-1 sweep on partially supported targets.

Depends on: D146302, D146303

~~

Huawei RRI, OS Lab

Reviewed By: courbet

Differential Revision: https://reviews.llvm.org/D146304
2023-08-25 16:43:43 +03:00
Luke Drummond
ce0d16f574 [NFC][AMDGPU] assert scoreboard index is in range
`getRegInterval` can theoretically return AGPRs or SGPRS which aren't
valid when updating the VgprMemTypes array. Make this clear with an
assert.
2023-08-25 13:30:06 +01:00
Aaron Ballman
adaae6a7c1 Fix LLVM Sphinx build
This addresses issues found by:
https://lab.llvm.org/buildbot/#/builders/30/builds/39310
2023-08-25 08:00:33 -04:00
Louis Dionne
5e603450bb [clang] Also run the clang tests as part of the Clang-specific CI pipeline
We used to rely on the monorepo-wide premerge checks for running Clang
tests, but I think it makes more sense to run the Clang tests explicitly
in its CI pipeline since we want to move away from monorepo-wide checks.

Differential Revision: https://reviews.llvm.org/D158765
2023-08-25 07:52:40 -04:00
Krasimir Georgiev
eb6277e554 update certifi to 2023.7.22
For CVE-2023-37920: https://security.snyk.io/vuln/SNYK-PYTHON-CERTIFI-5805047
2023-08-25 11:19:08 +00:00
Michael Halkenhaeuser
275259eb9a [OpenMP] Add getComputeUnitKind to generic-elf-64bit plugin
Make the generic-plugin report a corresponding CU kind -- instead of 'unknown'.

Reviewed By: tianshilei1992

Differential Revision: https://reviews.llvm.org/D158542
2023-08-25 07:14:43 -04:00
Krasimir Georgiev
d282781290 update gitpython to 3.1.32
For CVE-2023-40267: https://security.snyk.io/vuln/SNYK-PYTHON-GITPYTHON-5840584.
2023-08-25 11:08:54 +00:00
Florian Hahn
be5013a0a2
[ConstraintElim] Add some tests with inductions that may wrap.
Extra tests for D152730, D158777.
2023-08-25 11:49:52 +01:00
Mateusz Hurnik
232f0c9a9a [NFC][AMDGPU] Remove redundant code
As the result of this constant function is unused it is redundant.

Reviewed by: arsenm
Differential Revision: https://reviews.llvm.org/D158747
2023-08-25 11:18:48 +01:00
Simon Pilgrim
00d19664b2 [X86] matchIndexRecursively - don't peek through SIGN_EXTEND for vector indices
Don't rely on implicit extension for gather/scatter ops
2023-08-25 10:48:16 +01:00
Justin Bogner
d43f324f6d [Sema][HLSL] Remove some duplicated code. NFC 2023-08-25 01:03:22 -07:00
Justin Bogner
ea32f99480 [Sema][HLSL] Clarify wording. NFC 2023-08-25 01:03:22 -07:00
serge-sans-paille
8760ff163c
Revert "[clang] - Add missing builtin name to AtomicExpr JSON dump"
There seems to be something target-specific in the test, but I cannot
get why, revering.
s
Failing buildbot: https://lab.llvm.org/buildbot/#/builders/216/builds/26256

This reverts commit 01b2554ff4.
2023-08-25 09:51:44 +02:00
LiaoChunyu
1b12427c01 [VP][RISCV] Add vp.is.fpclass and RISC-V support
There is no vp.fpclass after FCLASS_VL(D151176), try to support vp.fpclass.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D152993
2023-08-25 15:40:55 +08:00
Noah Goldstein
2acf00bd0a Revert "Recommit "[InstCombine] Expand foldSelectICmpAndOr -> foldSelectICmpAndBinOp to work for more binops" (2nd Try)"
Still appears to be buggy:
https://lab.llvm.org/buildbot/#/builders/124/builds/8260

This reverts commit 397a9cc4d8.
2023-08-25 02:22:23 -05:00
Nikita Popov
4eafc9b6ff [IR] Treat callbr as special terminator (PR64215)
isLegalToHoistInto() currently return true for callbr instructions.
That means that a callbr with one successor will be considered a
proper loop preheader, which may result in instructions that use
the callbr return value being hoisted past it.

Fix this by adding callbr to isExceptionTerminator (with a rename
to isSpecialTerminator), which also fixes similar assumptions in
other places.

Fixes https://github.com/llvm/llvm-project/issues/64215.

Differential Revision: https://reviews.llvm.org/D158609
2023-08-25 09:20:18 +02:00
serge-sans-paille
01b2554ff4
[clang] - Add missing builtin name to AtomicExpr JSON dump
As a side effect, introduce AtomicExpr::getOpAsString() to dump the
AtomicOp string representation.

This is a recommit with the target fully specified.

Differential Revision: https://reviews.llvm.org/D158558
2023-08-25 09:18:18 +02:00
Takuya Shimizu
615d812696 [clang][ExprConstant] Improve error message of compound assignment against uninitialized object
BEFORE this patch, compound assignment operator against uninitialized object such as uninit += 1 was diagnosed as subexpression not valid
This patch clarifies the reason for the error by saying that uninit is an uninitialized object.

Fixes https://github.com/llvm/llvm-project/issues/51536

Reviewed By: shafik, tbaeder
Differential Revision: https://reviews.llvm.org/D157855
2023-08-25 16:08:07 +09:00
Corentin Jabot
6824d156d5 [Clang] Fix a crash when an invalid immediate function call appears in a cast
Fixes #64949

Reviewed By: Fznamznon, erichkeane, shafik

Differential Revision: https://reviews.llvm.org/D158733
2023-08-25 08:50:41 +02:00
Matthias Springer
79ff70fda2 [mlir][sparse] Better error handling when bufferizing sparse_tensor ops
sparse_tensor ops cannot be bufferized with One-Shot Bufferize. (They can only be analyzed.) The sparse compiler does the actual lowering to memref. Produce a proper error message instead of crashing.

This fixes #61311.

Differential Revision: https://reviews.llvm.org/D158728
2023-08-25 08:34:05 +02:00