Commit Graph

535688 Commits

Author SHA1 Message Date
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
Justin Bogner
f9855917f6 [HLSL] Treat classes and structs as packed by default (#137391)
Fixes #121010.
2025-04-28 13:44:46 -07:00
Krzysztof Parzyszek
9ea5254f77 [flang][OpenACC][OpenMP] Separate implementations of ATOMIC constructs (#137517)
The OpenMP implementation of the ATOMIC construct will change in the
near future to accommodate atomic conditional-update and conditional-
update-capture operations. This patch separates the shared implemen-
tations to avoid interfering with OpenACC.
2025-04-28 15:43:39 -05:00
Susan Tan (ス-ザン タン)
dfdc50be8e [mlir][acc] Remove declare attribute verification (#137676)
The part that verifies the declare attributes are preserved in the
verifier can fail easily during the FIR lowering pipeline. For example,
during FIR lowering to FIRCG, fir.declare can be removed. Thus, any
fir.declare that has acc.declare attributes will cause a verifier
failure. Since the declare attribute only existed to simplify the effort
of locating acc declare enter and exit points, which can be easily
replaced by a def-use chain traversal, we are considering removing the
verification of declare attributes in this MR.

Example:

```  
%1 = fir.alloca !fir.array<10xf32> {bindc_name = "arr", uniq_name = "_QMmmFsubEarr"}                                                                                                                                  
%2 = fir.shape %c10 : (index) -> !fir.shape<1>
%3 = fir.declare %1(%2) {acc.declare = #acc.declare<dataClause =  acc_create>, uniq_name = "_QMmmFsubEarr"} : (!fir.ref<!fir.array<10xf32>>, !fir.shape<1>) -> !fir.ref<!fir.array<10xf32>>
%4 = acc.create varPtr(%3 : !fir.ref<!fir.array<10xf32>>) -> !fir.ref<!fir.array<10xf32>> {name = "arr"}
%5 = acc.declare_enter dataOperands(%4 : !fir.ref<!fir.array<10xf32>>) 
```

the acc.declare_enter itself is enough to identify when the data region
starts.
2025-04-28 13:11:26 -07:00
David Green
86b7ce9497 [CostModel] Remove some negative costs. (#135533)
The cost model in the past returned -1 for unknown costs, but over time
this has largely been removed. This cleans up some of the uses that have
remained. It uses 0/free for the cost of an insert and 1/basic for the
cost of anything that is unknown.
2025-04-28 21:08:14 +01:00
Maryam Moghadas
82a1d5078d [PowerPC] Add dense math half-precision floating-point outer-product accumulate to DMR instructions (#133272)
This patch adds the following Dense Math Facility 16-bit half-precision
floating-point calculation instructions: dmxvf16gerx2, dmxvf16gerx2pp,
dmxvf16gerx2pn, dmxvf16gerx2np, dmxvf16gerx2nn, pmdmxvf16gerx2,
pmdmxvf16gerx2pp, pmdmxvf16gerx2pn, pmdmxvf16gerx2np, pmdmxvf16gerx2nn,
along with their corresponding intrinsics and tests.
2025-04-28 16:03:10 -04:00
Sam Elliott
31bd7a5071 [RISCV] XFAIL SiFive Interrupt Test 2025-04-28 13:00:49 -07:00
ivangarcia44
cd116ee29e Add examples for reinterpret_cast and subview operators to show their behavior in relation to their input memref underlying memory and view (#135244)
While working on #134845 I was trying to understand the difference of
how the reinterpret_cast and subview operators see the input memref, but
it was not clear to me.

I did a couple of experiments in which I learned that the subview takes
into account the view of the input memref to create the view of the
output memref, while the reinterpret_cast just uses the underlying
memory of the input memref.

I thought it would help future readers to see these two experiements as
examples in the documentation to quickly figure out the difference
between these two operators.

@matthias-springer
@joker-eph
@sahas3
@Hanumanth04
@dixinzhou
@rafaelubalmw

---------

Co-authored-by: Ivan Garcia <igarcia@vdi-ah2ddp-178.dhcp.mathworks.com>
2025-04-28 15:58:47 -04:00
Joshua Batista
c8b3d79961 [DXIL] Remove incompatible metadata types when preparing DXIL. (#136386)
This PR introduces a Metadata Node Kind allowlist. The purpose is to
prevent newer Metadata Node Kinds to be used and inserted into the
outputted DXIL module. Only the metadata kinds that are accepted in the
DXIL Validator are on the allowlist. The Github DXC validator doesn't
support these newer Metadata Node Kinds, so we need to filter them out.

We introduce this restrictive allowlist into LLVM and strip all metadata
that isn't found in the list.

The accompanying test would add the `llvm.loop.mustprogress` metadata
node kind, but thanks to the allowlist, filters it out, and so the
whitelist is proven to work.
The test also has two separate metadata kinds that are on the allowlist,
and remain after the DXIL Prepare pass.
2025-04-28 12:43:38 -07:00