Commit Graph

535696 Commits

Author SHA1 Message Date
Kazu Hirata
ff66d34286 [Driver] Simplify string comparisons (NFC) (#137756) 2025-04-29 00:30:59 -07:00
Pavel Labath
a9ece2dc68 [lldb] Skip some Host::GetProcessInfo tests for macos
Some of the tests moved in #134354 do not currently pass on a mac. Disable
them.

The test for testing process priority also does not build on a mac.  I'm not
moving it (back) to the linux, since it's "almost" fine -- we'd just need to
implement the RLIMIT_NICE logic differently. I'm not doing that now since
(apart from linux) there are no systems which are able to retrieve the process
priority.
2025-04-29 09:28:43 +02:00
Jack Styles
ace8ceab73 [ARM][Driver] Ensure NEON is enabled and disabled correctly (#137595)
In #130623 support was added for `+nosimd` in the clang driver.
Following this PR, it was discovered that, if NEON is disabled in the
command line, it did not disable features that depend on this, such as
Crypto or AES. To achieve this, This PR does the following:
- Ensure that disabling NEON (e.g., via +nosimd) also disables dependent
features like Crypto and AES.
- Update the driver to automatically enable NEON when enabling features
that require it (e.g., AES).

This fixes inconsistent behavior where features relying on NEON could be
enabled without NEON itself being active, or where disabling NEON left
dependent features incorrectly enabled.
2025-04-29 08:28:10 +01:00
LLVM GN Syncbot
a618ae2c72 [gn build] Port e43e8ec7af 2025-04-29 06:46:28 +00:00
Nikolas Klauser
e43e8ec7af [libc++] Remove dead implementation of is_nothrow_convertible and merge the remaining code into is_convertible.h (#137717)
We can use the `__is_nothrow_convertible` builtin unconditionally now,
which makes the implementation very simple, so there isn't much of a
need to keep a separate header around.
2025-04-29 08:46:06 +02:00
Pavel Labath
15cd71afd2 [lldb] Make ValueObject::Dereference less aggressive (#137311)
The function was always trying to dereference both the synthetic and
non-synthetic view of the object. This is wrong as the caller should be
able to determine which view of the object it wants to access, as is
done e.g. for child member access.

This patch removes the nonsynthetic->synthetic fallback, which is the
more surprising path, and fixes the callers to try both versions of the
object (when appropriate). I also snuck in simplification of the member
access code path because it was possible to use the same helper function
for that, and I wanted to be sure I understand the logic correctly.

I've left the synthetic->nonsynthetic fallback in place. I think we may
want to keep that one as we often have synthetic child providers for
pointer types. They usually don't provide an explicit dereference
operation but I think users would expect that a dereference operation on
those objects would work. What we may want to do is to try the
*synthetic* operation first in this case, so that the nonsynthetic case
is really a fallback.

---------

Co-authored-by: Ilia Kuklin <kuklin.iy@mail.ru>
2025-04-29 08:27:18 +02:00
Pavel Labath
679cc0a1ed [lldb] Remove Function null checks in Block.cpp (#137611)
As of #117683, Blocks are always enclosed in a function, so these checks
never fail. We can't change the signature of
`CalculateSymbolContextFunction` as it's an abstract function (and some
of its implementations can return nullptr), but we can create a
different function that we can call when we know we're dealing with a
block.
2025-04-29 08:20:08 +02:00
Pavel Labath
ebaeecc429 [lldb] Use early returns in TypeSystemClang::IsPossibleDynamicType (#137630)
Remove a couple of levels of indentation before I need to add another
one to fix a bug.
2025-04-29 08:17:53 +02:00
Michael Buch
da7099290c Revert "[lldb][Format] Make function name frame-format variables work without debug-info" (#137757)
Reverts llvm/llvm-project#137408

This change broke `lldb/test/Shell/Unwind/split-machine-functions.test`.

The test binary has a symbol named `_Z3foov.cold` and the test expects
the backtrace to print the name of the cold part of the function like
this:

```
# SPLIT: frame #1: {{.*}}`foo() (.cold) +
```
but now it gets

```
frame #1: 0x000055555555514f split-machine-functions.test.tmp`foo() + 12
```
2025-04-29 07:13:04 +01:00
Timm Baeder
0ddb5794b7 [clang][bytecode] Remove base casts before doing memcpy (#137754)
We have to copy the entire thing, not just one of the bases.
2025-04-29 08:06:31 +02:00
LLVM GN Syncbot
fa1fe11e38 [gn build] Port d1bb8d6a5c 2025-04-29 05:54:01 +00:00
Hemang Gadhavi
d1bb8d6a5c [lldb][AIX] get host info for AIX (#134354)
This PR is in reference to porting LLDB on AIX.

Link to discussions on llvm discourse and github:

1. https://discourse.llvm.org/t/port-lldb-to-ibm-aix/80640
2. https://github.com/llvm/llvm-project/issues/101657
The complete changes for porting are present in this draft PR:
https://github.com/llvm/llvm-project/pull/102601

- Added changes to make the common host support functions under
`Host/posix` for unix-like system.
Also, created the `unittests/Host/posix/` to test the hostInfo & support
functions for unix-like system.
- Added changes to get the host information for AIX. (GetProcessInfo()) 
(Information like : executable path, arch, process status etc.)
2025-04-29 11:23:03 +05:30
Kazu Hirata
93145004b4 [Support] Construct SmallVector with ArrayRef (NFC) (#137586) 2025-04-28 22:25:17 -07:00
Kazu Hirata
bbbb178a35 [mlir] Fix a warning
This patch fixes:

  mlir/lib/Dialect/OpenACC/IR/OpenACC.cpp:2905:17: error: unused
  variable 'var' [-Werror,-Wunused-variable]

  mlir/lib/Dialect/OpenACC/IR/OpenACC.cpp:2908:42: error: unused
  variable 'dataClauseOptional' [-Werror,-Wunused-variable]
2025-04-28 22:18:55 -07:00
Bob Wilson
2f1ef1d183 [Clang] Add new -header-include-filtering=direct-per-file option (#137087)
This adds a new filtering option to be used along with the
-header-include-format=json option. The existing "only-direct-system"
filtering option is missing some things:
- It does not show module imports.
- It does not show includes of non-system headers. This new
"direct-per-file" filtering has a separate entry in the JSON output for
each non-system source file, showing the direct includes and imports
from that file. You can use this to see uses of non-system headers, and
also find the paths through non-system headers that lead up to module
imports and system headers. Modules are identified here by their
modulemap files.
2025-04-28 21:54:45 -07:00
Timm Baeder
15579a8e72 [clang][bytecode] Check array sizes against step limit (#137679) 2025-04-29 05:47:22 +02:00
Naveen Seth Hanig
7ce0f5a9cc [clang][modules] Validate input file format for GenerateModuleInterfaceAction (#132692) (#137711)
Fixes #132692.

`clang -cc1` crashes when generating a module interface with
`emit-module-interface` or `emit-reduced-module-interface` using an
input file which is already a precompiled module (`.pcm`) file.
This commit adds validation for the input file format and Clang will now
emit an error message instead of crashing.
2025-04-29 11:22:34 +08:00
Jonas Devlieghere
a37e475efc [lldb] Rely on operator== for std::vector (NFC)
Rely on operator== for std::vector instead of comparing the elements in
the vector element by element,
2025-04-28 20:10:56 -07:00
Sam Elliott
4e175b8896 [RISCV] Fix Defs/Uses for SiFive CLIC Support (#137724)
The expensive checks bots found issues with #132481, due to not setting
defs/uses correctly. In 31bd7a5071 I added verify flags, so that the
failure is reproduced without requiring expensive checks, and xfailed
the test.

This change:
- Ensures that registers are correctly marked as defs/uses.
- Removes the xfail.
- Leaves the tests with `-verify-machineinstrs` which should have been
present originally.
2025-04-28 19:35:11 -07:00
Luke Lau
7ca6490636 [VPlan] Factor out isUnrolled() helper in VPWidenIntOrFpInductionRecipe. NFC (#137635)
Split off from #129508, this generalizes getSplatVFValue and
getLastUnrolledPartOperand so they don't need changed if another operand
is added.
2025-04-29 10:18:47 +08:00
Thurston Dang
d913ea307e [msan] Implement support for avx512fp16.mask.{add/sub/mul/div/max/min}.sh.round (#137441)
This adds a handler, visitGenericScalarHalfwordInst, which works for
mask.{add/sub/mul/div/max/min}.sh.round.

Updates the tests in https://github.com/llvm/llvm-project/pull/136260
2025-04-28 18:41:23 -07:00
Elvis Wang
1fc0a1401a [LV][AArch64] Add test for fp128 fmuladd reduction.(NFC) (#137576)
This patch add the test for the fmuladd reduction to show the test
change/fail for the cost model change.

Note that without the fp128 load and trunc, there is no failure.

Pre-commit test for #113903.
2025-04-29 09:18:07 +08:00
Koakuma
5d0e26e571 [compiler-rt] Make sure __clzdi2 doesn't call itself recursively on sparc64 (#136737)
On 64-bit platforms, libgcc doesn't ship with __clzsi2, so __builtin_clz
gets lowered to __clzdi2. A check already exists for GCC, but as of
commit 8210ca0198 clang also lowers
__builtin_clz to __clzdi2 on sparc64.

Update the check so that building __clzdi2 with clang/sparc64 also
works.
2025-04-29 07:36:32 +07:00
Eugene Epshteyn
4def437cdc [flang][NFC] Fixed a typo in Exensions.md (#137738)
Fixed a small typo regarding F'2023 15.5.2.5 paragraph number.
2025-04-28 20:34:17 -04:00
erichkeane
aa940cedca [OpenACC][NFC] Fix GCC7 build after fec003a18a
A GCC 7 requirement on the completeness of types before using them in a
variant means we need a constructor for these (or define them outside the
current thing).  This patch should fix the build, as reported by
@kewen12
2025-04-28 17:30:58 -07:00
Jonas Devlieghere
82ab35961f [lldb-dap] Fix machine-overridable scope (#137723)
My previous commit was a bit sloppy, I didn't spot that
`lldb-dap.executable-path` already had a scope and I didn't consider
that `lldb-dap.log-path` should have the same scope.

This PR addresses both:

 - Fix duplicate scope for `lldb-dap.executable-path`.
 - Change scope of `lldb-dap.log-path` to `machine-overridable` too.
2025-04-28 17:01:03 -07:00
Craig Topper
e4d2ff5b01 [SelectionDAG][PowerPC] Remove setTruncatingStore from StoreSDNode. (#137667)
Mutating a node after it has been created isn't a good idea. After
e17f07c4de, we have a version of setStore
that can create a truncating indexed store. Use that instead of
MorphNodeTo+setTruncatingStore in PowerPC.

Unfortunately, if we return the newly created node, DAGCombiner will
visit the node and change the constant. To prevent this, we use
DCI.CombineTo and avoid adding the new node to the worklist.
2025-04-28 16:48:37 -07:00
Craig Topper
afbd2ce80f [TableGen] Use StringRef::empty() instead of comparing to an empty string. NFC (#137673) 2025-04-28 16:47:52 -07:00
Keith Smiley
a9a891029d [bazel] Fix layering check violation (#137734)
I broke this in 2ce6333a41 since I only
tested with a toolchain that doesn't support layering checks
2025-04-28 16:37:51 -07:00
Keith Smiley
2ce6333a41 [bazel] Fix lldb ODR issue (#137729)
In 42622c7959, depending on the entire
utility library resulted in the lldb binary having more symbols that it
needs, duplicating those in liblldb, leading to odr violations. Now
instead we just expose the Host library's headers, which happens to be
enough for this to compile and link, referencing the symbols from
liblldb
2025-04-28 16:30:54 -07:00
khaki3
b95cc91aaf [flang][acc] Remove an unused variable (#137731)
Fixes what https://github.com/llvm/llvm-project/pull/137691 introduced.
2025-04-28 16:30:47 -07:00
Christopher Bate
11291e213b [mlir] NFC: fix typo in #nvvm.target Tablegen record name (#137621) 2025-04-29 07:29:00 +08:00
khaki3
dd2a1590c3 [flang][acc] Generate constructors and destructors for common blocks (#137691) 2025-04-28 16:11:29 -07:00
Ivan Tadeu Ferreira Antunes Filho
bdfa1ec01f [lld-macho] Fix test to write to correct test dir location (#137708)
(follow-up to #135241).
2025-04-28 18:51:12 -04:00
Wanyi
47de54e9a2 [lldb-dap] Fix TestDap_attach.py flakiness (#137278)
# Summary
This patch makes the `request_attach` wait for events `process` and
`initialized` just like `request_launch`. This ensure the DAP session
can move forward somewhat correctly.

Recently `TestDap_attach.test_terminate_commands` became flaky.
It's hitting:
```
lldbsuite/test/tools/lldb-dap/dap_server.py", line 350, in send_recv
    raise ValueError(desc)
ValueError: no response for "disconnect"
```
I took a look at the DAP msg from that test case and noticed:
- It's not using the regular attaching, instead it's using the
`attachCommands` to launch debug the binary and it will stop at entry.
- The `initialized` event returned after the `disconnect` request. Which
means lldb-dap didn't really get ready yet.

### NOTE
The `dap_server.py` is doing things to mimic the VSCode (or other dap
clients) but it had some assumptions. For example, it's still missing
the `configurationDone` request and response because it relies on a
continue action to trigger the `configurationDone` request.

# Test Plan
```
./bin/llvm-lit -va /Users/wanyi/llvm-upstream/llvm-project/lldb/test/API/tools/lldb-dap/attach/TestDAP_attach.py
./bin/llvm-lit -va /Users/wanyi/llvm-upstream/llvm-project/lldb/test/API/tools/lldb-dap/launch/TestDAP_launch.py
```

To test the `wait_for_events` timeout case
```
events = self.wait_for_events(["process", "initialized", "fake", "event"], 1)
if events:
    raise ValueError(f'no events {",".join(events)} found for within timeout 1')
```
Observed
<img width="696" alt="image"
src="https://github.com/user-attachments/assets/bc97c0ef-d91f-4561-8272-4d36f5f5d4e6"
/>

### Also
Looks like some test cases should be re-enabled in
0b8dfb5762
But only comments was removed. The skip statements survived the change.
2025-04-28 18:32:51 -04:00
Sam Clegg
afdc4b1526 [lld][WebAssembly] Don't mark --start-lib/--end-lib files as live (#137714)
Without this change files in `--start-lib`/`--end-lib` groups were being
marked as live, which means there static constructors were being
included in the link.
2025-04-28 15:30:35 -07:00
Erich Keane
0e07478a5e [CIR] Implement lowering for LinkageSpecDecl (#137634)
Like the NamespaceDecl, this is just emitted as a decl-context, where
all its internal declarations get emitted for it. The incubator doesn't
seem to have any good tests for this, so I wrote what I could think of
as a half-decent test for this one, though the lowering doesn't manage
whether these should be mangled, so the test is mostly just for
spot-checking purposes.

I'm implementing this as it will make writing further tests for future
features a little easier.
2025-04-28 15:23:10 -07:00
erichkeane
fec003a18a [OpenACC]Reimplement 'for' loop checks for a loop construct
The 'loop' construct has some pretty strict checks as to what the for
loop associated with it has to look like. The previous implementation
was a little convoluted and missed implementing the 'condition'
checking.  Additionally, it did a bad job double-diagnosing with
templates.

This patch rewrites it in a way that does a much better job with the
double-diagnosing, and proeprly implements some checks for the
'condition' of the for loop.
2025-04-28 15:22:47 -07:00
Vitaly Buka
b111da97e8 [NFC][asan] Try to deflake asan_lsan_deadlock test (#137718)
10s looks not enough. With highly parallel test
execution on VMs it's very possible that Asan
report will have no enough time to produce output.

I can reproduce locally 1s is not always enough,
but likely my workstation is faster then buildbot.

Additionally, don't use puts/CHECK to validate
timeout. We can exit with 0 and it should violate
"not" expectation.

Follow up to #131756.
2025-04-28 15:17:51 -07:00
Alexey Bataev
ea1b525ceb [LAA] Add tests with non-power-of-2 store-load forward distance (#136710) 2025-04-28 15:10:55 -07:00
Bruno Cardoso Lopes
a5024cd0d7 [MLIR][LLVM] More on CG Profile: support null function entries (#137269) 2025-04-28 15:03:09 -07:00
Alexander Kornienko
b509f7cca5 Revise CK_NullToPointer comment
This addresses a post-commit review comment in https://github.com/llvm/llvm-project/pull/137364#discussion_r2064772853.
2025-04-28 23:45:31 +02:00
Alexey Bataev
88f8637d22 Revert "[LAA] Add tests with non-power-of-2 store-load forward distance (#136710)"
This reverts commit 51bbebb667 to fix
buildbots https://lab.llvm.org/buildbot/#/builders/137/builds/17662
2025-04-28 14:36:44 -07:00
Jonas Devlieghere
7d4e6ff216 [lldb-dap] Bump the version to 0.2.13 2025-04-28 14:11:01 -07:00
Felipe de Azevedo Piovezan
b73169ad3e [lldb] Disable TestDAP_attachByPortNum
This test is flaky and creating a lot of noise in CI.
See https://github.com/llvm/llvm-project/issues/137660
2025-04-28 14:08:14 -07:00
John Harrison
4fa0f1d166 [lldb-dap] Adding an icon to the lldb-dap package. (#137695)
This shows up in the extension UI and in the VSCode extension
marketplace.

I used the llvm/llvm-www/blob/main/img/LLVMWyvernSmall.png for the
image.

Here is what this looks like locally: 
<img width="1020" alt="Screenshot 2025-04-28 at 12 30 33 PM"
src="https://github.com/user-attachments/assets/cd615161-06db-4a37-8f8a-df65ca620a67"
/>
2025-04-28 14:02:36 -07:00
Alexey Bataev
51bbebb667 [LAA] Add tests with non-power-of-2 store-load forward distance (#136710) 2025-04-28 17:02:02 -04:00
Florian Hahn
d2ce88a939 [VPlan] Create initial skeleton before creating regions. (NFC)
Move out the logic to prepare for vectorization to a separate transform,
before creating loop regions. This was discussed as follow-up
in https://github.com/llvm/llvm-project/pull/136455.

This just moves the existing code around slightly  and will simplify
follow-up patches to include the exiting edges during initial VPlan
construction.
2025-04-28 21:51:32 +01:00
Amr Hesham
e12ff331f1 [CIR] Standardize element type name between Array and Vector Types (#137465)
Standardize the element type name
2025-04-28 22:50:48 +02:00
Tom Stellard
59978b21ad [sanitizer_common] Remove interceptors for deprecated struct termio (#137403)
This struct will be removed from glibc-2.42 and has been deprecated for
a very long time.

Fixes #137321
2025-04-28 13:45:11 -07:00