Commit Graph

537765 Commits

Author SHA1 Message Date
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
Zahira Ammarguellat
38e0f983ad [CLANGD] [NFC] Fix proposed by static analyzer. (#140116)
This fixes an issue reported by the sanitizer with the following error
message:
`copy_constructor_call: IndexOpts` is passed by value as a parameter to`
clang::index::IndexingOptions::IndexingOptions` instead of being moved.
2025-05-16 07:56:36 -04:00
Harrison Hao
25c4478f38 [NFC][AMDGPU] Convert commute-compares.ll to autogenerated CHECK lines (#140076) 2025-05-16 19:34:20 +08:00
Louis Dionne
e829963a4f [libc++][NFC] Update the documentation for _LIBCPP_OVERRIDABLE_FUNCTION (#140121) 2025-05-16 07:29:46 -04:00
Timm Baeder
e5f8998ac8 [clang][bytecode] Explicitly start variable lifetimes via placement new (#140221)
placement new /std::construct{,_at} can resurrect a variable after it's
destructor has been called.
2025-05-16 12:48:22 +02:00
Paul Walker
711d72e38e [LLVM][SVE] Relax optimizeIncrementingWhile constant operand requirements. (#140037)
Only the latter part of optimizeIncrementingWhile requires a constant
first operand and so the initial bailout code is preventing the obvious
whilele(X,MAX_INT) -> splat(true) combine.
2025-05-16 11:43:56 +01:00
Simon Pilgrim
882a4c531f [X86] combineGatherScatter - ensure index / pointer sizes match when converting index shift to scale (#140110)
The index value can sext/trunc to the pointer size before being scaled

Noticed while reviewing #139703
2025-05-16 11:41:21 +01:00
Simon Pilgrim
b712590ef4 [X86] Add test coverage for #140234 2025-05-16 11:30:34 +01:00
Weibo He
9f77c26ec6 [CoroEarly] Hide promise alloca for later passes (#139243)
Currently coroutine promises are modeled as allocas. This is problematic
because other middle-end passes will assume promise dead after coroutine
suspend, leading to misoptimizations.

I propose the front ends remain free to emit and use allocas to model
coro promise. At CoroEarly, we will replace all uses of promise alloca
with `coro.promise`. Non coroutine passes should only access promise
through `coro.promise`. Then at CoroSplit, we will lower `coro.promise`
back to promise alloca again. So that it will be correctly collected
into coro frame. Note that we do not have to bother maintainers of other
middle-end passes.

Fix #105595
2025-05-16 17:23:03 +08:00
Wenju He
d779b8f92b [libclc] Append file_specific_compile_options after ARG_COMPILE_FLAGS (#139871)
This enables file_specific_compile_options to take precedence over
ARG_COMPILE_FLAGS. For example, if we add -fno-slp-vectorize to
COMPILE_OPTIONS of a file, the behavior changes as follows:
* Before this PR: -fno-slp-vectorize is overwritten by -O3, resulting in
SLP vectorizer remaining enabled.
* After this PR: -fno-slp-vectorize overwrites -O3, effectively
disabling SLP vectorizer.
2025-05-16 10:21:45 +01:00
Wenju He
299a278db1 [libclc] Improving vector code generated from scalar code (#140008)
The previous method splits vector data into two halves. shuffle_vector
concatenates the two results into a vector data of original size. This
PR eliminates the use of shuffle_vector.
2025-05-16 10:20:32 +01:00
Matthew Devereau
22576e2cce [Clang][AArch64] Add pessimistic vscale_range for sve/sme (#137624)
The "target-features" function attribute is not currently considered
when adding vscale_range to a function. When +sve/+sme are pushed onto
functions with "#pragma attribute push(+sve/+sme)", the function
potentially misses out on optimizations that rely on vscale_range being
present.
2025-05-16 09:39:07 +01:00
Pierre van Houtryve
aacebaeab5 [AMDGPU] Do not promote uniform i16 operations to i32 in CGP (#140208)
For the majority of cases, this is a neutral or positive change.
There are even testcases that greatly benefit from it, but some regressions are possible.
There is #140040 for GlobalISel that'd need to be fixed but it's only a one instruction regression and I think it can be fixed later.

Solves #64591
2025-05-16 10:31:03 +02:00
Pierre van Houtryve
5e7bc5e080 [DAGCombiner] Remove hasOneUse check from sext+sext_inreg to sext_inreg combine (#140207)
The hasOneUseCheck does not really add anything and makes the combine too
restrictive. Upcoming patches benefit from removing the hasOneUse check.
2025-05-16 10:25:49 +02:00
Benjamin Maxwell
3aaf44f95d [AArch64] Restrict .variant_pcs directive to ELF targets (#138924)
Directive was implemented in c87bd2d8eb to support lazy binding and is
emitted for vector PCS functions. It's specific to ELF but is currently
emitted for all binary formats and crashing on non-ELF targets.

Fixes #138260

---------

Co-authored-by: Cullen Rhodes <cullen.rhodes@arm.com>
2025-05-16 09:21:55 +01:00
Younan Zhang
858649ad0e [Clang] Profile singly-resolved UnresolvedLookupExpr with the declaration (#140029)
For a dependent variable template specialization, we don't build a
dependent Decl node or a DeclRefExpr to represent it. Instead, we
preserve the UnresolvedLookupExpr until instantiation.

However, this approach isn't ideal for constraint normalization. We
consider the qualifier during profiling, but since that's based on the
written code, it can introduce confusing differences, even when the
expressions resolve to the same declaration.

This change ensures that, if possible, we profile the resolved
declaration instead of its qualifier. For expressions that resolve to
more than one declarations, we still profile its qualifier, as otherwise
it would make us depend on the order of lookup results.

Fixes https://github.com/llvm/llvm-project/issues/139476
2025-05-16 16:21:24 +08:00
Pierre van Houtryve
fd85ffb4c4 [AMDGPU] Handle min/max in isNarrowingProfitable (#140206)
Introduces a slight regression in some cases but it'll even out once we
disable the promotion in CGP.
2025-05-16 10:16:44 +02:00
Jannick Kremer
c2045f24ea [libclang/python] Add typing annotations for the Cursor class (#138103)
This fully annotates the Cursor class, resolving 95 strict typing errors
as the next step towards #76664

These changes are a superset of the typing annotation changes from
#120590
2025-05-16 10:11:03 +02:00
Jannick Kremer
82a9cb358b [libclang/python] Ensure all used library functions are registered (#140015)
Add a few library functions that were not previously registered to the
`CDLL` object. The current behavior relied on the default `restype` to
work.

Add a test to check that all used library functions are properly
registered.
2025-05-16 10:03:48 +02:00
Paschalis Mpeis
bb5566aac2 [llvm][docs] Improve usage note on stacked PRs (#138949) 2025-05-16 09:02:17 +01:00
Oliver Hunt
39fa5b31c5 [llvm][NFC] Update LocalVarDef::CVRegister to fix size MS ABI (#140214)
LocalVarDef::CVRegister being a uint16_t is not enough for the fields to
be packed with the MS ABI.

This makes the field a 16 bit a uint32_t
2025-05-16 00:47:52 -07:00
Dominik Adamski
eb4fde9a4e Revert "[Flang] Turn on alias analysis for locally allocated objects" (#140202)
Reverts llvm/llvm-project#139682 (commit: cf16c97bfa )
due to reported regression in Fujitsu Fortran test suite:
https://ci.linaro.org/job/tcwg_flang_test--main-aarch64-Ofast-sve_vla-build/2081/artifact/artifacts/notify/mail-body.txt/*view*/
2025-05-16 09:44:33 +02:00
Florian Hahn
bf92b127d2 Revert "[LoopPeel] Implement initial peeling off the last loop iteration. (#139551)"
This reverts commit bb10c3ba7f.

Also reverts 4f663cca15:
  Revert "[LoopPeel] Make sure PeelLast is always initialized."

Revert for now to bring msan bots back to green

 https://lab.llvm.org/buildbot/#/builders/164/builds/9992
 https://lab.llvm.org/buildbot/#/builders/94/builds/7158
2025-05-16 08:33:12 +01:00
Iris Shi
1c2c02c8cb [RISCV][Scheduler] Split UnsupportedSchedZfa by other fp extensions (#140186) 2025-05-16 15:30:01 +08:00
Sudharsan Veeravalli
9a1bfc17d3 [RISCV] Add SEXT_INREG patterns for Xqcibm ext instruction (#140192)
Handle sign_extend_inreg from i1/i8/i16
2025-05-16 12:49:14 +05:30
Brad Smith
a23d18726d [Driver][Haiku] Add /boot/system/develop/headers/gcc/include header path (#140189) 2025-05-16 03:18:19 -04:00
Vlad Serebrennikov
17853c3a5f [libclang/python][NFC] Refactor wildcard import of ctypes (#140191)
The list is not that long.
2025-05-16 11:05:10 +04:00
Oliver Hunt
76ba29bfd8 [NFC] Address bit-field storage sizes to ensure ideal packing (#139825)
The MS bit-field packing ABI depends on the storage size of the type of
being placed in the bit-field. This PR addresses a number of cases in
llvm where the storage type has lead to suboptimal packing.
2025-05-16 00:02:58 -07:00
Christopher Di Bella
c41812e6ea [libcxx] applies #134819 to insert_or_assign with const key_type& (#140124)
This was missed due to using prvalues in the test case, which were
picked up by the rvalue-reference overload instead.
2025-05-16 08:56:45 +02:00
Min Hsu
937446d433 [M68k] Fix incorrect move mask encoding with pre-decrement operand
When the memory operand of MOVEM instruction has an addressing mode of
pre-decrement, the move mask should be reversed.
This patch fixes it by creating a new asm operand with a different
encoding method.

Reported by @petmac
2025-05-15 23:55:51 -07:00
Christian Ulmann
1001d6a6cd [MLIR][LLVM] Add import-structs-as-literals flag to the IR import (#140098)
This commit introduces the `import-structs-as-literals` option to the
MLIR import. This ensures that all struct types are imported as literal
structs, even when they are named in LLVM IR.
2025-05-16 08:43:06 +02:00
Kazu Hirata
a83668c3dd [BOLT] Use llvm::upper_bound (NFC) (#140174) 2025-05-15 23:29:37 -07:00
Kazu Hirata
5ca94f92fb [llvm-jitlink] Use std::optional::value_or (NFC) (#140173) 2025-05-15 23:29:15 -07:00
Kazu Hirata
0f0fd6213e [Basic] Use std::optional::value_or (NFC) (#140172) 2025-05-15 23:28:57 -07:00
Kiva
af083d09bd [RISCV] Add zihintpause LLVM/Clang intrinsic (#139519)
This PR adds the missing intrinsic `__builtin_riscv_pause` for the
zihintpause extension.

Spec:
https://five-embeddev.com/riscv-user-isa-manual/Priv-v1.12/zihintpause.html
Fixes #129961
2025-05-16 14:20:53 +08:00
Dhruv Srivastava
bcb1227c3c [lldb][AIX] Adding NativeThreadAIX (#139537)
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 NativeThreadAIX base files, 
to be integrated with already merged NativeProcessAIX.
2025-05-16 11:30:07 +05:30
Ruiling, Song
86e9be0954 EquivalenceClasses: Make ECValue public. NFC (#139689)
Expose the inner class so that we can explicitly write the type outside
the parent class.
2025-05-16 13:09:07 +08:00
Iris Shi
680b3b742d [RISCV][Scheduler] Add scheduling definitions for 128-bit Zfa instructions (#140003)
Followup of #139495 and #139508
2025-05-16 11:39:05 +08:00