Commit Graph

542664 Commits

Author SHA1 Message Date
Chelsea Cassanova
c73e5e3e20 [lldb][scripts] Fix bugs in framework fix script (#145961)
The script used to fix up LLDB's header for use in the macOS framework
contained 2 bugs that this commit addreses:

1. The output contents were appended to the output file multiple times
instead of only being written once.
2. The script was not considering LLDB includes that were *not* from the
SB API.

This commit addresses and fixes both of these bugs and updates the
corresponding test to match.
2025-06-26 15:06:37 -07:00
Jordan Rupprecht
4e154ccaf1 [bazel] Add missing deps needed for parse_headers after #145313 (#145978)
For d31ba52563
2025-06-26 17:03:15 -05:00
Florian Hahn
772eb07567 [VPlan] Clarify comments after #145340 (NFC).
Adjust comments as suggested post-commit for #145340.
2025-06-26 22:42:06 +01:00
Igor Kirillov
aeec2c6e48 [VPlan] Speed up VPSlotTracker by using ModuleSlotTracker (#139881)
Currently, when VPSlotTracker is initialized with a VPlan, its
assignName method calls printAsOperand on each underlying instruction.
Each such call recomputes slot numbers for the entire function, leading
to O(N × M) complexity, where M is the number of instructions in the
loop and N is the number of instructions in the function.

This results in slow debug output for large loops. For example, printing
costs of all instructions becomes O(M² × N), which is especially painful
when enabling verbose dumps.

This patch improves debugging performance by caching slot numbers using
ModuleSlotTracker. It avoids redundant recomputation and makes debug
output significantly faster.
2025-06-26 22:40:48 +01:00
LLVM GN Syncbot
e811383f33 [gn build] Port d7b936b633 2025-06-26 21:11:12 +00:00
LLVM GN Syncbot
ca0565aa0b [gn build] Port 33872f1218 2025-06-26 21:11:11 +00:00
LLVM GN Syncbot
8f62c0c3da [gn build] Port 0faa181434 2025-06-26 21:11:10 +00:00
LLVM GN Syncbot
6116f5acc6 [gn build] Port 0a3c5c42a1 2025-06-26 21:11:09 +00:00
Jun Wang
063cee7bde [AMDGPU][MC] Allow opsel for v_max_i16 etc in GFX10 (#143982)
In GFX10, a number of VOP3 instructions should allow opsel, including
V_MAX_I16, V_MAX_U16, V_MIN_I16, V_MIN_U16, V_MUL_LO_U16, V_LSHLREV_B16,
V_LSHRREV_B16, and V_ASHRREV_I16.
2025-06-26 14:08:13 -07:00
Jaden Angella
1dfdd1e6de [mlir][emitC] Add support to emitter for classop, fieldop and getfieldop (#145605)
Add support to the emitter for `ClassOp`, `FieldOp` and `GetFieldOp`.
These ops were introduced in #141158
2025-06-26 13:54:05 -07:00
Nico Weber
fb138a675e [gn] port 40cc4379cd 2025-06-26 22:40:49 +02:00
Nico Weber
64f16f4896 [gn] port e175ecff93 2025-06-26 22:40:49 +02:00
Ralender
30c61119b9 [MergeICmps] Fix miss-compile in MergeICmps in presence of blockaddresses (#145925) 2025-06-26 22:32:31 +02:00
Matheus Izvekov
a9ed84b618 [clang] ms-abi: member pointer inheritance model lock-down fix (#145958)
Lock down the inheritance model for member pointers even when converting
from nullptr.

This fixes a regression introduced in
https://github.com/llvm/llvm-project/pull/131966

There are no release notes, since the regression was never released.

Fixes https://github.com/llvm/llvm-project/issues/144081
2025-06-26 17:30:43 -03:00
Erich Keane
d699fbd203 [OpenACC][Docs] Add a release note for Clang 21 (#145938)
This patch adds a release note that explains the current status of
OpenACC in Clang. Currently we cannot actually make an executable
because the OpenACC dialect of MLIR doesn't support any amount of
lowering to LLVM-IR, so the usefulness of OpenACC is entirely for
front-end related uses, such as tooling or semantic checking.
2025-06-26 13:17:22 -07:00
Sterling-Augustine
5d03e7a204 Revert "[NFC][DebugInfo][DWARF] Create new low-level dwarf library (#… (#145959)
…145081)"

This reverts commit cbf781f0bd.

Breaks a couple of buildbots.
2025-06-26 13:09:20 -07:00
Nico Weber
0f1fd8735c [gn] fix gn gen after 2a907f40bc 2025-06-26 22:07:33 +02:00
Joseph Huber
df5097dd94 [Offload] Add default for HSA agent type to silence warning (#145943)
Summary:
There's a new one called the AIE (AI Engine). We could handle this, but
since we don't use it currently I'm just making it future-proof. Adding
the AIE check would require checking the HSA version which isn't
worthwhile just yet.
2025-06-26 14:46:08 -05:00
Kazu Hirata
938cdb30f1 [flang] Migrate away from std::nullopt (NFC) (#145928)
ArrayRef has a constructor that accepts std::nullopt.  This
constructor dates back to the days when we still had llvm::Optional.

Since the use of std::nullopt outside the context of std::optional is
kind of abuse and not intuitive to new comers, I would like to move
away from the constructor and eventually remove it.

This patch replaces std::nullopt with {}.  There are a couple of
places where std::nullopt is replaced with TypeRange() to accommodate
perfect forwarding.
2025-06-26 12:41:49 -07:00
Sean Perry
a0c5f1992d [SystemZ][zOS] disable _Float16 support on z/OS (#145532)
The new half float type (aka _Float16 ) isn't supported on z/OS.
2025-06-26 15:21:04 -04:00
Andre Kuhlenschmidt
283c2e8d7c [flang][semantics] fix issue with equality of min/max in module files (#145824)
Convert all binary calls of min/max to extremum operations, so that
extremums generated by the compiler compare equal, and user min/max
calls also compare equal.

Fixes #133646

Originally opened as #144162 but I accidentally pushed a merge in such a
way that a bunch of code owners got added to the review. This is just
rebasing the original work on main and fixing the failing tests.
2025-06-26 12:15:57 -07:00
Simon Pilgrim
e25db2f6b3 [CostModel] getInstructionCost - match SK_InsertSubvector shuffle patterns before SK_Select (#145920)
More closely match improveShuffleKindFromMask's shuffle ordering by
trying to match a SK_InsertSubvector shuffles patterns before SK_Select
- both can match many of the same patterns, but its much easier to
recognise when a SK_InsertSubvector can be converted to SK_Select than
vice-versa.

Another step towards #145335 - which I'm hoping will allow us to
generalise improveShuffleKindFromMask and remove getInstructionCost's
shuffle matching entirely.
2025-06-26 20:15:51 +01:00
Simon Pilgrim
72ffa799c8 [NVPTX] tryStoreParam - remove default-only switch statement. NFC. (#145948)
#145581 removed all the remaining special cases from the switch
statement leaving just the default, which MSVC complains about.
2025-06-26 20:13:04 +01:00
Snehasish Kumar
70233c61d6 Add minimum count threshold for indirect call promotion (#145282)
Allow users to set the minimum absolute count for indirect call promotion. This is primarily meant to be control indirect call promotion for synthetic vp metadata introduced in #141164 for use by MemProf.
2025-06-26 12:10:59 -07:00
Maksim Panchenko
4308292d1e [BOLT] Refactor NewTextSegmentAddress handling (#145950)
Refactor the code for NewTextSegmentAddress to correctly point at the
true start of the segment when PHDR table is placed at the beginning. We
used to offset NewTextSegmentAddress by PHDR table plus cache line
alignment.

NFC for proper binaries. Some YAML binaries from our tests will diverge
due to bad segment address/offset alignment.
2025-06-26 12:09:11 -07:00
dyung
b0500f56c8 Revert "[clang][python][test] Move python binding tests to lit framework" (#145951)
Reverts llvm/llvm-project#145855

The test added is XPASS-ing on a bot:
https://lab.llvm.org/buildbot/#/builders/144/builds/28623
2025-06-26 15:02:14 -04:00
Philip Reames
0ef27186c9 [tests] Additional coverage for gather/scatter address optimizations 2025-06-26 11:50:57 -07:00
Ramkumar Ramachandra
947e072744 [CodeGen/RISCV] Add fixed-vector [l]lround tests (#145926)
In preparation to unify the codegen of [l]lrint and [l]lround, making
the latter go through custom-lowering for vector-codegen, add some tests
showing the current fixed-vector-unrolled codegen of [l]lround.
2025-06-26 19:43:22 +01:00
Abid Qadeer
232c2921e1 Reland [mlir][OpenMP] Use correct debug location with link clause. (#145889)
https://github.com/llvm/llvm-project/pull/145026 was reverted because it
failed a sanitizer test. That issue has been fixed in
https://github.com/llvm/llvm-project/pull/145883.
2025-06-26 19:32:30 +01:00
Sterling-Augustine
cbf781f0bd [NFC][DebugInfo][DWARF] Create new low-level dwarf library (#145081)
This is the culmination of a series of changes described in [1].
    
Although somewhat large by line count, it is almost entirely mechanical,
creating a new library in DebugInfo/DWARF/LowLevel. This new library has
very minimal dependencies, allowing it to be used from more places than
the normal DebugInfo/DWARF library--in particular from MC.
    
I am happy to put it in another location, or to structure it differently
if that makes sense. Some have suggested in BinaryFormat, but it is not
a great fit there. But if that makes more sense to the reviewers, I can
do that.
 
Another possibility would be to use pass-through headers to allow
clients who don't care to depend only on DebugInfo/DWARF. This would be
a much less invasive change, and perhaps easier for clients. But also a
system that hides details.

Either way, I'm open.

1.
https://discourse.llvm.org/t/rfc-debuginfo-dwarf-refactor-into-to-lower-and-higher-level-libraries/86665/2
2025-06-26 11:23:46 -07:00
LU-JOHN
f2991bf791 [AMDGPU] Convert 64-bit sra to 32-bit if shift amt >= 32 (#144421)
Use KnownBits to convert 64-bit sra to 32-bit sra.

Scaled-down alive2 verification with 16/8-bit types:
https://alive2.llvm.org/ce/z/LamASk

---------

Signed-off-by: John Lu <John.Lu@amd.com>
2025-06-26 14:22:59 -04:00
jtstogel
442c417749 [libc][bazel] Support generating public libc headers in Bazel builds. (#145381)
Running `hdrgen` in Bazel hermetically requires adding a new dependency
on PyYAML. This PR uses PyYAML version 5.1 due to keep in line with the
docs:
b878e0d118/libc/docs/dev/header_generation.rst (L22)

See https://github.com/llvm/llvm-project/issues/134780.

Generated headers are placed in a `staging/` directory so that they have
the opportunity to be treated differently from non-generated headers.
This is a follow-up to https://github.com/llvm/llvm-project/pull/141256,
which was reverted in https://github.com/llvm/llvm-project/pull/143001
because it caused downstream failures when bootstrapping builds.
2025-06-26 11:17:57 -07:00
jtstogel
66ec14171e [libc][bazel] Add bazel targets for libc/include/... tests. (#141150)
This PR also sets `alwayslink=True` for `//libc/test:LibcUnitTest`. This
ensures that the `main` function provided always gets linked into a test
target. While not strictly necessary, it makes it so tests like
45d8759cbe/libc/test/include/signbit_test.c
will give a duplicate symbol error if they incorrectly depend on
`//libc/test:LibcUnitTest`.

This PR is missing tests for generated header includes since the current
Bazel setup lacks generated headers or a mechanism to run hermetic
tests. CMake version of the header include tests:
a2ce564720/libc/test/include/CMakeLists.txt (L515)

See issue https://github.com/llvm/llvm-project/issues/134780
2025-06-26 11:16:43 -07:00
erichkeane
edf0d0da43 [OpenACc][CIR] Fix tests failed because of crossed-patches
Review #145600 and #145770 crossed, which caused compute-copy and
combined-copy tests to fail because of an insufficiently written 'check'
line for a cir.func, which didn't account for the linkage spec being
added.  This patch adds that to fix the build.
2025-06-26 11:03:51 -07:00
AZero13
6b9e6f066f [Hexagon] Remove emplace workaround (NFC) (#145718)
It was done because it was not supported in gcc 4.7.4.
2025-06-26 10:57:25 -07:00
Simon Pilgrim
592f203ee6 [X86] abds-vector-128.ll - regenerate VPTERNLOG asm comment 2025-06-26 18:54:27 +01:00
Naveen Seth Hanig
30d861f2e8 [clang-scan-deps] Enable test P1689.cppm on Windows (#145857)
The test `test/ClangScanDeps/P1689.cppm` was previously not supported on
Windows due to the differences in path separators between Windows and
Linux. This normalizes the paths, allowing this test to run on Windows
as well.

This is motivated by the review feedback for #145221, where the same
change was suggested for a test derived from this one.
2025-06-26 19:52:38 +02:00
Kai Nacke
655d04859b [GOFF] Add writing of text records (#137235)
Sections which are not allowed to carry data are marked as virtual. Only
complication when writing out the text is that it must be written in
chunks of 32k-1 bytes, which is done by having a wrapper stream writing
those records.
Data of BSS sections is not written, since the contents is known to be
zero. Instead, the fill byte value is used.
2025-06-26 13:50:40 -04:00
Chelsea Cassanova
e880cf7421 Reland "[lldb][target] Add progress report for wait-attaching to proc… (#145111)
…ess" (#144810)

This relands commit e0933ab5ae. The
original commit was causing the test TestCreateAfterAttach.py to fail on
ARM Ubuntu bots. It's possible that this could've been happening because
the test for wait-attach progress reporting is waiting on a process
named "a.out" which could be too generic as multiple other tests (when
run in parallel on the bots) could also be using processes named
"a.out". This commit changes the wait-attach progress report test to
wait on a unique process name.

Original PR description:

This commit adds a progress report when wait-attaching to a process as
well as a test for this.

Original PR link: https://github.com/llvm/llvm-project/pull/144768
2025-06-26 10:45:11 -07:00
Nikolas Klauser
4c8fab399b [libc++] Avoid type-punning between __hash_value_type and pair (#143501)
This patch is very similar to #134819 in nature. Before this patch, we
were dereferencing pointers to objects which were never constructed. Now
we always assume that nodes store `pair<const KeyT, ValueT>` for
unordered_maps instead, as they actually do.
2025-06-26 19:43:59 +02:00
Diego Caballero
7842e9eada [mlir][Vector] Lower vector.to_elements to LLVM (#145766)
Only elements with at least one use are lowered to `llvm.extractelement`
op.
2025-06-26 10:36:08 -07:00
Abhishek Kaushik
abf8e25ac7 [DAG] Add SDPatternMatch::m_Load (#145481)
Add SDPatternMatch matcher and unit test coverage for `ISD::LOAD`
opcode.
This only matches the loaded value i.e. ResNo 0 and not the output
chain.
e.g.
```
m_Load(m_Value(), m_Value(), m_Value())
```

The first value is the input chain, the second is the base pointer, and
the last value is the offset.
2025-06-26 23:03:31 +05:30
Steven Perron
1d60d91bf3 [HLSL][SPIRV] Add option to add all KHR extensions (#145536)
In DXC, there is an option to enable all KHR extension. This is added by
passing the KHR option to the SPIR-V backend, which will enable all of
the appropriate extensions.

Part of https://github.com/llvm/llvm-project/issues/137650.
2025-06-26 13:28:57 -04:00
erichkeane
0a2b6f6c1c [OpenACC] Fix 'copyout' allowed modifiers alwaysin vs alwaysout
While doing lowering, I discovered that the restriction onthe allowed
modifiers for 'copyout' didn't make sense! After discussion on the
OpenACC standards mailing list I discovered that this was a copy/paste
error during standardization that they intend to fix, and really meant
for copyout to allow alwaysout instead of alwaysin.

When implementing, I blindly followed the standard :)

This patch corrects the implementation to do what was meant.
2025-06-26 10:26:20 -07:00
Ebuka Ezike
0b8a656ba1 [lldb-dap] Fix source references (#144364)
The
[protocol](https://microsoft.github.io/debug-adapter-protocol//specification.html#Types_Source)
expects that `sourceReference` be less than `(2^31)-1`, but we currently
represent memory address as source reference, this can be truncated
either when sending through json or by the client. Instead, generate new
source references based on the memory address.

Make the `ResolveSource` function return an optional source.
2025-06-26 18:22:47 +01:00
qxy11
5c310d1ef0 Default transcript dumping in "statistics dump" to false (#145436)
### Summary
Currently, if the setting `interpreter.save-transcript` is enabled,
whenever we call "statistics dump", it'll default to reporting a huge
list of transcripts which can be a bit noisy. This is because the
current check `GetIncludeTranscript` returns `!GetSummaryOnly()` by
default if no specific transcript-setting option is given in the
statistics dump command (ie. `statistics dump --transcripts=false` or
`statistics dump --transcripts=true`). Then when
`interpreter.save-transcript` is enabled, this saves a list of
transcripts, and the transcript list ends up getting logged by default.

These changes default the option to log transcripts in the `statistics
dump` command to "false". This can still be enabled via the
`--transcripts` option if users want to see a transcript. Since
`interpreter.save-transcript` is false by default, the main delta is
that if `interpreter.save-transcript` is true and summary mode is false,
we now disable saving the transcript.

This also adds a warning to 'statistics dump --transcript=true' when
interpreter.save-transcript is disabled, which should help users
understand
why transcript data is empty.

### Testing

#### Manual testing
Tested with `settings set interpreter.save-transcript true` enabled at
startup on a toy hello-world program:
```
(lldb) settings set interpreter.save-transcript true
(lldb) target create "/home/qxy11/hello-world/a.out"
Current executable set to '/home/qxy11/hello-world/a.out' (x86_64).
(lldb) statistics dump
{
  /* no transcript */
}
(lldb) statistics dump --transcript=true
{
"transcript": [
    {
      "command": "statistics dump",
      "commandArguments": "",
      "commandName": "statistics dump",
      "durationInSeconds": 0.0019650000000000002,
      "error": "",
      "output": "{...
    },
    {
      "command": "statistics dump --transcript=true",
      "commandArguments": "--transcript=true",
      "commandName": "statistics dump",
      "timestampInEpochSeconds": 1750720021
    }
  ]
}
```
Without `settings set interpreter.save-transcript true`:
```
(lldb) target create "/home/qxy11/hello-world/a.out"
Current executable set to '/home/qxy11/hello-world/a.out' (x86_64).
(lldb) statistics dump
{
  /* no transcript */
}
(lldb) statistics dump --transcript=true
{
  /* no transcript */
}
warning: transcript requested but none was saved. Enable with 'settings set interpreter.save-transcript true'
```

#### Unit tests
Changed unit tests to account for new expected default behavior to
`false`, and added a couple new tests around expected behavior with
`--transcript=true`.
```
lldb-dotest -p TestStats ~/llvm-sand/external/llvm-project/lldb/test/API/commands/statistics/basic/
```
2025-06-26 10:16:05 -07:00
Erick Velez
066a14d4d4 [clang-doc] refactor JSONGenerator array usage (#145595)
Improve code reuse by calling serializeArray in more generic cases
instead of creating and reserving arrays on their own.
2025-06-26 10:11:02 -07:00
Florian Mayer
e0c7136713 [LowerAllowCheck] preserve CFG analyses (#145816) 2025-06-26 10:08:34 -07:00
Florian Mayer
9a44f55c00 [sanitizers] do not accept out of bounds -fsanitize-skip-hot-cutoff (#145806)
If the user gives an out of bounds value, it is best to fail and let the
user decide what to do.
2025-06-26 10:08:04 -07:00
Florian Mayer
32aa80c362 [NFCI] [LowerAllowCheck] also test lower-allow-check-percentile-cutoff-hot (#145822) 2025-06-26 10:07:37 -07:00