Commit Graph

537802 Commits

Author SHA1 Message Date
Craig Topper
976b00654a [RISCV] Disable combineToVCPOP for illegal scalable vector types. (#140195)
This transform creates target specific instructions which must have
legal types. We were checking this for fixed vectors, but not scalable
vectors. This caused a crash with <vscale x 1 x i1> which isn't legal
for Zve32x.
2025-05-16 11:24:26 -07:00
David Green
0de8ff6d9c [AArch64] Reduce the cost of repeated sub-shuffle (#139331)
Given a larger-than-legal shuffle we will split into multiple sub-parts.
This adds a check to the computed costs of sub-shuffles so that repeated
sequences are not accounted for multiple times. This especially reduces
the cost of broadcasts/splats.
2025-05-16 18:50:05 +01:00
Mariusz Kwiczala
85fe4ab8a3 Rename GsymDIContext to GsymContext (#140227)
Renaming based on suggestion here: 
https://github.com/llvm/llvm-project/pull/139686#discussion_r2089538528
2025-05-16 10:18:21 -07:00
Hui
4b104c6853 [libc++] Fix flat_{multi}set insert_range (#137462)
Fixes #136656
2025-05-16 13:17:21 -04:00
Alexander Richardson
aec685ea77 [DataLayout] Introduce DataLayout::getAddressSize(AS)
This function can be used to retrieve the number of bits that can be used
for arithmetic in a given address space (i.e. the range of the address
space). For most in-tree targets this should not make any difference
but differentiating between the size of a pointer in bits and the address
range is extremely important e.g. for CHERI-enabled targets, where pointers
carry additional metadata such as bounds and permissions and only a subset
of the pointer bits is used as the address.

The address size is defined to be the same as the index size.

We considered adding a separate property since targets exist where indexing
and address range actually use different sizes (AMDGPU fat pointers with
160 representation, 48 bit address and 32 bit index), but for the purposes
of LLVM semantics, differentiating them does not add much value and it
introduces a lot of complexity in ensure the correct bits are used. See
the reasoning by @nikic on https://discourse.llvm.org/t/clarifiying-the-semantics-of-ptrtoint/83987/38https://discourse.llvm.org/t/clarifiying-the-semantics-of-ptrtoint/83987/49

Originally uploaded as https://reviews.llvm.org/D135158

Reviewed By: davidchisnall, krzysz00

Pull Request: https://github.com/llvm/llvm-project/pull/139347
2025-05-16 10:04:00 -07:00
Dan Blackwell
e620f10f57 [compiler-rt][sanitizer_common] Alter sanitizer_set_report_path_test to not assume a fixed file path (#139282)
Currently, `Posix/sanitizer_set_report_path_test.cpp` contains the
following check: `// CHECK: ERROR: Can't create directory:
{{.*}}Posix/Output/sanitizer_set_report_path_test.cpp.tmp`. This makes
an assumption that the test file resides in `Posix/Output`, however when
testing on a remote device, an alternative temporary directory path is
used. This patch instead checks that the path in the error message
matches the requested path dynamically.
2025-05-16 10:02:54 -07:00
Craig Topper
8188931778 [RISCV] Rename getOriginalAlign->getBaseAlign after #139930 2025-05-16 09:57:24 -07:00
Alexey Bataev
d79d9b8fbf [SLP]Change the insertion point for outside-block-used nodes and prevec phi operand gathers
Need to set the insertion point for (non-schedulable) vector node after
the last instruction in the node to avoid def-use breakage. But it also
causes miscompilation with gather/buildvector operands of the phi nodes,
used in the same phi only in the block.
These nodes supposed to be inserted at the end of the block and after
changing the insertion point for the non-schedulable vec block, it also
may break def-use dependencies. Need to prevector such nodes, to emit
them as early as possible, so the vectorized nodes are inserted before
these nodes.

Fixes #139728

Reviewers: hiraditya, HanKuanChen, RKSimon

Reviewed By: RKSimon

Pull Request: https://github.com/llvm/llvm-project/pull/139917
2025-05-16 12:52:27 -04:00
Rahul Joshi
7674d6fa9e [LLVM][TableGen] Simplify DagInit::get (#140056)
- Add `DagInit::get` overloads that do not need ValName to be specified.
- Fix some calls to either not create temporary arrays for DAG args or
use the std::pair<> overload.
2025-05-16 09:45:58 -07:00
peremyach
ebb15353d2 Reduce llvm-gsymutil memory usage (#139907)
For large binaries gsymutil ends up using too much memory. This diff
adds DIE tree cleanup per compile unit to reduce memory usage.

P. S. Not sure about formatting. Maybe it hasn't been run in a while, or
I have misconfigured something.

`$ git clang-format HEAD~1
clang-format did not modify any files
$ clang-format --version
clang-format version 21.0.0git
(git@github.com:peremyach/llvm-project.git
8d945c8357e1bd9872a34f92620d4916bfd27482)
`

Co-authored-by: Arslan Khabutdinov <akhabutdinov@fb.com>
2025-05-16 09:44:17 -07:00
Raphael Moreira Zinsly
52af23f950 [RISCV] Add stack probing in eliminateCallFramePseudoInstr (#139731)
Stack clash protection code was missing from
RISCVFrameLowering::eliminateCallFramePseudoInstr, calling allocateStack
fixes it.
This patch also fixes the tests in stack-probing-dynamic.ll that should
be testing the stack allocation before a function call.
2025-05-16 09:41:34 -07:00
Andres-Salamanca
ec44c74fe7 [CIR] Upstream support for FlattenCFG switch and SwitchFlatOp (#139154)
This PR adds support for the `FlattenCFG` transformation on `switch`
statements. It also introduces the `SwitchFlatOp`, which is necessary
for subsequent lowering to LLVM.
2025-05-16 09:38:56 -07:00
Craig Topper
ea4bf3456f [RISCV] Add Zilsd to RISCVMergeBaseOffset. (#140157)
I only tested a simple case for folding the addi from medany codemodel.
I assume everything else should just work.
2025-05-16 09:37:34 -07:00
Craig Topper
dcd62f3674 [SelectionDAG] Rename MemSDNode::getOriginalAlign to getBaseAlign. NFC (#139930)
This matches the underlying function in MachineMemOperand and how it is
printed when BaseAlign differs from Align.
2025-05-16 09:37:02 -07:00
Craig Topper
7f4a9105df [RISCV] Add Zilsd/Zclsd support to RISCVMakeCompressible. (#140136) 2025-05-16 09:36:39 -07:00
Aiden Grossman
23a674d2ec [libcxxabi] Update ItaniumDemangle.h from LLVM (#140273)
76ba29bfd8 landed changes in
ItaniumDemangle.h on the LLVM side that were not propagated over to the
libcxxabi side. This patch fixes that.
2025-05-16 09:26:09 -07:00
Momchil Velikov
e9c9c33fa4 [MLIR][ArmSVE] Add an ArmSVE dialect operation which maps to svusmmla (#135634) 2025-05-16 17:12:35 +01:00
James Y Knight
7fe1b43122 NFC: reformat bazel files with buildifier. 2025-05-16 12:12:03 -04:00
nd
c72c0b298c Fix race condition during iteration through modules (#139283) (#139862)
Use the locking iterator to ensure module don't change during iteration.
2025-05-16 09:09:50 -07:00
Andy Kaylor
2f5a24d0c5 [CIR][NFC] Fix warning about unhandled Decl (#140159)
This fixes a warning about an unhandled Decl that was recently
introduced. While adding the new decl, I noticed that one of the others
that was in the "NYI" group belonged in the "unreachable" group, so I
moved it also.
2025-05-16 09:08:32 -07:00
Andy Kaylor
fa2263b309 [CIR][NFC] Use arrangeFunctionDeclaration to build function types (#139787)
This change replaces the simplified call that we were previously using
to convert the function type provided by a global declaration to the CIR
function type. We now go through 'arrangeGlobalDeclaration' which builds
the function type in a more complicated manner. This change has no
observable differences for the currently upstreamed CIR support, but it
is necessary to prepare for C++ member function calls, which require the
extra handling.
2025-05-16 09:08:16 -07:00
Kazu Hirata
9adcb4fe12 [clang] Use llvm::replace (NFC) (#140264) 2025-05-16 09:06:31 -07:00
Kazu Hirata
589e7abea5 [clang-tidy] Use std::binary_search (NFC) (#140263) 2025-05-16 09:06:17 -07:00
Benjamin Kramer
82bad53bda [StaticDataLayout][PGO] Remove inclusion of private gmock header
This one is supposed to be included via gmock.h
2025-05-16 17:56:56 +02:00
Jay Foad
e30301aaec [MachineCopyPropagation] Make use of lane mask info in basic block liveins (#140248) 2025-05-16 16:54:34 +01:00
Stanislav Mekhanoshin
be6c1684c0 [AMDGPU] Automate creation of byte_sel dags. NFCI. (#140155) 2025-05-16 08:54:04 -07:00
Benjamin Kramer
71d1b4c77c [ItaniumDemangle] Make it independent of LLVM again. NFC 2025-05-16 17:53:13 +02:00
Momchil Velikov
63a4cae56c [MLIR][ArmSVE] Add an ArmSVE dialect operation which maps to svdupq_lane (#135633) 2025-05-16 16:47:07 +01:00
John Harrison
087a5d2ec7 [lldb-dap] Adding additional asserts to unit tests. (#140107)
Adding an assert that the 'continue' request succeeds caused a number of
tests to fail. This showed a number of tests that were not specifying if
they should be stopped or not at key points in the test. This is likely
contributing to these tests being flaky since the debugger is not in the
expected state.

Additionally, I spent a little time trying to improve the readability of
the dap_server.py and lldbdap_testcase.py.
2025-05-16 08:47:01 -07:00
Jameson Nash
6ebb84869e langref updates for aarch64 trampoline (#139740)
Add clarifying comments to the langref from the review of #126743
2025-05-16 17:46:27 +02:00
Florian Hahn
04fde85057 [VPlan] Rename isUniform(AfterVectorization) to isSingleScalar (NFC). (#140134)
Update the naming in VPReplicateRecipe and vputils to the more accurate
isSingleScalar, as the functions check for cases where only a single
scalar is needed, either because it produces the same value for all
lanes or has only their first lane used.

Discussed in https://github.com/llvm/llvm-project/pull/139150.

PR: https://github.com/llvm/llvm-project/pull/140134
2025-05-16 16:38:39 +01:00
Iris Shi
78af0f3ab8 [mlir][NFC] Use llvm::sort (#140261) 2025-05-16 23:35:13 +08:00
erichkeane
8696d16242 [OpenACC][CIR] Implement 'async' lowering for combined constructs
Implementation is 'trivial' as were the rest of the non data clauses, so
this implements them, finishing the last non-data/var-list clause for
combined constructs.  Also ensures this is properly tested.
2025-05-16 08:17:29 -07:00
LLVM GN Syncbot
36290b7289 [gn build] Port 9c3ab1cfc8 2025-05-16 14:38:55 +00:00
Kazu Hirata
4567c11d28 [clang] Use llvm::binary_search (NFC) (#140216) 2025-05-16 07:32:44 -07:00
Kazu Hirata
7d63306887 [clang] Fix typos in documentation (#140211) 2025-05-16 07:32:23 -07:00
Kazu Hirata
5c60f06648 [TextAPI] Use llvm::replace (NFC) (#140201) 2025-05-16 07:31:20 -07:00
Kazu Hirata
ab1fea49e2 [clang-tools-extra] Use llvm::replace (NFC) (#140200) 2025-05-16 07:30:46 -07:00
Kazu Hirata
e401fb8c47 [BOLT] Use llvm::replace (NFC) (#140199) 2025-05-16 07:30:29 -07:00
Alexander Kornienko
3aeced7308 [clang] Fix assertion failure in constexpr union deserialization (#140179)
This commit fixes https://github.com/llvm/llvm-project/issues/140130
2025-05-16 16:29:33 +02:00
Kazu Hirata
9c3ab1cfc8 Revert "Reapply: [llvm-objdump] Add support for HIP offload bundles (#140128)"
This reverts commit 910220b84f.

Multiple buildbot failures have been reported:
https://github.com/llvm/llvm-project/pull/140128
2025-05-16 07:23:21 -07:00
LLVM GN Syncbot
ba631508ae [gn build] Port 910220b84f 2025-05-16 13:47:20 +00:00
Simon Pilgrim
2b5222b192 [X86] SimplifyDemandedVectorEltsForTargetNode - add X86ISD::MOVDDUP handling (#140237)
Reduce YMM MOVDDUP node to XMM if the upper elements are not demanded

Noticed while working on #140234
2025-05-16 14:45:38 +01:00
Nikolas Klauser
e1ca2c5b60 [libc++] Reject abilist if it contains an ABI tag (#139030)
We currently don't have any ABI tags in our dylib symbols, and this is
unlikely to change in the future. By diagnosing this we avoid
accidentally adding one through e.g. having `_LIBCPP_HIDE_FROM_ABI` on
an exported symbol.
2025-05-16 15:41:53 +02:00
Douglas
8eafd93034 [Support] Set OF_Delete for InMemoryBuffer's call to openFileForWrite under commit (#140109)
https://github.com/llvm/llvm-project/pull/134787 unintentionally enabled
`--mmap-output-file` by default under LLD which caused the Windows-only
test `lld\test\ELF\link-open-file.test` to fail. This failure uncovered
what appears to be an inconsistency on Windows between
`createOnDiskBuffer` and `createInMemoryBuffer` with respect to `DELETE`
access for the output file.

The output file created by `createOnDiskBuffer` sets the flag
`OF_Delete` as part of `fs::TempFile::create` while the output file
created by `createInMemoryBuffer` sets `OF_None` under
`InMemoryBuffer::commit`.

The test `lld\test\ELF\link-open-file.test` ensures that if
`FILE_SHARE_DELETE` is _not_ specified for an output file that LLD is
expected to overwrite, LLD should fail. This only happens if: "the file
or device has been opened for delete access" which is only done for
`fs::TempFile::create`.

See
https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-createfilew#FILE_SHARE_DELETE.

Therefore, I propose setting `OF_Delete` for `InMemoryBuffer::commit`'s
call to `openFileForWrite` to stay consistent with
`fs::TempFile::create`.
2025-05-16 06:40:45 -07:00
David Salinas
910220b84f Reapply: [llvm-objdump] Add support for HIP offload bundles (#140128)
Utilize the new extensions to the LLVM Offloading API to extend to
llvm-objdump to handle dumping fatbin offload bundles generated by HIP.
This extension to llvm-objdump adds the option --offload-fatbin.
Specifying this option will take the input object/executable and extract
all offload fatbin bundle entries into distinct code object files with
names reflecting the source file name combined with the Bundle Entry ID.
Users can also use the --arch-name option to filter offload fatbin
bundle entries by their target triple.

---------

Co-authored-by: dsalinas <dsalinas@MKM-L1-DSALINAS.amd.com>
2025-05-16 09:39:15 -04:00
Alex MacLean
689a960b69 [NVPTX] Update various intrinsic attributes (#140119) 2025-05-16 06:31:07 -07:00
Shafik Yaghmour
dd32ad1c37 [Clang][Lex][NFC] Assert getExternalSource() in updateOutOfDateIdentifier (#140137)
Static analysis flagged the unconditional access of getExternalSource().
We don't initialize ExternalSource during construction but via
setExternalSource(). If this is not set it will violate the invariant
covered by the assert.
2025-05-16 06:26:56 -07:00
David Green
a07cc181cc [AArch64][GlobalISel] Add GISel test coverage for argument-blocks-array-of-struct.ll. NFC
See #50062.
2025-05-16 13:25:44 +01:00
Dhruv Srivastava
c02e6ca3b3 [lldb][AIX] Added 32-bit XCOFF Executable support (#139875)
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

**Description:**
Adding support for XCOFF 32 bit file format as well in lldb, up to the
point where 64-bit support is implemented.
Added a new test case for the same. 
This is an incremental PR on top of the previous couple of XCOFF support
commits.
2025-05-16 17:40:13 +05:30