533308 Commits

Author SHA1 Message Date
Valentin Clement (バレンタイン クレメン)
3f4e4e0a12
[flang][cuda] Add on_device interface to cudadevice (#134747) 2025-04-07 18:21:07 -07:00
Rahul Joshi
bb1f32ded0
[NFC][LLVM] Change initialize<PassName>PassOnce to return void (#134500)
- The return value of these functions (called using `llvm::call_once`)
is never used, so make these functions return void.
2025-04-07 18:10:06 -07:00
Rahul Joshi
20eb60d3f2
[NFC][LLVM] Cleanup pass initialization for wasm/LoongArch (#134452)
- Remove calls to pass initialization from pass constructors.
- https://github.com/llvm/llvm-project/issues/111767
2025-04-07 18:09:46 -07:00
Rahul Joshi
80fde75dc6
[NFC][LLVM][SystemZ] Cleanup pass initialization for SystemZ (#134450)
- Remove calls to pass initialization from pass constructors.
- https://github.com/llvm/llvm-project/issues/111767
2025-04-07 18:08:55 -07:00
Bruno Cardoso Lopes
a168ddc470
[MLIR][LLVM] Block address support (#134335)
Add support for import and translate.

MLIR does not support using basic block references outside a function
(like LLVM does), This PR does not consider changes to MLIR to that
respect. It instead introduces two new ops: `llvm.blockaddress` and
`llvm.blocktag`. Here's an example:

```
llvm.func @ba() -> !llvm.ptr {
  %0 = llvm.blockaddress <function = @ba, tag = <id = 1>> : !llvm.ptr
  llvm.br ^bb1
^bb1:  // pred: ^bb0
  llvm.blocktag <id = 1>
  llvm.return %0 : !llvm.ptr
}
```

Value `%0` hold the address of block tagged as `id = 1` in function
`@ba`. Block tags need to be unique within a function and use of
`llvm.blockaddress` requires a matching tag in a `llvm.blocktag`.
2025-04-07 17:53:18 -07:00
Matt Arsenault
1a9928442b
SeparateConstOffsetFromGEP: Avoid looking at constant uses (#134685)
We could be more aggressive and inspect uses of global variables,
if the use context instruction is in the same function.
2025-04-08 07:44:45 +07:00
Matt Arsenault
76e219d9c3
SeparateConstOffsetFromGEP: Add more tests with lower-gep (#134684)
I didn't see any failures while trying to break hasMoreThanOneUseInLoop
or other paths here.
2025-04-08 07:40:57 +07:00
Matt Arsenault
8286b804d5
OMPIRBuilder: Do not try to expand uses of ConstantData (#134584) 2025-04-08 07:36:55 +07:00
Matt Arsenault
87afe4de22
OMPIRBuilder: Cleanup checking for GlobalValue (#134583)
GlobalValue already subsumes GlobalObject and GlobalVariable,
plus make use of the std::get<0> already copied to a variable
above.
2025-04-08 07:33:07 +07:00
Rahul Joshi
7073676216
[NFC][LLVM][DirectX] Cleanup pass initialization for DirectX (#134419)
- Remove calls to pass initialization from pass constructors.
- https://github.com/llvm/llvm-project/issues/111767
2025-04-07 17:28:26 -07:00
Rahul Joshi
a3754ade63
[NFC][LLVM][AMDGPU] Cleanup pass initialization for AMDGPU (#134410)
- Remove calls to pass initialization from pass constructors.
- https://github.com/llvm/llvm-project/issues/111767
2025-04-07 17:27:50 -07:00
Rahul Joshi
1356e202b2
[NFC][LLVM][BPF] Cleanup pass initialization for BPF (#134414)
- Remove calls to pass initialization from pass constructors and move
them to target initialization.
- https://github.com/llvm/llvm-project/issues/111767
2025-04-07 17:27:26 -07:00
Matheus Izvekov
735f5b1cb4
[clang] fix DependentTemplateSpecializationType transform (#134748)
This changes the transform for DTST so it rebuilds the node if any of
the template arguments changed.

This fixes a regression reported here:
https://github.com/llvm/llvm-project/pull/133610#issuecomment-2784576267
which was introduced by https://github.com/llvm/llvm-project/pull/133610

There are no release notes since the regression was never released.
2025-04-07 21:25:37 -03:00
Matt Arsenault
1f359610b0
ObjCARC: Drop pointer bitcast handling (#134274)
There is more in the file to drop, but this looks like the easier
part.
2025-04-08 07:23:00 +07:00
Han-Kuan Chen
d7354e337a
[SLP][REVEC] Fix ShuffleVector does not consider alternate instruction. (#134599) 2025-04-08 08:04:43 +08:00
Jorge Gorbe Moya
99d12ac172 [bazel] Fix build after 65813e0e94c0403dad61e8365b39d76d7b3bfc14 2025-04-07 17:03:30 -07:00
Justin Bogner
0afa872a0d
[DirectX] Scalarize the dx.saturate intrinsic (#134381)
The DXIL Saturate op only takes scalars.

Fixes #134378.
2025-04-08 08:54:10 +09:00
Tom Yang
65813e0e94
Control Darwin parallel image loading with target.parallel-module-load (#134437)
A requested follow-up from
https://github.com/llvm/llvm-project/pull/130912 by @JDevlieghere to
control Darwin parallel image loading with the same
`target.parallel-module-load` that controls the POSIX dyld parallel
image loading. Darwin parallel image loading was introduced by
https://github.com/llvm/llvm-project/pull/110646.

This small change:
* removes
`plugin.dynamic-loader.darwin.experimental.enable-parallel-image-load`
and associated code.
* changes setting call site in
`DynamicLoaderDarwin::PreloadModulesFromImageInfos` to use the new
setting.

Tested by running `ninja check-lldb` and loading some targets.

Co-authored-by: Tom Yang <toyang@fb.com>
2025-04-07 16:33:48 -07:00
Jerry-Ge
a38ad6e2a2
[mlir][tosa] Check empty Concat input for inferReturnTypeComponents (#134728)
Signed-off-by: Jerry Ge <jerry.ge@arm.com>
2025-04-07 16:27:08 -07:00
Mingming Liu
ddb32a67c2
[NFC] Add a precommit test for aarch64 jump table partitioning (#125987) 2025-04-07 16:21:12 -07:00
Andres Chavarria
9b63a92ca7
Implement areInlineCompatible for SystemZ using feature bitset (#132976)
## What?
Implement `areInlineCompatible` for the SystemZ target using
FeatureBitset comparison.

## Why?
The default implementation in `TargetTransformInfoImpl.h` makes a string
comparison and only inlines when the target-cpu and the target-features
for caller and callee are the same. We are missing out on optimizations
when the callee has a subset of features of the caller.

## How?
Get the FeatureBitset of the caller and callee and check when callee is
a subset or equal to the caller's features. It's a similar
implementation to ARM, PowerPC...

## Testing?
Test cases check for when the callee is a subset of the caller, when
it's not a subset and when both are equals.
2025-04-08 00:50:30 +02:00
Philip Reames
9ce4557978 [RISCV] Add coverage for reported miscompile in shuffle lowering
Derived from the example in https://github.com/llvm/llvm-project/issues/134126
2025-04-07 15:34:00 -07:00
Sarah Spall
01bc672b8a
[HLSL] Desugar ConstantArrayType when calculating cbuffer field layout (#134683)
When calculating the layout for a cbuffer field, if that field is a
ConstantArrayType, desguar it before casting it to a ConstantArrayType.
Closes #134668

---------

Co-authored-by: Eli Friedman <efriedma@quicinc.com>
2025-04-07 15:25:47 -07:00
Florian Hahn
ad9f15ab53
[VPlan] Introduce and use VPValue::replaceUsesOfWith (NFC).
Adds an API matching LLVM's IR Value, which simplifies some code a
bit.
2025-04-07 22:07:52 +01:00
Steven Hedges
eeebdb9711
[llvm] Fix Typo in Kaleidoscope BuildingAJIT Example (#134391)
Changed "precedecnce" to precedence.
2025-04-07 22:05:15 +01:00
amansharma612
3382aef944
[libc] Fixed typo in porting.rst (#134488)
Co-authored-by: Aman Sharma <210100011@iitb.ac.in>
2025-04-07 21:59:41 +01:00
Pedro Lobo
6a94bd136d
[PPC] Change placeholder from undef to poison (#134552)
Call `insertelement` on a `poison` value instead of `undef`.
2025-04-07 21:56:02 +01:00
Ramkumar Ramachandra
2ac11daf92
[SCEV] Improve code around constant TC (NFC) (#133261) 2025-04-07 21:52:36 +01:00
Jason Molenda
df28c81f5a [lldb][debugserver] Fix an off-by-one error in watchpoint identification (#134314)
debugserver takes the address of a watchpoint exception and calculates
which watchpoint was responsible for it. There was an off-by-one error
in the range calculation which causes two watchpoints on consecutive
ranges to not correctly identify hits to the second watchpoint. The
result is that lldb wouldn't show the second watchpoint as ever being
hit.

Re-landing this test with a modification to only require two
watchpoints in the test, instead of four.  If four watchpoints can
be set, it will test them.

rdar://145107575
2025-04-07 13:50:31 -07:00
vporpo
3756ba3c87
[SandboxIR] Implement ConstantDataSequential and subclasses (#133547)
This patch implements sandboxir::ConstantDataSequential mirroring LLVM
IR.
2025-04-07 13:48:30 -07:00
Krzysztof Drewniak
d1a0572117
[AMDGPU] Add buffer.fat.ptr.load.lds intrinsic wrapping raw rsrc version (#133015)
Add a buffer_fat_ptr_load_lds intrinsic, by analogy with
global_load_lds, which enables using `ptr addrspace(7)` to set the rsrc
and offset arguments to raw_ptr_buffer_load_lds.
2025-04-07 15:42:22 -05:00
Nicolas van Kempen
15750a0ab2
[clang-tidy] Use --match-full-lines instead of --strict-whitespace in check_clang_tidy (#133756)
See Discourse post here:
https://discourse.llvm.org/t/rfc-using-match-full-lines-in-clang-tidy-tests/85553

I've added `--match-partial-fixes` to all tests that were failing,
unless I noticed the fix was quick and trivial.
2025-04-07 16:34:07 -04:00
Peter Collingbourne
9222607227
gn build: Add check-builtins target.
Tested on aarch64 Linux and x86_64 Linux.

Reviewers: aeubanks, nico

Reviewed By: aeubanks

Pull Request: https://github.com/llvm/llvm-project/pull/134482
2025-04-07 13:22:52 -07:00
Shafik Yaghmour
d4c16424cf
[LLVM][Demangle] Fix MS Demangler to be stricter about wide string literals (#134483)
Static analysis detected that Demangler::demangleStringLiteral had a
potential overflow if not checking StringByteSize properly.

Added check to ensure that for wide string it is always even and that
there were the byte count did not mismatch the actual size of the
literal.

Fixes: https://github.com/llvm/llvm-project/issues/129970
2025-04-07 13:18:53 -07:00
Florian Hahn
7aedebac8c
[VPlan] Populate ExitBlocks when cloning VPlan (NFC).
Update VPlan::duplicate to add cloned exit blocks to ExitBlocks.

Currently there are no uses of the exit blocks after cloning so this is
NFC at the moment.
2025-04-07 21:17:42 +01:00
LLVM GN Syncbot
78f624a0d4 [gn build] Port 7013b51548c0 2025-04-07 20:01:32 +00:00
LLVM GN Syncbot
e1f6e40b28 [gn build] Port 475cbf0ad6e7 2025-04-07 20:01:31 +00:00
LLVM GN Syncbot
06bf7a99fd [gn build] Port 1f72fa29ecb4 2025-04-07 20:01:30 +00:00
LLVM GN Syncbot
7d4cddadf2 [gn build] Port 0a1742708ddc 2025-04-07 20:01:29 +00:00
Brad Smith
9fdac840ec
[sanitizer_common] Fix building with NetBSD 10.99.12 or newer (#134708)
16543c4905

__lwp_getprivate_fast() was moved to a new arch-specific header file.

Closes: #125566

Co-authored-by: Thomas Klausner <wiz@gatalith.at>
2025-04-07 15:56:58 -04:00
Rahul Joshi
19dbde0e81
[NFC][LLVM] Cleanup pass initialization for ARM/ARV/Lanai/X86/XCore (#134400)
- Remove pass initialization from pass constructors.
- https://github.com/llvm/llvm-project/issues/111767
2025-04-07 12:56:16 -07:00
Lei Huang
3479c57466
PowerPC32:PIC: Update to bcl to fix branch prediction mis-predict issue (#134140)
Update `bl` to `bcl 20, 31, .+4` for 32bit PIC code gen so the link
stack is 
not corrupted and cause mis-predict for the branch predictor.

fixes: https://github.com/llvm/llvm-project/issues/128644
2025-04-07 15:50:21 -04:00
Damien L-G
9965f3d337
[libc++] Improve diagnostic when violating std::atomic trivially copyable mandates (#131754)
When attempting to instantiate `std::atomic` with a non trivially
copyable type, one gets errors from instantiating internals before the
actual static assertion that check the template parameter type
requirements.

The `verify` test for it had a `// ADDITIONAL_COMPILE_FLAGS: -Xclang
-verify-ignore-unexpected=error` directive to work around this issue.
The changes I propose enable us to drop that directive.
As I understand it, the `verify` test was misplaced so I moved it to
`test/{std -> libcxx}/atomics`.

(I ran into this while working on #121414 in which we would add another
static assertion in `__check_atomic_mandates`)
2025-04-07 15:25:45 -04:00
Drew Lewis
27c099bc84
Move CodeGen cuda.h to Inputs from include (#134706)
Mirrors the behavior of CodeGenCUDA directory and the location of other
.h files in CodeGen.
2025-04-07 12:23:10 -07:00
Leandro Lupori
76fee8f4ed
[flang][OpenMP][NFC] Don't use special chars in error messages (#134686)
Some error messages were using a special char for `fi`, in the
word `specified`, probably due to a typo.

This caused an error on Windows: #134625
2025-04-07 16:22:51 -03:00
Brad Smith
8f5a3ec649
[sanitizer_common] Use HW_NCPUONLINE sysctl on NetBSD in GetNumberOfCPUs() (#134704) 2025-04-07 15:15:12 -04:00
Piotr Fusik
10bef367a5
[RISCV][test] Fix a comment typo (#134242) 2025-04-07 20:47:21 +02:00
YLChenZ
529e9127f0
[clang][doc]: Merge entries with duplicate content. (#134089)
Before the patch:

![docb4](https://github.com/user-attachments/assets/6db1000f-d555-48b8-8a19-85c41b043fd8)
after the patch:

![doc-after](https://github.com/user-attachments/assets/1cff64b6-db2e-48d8-b0a9-a403fd61f8af)

Fixes #133706
2025-04-07 14:42:57 -04:00
Jason Molenda
369c7739d0 Revert "[lldb][debugserver] Fix an off-by-one error in watchpoint identification (#134314)"
This reverts commit 21d912121c9f41385b165a736be787527f5bd7c2.

Failure on the aarch64 ubuntu bot when setting the 4th watchpoint;
may be a hardware limitation on that bot.  I thought creating four
watchpoints would be generally safe, but I don't need to do that
for my test, will re-land without it.
2025-04-07 11:21:58 -07:00
Jason Molenda
21d912121c
[lldb][debugserver] Fix an off-by-one error in watchpoint identification (#134314)
debugserver takes the address of a watchpoint exception and calculates
which watchpoint was responsible for it. There was an off-by-one error
in the range calculation which causes two watchpoints on consecutive
ranges to not correctly identify hits to the second watchpoint. The
result is that lldb wouldn't show the second watchpoint as ever being
hit.

rdar://145107575
2025-04-07 11:11:31 -07:00