529076 Commits

Author SHA1 Message Date
A. Jiang
f5f5286da3
[libc++] Implement LWG3990 for Clang (#128834)
This patch adds `[[_Clang::__no_specializations__]]` to `tuple`, with
warning/error suppressed for `tuple<>`.
2025-03-02 23:00:08 +08:00
Jacek Caban
d403f33886
[LLD][COFF] Mark personality functions as live in both symbol tables on ARM64X (#129295) 2025-03-02 13:37:51 +01:00
Billy Laws
8eba022886
[CodeGen][ARM64EC] Mangle EH personality handler names (#121652) 2025-03-02 13:35:51 +01:00
Jacek Caban
c6598f6ddf
[LLD][COFF] Add support for autoimports on ARM64X (#129282) 2025-03-02 13:10:50 +01:00
Jacek Caban
f858ac7acc
[LLD][COFF] Correct relocation size comments in autoimport tests (NFC) (#129403) 2025-03-02 13:10:01 +01:00
Amir Bishara
ac8b5a9e47
[mlir][scf]-Fix reverse iterator overflow in loop traversal (#128421)
Fix a bug in method `getUntiledProducerFromSliceSource` where address
sanitizer fails compilation on heap
buffer overflow for accessing value out of the iteration range.

This PR fixes the issue and adds a lit test to reproduce it.
2025-03-02 14:08:10 +02:00
Florian Hahn
ba7e27381f
[VPlan] Use VP_CLASSOF_IMPL in VPWidenRecipe. (NFC) 2025-03-02 11:40:23 +00:00
Congcong Cai
60afce2df9
[clang-tidy] fix fp when modifying variant by `operator[]` with template in parameters (#128407)
`ArraySubscriptExpr` can switch base and idx. For dependent array
subscript access, we should check both base and idx conservatively.
2025-03-02 19:39:49 +08:00
JP Hafer
416c7b370e
[ARM] Remove unneeded global inits (NFCI) (#129299)
Theses consts in ASMTargetParser were causing unnecessary global
initialization fuctions.
_GLOBAL__sub_I_ARMTargetParser.cpp
_GLOBAL__sub_I_Triple.cpp

Both functions init the same consts. I messed up the first PR on this
sorry.
2025-03-02 11:03:33 +00:00
Florian Hahn
f937b17e85
[LV] Don't query SCEV for non-invariant values in cost model.
This fixes a divergence between VPlan and legacy cost model, matching
behavior further up in getInstructionCost as well.

Fixes https://github.com/llvm/llvm-project/issues/129236.
2025-03-02 10:55:52 +00:00
A. Jiang
fa5db05ca3
[libc++][test] XFAIL for FreeBSD in thread_create_failure.pass.cpp (#129413)
Per https://man.freebsd.org/cgi/man.cgi?query=setrlimit, FreeBSD's
`setrlimit` seems to limit the number of processes, not threads via
`RLIMIT_NPROC`. So this test should be XFAIL for FreeBSD.
2025-03-02 11:35:22 +01:00
AdityaK
4a8412d430
[libc++] Add tests for gcd that result in something other than zero or one (#129395)
@colincross identified gcd does not have a single case whose answer is
not 0, 1, or the smaller of the two inputs.
2025-03-02 11:33:59 +01:00
Kazu Hirata
4b3f0fa7e7
[llvm-jitlink] Avoid repeated hash lookups (NFC) (#129422) 2025-03-02 01:12:33 -08:00
Kazu Hirata
1fd014c13d
[SPIRV] Avoid repeated hash lookups (NFC) (#129421) 2025-03-02 01:11:42 -08:00
Kazu Hirata
4eef3de588
[Mips] Avoid repeated hash lookups (NFC) (#129420) 2025-03-02 01:11:23 -08:00
Kazu Hirata
c1211d5cc4
[IPO] Avoid repeated hash lookups (NFC) (#129419) 2025-03-02 01:10:50 -08:00
Kazu Hirata
2bbb394a98
[CodeGen] Avoid repeated hash lookups (NFC) (#129418) 2025-03-02 01:10:18 -08:00
Kazu Hirata
69c7336c77
[Analysis] Avoid repeated hash lookups (NFC) (#129417) 2025-03-02 01:09:58 -08:00
Timm Baeder
2c1e9f14be
[clang][bytecode] Explicit composite array descriptor types (#129376)
When creating descriptor for array element types, we only save the
original source, e.g. int[2][2][2]. So later calls to getType() of the
element descriptors will also return int[2][2][2], instead of e.g.
int[2][2] for the second dimension.
Fix this by explicitly tracking the array types.
The last attached test case used to have an lvalue offset of 32 instead
of 24.

We should do this for more desriptor types though and not just composite
array, but I'm leaving that to a later patch.
2025-03-02 09:40:56 +01:00
Craig Topper
81a8b5c579 [MachineSink] Use Register and MCRegUnit. NFC 2025-03-01 21:57:04 -08:00
Fangrui Song
99ff3d0bcb [MCParser] Remove some section directive not supported by gas
and not emitted by AsmPrinter.

The intention was to remove `.eh_frame`, which had the wrong
section flags. Let's also remove .data.rel and .data.rel.ro
but keep other extensions like .rodata
2025-03-01 21:04:21 -08:00
Fangrui Song
74638f1634 [test] Replace .data.rel.ro with .section .data.rel.ro,"aw"
to avoid using the extension unsupported by gas.
2025-03-01 20:55:17 -08:00
Fangrui Song
1b1dc50505 [MCParser] Improve parseIntToken error message
Add a default argument, which is more readable than existing call sites
and encourages new call sites to omit the argument.

Omit " in ... directive" since this the error message includes the line.
2025-03-01 19:37:00 -08:00
Maksim Panchenko
5a11912ece
[BOLT] Refactor interface for creating instruction patches. NFCI (#129404)
Add BinaryContext::createInstructionPatch() interface for patching parts
of the original binary with new instruction sequences. Refactor
PatchEntries pass to use the new interface.
2025-03-01 19:20:17 -08:00
Matt Arsenault
a0540e6c98
unittests: Use EXPECT_ instead of ASSERT_ in a few tests (#129251) 2025-03-02 09:29:56 +07:00
Matt Arsenault
83941577cf
llvm-rc: Relax error message checked in test (#129243)
In the fork path, it does not print the piece about posix_spawn failed

Part of #129208
2025-03-02 09:26:45 +07:00
Fangrui Song
b6d5fa05ad [llvm-ml] Remove unused DWARF/Mach-O/ARM If-Then functions 2025-03-01 17:41:32 -08:00
Fangrui Song
43c3014ec1 [llvm-ml] Remove unused parser functions 2025-03-01 17:19:39 -08:00
Fangrui Song
077497d180 [MCParser] Remove parseParenExprOfDepth
Introduced by http://reviews.llvm.org/D9742 as a hack, which then became
unneeded.

Primary test: llvm/test/MC/Mips/memory-offsets.s
2025-03-01 16:52:45 -08:00
Da-Viper
8ec0d60e28
[lldb-dap] Add: show return value on step out (#106907)
https://github.com/user-attachments/assets/cff48c6f-37ae-4f72-b881-3eff4178fb3c
2025-03-01 18:21:21 -06:00
Fangrui Song
5e6c0853fd [MCParser] Clean up onEndOfFile
and modernize NumOfMacroInstantiations
2025-03-01 15:58:19 -08:00
Fangrui Song
e3e9c5c873 [MC] Remove unneeded onLabelParsed and onLabelParsed from HLASM
They are only used by ARM and wasm.
2025-03-01 15:24:52 -08:00
Maksim Panchenko
8910e41c86
[BOLT][AArch64] Refactor ADR to ADRP+ADD conversion pass. NFCI (#129399)
In preparation of using the new interface in more places, refactor the
ADR conversion pass.
2025-03-01 14:10:59 -08:00
Fangrui Song
872e4a3388 [X86] Replace reloc_global_offset_table8 with R_X86_64_GOTPC64 2025-03-01 13:32:48 -08:00
Vitaly Buka
038731c709
[ubsan] Remove -fsanitizer=vptr from -fsanitizer=undefined (#121115)
This makes `undefined` more consistent.

`vptr` check adds additional constraints:
1. trap is off,  or silently disabled
2. rtti is no, or compilation error
3. c++abi, or linking error

So it's not obvious if `-fsanitizer=undefined`
will have it on.

https://discourse.llvm.org/t/rfc-remove-vptr-from-undefined/83830
2025-03-01 13:21:47 -08:00
Florian Hahn
75270e3750
[VPlan] Don't print VPlan DT after VPlan construction. (NFC)
Remove unnecessary code to just print VPlan dominator tree.
2025-03-01 21:15:56 +00:00
Trevor Laughlin
304c053a5c
[cindex] Add API to query the class methods of a type (#123539)
Inspired by https://github.com/llvm/llvm-project/pull/120300, add a new
API `clang_visitCXXMethods` to libclang (and the Python bindings) which
allows iterating over the class methods of a type.

---------

Co-authored-by: Vlad Serebrennikov <serebrennikov.vladislav@gmail.com>
Co-authored-by: Aaron Ballman <aaron@aaronballman.com>
2025-03-02 00:59:26 +04:00
Jan Patrick Lehr
fe18796142
[Offload][AMDGPU] Enable SPIRV target in build conf (#129323)
Enable the SPIRV backend on the CMake-cache file buildbots.
2025-03-01 21:56:28 +01:00
Csanád Hajdú
9b7b7d6075
[LLD][ELF] Add -z execute-only-report that checks PURECODE section flags (#128883)
`-z execute-only-report` checks that all executable sections have either
the SHF_AARCH64_PURECODE or SHF_ARM_PURECODE section flag set on AArch64
and ARM respectively.
2025-03-01 12:36:56 -08:00
Fangrui Song
b65e0947ca
[Mips] Allow expressions in some immediate operands
e.g.
`addiu   $t2, $t3, .Lend-.Lstart-4`
used by libdragon/boot/boot_trampoline.S

To make this work, update a few places:

* AsmParser: When matching a isSImm/isUImm, consider an expression
  that does not evaluate to an assemble-time constant an immediate.
* MCCodeEmitter: If this is an I-type instruction and the expression
  does not evaluate to an assemble-time constant, append a
  `fixup_Mips_AnyImm16`.
  TODO: in MipsInstrInfo.td, more `Operand` should switch from the
  default `getMachineOpValue` to `getImmOpValue` like RISCV.
* AsmBackend: If the expression does not evaluate to a constant
  with assembler layout information, report "unknown relocation type"
  like X86. If the result is not within [-32768,65535] (the bound gas
  uses when parsing a constant integer for ADDIU)

Fix #126531

Pull Request: https://github.com/llvm/llvm-project/pull/127581
2025-03-01 10:26:49 -08:00
Fangrui Song
b356a3085b [Mips] Format some MCTargetDesc files. NFC
In preparation for #127581
2025-03-01 10:16:02 -08:00
Veera
bc35510725
[InstSimplify] Fold X * C >= X to true (#129352)
Proof: https://alive2.llvm.org/ce/z/T_ocLy

Discovered in: https://github.com/rust-lang/rust/issues/114386

This PR folds `X * C >= X` to `true` when `C` is known to be non-zero
and `mul` is `nuw`.

Folds for other math operators exist already:
https://llvm-ir.godbolt.org/z/GKcYEf5Kb
2025-03-01 12:02:57 -05:00
Simon Pilgrim
5ddf40fa78
[VectorCombine] scalarizeLoadExtract - don't create scalar loads if any extract is waiting to be erased (#129375)
If any extract is waiting to be erased, then bail out as this will distort the cost calculation and possibly lead to infinite loops.

Fixes #129373
2025-03-01 16:54:22 +00:00
Kazu Hirata
88460137d9
[memprof] Use llvm::equal in stackFrameIncludesInlinedCallStack (NFC) (#129372)
llvm::equal hides all the iterator manipulation behind the scenes
while reducing the line count.
2025-03-01 08:15:24 -08:00
Kazu Hirata
70f4e6abf6
[ExecutionEngine] Avoid repeated hash lookups (NFC) (#129356) 2025-03-01 08:15:00 -08:00
Kazu Hirata
70af83ff5f
[X86] Avoid repeated hash lookups (NFC) (#129360) 2025-03-01 08:14:17 -08:00
Kazu Hirata
f892dc7440
[Transforms] Avoid repeated hash lookups (NFC) (#129359) 2025-03-01 08:13:52 -08:00
Kazu Hirata
0bcc37cf1e
[SPIRV] Avoid repeated hash lookups (NFC) (#129358) 2025-03-01 08:13:18 -08:00
Kazu Hirata
00414c3371
[Hexagon] Avoid repeated hash lookups (NFC) (#129357) 2025-03-01 08:13:00 -08:00
Sebastian Schaller
cc5d8a4b2f
[AArch64] fall back to SDAG for instructions with emulated TLS variables (#129215)
Fixes #126200 
At the moment, GlobalISel is missing an implementation for emulated TLS
variables.
I fixed the issue by falling back to SDAG in this case, as I currently
don't have the knowledge to implement it myself.

Co-authored-by: Schaller, Sebastian <sebastian.schaller@dentsplysirona.com>
2025-03-01 15:47:25 +00:00