466374 Commits

Author SHA1 Message Date
Thurston Dang
d0b0dbeae1 [msan] Intercept dladdr1, and refactor dladdr
This patch adds an msan interceptor for dladdr1 (with support
for RTLD_DL_LINKMAP and RTLD_DL_SYMENT) and an accompanying
test. It also adds a helper file, msan_dl.cpp, that contains
UnpoisonDllAddrInfo (refactored out of the dladdr interceptor)
and UnpoisonDllAddr1ExtraInfo.

Differential Revision: https://reviews.llvm.org/D154272
2023-07-01 19:18:27 +00:00
Evandro Menezes
4a5b5bf318 [AArch64] Remove duplicate code (NFC)
Remove multiple versions of the predicate that checks if the
instruction operand is shifted by up to 4.
2023-07-01 13:29:55 -05:00
Petr Hosek
1c241bb791 [libc] Missing FEnvImpl.h dependency on math.h
FEnvImpl.h includes math.h and so needs an explicit dependency.

Differential Revision: https://reviews.llvm.org/D154044
2023-07-01 18:27:36 +00:00
Sergei Barannikov
c2d7ee79b9 [RISCV] Add a test with unknown argument of .attribute directive 2023-07-01 20:50:32 +03:00
Evandro Menezes
6a5da11b87 [AArch64] Add scheduling model for Neoverse N1
Add the scheduling model for Neoverse N1.

Differential revision: https://reviews.llvm.org/D152417
2023-07-01 12:35:22 -05:00
Piotr Zegar
c1dc914a8c [clang-tidy] Correct sizeof/alignas handling in misc-redundant-expression
Fixed issue with the comparison of UnaryExprOrTypeTraitExpr
objects in which only the argument type was checked, without
considering the kind of expression. This led to false positives when
using sizeof(x) and alignof(x) expressions, as only the
comparison x = x was performed without checking if sizeof
was equal to alignof.

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

Reviewed By: Izaron

