515019 Commits

Author SHA1 Message Date
Adrian Prantl
9eddc8b9bf
[lldb] Expose structured command diagnostics via the SBAPI. (#112109)
This allows IDEs to render LLDB expression diagnostics to their liking
without relying on characterprecise ASCII art from LLDB. It is exposed
as a versioned SBStructuredData object, since it is expected that this
may need to be tweaked based on actual usage.
2024-10-14 16:29:26 -07:00
vporpo
fc08ad6610
[SandboxVec][DAG] Implement UnscheduledSuccs (#112255)
This patch implements the UnscheduledSuccs counter in DGNode. It counts
the number of unscheduled successors and is used by the scheduler to
determine when a node is ready.
2024-10-14 16:23:22 -07:00
Nicolas van Kempen
3484ed9325
[docs][clang-tools-extra] Fix broken document link in ReleaseNotes.rst
Fixes the following error:
```
clang-tools-extra/docs/ReleaseNotes.rst:247: WARNING: unknown document: 'clang-tidy/checks/readability/readability-identifier-naming' [ref.doc]
```
2024-10-14 18:43:33 -04:00
k-kashapov
f032622dd2
[MSan] Copy tests for 32-bit architectures (#111835)
As discussed in https://github.com/llvm/llvm-project/pull/109284
Copied msan tests from 64-bit platforms to following 32-bit platforms:
* MIPS
* ARM
* RISCV
* PowerPC
* i386

Most of the tests have been copied form mips64.
Target triple and test contents have not been changed: to be done in
next PR.

---------

Co-authored-by: Kamil Kashapov <kashapov@ispras.ru>
2024-10-14 15:39:36 -07:00
Shubham Sandeep Rastogi
d8de2391eb Revert "[lldb] Improve unwinding for discontinuous functions (#111409)"
This reverts commit a89e01634fe2e6ce0b967ead24280b6693b523dc.

This is being reverted because it broke the test:

Unwind/trap_frame_sym_ctx.test

/Users/ec2-user/jenkins/workspace/llvm.org/lldb-cmake/llvm-project/lldb/test/Shell/Unwind/trap_frame_sym_ctx.test:21:10: error: CHECK: expected string not found in input
 CHECK: frame #2: {{.*}}`main
2024-10-14 15:27:05 -07:00
Craig Topper
1c17484e10
[RISCV] Use RVInst16CB for C_SRLI64_HINT and C_SRAI64_HINT. (#112250)
c.srli(64) and c.srai(64) are encoded differently than c.slli(64). The
former have a 3-bit register, while the latter has a 5-bit register.
c.srli and c.srai already use RVInst16CB.

The "let Inst{11-10} =" prevented this from causing any functional
issues by dropping the upper 2 bits of the register. The ins/outs list
uses GPRC so the register class is constrained.
2024-10-14 15:25:29 -07:00
David CARLIER
b8ee0aac2a
[compiler-rt] DumpAllRegisters implementation for windows arm64. (#112254) 2024-10-14 23:13:37 +01:00
Craig Topper
d0d54fa066 [RISCV] Move "let rd = 0" into class body. NFC
We usually override operand related fields in the class body instead
of at the top level.
2024-10-14 15:07:45 -07:00
Yuta Saito
58bf78ce9e
[lld][WebAssembly] Fix build break when building liblldWasm.so (#112275)
Fix `BUILD_SHARED_LIBS=ON` build for
d4efc3e097f40afbe8ae275150f49bb08fc04572
2024-10-15 07:04:27 +09:00
Paul Kirth
c4131cb56c
[Fuchsia][cmake] Avoid referencing cxx_shared in compiler-rt (#112257)
After https://github.com/llvm/llvm-project/pull/80007 Fuchsia builds are
now always building cxx_shared for arm64 and x64 Linux. Ultimately, this
is because the LIBCXX_ENABLE_SHARED is not used in compiler-rt to select
the correct libc++ target, and because cxx_shared is now always defined,
it is selected as a dependency when building runtimes tests.

---------

Co-authored-by: Petr Hosek <phosek@google.com>
2024-10-14 14:41:19 -07:00
Jonas Devlieghere
9cc6e6f71c
[lldb] Use CFPropertyListCreateData in debugserver (NFC) (#112262)
CFPropertyListCreateXMLData has been deprecated since macOS 10.10. Use
CFPropertyListCreateData instead.
2024-10-14 14:30:32 -07:00
lntue
d0b6709965
[libc][math] Fix issignaling macro usage in the implementation. (#112235) 2024-10-14 17:30:07 -04:00
Nico Weber
140cbca83d Revert "[AMDGPU][SplitModule] Handle !callees metadata (#108802)"
This reverts commit 4a0dc3ef36ceff20787ff277a1fb6a1b513c4934.
Breaks tests, see comments on
https://github.com/llvm/llvm-project/pull/108802
2024-10-14 17:26:15 -04:00
Aly ElAshram
76173b1b67
[libc] Add Linux mman extension remap_file_pages. (#110307)
Fixes https://github.com/llvm/llvm-project/issues/110122
- Create remap_file_pages.h/.cpp wrapper for the linux sys call.
- Add UnitTests for remap_file_pages
- Add function to libc/spec/linux.td
- Add Function spec to mman.yaml
2024-10-14 14:04:32 -07:00
Luke Lau
db57fc4edc
[RISCV][VLOPT] Fix passthru check in getOperandInfo (#112244)
If a pseudo has a passthru, I believe the first source operand will have
operand no 2, not 1.
2024-10-14 20:54:17 +01:00
ChiaHungDuan
037938d637
Revert "[scudo] Apply the min release threshold to the group" (#112252)
Reverts llvm/llvm-project#112014

The change didn't update the iterator
2024-10-14 12:53:07 -07:00
vporpo
08bfc9b0ae
[SandboxVec][DAG] Avoid unnecessary dependency scan and improve description (#112057)
When NewInterval is below DAGInterval we used to revisit instructions
already visited. This patch fixes this by separating the scan in two:
1. The full scan of the NewInterval, and
2. The cross-interval scan for DAGInterval.

This is further explained in the new description.
2024-10-14 12:50:21 -07:00
Petr Hosek
66723a07d8
[HIP] Suport LLVM Driver (#112249)
This addresses an issue introduced in #112041.
2024-10-14 12:43:38 -07:00
Florian Mayer
e052c4c2b9
[NFC] [MTE] Use aarch64-linux-android34 for globals test (#112050)
It doesn't make a difference currently, but MTE globals are only
supported on Android, so that's the more natural target to use.
2024-10-14 12:31:49 -07:00
Max Winkler
9bf68c2400
[Headers] [ARM64EC] Fix extra tokens inside intrin0.h preprocessor directive (#112066)
Fixes https://github.com/llvm/llvm-project/pull/87717.
2024-10-14 12:22:25 -07:00
Michael Kuron
96c32073a1
[NVTPX] Copy kernel arguments as byte array (#110356)
Ensures that struct padding is not skipped, as it may contain actual
data if the struct is really a union.

The patch originated from a discussion on #53710

Fixes #53710
2024-10-14 12:12:27 -07:00
Haojian Wu
0eaccee180
[Clang] Diagnose dangling references in std::vector. (#111753)
This is a follow-up to https://github.com/llvm/llvm-project/pull/108344.

The original bailout check was overly strict, causing it to miss cases
like the vector(initializer_list, allocator) constructor. This patch
relaxes the check to address that issue.

Fix #111680
2024-10-14 21:09:00 +02:00
Thomas Petazzoni
a1217020da
Undef _TIME_BITS along with _FILE_OFFSET_BITS
This change is identical to
26800a2c7e7996dc773b4e990dd5cca41c45e1a9 ("[sanitizer] Undef
_TIME_BITS along with _FILE_OFFSET_BITS on Linux"), but for
sanitizer_procmaps_solaris.cpp.

Indeed, even though sanitizer_procmaps_solaris.cpp is Solaris
specific, it also gets built on Linux platforms. It also includes
sanitizer_platform.h, which also ends up including features-time64.h,
causing a build failure on 32-bit Linux platforms on which 64-bit
time_t is enabled by setting _TIME_BITS=64.

To fix this, we do the same change: undefine _TIME_BITS, which anyway
will cause no harm as the rest of this file is inside a
SANITIZER_SOLARIS compile-time conditional.

Fixes:

In file included from /home/thomas/buildroot/buildroot/output/host/i686-buildroot-linux-gnu/sysroot/usr/include/features.h:394,
                 from ../../../../libsanitizer/sanitizer_common/sanitizer_platform.h:25,
                 from ../../../../libsanitizer/sanitizer_common/sanitizer_procmaps_solaris.cpp:14:
/home/thomas/buildroot/buildroot/output/host/i686-buildroot-linux-gnu/sysroot/usr/include/features-time64.h:26:5: error: #error "_TIME_BITS=64 is al
lowed only with _FILE_OFFSET_BITS=64"
   26 | #   error "_TIME_BITS=64 is allowed only with _FILE_OFFSET_BITS=64"
      |     ^~~~~

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Closes: https://github.com/llvm/llvm-project/pull/99699
2024-10-14 20:02:26 +01:00
Benjamin Kramer
8bb100b940 [bazel] Add missing dependencies for d4efc3e097f40afbe8ae275150f49bb08fc04572 2024-10-14 20:54:31 +02:00
Artem Belevich
30a06e8022
[CUDA] Add support for CUDA-12.6 and sm_100 (#112028)
This is a copy of #97402(with minor updates), which is now ready to land.

---------

Co-authored-by: Sergey Kozub <skozub@nvidia.com>
2024-10-14 11:51:05 -07:00
Michael Maitland
c2c4db8d8f
[RISCV][VLOPT] Add support for 11.11 div instructions (#112201)
This adds support for these instructions and also tests getOperandInfo
for these instructions as well.
2024-10-14 14:44:33 -04:00
Michael Maitland
82e89c0271
[RISCV][VLOPT] Add support for 11.9 min/max instructions (#112198)
This adds support for these instructions and also tests getOperandInfo
for these instructions as well.
2024-10-14 14:43:56 -04:00
Sasha Lopoukhine
36a405519b
[mlir][SCF] Multiply lower bound in loop range folding (#111875)
Fixes #83482
2024-10-14 20:15:12 +02:00
Shourya Goel
8906bff5ab
[libc][complex] Silence pedantic warning (#112239)
Fix buildbot errors due to #111659
2024-10-14 14:11:01 -04:00
ChiaHungDuan
53c9553562
[scudo] Apply the min release threshold to the group (#112014)
For the block smaller than a page size, one block is unlikely to
introduce more unused pages (at most 2 if it acrosses the page boundary
and both touched pages are unused). So it's better to apply the
threshold to reduce the time of scanning groups that can't release any
new pages.
2024-10-14 10:46:12 -07:00
Yuta Saito
d4efc3e097
[Coverage][WebAssembly] Add initial support for WebAssembly/WASI (#111332)
Currently, WebAssembly/WASI target does not provide direct support for
code coverage.
This patch set fixes several issues to unlock the feature. The main
changes are:

1. Port `compiler-rt/lib/profile` to WebAssembly/WASI.
2. Adjust profile metadata sections for Wasm object file format.
- [CodeGen] Emit `__llvm_covmap` and `__llvm_covfun` as custom sections
instead of data segments.
    - [lld] Align the interval space of custom sections at link time.
- [llvm-cov] Copy misaligned custom section data if the start address is
not aligned.
    - [llvm-cov] Read `__llvm_prf_names` from data segments
3. [clang] Link with profile runtime libraries if requested

See each commit message for more details and rationale.
This is part of the effort to add code coverage support in Wasm target
of Swift toolchain.
2024-10-15 02:41:43 +09:00
Michael Maitland
2f077ece2f [RISCV][VLOPT] Enable VLOptimizer for vl-opt.ll test file 2024-10-14 10:36:06 -07:00
Shourya Goel
f4ba6a654d
[libc][complex] Set up headers and add documentation for complex.h. (#111659)
Refer: 7.3.1 from [ISO
SPEC](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3220.pdf)

I have added complex variants of F16 and F128 in libc doc but have
omitted support for them since we will have to first investigate how
their support matrix for clang and gcc looks like, and then add header
guards for them accordingly. Planning to add them in follow up PRs once
this gets landed.
2024-10-14 13:35:04 -04:00
Amir Ayupov
3c4f00905e
[BOLT] Support perf2bolt-N in the driver
Check invoked tool with `starts_with`.

Addresses the issue where `perf2bolt` invoked using a distro symlink
`perf2bolt-16` fails to run in perf2bolt mode and runs in llvm-bolt mode
instead.

The issue is mentioned in https://vondra.me/posts/playing-with-bolt-and-postgres/

Test Plan:
```
ln -sf perf2bolt perf2bolt-20
perf2bolt-20 clang -p perf.data -o fdata.clang -w yaml.clang
...
PERF2BOLT: wrote 188593 objects and 0 memory objects to fdata.clang
```

Reviewers: ayermolo, rafaelauler, dcci, maksfb

Reviewed By: maksfb

Pull Request: https://github.com/llvm/llvm-project/pull/111072
2024-10-14 10:17:31 -07:00
Pavel Labath
a89e01634f
[lldb] Improve unwinding for discontinuous functions (#111409)
Currently, our unwinder assumes that the functions are continuous (or at
least, that there are no functions which are "in the middle" of other
functions). Neither of these assumptions is true for functions optimized
by tools like propeller and (probably) bolt.

While there are many things that go wrong for these functions, the
biggest damage is caused by the unwind plan caching code, which
currently takes the maximalist extent of the function and assumes that
the unwind plan we get for that is going to be valid for all code inside
that range. If a part of the function has been moved into a "cold"
section, then the range of the function can be many megabytes, meaning
that any function within that range will probably fail to unwind.

We end up with this maximalist range because the unwinder asks for the
Function object for its range. This is only one of the strategies for
determining the range, but it is the first one -- and also the most
incorrect one. The second choice would is asking the eh_frame section
for the range of the function, and this one returns something reasonable
here (the address range of the current function fragment) -- which it
does because each fragment gets its own eh_frame entry (it has to,
because they have to be continuous).

With this in mind, this patch moves the eh_frame (and debug_frame) to
the front of the queue. I think that preferring this range makes sense
because eh_frame is one of the unwind plans that we return, and some
others (augmented eh_frame) are based on it. In theory this could break
some functions, where the debug info and eh_frame disagree on the extent
of the function (and eh_frame is the one who's wrong), but I don't know
of any such scenarios.
2024-10-14 18:56:37 +02:00
Michael Marjieh
b5600c6f85
[TargetLowering][SelectionDAG] Exploit nneg Flag in UINT_TO_FP (#108931)
1. Propagate the nneg flag in WidenVecRes
2. Use SINT_TO_FP in expandUINT_TO_FP when possible.
2024-10-14 20:55:48 +04:00
Keith Smiley
c79e5acfe8
[clang-tidy][readability-identifier-naming] Support namespace aliases (#112112)
Fixes: https://github.com/llvm/llvm-project/issues/109385
2024-10-14 09:35:20 -07:00
Keith Smiley
39ac8b25cd
[clang][GNU] Pass -t through to the linker (#112106) 2024-10-14 09:24:42 -07:00
c8ef
ab6ec7ab14
[clang] Mark __builtin_convertvector and __builtin_shufflevector as constexpr. (#112129)
Closes #107985.

LanguageExtensions.rst states that `__builtin_shufflevector` and
`__builtin_convertvector` can be evaluated as constants, but this is not
reflected in Butiltins.td. This patch aligns these two.
2024-10-15 00:09:36 +08:00
Erich Keane
cf456ed2a4
[OpenACC] implement loop 'worker' clause. (#112206)
The worker clause specifies iterations of the loop/ that are executed in
parallel by distributing the iterations among the multiple works within
a single gang.

The sema rules for this type are simply that it cannot be combined with
a `kernel` construct with a `num_workers` clause, child `loop` clauses
cannot contain a `gang` or `worker` clause, and that the argument is oly
allowed when associated with a `kernel`.
2024-10-14 09:08:24 -07:00
Doug Wyatt
cef66aa04d
[Clang] Diagnose additional ObjC statements as function effect violations (#112148)
Bug fix: `@autoreleasepool`, `@synchronized`, and `@finally` were not
being noticed and treated as function effect violations.

---------

Co-authored-by: Doug Wyatt <dwyatt@apple.com>
2024-10-14 17:49:30 +02:00
Shilei Tian
a74659445d
[AMDGPU] Skip terminators when forcing emit zero flag (#112116)
When forcing emit zero, we need to skip terminators of a MBB; otherwise
the terminator list of the MBB would be broken.
2024-10-14 11:46:18 -04:00
Michael Maitland
a31e834ba8 [RISCV][VLOPT] Update test cases to use riscv-enable-vl-optimizer and better formatting 2024-10-14 08:44:16 -07:00
Aaron Ballman
8e5aa538ca
[C2y] Add test coverage for N3298 (#112033)
This paper adds 'i' and 'j' as suffixes for forming a _Complex constant.
This feature has been supported in Clang since at least Clang 3.0, so
only test coverage is needed.

It does remove -Wgnu-imaginary-constant in C mode (still used in C++
mode) because the feature is now a C2y feature rather than a GNU one.
2024-10-14 11:40:10 -04:00
Thomas Fransham
09fa2f012f
[Clang] Add explicit visibility symbol macros (#108276)
This is part of the effort to support for enabling plugins on windows by
adding better support for building llvm and clang as a DLL. These macros
are similar to the ones i added in #96630, but are for clang.
Added explicit symbol visibility macros definitions that are defined in
a new header and will be used to for shared library builds of clang to
export
symbols. 
Updated clang cmake to define a macro to enable the symbol visibility
macros and explicitly disable them for clang tools that always use
static linking.

---------

Co-authored-by: Aaron Ballman <aaron@aaronballman.com>
2024-10-14 18:32:50 +03:00
David Spickett
eb83e4abd6 [llvm][llvm-lit] Fix typo in --resultdb-output help 2024-10-14 15:12:40 +00:00
Benjamin Kramer
7900daaa7b [MLIR] Fix parseInteger(uint64_t) for large values
This is a regression from e692af85966903614d470a7742ed89d124baf1a6
2024-10-14 17:07:27 +02:00
Alexey Bataev
ab902ee54a [SLP][NFC]Replace more unreachable terminators by rets, NFC 2024-10-14 07:50:07 -07:00
Albert Huang
aa2c0f35a1
[ARM] [AArch32] Add support for Arm China STAR-MC1 CPU (#110085)
STAR-MC1 is an Armv8m CPU.

Technical specifications available at:

https://www.armchina.com/download/Documents/Application-Notes/Technical-Reference-Manual?infoId=160
2024-10-14 15:48:12 +01:00
Tarun Prabhu
839344f025
[clang][flang][mlir] Reapply "Support -frecord-command-line option (#102975)"
The underlying issue was caused by a file included in two different
places which resulted in duplicate definition errors when linking
individual shared libraries. This was fixed in c3201ddaeac02a2c86a38b
[#109874].
2024-10-14 08:44:24 -06:00