547558 Commits

Author SHA1 Message Date
Finn Plummer
01b1e0a891 review: rename files 2025-08-14 16:47:48 +00:00
Finn Plummer
15632c83e9 review: fix up test comments 2025-08-14 16:47:09 +00:00
Finn Plummer
b821448e65 review: apply suggestions from the boilerplate pr here 2025-08-13 17:42:56 +00:00
Finn Plummer
325809da9d add basic test cases 2025-08-12 18:34:28 +00:00
Finn Plummer
d8bc47e81c Add ToRemove to implemented options 2025-08-12 18:10:31 +00:00
Finn Plummer
09a5ebed14 [DirectX] Add suport to remove specified sections (parts) 2025-08-12 18:10:07 +00:00
Finn Plummer
d450f5e5a1 self-review: correct header filesize 2025-08-12 18:05:54 +00:00
Finn Plummer
99e3b41a98 review: remove partition related options 2025-08-12 17:05:56 +00:00
Finn Plummer
152c383f8b review: remove symbol related options 2025-08-12 17:02:55 +00:00
Finn Plummer
c78cc588f4 review: allow PreserveDates 2025-08-12 16:56:39 +00:00
Finn Plummer
56cbd57532 review: address LLVM/objcopy guideline comments 2025-08-12 16:42:18 +00:00
Finn Plummer
7ca8df7351 review: account for endianness on non-copy values 2025-08-11 22:25:33 +00:00
Finn Plummer
a3229ee009 review: use dxbc instead of dxc 2025-08-11 22:25:14 +00:00
Finn Plummer
c4b10967ee self-review: recompute offsets instead of storing them 2025-08-11 22:24:58 +00:00
Finn Plummer
648d0fc2fc add basic tests 2025-08-11 19:56:19 +00:00
Finn Plummer
44f66db8dc boiler plate to add dxcontainer to objcopy 2025-08-08 22:10:48 +00:00
Jonas Devlieghere
dbaa82b384
[lldb] Move the generic MCP code into Protocol/MCP (NFC) (#152188)
This moves all the generic MCP code into the new ProtocolMCP library so
it can be shared between the MCP implementation in LLDB (built on the
private API) and lldb-mcp (built on the public API).

This PR doesn't include the actual MCP server. The reason is that the
transport mechanism will be different between the LLDB implementation
(using sockets) and the lldb-mcp implementation (using stdio). The goal
s to abstract away that difference by making the server use
JSONTransport (again) but I'm saving that for a separate PR.
2025-08-05 14:10:31 -07:00
Peter Klausler
867602742c
[flang] Minor speed-up to module file parsing (#152178)
Module files shouldn't ever produce parsing errors, and if they did in
the case of a badly-generated module file, the compiler will notice and
crash. So we can run the parser on module files with message deferral
enabled, and that saves time that would otherwise be spent generating
messages on failed parsing alternatives that are discarded anyway when
backtracking. It's not a big savings (single digit percentage on overall
compilation time for a big application with lots of modules), but worth
doing.
2025-08-05 13:40:30 -07:00
Peter Klausler
fc9a080780
[flang][runtime] Handle empty NAMELIST value list (#151770)
InputNamelist() returns early if any value list read in by
InputDerivedType() or DescriptorIo<Input>() is empty, since they return
false. But an empty value list is okay, and the early return should
occur only on error.

Fixes https://github.com/llvm/llvm-project/issues/151756.
2025-08-05 13:40:11 -07:00
Peter Klausler
56051daaf0
[flang][runtime] Optimize Descriptor::FixedStride() (#151755)
Put the common cases on fast paths, and don't depend on IsContiguous()
in the general case path. Add a unit test, too.
2025-08-05 13:39:54 -07:00
Peter Klausler
effa35d240
[flang][runtime] Don't always accept a bare exponent letter (#151597)
For more accurate compatibility with other compilers' extensions, accept
a bare exponent letter as valid real input to a formatted READ statement
only in a fixed-width input field. So it works with (G1.0) editing, but
not (G)/(D)/(E)/(F) or list-directed input.

Fixes https://github.com/llvm/llvm-project/issues/151465.
2025-08-05 13:39:33 -07:00
Peter Klausler
aec90f2f27
[flang][runtime] Fix child input bugs under NAMELIST (#151571)
When NAMELIST input takes place on a derived type, we need to preserve
the type in the descriptor that is created for storage sequence
association. Further, the fact that any child list input in within the
context of a NAMELIST must be inherited so that input fields don't try
to consume later "variable=" strings.

Fixes https://github.com/llvm/llvm-project/issues/151222.
2025-08-05 13:39:08 -07:00
Caslyn Tonelli
cfd1ee781f
[libc] Add dlinfo + RTLD_DI_* macros to dlfcn.h (#149938)
An initial commit for #149911, this adds a stub implementation for
dlinfo and the enums list of `RTLD_DI_*` values.

While the dlinfo implementation relies on dynamic linker support, this
patch will add its prototype in the generated dlfcn.h header so that it
can be used by downstream platforms that have their own dlinfo
implementation.
2025-08-05 13:34:30 -07:00
Jann
da6424c9e3
[DebugInfo][DWARF] Don't emit bogus DW_AT_call_target for complex calls (#151378)
On X86-64, LLVM currently generates the same DWARF debug info for `call
rax` and `call [rax]`; in both cases, the generated DWARF claims that
the call goes to address RAX. This bug occurs because the X86 machine
instructions CALL64r and CALL64m both receive register operands, but
those register operands have different semantics.

To fix it, change DwarfDebug::constructCallSiteEntryDIEs() to validate
the callee operand's semantics (`OperandType`) and make sure it is not
semantically describing a memory location.

This fix will result in less DW_TAG_call_site and DW_AT_call_target
entries being generated.

There is an existing test in dwarf-callsite-related-attrs.ll that
asserts the broken behavior; remove the broken check, and instead add a
new test dwarf-callsite-related-attrs-indirect.ll that checks behavior
for indirect calls.

The existing test xray-custom-log.ll is validating something even more
broken: It checks the debug info generated by a PATCHABLE_EVENT_CALL.
`TII->getCalleeOperand()` assumes that the first argument of a call
instruction is always the destination, but the first argument of
PATCHABLE_EVENT_CALL is instead the event structure; and so we were
emitting debug info claiming the callee was stored in a register that
actually contains some kind of xray event descriptor, and the test
validates that this happens.
I am breaking and deleting this test.
I guess the intent there might have been to validate that we emit
debuginfo referencing the target of the direct call that LLVM emits
(which we don't do)? But I'm not sure.
2025-08-05 13:25:01 -07:00
Jeremy Kun
97dee32445
[MLIR][Presburger] add iterVarKind for convenient iterating over variables (#152091)
I find myself doing this alot

```
for (unsigned varIndex = rel.getVarKindOffset(VarKind::Domain);
     varIndex < rel.getVarKindEnd(VarKind::Domain); ++varIndex) {
  ...
}
```

Adding this convenience method so I can instead do

```
for (unsigned varIndex : rel.iterVarKind(VarKind::Domain)) {
  ...
}
```

---------

Co-authored-by: Jeremy Kun <j2kun@users.noreply.github.com>
2025-08-05 13:18:59 -07:00
Florian Hahn
d478502a42
[VPlan] Ensure that IV resume phi for epilogue is always first. (NFCI)
Update handling of canonical IV resume phi for the epilogue loop to make
sure the resume phi for the canonical IV is always the first phi in the
scalar preheader.

This makes it easier to retrieve it in preparePlanForEpilogueVectorLoop.

For now, we keep an assert to make sure we use the same resume phi as
before. This will be removed in the future.
2025-08-05 21:06:41 +01:00
moscickimilosz
c1add93e45
[mlir][spirv] Change Spirv.GlobalVariableOp builtin -> built_in (#152148)
GlobalVariableOp describes that built_in specifies SPIR-V BuiltIn
decoration associated with the op. The attribute was defined as builtin
in the tablegen (no uderscore). This was causing correct
GlobalVariableOp decorations like: built_in("GlobalInvocationId") to be
saved as a new attribute making it impossible to access the built_in
attribute through getBuiltinAttr.
2025-08-05 15:47:37 -04:00
Igor Kudrin
f8a4f61101
[lldb] Avoid a crash after selecting an unknown platform (#151803)
`PlatformList::Create()` added an item to the list even when
`Platform::Create()` returned `nullptr`. Other methods use these items
without checking, which can lead to a crash. For example:

```
> lldb
(lldb) platform select unknown
error: unable to find a plug-in for the platform named "unknown"
(lldb) file a.out-arm64
PLEASE submit a bug report to...
Stack dump:
0.      Program arguments: lldb
1.      HandleCommand(command = "file a.out-arm64 ")
...
```
2025-08-05 12:42:38 -07:00
Jorge Gorbe Moya
c19314f070
[bazel] Port fa39b67de01af189b59f9034ef6228a2951364b0 (#152191) 2025-08-05 12:39:54 -07:00
Martin Storsjö
f355a57728
[libcxx] Initialize vcruntime __std_exception_data in the exception copy ctor (#144329)
This fixes failures in a number of tests, in the
clang-cl-no-vcruntime configuration (where libcxx provides dummy, no-op
replacements of some vcruntime base exception classes), if building with
optimization enabled.

Previously, with optimization enabled, the compiler concluded that these
fields would be uninitialized at the points of asserts in the tests.

This fixes the following tests in this configuration:

llvm-libc++-shared-no-vcruntime-clangcl.cfg.in ::
std/language.support/support.dynamic/alloc.errors/bad.alloc/bad_alloc.pass.cpp
llvm-libc++-shared-no-vcruntime-clangcl.cfg.in ::
std/language.support/support.dynamic/alloc.errors/new.badlength/bad_array_new_length.pass.cpp
llvm-libc++-shared-no-vcruntime-clangcl.cfg.in ::
std/language.support/support.exception/bad.exception/bad_exception.pass.cpp
llvm-libc++-shared-no-vcruntime-clangcl.cfg.in ::
std/language.support/support.exception/exception/exception.pass.cpp
llvm-libc++-shared-no-vcruntime-clangcl.cfg.in ::
std/language.support/support.rtti/bad.cast/bad_cast.pass.cpp
llvm-libc++-shared-no-vcruntime-clangcl.cfg.in ::
std/language.support/support.rtti/bad.typeid/bad_typeid.pass.cpp
2025-08-05 22:11:27 +03:00
Leandro Lacerda
cd0268063d
[Offload][Conformance] Add tests for single-precision math functions (#152013)
This patch adds a new set of conformance tests for single-precision math
functions provided by the LLVM libm for GPUs.

The functions included in this set were selected based on the following
criteria:
- An implementation exists in `libc/src/math/generic` (i.e., it is not
just a wrapper around a compiler built-in).
- The corresponding LLVM CPU libm implementation is correctly rounded.
- The function is listed in Table 65 of the OpenCL C Specification
v3.0.19.
2025-08-05 13:33:20 -05:00
Leandro Lacerda
448c88478d
[libc] Enable the acoshf math function on AMD GPUs (#152157)
This patch adds the `acoshf` math function to the AMDGPU build.
2025-08-05 13:33:11 -05:00
Florian Hahn
47258ca470
[VPlan] Use VPPhi instead of dyn_cast + opcode check in isPhi (NFC). 2025-08-05 19:20:12 +01:00
Florian Hahn
e3ededa0f1
[LV] Add tests with canonical widen IV, reductions in different order.
Add missing test coverage for re-using the resume value from the main
vector loop for the canonical IV in the epilogue.
2025-08-05 19:19:13 +01:00
LLVM GN Syncbot
87a7a9caaf [gn build] Port 8a2d3f5653eb 2025-08-05 18:10:23 +00:00
Kazu Hirata
40fbc76dc8 [lldb] Fix the build
This patch fixes:

  lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp:623:47:
  error: expected ';' after expression
2025-08-05 11:09:56 -07:00
Jonas Devlieghere
12da87bef1
[lldb] Use Python Bytes instead of Buffer for Binary I/O (NFC) (#152031)
Binary I/O (also called buffered I/O) expects bytes-like objects and
produces bytes objects [1]. Switch from using a Python buffer to using
Python bytes to read the data. This eliminates calls to functions that
aren't part of the Python stable C API.

[1] https://docs.python.org/3/library/io.html#binary-i-o
2025-08-05 10:58:59 -07:00
Nikolas Klauser
bb3c060ca4
[libc++] Fix incorrect down-cast in __tree (#152181) 2025-08-05 19:55:30 +02:00
royitaqi
4882874ddc
[vscode-lldb] Fix yarn package (#152002)
# Problem
`yarn package` cannot be run twice in a row - the second time will error
out:
> Error: ENOENT: no such file or directory, stat
'<path>/llvm-project/lldb/tools/lldb-dap/out/lldb-dap.vsix'

This error is also weird, because the file actually exists. See the end
of this [full
output](https://gist.github.com/royitaqi/f3f4838ed30d7ade846f53f0fb7d68f4).

# Fix

Delete the `lldb-dap.vsix` file at the start of each run. See
consecutive runs [being
successful](https://gist.github.com/royitaqi/9609181b4fe6a8a4e71880c36cd0c7c9).
2025-08-05 10:54:07 -07:00
Walter Erquinigo
9179b07981
[LLDB] Complete a missing register format mapping in the gdb-remote p… (#152170)
…rotocol

When writing a custom gdb-remote server I realized that the encoder and
decoder of register formats is incomplete.

- Add the encoder on the server side and add an llvm_unreachable is
there's a missing case.
- Add a decoder on the client side that doesn't fail. We have to keep it
flexible.

I couldn't figure out an easy way to test this but the changes seem very
straightforward to me.
2025-08-05 13:53:15 -04:00
Caslyn Tonelli
b5bf100046
[libc] Add RTLD_NEXT + RTLD_DEFAULT (#149909)
Related to #97920, this patch adds `dlsym` macros `RTLD_NEXT` AND
`RTLD_DEFAULT` to dlfcn.h.
2025-08-05 10:51:28 -07:00
Ramkumar Ramachandra
f03345a07a
[LV] Improve a test; get rid of runtime checks (#152182) 2025-08-05 18:48:10 +01:00
Justin Bogner
8a2d3f5653
[HLSL][Sema] Use hlsl::BindingInfoBuilder instead of RangeInfo. NFC (#150634)
Clean up some duplicated logic. We had two ways to do the same thing
here, and BindingInfoBuilder is more flexible.
2025-08-05 10:47:06 -07:00
gulfemsavrun
4a13f0912a
Revert "[compiler-rt][test] Apply CFLAGS from sanitizer_common to all tests" (#152177)
Reverts llvm/llvm-project#120798 because it caused an AddressSanitizer
test breakage in global-overflow-bfd.cpp:

https://luci-milo.appspot.com/ui/p/fuchsia/builders/toolchain.ci/clang-linux-x64/b8707434189452310849/overview
2025-08-05 10:15:27 -07:00
Michael Buch
406f61fd3a
[lldb][CPlusPlusLanguage] Create public accessors for getting DemangledNameInfo components and use them in tests (#152134)
This way we make sure that the logic to reconstruct demangled names in
the tests is the same as the logic when reconstructing the actual
frame-format variable.

`DemangledNameInfo::SuffixRange` is currently the only one which we
can't test in the same way until we set it from inside the
`TrackingOutputBuffer`. I added TODOs to track this.
2025-08-05 18:12:22 +01:00
Helena Kotas
3b2a1a5d9b
[HLSL][NFC] Move all resource tests under CodeGenHLSL\resources (#152035)
Also removes an outdated test buffer-array-operator.hlsl. Array operator on resources is tested in StructuredBuffers-subscripts.hlsl and RWBuffer-subscript.hlsl.
2025-08-05 10:05:05 -07:00
zGoldthorpe
d7074b63ed
[Clang][AMDGPU] Add builtins for some buffer resource atomics (#149216)
This patch exposes builtins for atomic `add`, `max`, and `min` operations that
operate over buffer resource pointers.
2025-08-05 11:04:15 -06:00
Fangrui Song
913c5b4d1f clang -cc1as: Remove a redundant initSections call
`Parser->Run(Opts.NoInitialTextSection)` calls initSections. Remove a
redundant initSections to remove an extra FT_Align fragment, observed
when investigating a missing MCOrgFragment relaxation issue
https://github.com/ClangBuiltLinux/linux/issues/2116
2025-08-05 10:02:53 -07:00
Ramkumar Ramachandra
5dfc2d4535
[LV] Regen some tests with UTC (#152128) 2025-08-05 18:01:02 +01:00
lonely eagle
e3467d8dea
[mlir][nvgpu] Fix tma descriptor check (#152160)
The tma descriptor check does not appear to be correct, as it requires
the last dimension of memref to be 128 bytes. However, the bytes of the
last dimension can be equal to swizzle bytes.
2025-08-06 00:56:55 +08:00