Differential Revision: https://reviews.llvm.org/D152713
2023-07-01 16:20:38 +00:00
Piotr Fusik
81ad5a5cb8 [libc++] Implement stringbuf members of P0408R7 (Efficient Access to basic_stringbuf's Buffer)
Reviewed By: #libc, Mordante

Differential Revision: https://reviews.llvm.org/D153709
2023-07-01 13:43:08 +02:00
Mark de Wever
5bf142749e [libc++][doc] Updates spaceship status.
Work on the missing chrono parts has started, but their operators will
be added in different patches. So split the remaining chrono part to one
entry per line and mark them in progress.
2023-07-01 12:37:02 +02:00
Mark de Wever
0fa67d44e0 [libc++] Enables constexpr string tests.
These tests were disabled during constant evaluation in D90569. At that
time constexpr string was not implemented. It now is.

Reviewed By: #libc, philnik

Differential Revision: https://reviews.llvm.org/D154227
2023-07-01 12:26:48 +02:00
Mike Crowe
8fdbc8712c [clang-tidy] Improve documentation for modernize-use-std-print check
Remove incorrect use of double colons so that the code blocks are
rendered correctly to HTML.

Wrap the name of another check in single backticks. Wrap the name of a
macro in double backticks.

Explain that with the default settings the check is only enabled with
C++23 or later standards.

Correct std::string_data() to std::string::data().

Reviewed By: PiotrZSL

Differential Revision: https://reviews.llvm.org/D154151
2023-07-01 08:40:21 +00:00
Haojian Wu
dc6c8b8d1e [LTO] Fix a missing comment
Address a missing code-review comment: https://reviews.llvm.org/D154191#inline-1490951
2023-07-01 08:33:45 +02:00
Haojian Wu
b28296c500 [bazel] Port bazel support for 5bf8efd269f8b75b5be40f087f231d71f744885c 2023-07-01 08:27:26 +02:00
Haojian Wu
6ecc6b1250 [LTO] Replace llvm::writeFileAtomically with llvm::writeToOutput API. 2023-07-01 08:22:01 +02:00
Vincent Lee
2fc0d17e8b [FuncSpec] Avoid crashing when SwitchInst doesn't see ConstantInt
D150464 updated the cost model for function specialization. Unfortunately, this
also crashes when trying to build stage2 LLD with thinLTO and assertions. It looks
like the issue is caused by a mishandling of the Constant in a SwitchInst since the
Constant cannot always be assumed to safely casted to a ConstantInt. In the case
of the crash, Constant was a ConstantExpr which triggered the assertion.

Reviewed By: ChuanqiXu

Differential Revision: https://reviews.llvm.org/D154159
2023-06-30 21:02:50 -07:00
Evandro Menezes
afb2743778 [AArch64] Remove duplicate code (NFC) 2023-06-30 21:37:51 -05:00
Sergei Barannikov
af20c1c129 [MC] Add three-state parseDirective as a replacement for ParseDirective
Conventionally, parsing methods return false on success and true on
error. However, directive parsing methods need a third state: the
directive is not target specific. AsmParser::parseStatement detected
this case by using a fragile heuristic: if the target parser did not
consume any tokens, the directive is assumed to be not target-specific.

Some targets fail to follow the convention: they return success after
emitting an error or do not consume the entire line and return failure
on successful parsing. This was partially worked around by checking for
pending errors in parseStatement.

This patch tries to improve the situation by introducing parseDirective
method that returns ParseStatus -- three-state class. The new method
should eventually replace the old one returning bool.

ParseStatus is intentionally implicitly constructible from bool to allow
uses like `return Error(Loc, "message")`. It also has a potential to
replace OperandMatchResulTy as it is more convenient to use due to the
implicit construction from bool and more type safe.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D154101
2023-07-01 04:33:28 +03:00
Jason Molenda
624813a4f4 Change the dyld notification function that lldb puts a breakpoint in
On Darwin systems, the dynamic linker dyld has an empty function
it calls when binaries are added/removed from the process.  lldb puts
a breakpoint on this dyld function to catch the notifications.  The
function arguments are used by lldb to tell what is happening.

The linker has a natural representation when the addresses of
binaries being added/removed are in the pointer size of the process.
There is then a second function where the addresses of the binaries
are in a uint64_t array, which the debugger has been using before -
dyld allocates memory for the array, copies the values in to it,
and calls it for lldb's benefit.

This changes to using the native notifier function, with pointer-sized
addresses.

Differential Revision: https://reviews.llvm.org/D139453
2023-06-30 18:29:46 -07:00
Haohai Wen
2a631a8fed [lld/COFF] Add /dwodir to enable DWARF fission with LTO
This patch added /dwodir to lld/COFF which is equivalent to lld/ELF
option -plugin-opt=dwo_dir=. This option tells LTO backend to create
dwo directory and files and all dwo files will be in it. Otherwise all
dwarf sections will be embeded into image even if -gsplit-dwarf is
specified when using LTO.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D154070
2023-07-01 08:59:12 +08:00
Dave Lee
b43375bb81 [lldb] Add log indicating which kind of data formatter
The `formatter` logs include a function name, but these functions are mostly templates
and the template type parameter is not printed, which is useful context.

This change adds a new log which is printed upon entry of `FormatManager::Get`, which
shows the formatter context as either `format`, `summary`, or `synthetic`.

Differential Revision: https://reviews.llvm.org/D154128
2023-06-30 16:51:14 -07:00
Lucile Nihlen
b776e2a0b0 [clang] detect integer overflow through temporary values
Fixes #63629.

Differential Revision: https://reviews.llvm.org/D154253
2023-06-30 23:19:04 +00:00
Hamish Knight
a57bdc8fe6 [clang] Fix leak in LoadFromCommandLineWorkingDirectory unit test
Change `ASTUnit::LoadFromCommandLine` to return a `std::unique_ptr` instead of a +1 pointer, fixing a leak in the unit test `LoadFromCommandLineWorkingDirectory`.

Reviewed By: bnbarham, benlangmuir

Differential Revision: https://reviews.llvm.org/D154257
2023-06-30 16:02:12 -07:00
Yuan Yao
fc37f71777 [mlir][NVGPU]: Fix op description of nvgpu.device_async_wait.
According to the NVIDIA documentation on `cp.async.wait_group`
(https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#data-movement-and-conversion-instructions-cp-async-wait-group-cp-async-wait-all),
the `numGroups` attribute in `nvgpu.device_async_wait` should give an upper
bound of pending async group count (instead of a lower bound) when the
executing thread can be unblocked.

Reviewed By: christopherbate

Differential Revision: https://reviews.llvm.org/D154046
2023-06-30 15:47:46 -07:00
Ivan Butygin
9dc88651d5 [mlir][NFC] Sort dialects
Sort dialects cmake and registry.

Differential Revision: https://reviews.llvm.org/D154267
2023-07-01 00:37:16 +02:00
Samira Bazuzi
3b29b8a2ab Expose DataflowAnalysisContext.querySolver().
This allows for use of the same solver used by the DAC for additional solving post-analysis and thus shared use of MaxIterations in WatchedLiteralsSolver.

Reviewed By: ymandel, gribozavr2, sammccall

Differential Revision: https://reviews.llvm.org/D153805
2023-07-01 00:15:45 +02:00
Kun Wu
be2dd22b8f [mlir][sparse][gpu] reuse CUDA environment handle throughout instance lifetime
Differential Revision: https://reviews.llvm.org/D153173
2023-06-30 21:52:34 +00:00
Aart Bik
b939c015a4 [mlir][sparse] add affine parsing to new surface syntax for STEA
(1) uses the previously introduce API to reuse AffineExpr parser without codedup
(2) solves the look-ahead problem when parsing level spec

Reviewed By: Peiming

Differential Revision: https://reviews.llvm.org/D154254
2023-06-30 14:48:23 -07:00
Roland McGrath
5bf8efd269 [libc] Fix more inline definitions
Fix a bunch more instances of incorrect use of the `static`
keyword and missing use of LIBC_INLINE and LIBC_INLINE_VAR
macros. Note that even forward declarations and generic template
declarations must follow the prescribed patterns for libc code so
that they match every definition, all template specializations.

Reviewed By: Caslyn

Differential Revision: https://reviews.llvm.org/D154260
2023-06-30 14:46:25 -07:00
Dave Lee
2c37cbef58 [lldb] Delete RewriteObjCClassReferences (NFC)
The `RewriteObjCClassReferences` pass was applicable only to the code generated for the
fragile ObjC ABI (v1). That ABI is no longer active (last used for i386 macOS), which
means this pass has no effect.

Sources: `OBJC_CLASS_REFERENCES_` is emitted only by `CGObjCMac`, and not by
`CGObjCNonFragileABIMac`.

Differential Revision: https://reviews.llvm.org/D153802
2023-06-30 14:39:20 -07:00
Youngsuk Kim
5f32baf17d [clang] Replace uses of CreateElementBitCast (NFC)
Partial progress towards replacing uses of CreateElementBitCast, as it
no longer does what its name suggests.

Reviewed By: barannikov88

Differential Revision: https://reviews.llvm.org/D154229
2023-06-30 17:35:36 -04:00
Peiming Liu
a63d6a0014 [mlir][sparse] make UnpackOp return the actual filled length of unpacked memory
This might simplify frontend implementation by avoiding recomputation for the same value.

Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D154244
2023-06-30 21:35:15 +00:00
LLVM GN Syncbot
ab345bde81 [gn build] Port c4e98722ca79 2023-06-30 21:17:57 +00:00
Roland McGrath
dbd38b1219 [libc] Add missing cast in x86 big_endian_cmp_mask
Implicit narrowing conversions from int to uint16_t
get a compiler warning with the warning settings used
in the Fuchsia build.

Reviewed By: michaelrj

Differential Revision: https://reviews.llvm.org/D154256
2023-06-30 14:15:59 -07:00
Florian Hahn
55e7f1f786
[LV] Pass bool to requiresScalarEpilogue (NFC).
requiresScalarEpilogue only checks if the selected VF is vectorizing
(and not scalar). Update it to just take a boolean, to make it clearer
what information is used and to allow callers without a VF (used in a
follow-up patch).
2023-06-30 22:08:27 +01:00
Jerry Ge
cf8ae17896 Add Int4 support for tosa::ConstOp
- Also added Tosa_Weight and Tosa_WeightTensorXD specifically for weights

Signed-off-by: Jerry Ge <jerry.ge@arm.com>

Reviewed By: eric-k256

Differential Revision: https://reviews.llvm.org/D153646
2023-06-30 13:57:43 -07:00
fernandosalas
85c622b597 [scudo] Improve Secondary Cache Dump
Exclude cached blocks with invalid start address. Mainly concerned with
cached blocks that are still available/unused.

Reviewed By: Chia-hungDuan, cferris

Differential Revision: https://reviews.llvm.org/D154148
2023-06-30 20:55:41 +00:00
Chia-hung Duan
da8cc061f2 [scudo] Restore Freelist when we fail on PageMap creation
Differential Revision: https://reviews.llvm.org/D154041
2023-06-30 20:54:08 +00:00
Thurston Dang
850daa51f0 [msan] Add lit test for dladdr
This adds a simple lit test for dladdr. (There is currently a dladdr testcase in
compiler-rt/lib/msan/tests/msan_test.cpp, but not a stand-alone lit test.)

This is an incremental step towards adding a test case (and, eventually, an interceptor)
for the more complicated dladdr1 function.

Differential Revision: https://reviews.llvm.org/D154255
2023-06-30 20:52:49 +00:00
Amirreza Ashouri
bf17b08b45 correct misspelled _LIBCPP___TYPE_TRAITS_IS_EQUAILITY_COMPARABLE_H to _LIBCPP___TYPE_TRAITS_IS_EQUALITY_COMPARABLE_H
I just corrected a mistakenly misspelled macro

Reviewed By: philnik, #libc

Spies: libcxx-commits, #llvm, philnik

Differential Revision: https://reviews.llvm.org/D154252
2023-06-30 13:51:48 -07:00
Nikolas Klauser
c4e98722ca [libc++] Fix std::copy and std::move for ranges with potentially overlapping tail padding
This fixes thr bug reported in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108846.

Reviewed By: ldionne, #libc

Spies: mstorsjo, libcxx-commits

Differential Revision: https://reviews.llvm.org/D151953
2023-06-30 13:48:16 -07:00
Luke Lau
e8e0f32958 [RISCV] Fix vfwcvt/vfncvt pseudos w/ rounding mode lowering
Some signed opcodes were being lowered to their unsigned counterparts and
vice-versa.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D154234
2023-06-30 21:43:19 +01:00
Justin Bogner
781405e85e [test] Add a couple of missing REQUIRES
These tests only work if the targets in the input are available.
2023-06-30 14:41:23 -06:00
Ethan Luis McDonough
9bf5093623
[flang][openmp] Parallel reduction FIR lowering
This patch extends the logic for lowering loop construct reductions to parallel block reductions.

Reviewed By: kiranchandramohan

Differential Revision: https://reviews.llvm.org/D154182
2023-06-30 15:36:27 -05:00
Valentin Clement
60bb4bafe2
[flang][NFC] Fix typos 2023-06-30 13:15:25 -07:00
usama hameed
52a280bb60
[UBSan] Fix shared library linking in test for Darwin.
Without rpath information, the test fails on some Darwin platforms since the binary fails to find the shared library.

rdar://110010041

Differential Revision: https://reviews.llvm.org/D154003
2023-06-30 13:00:29 -07:00
Jeffrey Sandoval
6555c47448 [OpenMP][NVPTX] Handle additional invalid PTX characters
For OpenMP offload, Clang emits global symbols containing the string
'<captured>', which contains characters that are invalid in PTX.
Extend the existing pass that replaces '.'  and '@' characters with
'_$_' to also replace '<' and '>' characters.

Reviewed By: cchen

Differential Revision: https://reviews.llvm.org/D154241
2023-06-30 14:58:37 -05:00
Valentin Clement
0d6017cd62
[openacc][NFC] Bump parser support number to OpenACC 3.3
Parser support reached OpenACC 3.3 specification.
Bump the numbers to reflect the latest specs.

Reviewed By: razvanlupusoru, awarzynski

Differential Revision: https://reviews.llvm.org/D154249
2023-06-30 12:56:29 -07:00
Aiden Grossman
1048b7f8e7 [llvm-exegesis] Make sure auxiliary memory is unlinked after usage
Currently the shm_unlink is never called on the auxiliary memory shared
memory, so it stays around after running llvm-exegesis (including
running the llvm-exegesis tests). This patch adds the auxiliary memory
shared memory name to the SharedMemoryNames list so that it gets
unlinked when the destructor of SubprocessMemory is called.
2023-06-30 12:43:20 -07:00
Nikita Popov
bb3763e497 Revert "[SimplifyCFG] Allow dropping block that only contains ephemeral values"
This reverts commit 20f0c68fd83a0147a8ec1722bd2e848180610288.

https://reviews.llvm.org/D153966#4464594 reports an optimization
regression in Rust.

Additionally this change has caused an unexpected 0.3% compile-time
regression.
2023-06-30 21:24:05 +02:00
Andrzej Warzynski
5cebffc276 [mlir][Vector] Update the lowering of vector.transfer_write to SCF
This change updates the lowering of `vector.transfer_write` to SCF when
scalable vectors are used. Specifically, when lowering
`vector.transfer_write` to a loop of `vector.extractelement` ops, make
sure that the upper bound of the generated loop is scaled by
`vector.vscale`:
```
    %10 = vector.vscale
    %11 = arith.muli %10, %c16 : index
    scf.for %arg2 = %c0 to %11 step %c1
```

For reference, this is the current version (i.e. before this change):
```
    scf.for %arg2 = %c0 to %c16 step %c1
```
Note that this only valid for fixed-width vectors.

Differential Revision: https://reviews.llvm.org/D154226
2023-06-30 20:14:47 +01:00
Kun Wu
7a3ebba9cb [mlir][sparse][gpu] Add explaining string to three static_assert stmts
Differential Revision: https://reviews.llvm.org/D154243
2023-06-30 14:10:45 -05:00