529947 Commits

Author SHA1 Message Date
Zhaoxin Yang
6fbe491e17
[lld][LoongArch] Relax call36/tail36: R_LARCH_CALL36 (#123576)
Instructions with relocation `R_LARCH_CALL36` may be relax as follows:
```
From:
   pcaddu18i $dest, %call36(foo)
     R_LARCH_CALL36, R_LARCH_RELAX
   jirl $r, $dest, 0
To:
   b/bl foo  # bl if r=$ra, b if r=$zero
     R_LARCH_B26
```
2025-03-09 17:21:27 +08:00
Kazu Hirata
99d2b3b0aa
[llvm-profgen] Avoid repeated hash lookups (NFC) (#130466) 2025-03-09 00:49:37 -08:00
Kazu Hirata
573df34ea0
[llvm-jitlink] Avoid repeated hash lookups (NFC) (#130465) 2025-03-09 00:49:13 -08:00
Kazu Hirata
cf3aa06c16
[Utils] Avoid repeated hash lookups (NFC) (#130464) 2025-03-09 00:48:37 -08:00
Kazu Hirata
7c7cebf49d
[Scalar] Avoid repeated hash lookups (NFC) (#130463) 2025-03-09 00:48:17 -08:00
Kazu Hirata
7cd3047252
[IPO] Avoid repeated hash lookups (NFC) (#130462) 2025-03-09 00:47:57 -08:00
Kazu Hirata
2d1634fab7
[ExecutionEngine] Avoid repeated map lookups (NFC) (#130461) 2025-03-09 00:47:42 -08:00
Ben Shi
2172a5edcf
[clang][analyzer][NFC] Fix typos in comments (#130456) 2025-03-09 08:23:51 +01:00
Craig Topper
d47bc6fd93 [ARM] Change FastISel Address from a struct to a class. NFC
This allows us to use Register in the interface, but store an
unsigned internally in a union.
2025-03-08 22:53:07 -08:00
Craig Topper
0f646fc848 [AArch64] Remove unused DenseMap variable. NFC 2025-03-08 22:10:07 -08:00
Craig Topper
ae1479c79e [ARM] Remove unused argument. NFC 2025-03-08 22:08:54 -08:00
Craig Topper
275d7175ac [ARM] Use Register in FastISel. NFC 2025-03-08 21:58:35 -08:00
Timm Baeder
227f9544a4
[clang][bytecode][NFC] Bail out on non constant evaluated builtins (#130431)
If the ASTContext says so, don't bother trying to constant evaluate the
given builtin.
2025-03-09 06:35:19 +01:00
Ishaan Verma
735afc8ceb
[libc] Added type-generic macros for fixed-point functions (#129371)
Adds macros `absfx`, `countlsfx` and `roundfx` .
ref:  #129111
2025-03-09 00:11:34 -05:00
Thurston Dang
667bbd2ecc
[msan] Apply handleVectorReduceIntrinsic to max/min vector instructions (#129819)
Changes the handling of:
- llvm.aarch64.neon.smaxv
- llvm.aarch64.neon.sminv
- llvm.aarch64.neon.umaxv
- llvm.aarch64.neon.uminv
- llvm.vector.reduce.smax
- llvm.vector.reduce.smin
- llvm.vector.reduce.umax
- llvm.vector.reduce.umin
- llvm.vector.reduce.fmax
- llvm.vector.reduce.fmin
from the default strict handling (visitInstruction) to
handleVectorReduceIntrinsic.

Also adds a parameter to handleVectorReduceIntrinsic to specify whether
the return type must match the elements of the vector.

Updates the tests from https://github.com/llvm/llvm-project/pull/129741,
https://github.com/llvm/llvm-project/pull/129810,
https://github.com/llvm/llvm-project/pull/129768
2025-03-08 19:31:48 -08:00
A. Jiang
9e87caff98
[libc++][NFC] Comment cleanup for <type_traits> (#130422)
- Aligns all version comments to line 65.
- Consistently uses `// since C++` instead of `// C++`, in lowercase as
used in most version comments.
- Consistently uses `class` to introduce type template parameters.
- Consistently uses `inline constexpr` for variable templates.
- Corrects the comment for `bool_constant` to `// since C++17` as it's a
C++17 feature.
- Changes the class-key of `result_of` to `struct`, which follows N4659
[depr.meta.types] and the actual usage in libc++.
- Adds missed `// since C++17` for `is_(nothrow_)invocable(_r)`.
- Moves the comments for `is_nothrow_convertible_v` to the part for
variable templates.
- Removes duplicated comments for `true_type` and `false_type`.
2025-03-09 11:17:24 +08:00
Vitaly Buka
58ace30ebc
[NFC][YAML] Replace iterators with simple getter (#130449)
To simplify #130382.
2025-03-08 19:16:23 -08:00
Thurston Dang
3a0c33afd1
[msan] Handle Arm NEON pairwise min/max instructions (#129824)
Change the handling of:
- llvm.aarch64.neon.fmaxp
- llvm.aarch64.neon.fminp
- llvm.aarch64.neon.fmaxnmp
- llvm.aarch64.neon.fminnmp
- llvm.aarch64.neon.smaxp
- llvm.aarch64.neon.sminp
- llvm.aarch64.neon.umaxp
- llvm.aarch64.neon.uminp
from the incorrect heuristic handler (maybeHandleSimpleNomemIntrinsic)
to handlePairwiseShadowOrIntrinsic.

Updates the tests from https://github.com/llvm/llvm-project/pull/129760

Adds a note that maybeHandleSimpleNomemIntrinsic may incorrectly match
horizontal/pairwise intrinsics.
2025-03-08 19:08:08 -08:00
Vitaly Buka
0715c6cc6d
[NFC][IR] De-duplicate CFI related code (#130450) 2025-03-08 18:02:30 -08:00
Craig Topper
1649ca5af0 [AArch64] Use Register in AArch64FastISel.cpp. NFC 2025-03-08 17:24:51 -08:00
Khalil Estell
85d60a441a
[clangd] Add BuiltinHeaders config option (#129459)
This option, under `CompileFlags`, governs whether clangd uses its own
built-in headers (`Clangd` option value) or the built-in headers of the driver
in the file's compile command (`QueryDriver` option value, applicable to
cases where `--query-driver` is used to instruct clangd to ask the driver
for its system include paths).

The default value is `Clangd`, preserving clangd's current defaut behaviour.

Fixes clangd/clangd#2074
2025-03-08 19:16:37 -05:00
LLVM GN Syncbot
a892a5dc5e [gn build] Port 1d763f383380 2025-03-09 00:08:36 +00:00
Vitaly Buka
3a0d0c6b1e
[NFC][YAML] Switch std::sort to llvm::sort (#130448)
Follow up to #130379.
2025-03-08 16:08:08 -08:00
Douglas Yung
1d763f3833 Revert "Modify the localCache API to require an explicit commit on CachedFile… (#115331)"
This reverts commit ce9e1d3c15ed6290f1cb07b482939976fa8115cd.

The unittest added in this commit seems to be flaky causing random failure on buildbots:
 - https://lab.llvm.org/buildbot/#/builders/46/builds/13235
 - https://lab.llvm.org/buildbot/#/builders/46/builds/13232
 - https://lab.llvm.org/buildbot/#/builders/46/builds/13228
 - https://lab.llvm.org/buildbot/#/builders/46/builds/13224
 - https://lab.llvm.org/buildbot/#/builders/46/builds/13220
 - https://lab.llvm.org/buildbot/#/builders/46/builds/13210
 - https://lab.llvm.org/buildbot/#/builders/46/builds/13208
 - https://lab.llvm.org/buildbot/#/builders/46/builds/13207
 - https://lab.llvm.org/buildbot/#/builders/46/builds/13202
 - https://lab.llvm.org/buildbot/#/builders/46/builds/13196
and
 - https://lab.llvm.org/buildbot/#/builders/180/builds/14266
 - https://lab.llvm.org/buildbot/#/builders/180/builds/14254
 - https://lab.llvm.org/buildbot/#/builders/180/builds/14250
 - https://lab.llvm.org/buildbot/#/builders/180/builds/14245
 - https://lab.llvm.org/buildbot/#/builders/180/builds/14244
 - https://lab.llvm.org/buildbot/#/builders/180/builds/14226
2025-03-08 23:54:57 +00:00
Douglas Yung
0d209c6d90 Revert "[clangd] fix warning by adding missing parens"
This reverts commit df79000896101acc9b8d7435e59f767b36c00ac8.

Reverting follow-up commit to ce9e1d3c15ed6290f1cb07b482939976fa8115cd since the original commit test is flaky.
2025-03-08 23:54:18 +00:00
Douglas Yung
49e585f4c4 Revert "[gold] Fix compilation (#130334)"
This reverts commit b0baa1d8bd68a2ce2f7c5f2b62333e410e9122a1.

Reverting follow-up commit to ce9e1d3c15ed6290f1cb07b482939976fa8115cd since the original commit test is flaky.
2025-03-08 23:53:38 +00:00
Krzysztof Drewniak
1b2c23acbb
Re-land "[mlir][ODS] Add a generated builder that takes the Properties struct" (#130117) (#130373)
This reverts commit 32f543760c7f44c4c7d18bc00a3a1d8860c42bff.

Investigations showed that the unit test utilities were calling erase(),
causing a use-after-free. Fixed by rearranging checks in the test
2025-03-08 17:33:14 -06:00
Hristo Hristov
262a775582
[libc++][NFC] Fixed bad link in 21.rst (#130428) 2025-03-09 00:52:51 +02:00
Vitaly Buka
4d5955215e
[NFC][YAML][IR] Output CfiFunction sorted (#130379)
As-is it's NFC, as internally `CfiFunction*` are std::set<>.

We are changing internals of `CfiFunctionDefs` and
`CfiFunctionDecls` so they will be ordered by GUID.

Sorting by name is unnecessary but good for
readability and tests.
2025-03-08 12:19:28 -08:00
Liberty
c4ed0ad1f5
[Clang] Fix typo 'dereferencable' to 'dereferenceable' (#116761)
This patch corrects the typo 'dereferencable' to 'dereferenceable' in
CGCall.cpp.
The typo is located within a comment inside the `void
CodeGenModule::ConstructAttributeList` function.
2025-03-08 19:35:20 +00:00
Simon Pilgrim
379405afc0 [X86] Fix typo in X86ISD::SHUFP concatenation 2025-03-08 19:32:48 +00:00
LLVM GN Syncbot
c182e9db1e [gn build] Port 2fb1f0322403 2025-03-08 18:56:13 +00:00
Jade
90b1e5bc8a
[llvm][NFC]Fix a few typos (#110844) 2025-03-08 18:55:49 +00:00
Peter Jung
3ac24236aa
[llvm-profdata] Fix typo in llvm-profdata (#114675)
Signed-off-by: Peter Jung <admin@ptr1337.dev>
2025-03-08 18:52:24 +00:00
vporpo
2fb1f03224
[SandboxVec] Add region-from-bbs helper pass (#130153)
RegionFromBBs is a helper Sandbox IR function pass that builds a region
for each BB. This helps test region passes in isolation without relying
on other parts of the vectorizer, which is especially useful for
stress-testing.
2025-03-08 10:47:19 -08:00
Simon Pilgrim
6f77f534d0
[X86] combineConcatVectorOps - convert (V)SHUFPS concatenation to use combineConcatVectorOps recursion (#130426)
Only concatenate X86ISD::SHUFP nodes if at least one operand is
beneficial to concatenate - helps prevent lot of unnecessary AVX1
concatenations
2025-03-08 18:39:29 +00:00
Timm Baeder
aff6ab9d90
[clang][bytecode] Surround bcp condition with Start/EndSpeculation (#130427)
This is similar to what the current interpreter is doing - the
FoldConstant RAII object surrounds the entire HandleConditionalOperator
call, which means the condition and both TrueExpr or FalseExpr.
2025-03-08 19:37:20 +01:00
Craig Topper
bac490b0bc [TableGen] Use Register in FastISel output. NFC 2025-03-08 10:15:39 -08:00
Mikhail R. Gadelha
ed93e6b0e6 [RISCV] Added test for dag spill fix 2025-03-08 14:55:20 -03:00
Timm Baeder
e4fe22a8bd
[clang][bytecode][NFC] Check conditional op condition for ConstantExprs (#130425)
Same thing we now do in if statements. Check the condition of a
conditional operator for a statically known true/false value.
2025-03-08 18:29:19 +01:00
LLVM GN Syncbot
a22a646eaa [gn build] Port a1b14dbc4740 2025-03-08 17:11:25 +00:00
Jonas Devlieghere
a1b14dbc47
[lldb] Remove progress report coalescing (#130329)
Remove support for coalescing progress reports in LLDB. This
functionality was motivated by Xcode, which wanted to listen for less
frequent, aggregated progress events at the cost of losing some detail.
See the original RFC [1] for more details. Since then, they've
reevaluated this trade-off and opted to listen for the regular, full
fidelity progress events and do any post processing on their end.

rdar://146425487
2025-03-08 09:10:46 -08:00
Simon Pilgrim
b15e7f3c23
[X86] combineINSERT_SUBVECTOR - attempt to recursively shuffle combine if both base/sub-vectors are already shuffles (#130304) 2025-03-08 17:10:39 +00:00
Prakhar Dixit
037756242f
[mlir]Add a check to ensure bailing out when reducing to a scalar (#129694)
Fixes issue #64075
Referencing this comment for more detailed view ->
https://github.com/llvm/llvm-project/issues/64075#issuecomment-2694112594

**Minimal example crashing :** 
```
func.func @multi_reduction(%0: vector<4x2xf32>, %acc1: f32) -> f32 {
  %2 = vector.multi_reduction <add>, %0, %acc1 [0, 1] : vector<4x2xf32> to f32
  return %2 : f32
}
```
2025-03-08 16:34:01 +00:00
Timm Baeder
46d218d1af
[clang][bytecode] Implement __builtin_{memchr,strchr,char_memchr} (#130420)
llvm has recently started to use `__builitn_memchr` at compile time, so
implement this. Still needs some work but the basics are done.
2025-03-08 16:52:06 +01:00
Uday Bondhugula
b01c71bbd4
[MLIR][Affine] Fix crash in loop unswitching/hoistAffineIfOp (#130401)
Fix obvious crash as a result of missing affine.parallel handling. Also,
fix bug exposed in a helper method used by hoistAffineIfOp.

Fixes: https://github.com/llvm/llvm-project/issues/62323
2025-03-08 20:23:56 +05:30
Shilei Tian
a779af3f88
[AMDGPU] Change SGPR layout to striped caller/callee saved (#127353)
This PR updates the SGPR layout to a striped caller/callee-saved design,
similar
to the VGPR layout.

To ensure that s30-s31 (return address), s32 (stack pointer), s33 (frame
pointer), and s34 (base pointer) remain callee-saved, the striped layout
starts
from s40, with a stripe width of 8. The last stripe is 10 wide instead
of 8 to
avoid ending with a 2-wide stripe.

Fixes #113782.
2025-03-08 09:28:20 -05:00
LLVM GN Syncbot
e86c5a7b9d [gn build] Port 6d9dfd75e4df 2025-03-08 14:21:29 +00:00
Hristo Hristov
6d9dfd75e4
[libc++][type_traits] Implements "A type trait to detect reference binding to temporary" (#128649)
Implements partially: [P2255R2: A type trait to detect reference binding
to temporary](https://wg21.link/P2255R2)
Issue: https://github.com/llvm/llvm-project/issues/105180

https://eel.is/c++draft/meta.type.synop
https://eel.is/c++draft/meta.unary.prop

Implented type traits:
- [x] `reference_constructs_from_temporary`
- [x] `reference_converts_from_temporary`

Closes #129049

Minor drive-by tweak to `std::is_implicit_lifetime` tests.

---------

Co-authored-by: Hristo Hristov <zingam@outlook.com>
2025-03-08 15:20:56 +01:00
Timm Baeder
3b8f9a228c
[clang][bytecode] Loosen assertion This() for array elements (#130399)
getRecord() returns null on array elements, even for composite arrays.
The assertion here was overly restrictive and having an array element as
instance pointer should be fine otherwise.
2025-03-08 13:13:52 +01:00