531609 Commits

Author SHA1 Message Date
Daniel Chen
f73da649cb
Revert "[compiler-rt] Disable LLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON on AIX. (#131200)" (#132574)
…

This reverts commit 8e773d8a10cc996fbbe834f59ed9f7044c3539e0.
2025-03-22 20:56:47 -04:00
Fangrui Song
f3f0b99b1c [M68k] Add stub M68kMCExpr and migrate away from MCSymbolRefExpr::VariantKind
Similar to previous migration done for other targets (PowerPC, X86, ARM,
etc).

In the future, relocation specifiers should be encoded as part of
M68kMCExpr instead of MCSymbolRefExpr.
2025-03-22 17:51:48 -07:00
Lang Hames
41b572b99c [ORC][examples] Simplify example -- LLJIT already has a mangleAndIntern method.
We don't need a separate MangleAndInterner here any more.
2025-03-23 11:25:01 +11:00
Fangrui Song
f9898cf6a8 [SystemZ,test] Test section symbol and STT_TLS adjustment 2025-03-22 17:04:33 -07:00
Craig Topper
616737c386 [TableGen] Use std:vector instead of SmallVector for the list of CompressPatterns. NFC
There are very likely more than 4 compress patterns.
2025-03-22 15:33:55 -07:00
Florian Hahn
dfa665f19c
[VPlan] Add transformation to narrow interleave groups. (#106441)
This patch adds a new narrowInterleaveGroups transfrom, which tries
convert a plan with interleave groups with VF elements to a plan that
instead replaces the interleave groups with wide loads and stores
processing VF elements.

This effectively is a very simple form of loop-aware SLP, where we
use interleave groups to identify candidates.

This initial version is quite restricted and hopefully serves as a
starting point for how to best model those kinds of transforms.

Depends on https://github.com/llvm/llvm-project/pull/106431.

Fixes https://github.com/llvm/llvm-project/issues/82936.

PR: https://github.com/llvm/llvm-project/pull/106441
2025-03-22 21:40:17 +00:00
Florian Hahn
0d3ba087f7
[LV] Move IV bypass value creation out of ILV (NFC)
createInductionAdditionalBypassValues is only used for epilogue
vectorization now. Move it out of ILV, which means we do not have to
thread through ExpandedSCEVs and also don't have to track the bypass
values in ILV. Instead, directly create them if needed after executing
the epilogue plan. This moves more the epilogue specific logic out of
the generic executePlan.
2025-03-22 20:36:45 +00:00
Rynco Maekawa
5d54043006
[bindings] Add global_set_metadata for function debuginfo
Reviewed by: Alan Hu <ahulambda@gmail.com>
2025-03-22 16:36:36 -04:00
Kazu Hirata
f3e8e80563
[llvm] Construct SmallVector with ArrayRef (NFC) (#132560) 2025-03-22 13:11:31 -07:00
Fangrui Song
6e4e88d4cc [test] Improve R_RISCV_PLT32 and R_RISCV_GOT32_PCREL tests 2025-03-22 12:38:46 -07:00
Mohamed Emad
adcaf1769d
[libc] [NFC] fix type in docs/uefi/index.rst (#132553)
Closes #132537
2025-03-22 12:16:15 -07:00
Craig Topper
fb44c54d65
[RISCV] Add missing space to optimized-nf*-segment-load-store description. NFC (#132531) 2025-03-22 10:18:31 -07:00
Vasileios Porpodas
973ea045aa Revert "[Analysis][EphemeralValuesAnalysis][NFCI] Remove EphemeralValuesCache class (#132454)"
This reverts commit 4adefcfb856aa304b7b0a9de1eec1814f3820e83.
2025-03-22 10:13:39 -07:00
Timm Baeder
db7475a770
[clang][bytecode] Ignore overflow in unary operators if requested (#132557)
Add PreInc and PreDec ops for this purpose and ignore the overflow if
UnaryOperator::canOverflow() returns false.
2025-03-22 18:03:50 +01:00
Fangrui Song
ccc18ca147 [RISCV] Move VK_GOTPCREL and VK_PLT to RISCVMCExpr::Specifier
to migrate away from the deprecated MCSymbolRefExpr::VariantKind. In the
future, @GOTPCREL and @PLT in data directives should be encoded as part
of RISCVMCExpr instead of MCSymbolRefExpr.
2025-03-22 09:24:11 -07:00
Younan Zhang
868c89ff0e
[Clang] Fix a bot failure after 032ad590 (#132555)
See
https://github.com/llvm/llvm-project/pull/132061?notification_referrer_id=NT_kwDOBv04MLUxNTM5NjQwOTM5MToxMTcyNTgyODg#issuecomment-2745313527
2025-03-22 23:58:15 +08:00
Florian Hahn
34631744af
[VPlan] Get DataLayout from SE in VPExpandSCEVRecipe::execute (NFC)
This doesn't rely on State.CFG.
2025-03-22 15:49:57 +00:00
Timm Baeder
5fc891b965
[clang][bytecode][NFC] Use getElemType() in __builtin_memchr as well (#132550)
For consistency.
2025-03-22 16:34:22 +01:00
Matheus Izvekov
5999be0f47
[clang] fix RecursiveASTVisitor traversal from type to decl (#132551) 2025-03-22 12:12:24 -03:00
Kazu Hirata
2b69a49940
[Support] Avoid repeated hash lookups (NFC) (#132517) 2025-03-22 08:09:28 -07:00
Kazu Hirata
547181005a
[SPIRV] Avoid repeated hash lookups (NFC) (#132515) 2025-03-22 08:09:07 -07:00
Kazu Hirata
d8d2e7c491
[PowerPC] Avoid repeated hash lookups (NFC) (#132514) 2025-03-22 08:08:47 -07:00
Kazu Hirata
cb729be11c
[CodeGen] Avoid repeated hash lookups (NFC) (#132513) 2025-03-22 08:08:28 -07:00
Kazu Hirata
2fa59b3371
[Analysis] Avoid repeated hash lookups (NFC) (#132512) 2025-03-22 08:07:59 -07:00
Kazu Hirata
1b189cab5e
[llvm] Use *Set::insert_range (NFC) (#132509)
DenseSet, SmallPtrSet, SmallSet, SetVector, and StringSet recently
gained C++23-style insert_range.  This patch uses insert_range in
conjunction with llvm::{predecessors,successors} and
MachineBasicBlock::{predecessors,successors}.
2025-03-22 08:07:33 -07:00
Kazu Hirata
c6c394634c
[clang] Use *Set::insert_range (NFC) (#132507)
DenseSet, SmallPtrSet, SmallSet, SetVector, and StringSet recently
gained C++23-style insert_range.  This patch replaces:

  Dest.insert(Src.begin(), Src.end());

with:

  Dest.insert_range(Src);

This patch does not touch custom begin like succ_begin for now.
2025-03-22 08:06:38 -07:00
Younan Zhang
c5d4dfb291
[Clang][NFC] Use MarkUsedTemplateParameters in building alias CTAD guides (#132369)
It turns out that TemplateParamsReferencedInTemplateArgumentList() and
MarkUsedTemplateParameters() have the similar goal, so let's drop the
hand-written ASTVisitor.
2025-03-22 23:04:46 +08:00
Younan Zhang
032ad590d6
[Clang] Fix various bugs in alias CTAD transform (#132061) 2025-03-22 22:55:58 +08:00
Florian Hahn
2186199d08
[LV] Add test showing missing debug location on VPScalarIVStepsRecipe. 2025-03-22 14:38:14 +00:00
Timm Baeder
c51d396f4d
[clang][bytecode] Fix __builtin_memmove type diagnostics (#132544)
Set the source type when allocating primitives so we can later retrieve
it.
2025-03-22 14:58:32 +01:00
Stephan T. Lavavej
51aab96ebf
[libc++][test] Small fixes for time tests (#132532)
* Fix copy-paste damage in `formatter.tai_time.pass.cpp`.
+ Comparing the `#if` to the `#else` case, it's clear that this
half-copied check should be removed.
* Mark `is_steady` as `[[maybe_unused]]`.
  + It's only used within `LIBCPP_STATIC_ASSERT`.
2025-03-22 06:38:47 -07:00
Mikhail R. Gadelha
f138e36d52
[SelectionDAG][RISCV] Avoid store merging across function calls (#130430)
This patch improves DAGCombiner's handling of potential store merges by
detecting function calls between loads and stores. When a function call
exists in the chain between a load and its corresponding store, we avoid
merging these stores if the spilling is unprofitable.

We had to implement a hook on TLI, since TTI is unavailable in
DAGCombine. Currently, it's only enabled for riscv.

This is the DAG equivalent of PR #129258
2025-03-22 10:35:25 -03:00
Jesse Huang
fbaf3b895c
[RISCV] Update lld tests for the C ext implication change (#132541) 2025-03-22 20:57:50 +08:00
Baranov Victor
2909c420f6
[clang-tidy] modernize-use-starts-ends-with: fix false positives on find and rfind (#129564)
Also document cases with two or three arguments (matching default arguments)
this check matches.

Closes https://github.com/llvm/llvm-project/issues/129498.
2025-03-22 08:07:58 -04:00
Martin Storsjö
2a4522229c Revert "Reland "[Transforms] LoopIdiomRecognize recognize strlen and wcslen (#108985)" (#131412)"
This reverts commit ac9049df7e62e2ca4dc5d103593b51639b5715e3.

This change broke Wine (causing it to hang on startup), see
https://github.com/llvm/llvm-project/pull/108985 for discussion.
2025-03-22 12:41:04 +02:00
Martin Storsjö
1fdd8cb91e Revert "[Transform] Clean up strlen loop idiom (#132421)"
This reverts commit 7c52886700a5a70d873400ec022a99d7dce8b03b.

Reverting this as I have to revert another preceding commit,
ac9049df7e62e2ca4dc5d103593b51639b5715e3.
2025-03-22 12:40:40 +02:00
Mark de Wever
dd97324f11
[libc++][CI] Adds GCC trunk image. (#132271)
As discussed during the last monthly meeting we want to be able to test
the GCC development version in our CI, but we don't want to commit to
support this compiler version.

This adds the image to the CI Docker image. At the moment GCC-15 will
not pass the CI. Having it in the Docker image makes it possible to
validate fixes.

---------

Co-authored-by: Louis Dionne <ldionne.2@gmail.com>
Co-authored-by: Hristo Hristov <hghristov.rmm@gmail.com>
2025-03-22 11:36:34 +01:00
Florian Hahn
2f2100c879
[LV] Add additional tests for #106441.
Further increase test coverage for
https://github.com/llvm/llvm-project/pull/106441

Also regenerate checks with -filter-out-after.
2025-03-22 10:07:11 +00:00
Michael Buch
a27da0a20c
[llvm][MetadataLoader] Make sure we correctly load DW_APPLE_ENUM_KIND from bitcode (#132374)
This was pointed out in
https://github.com/llvm/llvm-project/pull/124752#issuecomment-2730052773

There was no test that roundtrips this attribute through LLVM bitcode,
so this was never caught.
2025-03-22 08:09:49 +00:00
Timm Baeder
6c8e9a6192
[clang][bytecode][NFC] Add assert to ptrauth_string_discriminator (#132527)
As pointed out by @shafik, this confuses static analysis and most
probably humans as well. Add an assertion to ensure the given array has
at least one element.
2025-03-22 08:05:28 +01:00
Jesse Huang
20b5728b7b
[RISCV] Implement the implications of C extension (#132259)
Implement the following implications according to the [Zc
spec](https://github.com/riscvarchive/riscv-code-size-reduction/blob/main/Zc-specification/Zc.adoc#13-c)

> As C defines the same instructions as Zca, Zcf and Zcd, the rule is
that:
> * C always implies Zca
> * C+F implies Zcf (RV32 only)
> * C+D implies Zcd
2025-03-22 14:48:52 +08:00
Fangrui Song
1d133420dc [MC] Use FirstTargetSpecifier 2025-03-21 23:25:38 -07:00
Timm Baeder
d67951694b
[clang][bytecode] Support overlapping regions in __builtin_memmove (#132523)
Unfortunately, a few circumstances make the implementation here less
than ideal, but we need to handle overlapping regions anyway.
2025-03-22 07:12:27 +01:00
Fangrui Song
1edefc3ea0 Move ARM-specific MCSymbolRefExpr::VariantKind to ARMMCExpr::Specifier
Similar to previous migration done for other targets (PowerPC, X86,
etc).

Note: ARMELFObjectWriter::needsRelocateWithSymbol is conservative and
already includes most specifiers.
2025-03-21 23:08:40 -07:00
Fangrui Song
4b417992dd [CodeGen] Rename PLTRelativeVariantKind. NFC
Migrate away from the deprecated MCSymbolRefExpr::VariantKind.
The name "Specifier" is utilized in a few *MCExpr.

> "Relocation specifier" is clear, aligns with Arm and IBM AIX's documentation, and fits the assembler's role seamlessly.
2025-03-21 23:02:08 -07:00
Fangrui Song
dad7f799b4 [ARM] Set STT_TLS for a few relocation specifiers
Symbols referenced through TLSLDO and FDPIC TLS-specific specifiers
should be set to STT_TLS as well.
2025-03-21 22:39:55 -07:00
Sudharsan Veeravalli
e7107973b8
Recommit "[RISCV] Add Qualcomm uC Xqcisync (Sync Delay) extension (#132184)" (#132520)
With a minor fix for the build failures.

Original message:

This extension adds nine instructions, eight for non-memory-mapped devices synchronization and delay instruction.

The current spec can be found at:
https://github.com/quic/riscv-unified-db/releases/tag/Xqci-0.7.0

This patch adds assembler only support.

Co-authored-by: Sudharsan Veeravalli quic_svs@quicinc.com
2025-03-22 11:07:48 +05:30
Fangrui Song
34f80126e9 [ARM] Improve STT_TLS tests and remove unsupported (tlsld) specifier
Test that symbols referenced through TLS-specific relocation specifiers
are set STT_TLS. As a minor issue, (tlsldo) does not set STT_TLS yet.

(tlsld) is not a valid specifier.
2025-03-21 22:29:22 -07:00
Ben Shi
597accfea6
[clang][CodeGen][AVR] Fix a crash in AVRABIInfo (#131976)
fixes https://github.com/llvm/llvm-project/issues/131967
2025-03-22 13:22:32 +08:00
Kazu Hirata
f459cfed7b
[AMDGPU] Avoid repeated hash lookups (NFC) (#132511) 2025-03-21 22:15:40 -07:00