519947 Commits

Author SHA1 Message Date
David Spickett
085e7d2b22
[bolt] Move CODE_OWNERS.txt to Maintainers.txt (#118082)
To align with: https://llvm.org/docs/DeveloperPolicy.html#maintainers

I have not changed the format of the file, my only goal here is that the
project have a `bolt/Maintainers.*` so it is easy to find.
2024-12-02 09:12:57 +00:00
Jay Foad
9cbbf15db9
[AMDGPU] Only insert intrinsic declarations when needed (#117998) 2024-12-02 09:08:33 +00:00
Balázs Kéri
7be501c1d3
[clang][ASTImporter] Allow import of similar friend template with different depth (#115734)
This fix applies to a case that occurs when the AST contains a friend
template that is contained within another template and this (outer)
template has specialization. (See the added test code in the commit.)
2024-12-02 10:08:14 +01:00
Pedro Lobo
98e747ba56
[clang] Use poison instead of undef as the placeholder when creating a new vector [NFC] (#117064)
Call `@llvm.vector.insert` with a `poison` vector when coercing a fixed
vector to a scalable vector with the same element type.
2024-12-02 09:00:39 +00:00
Nikita Popov
4851dbb8d6 [Hexagon] Use getSignedConstant for RoundTo8 XForm
To handle negative offset addrmodes correctly.

Fixes https://github.com/llvm/llvm-project/pull/117558#issuecomment-2510208764.
2024-12-02 09:57:51 +01:00
antangelo
54fcf3ec26
[clang] Implement P3176R1: The Oxford variadic comma (#117524)
Emit a deprecation warning when a variadic parameter in a
parameter-declaration-clause is not preceded by a comma for C++26.
2024-12-02 03:53:55 -05:00
Nikita Popov
8201926ec0
[InstSimplify] Generalize simplification of icmps with monotonic operands (#69471)
InstSimplify currently folds patterns like `(x | y) uge x` and `(x & y)
ule x` to true. However, it cannot handle combinations of such
situations, such as `(x | y) uge (x & z)` etc.

To support this, recursively collect operands of monotonic instructions
(that preserve either a greater-or-equal or less-or-equal relationship)
and then check whether any of them match.

Fixes https://github.com/llvm/llvm-project/issues/69333.
2024-12-02 09:53:10 +01:00
jeanPerier
a545cf5c6d
[flang][hlfir] add hlfir.eval_in_mem operation (#118067)
See HLFIROps.td change for the description of the operation.

The goal is to ease temporary storage elision for expression evaluation
(typically evaluating the RHS directly inside the LHS) for expressions
that do not have abtsractions in HLFIR and for which it is not clear
adding one would bring much. The case that is implemented in [the
following lowering
patch](https://github.com/llvm/llvm-project/pull/118070) is the array
call case, where adding a new hlfir.call would add complexity (needs to
deal with dispatch, inlining ....).
2024-12-02 09:52:29 +01:00
Haojian Wu
770adc5609
[clang] Infer lifetime_capture_by for map's subscript operator. (#118078) 2024-12-02 09:49:33 +01:00
Nikita Popov
7bbc049688
[InstCombine] Consolidate another fold into select value equivalence (#117746)
We had a separate fold that handled just the trivial case where we're
replacing exactly the argument of the select. Handle this in select
value equivalence by relaxing the infinite loop protection to allow a
replacement of a non-constant with a constant.

This also fixes https://github.com/llvm/llvm-project/issues/113301, as
the separate fold did not handle undef values correctly.
2024-12-02 09:45:39 +01:00
Veera
979a0356d4
[InstCombine] Fold X Pred C2 ? X BOp C1 : C2 BOp C1 to min/max(X, C2) BOp C1 (#116888)
Fixes #82414.

General Proof: https://alive2.llvm.org/ce/z/ERjNs4 
Proof for Tests: https://alive2.llvm.org/ce/z/K-934G

This PR transforms `select` instructions of the form `select (Cmp X C1)
(BOp X C2) C3` to `BOp (min/max X C1) C2` iff `C3 == BOp C1 C2`.

This helps in eliminating a noop loop in
https://github.com/rust-lang/rust/issues/123845 but does not improve
optimizations.
2024-12-02 09:33:45 +01:00
Shankhin
eaa6cc547e
Fixes #118231: Corrected spelling mistake in has_acitive_owner function (#118266)
Fixes #118231 
- Updated the method name to `has_active_owner` in
`llvm-project/libc/src/__support/threads/linux/rwlock.h`
- Verified usage and updated all references to the method.
- Ran tests:
    - `check-llvm-unit`
    - `check-all`
2024-12-02 16:10:25 +08:00
Lang Hames
08c1a6b3e1 Revert "[ORC] Track all dependencies on symbols that aren't Ready yet."
This reverts commit 427fb5cc5ac34414c4682c90d3db0c63c5a1b227 while I investigate
the bot failure in https://lab.llvm.org/buildbot/#/builders/95/builds/6835.
2024-12-02 18:37:48 +11:00
Timm Baeder
dd0d9561b8
[clang][bytecode] Support vector-to-vector bitcasts (#118230) 2024-12-02 08:20:41 +01:00
Fangrui Song
d9d656edd4 [ELF] resolve LazySymbol: remove a branch in the fast path 2024-12-01 23:07:38 -08:00
Adam Yang
0a44b24d66
[DXIL] Add GroupMemoryBarrierWithGroupSync intrinsic (#114349)
fixes #112974
partially fixes #70103

An earlier version of this change was reverted so some issues could be fixed.

### Changes
- Added new tablegen based way of lowering dx intrinsics to DXIL ops.
- Added int_dx_group_memory_barrier_with_group_sync intrinsic in
IntrinsicsDirectX.td
- Added expansion for int_dx_group_memory_barrier_with_group_sync in
DXILIntrinsicExpansion.cpp`
- Added DXIL backend test case

### Related PRs
* [[clang][HLSL] Add GroupMemoryBarrierWithGroupSync intrinsic
#111883](https://github.com/llvm/llvm-project/pull/111883)
* [[SPIRV] Add GroupMemoryBarrierWithGroupSync intrinsic
#111888](https://github.com/llvm/llvm-project/pull/111888)
2024-12-01 22:31:40 -08:00
Lang Hames
91f69b70e0 [ORC] Remove redundant check from ObjectLinkingLayer.
Non-locally scoped symbols must have names.
2024-12-02 17:27:12 +11:00
Congcong Cai
010317e173
[clang-tidy][use-internal-linkage]fix false positives for ExportDecl (#117901)
Fixed: #97190
2024-12-02 13:59:55 +08:00
Daniil Kovalev
a9ad9e27ca
[PAC][llvm-readobj][AArch64] Move PAuth GOT relocs out of private space (#118214)
Apply change from the spec
https://github.com/ARM-software/abi-aa/pull/300
2024-12-02 08:53:49 +03:00
Richard Trieu
c4a1e0efe6 [clang] Remove redundant integer values in template type diffing
Look through SubstNonTypeTemplateParmExpr to find an IntegerLiteral
node when attempting to determine if extra info is printed via
the aka mechanism.  This will avoid printing types such as
"array<5 aka 5>" and will only show "array<5>".
2024-12-01 19:21:42 -08:00
Shilei Tian
8cb44859cc FIX: Fix test failure in offload/test/mapping/power_of_two_alignment.c
A C file with `template` in it. Awesome.
2024-12-01 21:40:46 -05:00
Shilei Tian
ed7a8f1556
[NFC][Offload] Correct the compile command of two C test files (#118243)
The compile command for the two C test files are `compilexx`, which is
actually
for C++ compilation.
2024-12-01 21:34:26 -05:00
Lang Hames
427fb5cc5a [ORC] Track all dependencies on symbols that aren't Ready yet.
AsynchronousSymbolQuery tracks the symbols that it depends on in order to (1)
detach the query in the event of a failure, and (2) report those dependencies
to clients of the ExecutionSession::lookup method (via the RegisterDependencies
argument). Previously we tracked only dependencies on symbols that didn't meet
the required state (the only symbols that the query needs to be attached to),
but this is insufficient to report all necessary dependencies to lookup clients.
E.g. A lookup requiring SymbolState::Resolved where some matched symbol is
already Resolved but not yet Emitted or Ready would result in the dependency on
that symbol not being reported, which could result in illegal access in
concurrent JIT setups. (This bug was discovered by @mikaoP on discord with a
simple concurrent JIT setup).

This patch tracks and reports all dependencies on symbols that aren't Ready yet,
correcting the under-reporting issue. AsynchronousSymbolQuery::detach is updated
to stop asserting that all depended-upon symbols have a query attached.
2024-12-02 13:17:19 +11:00
Longsheng Mou
a4c3683b66
[mlir][NFC] Fix typo. (#118163)
Fixes https://github.com/llvm/llvm-project/issues/117222.
2024-12-02 09:20:36 +08:00
Abdul Raheem
92a4b44326
[MLIR][NFC] Fixed a typo of member variable static_basis (#117678)
-- Fixed a typo of member variable static_basis of
AffineDelinearizeIndexOp operation in AffineOps.td

Signed-off: Abdul Raheem Beigh <abdulraheembeigh@gmail.com>
2024-12-02 09:19:47 +08:00
Fangrui Song
574f64ca61 [TimeProfiler] Remove unneeded check 2024-12-01 15:12:57 -08:00
antangelo
73f087b331
[NFC][SelectionDAG] Replace generic @llvm.expect.with.probability codegen test with X86 test (#117848)
Adds test case for X86 to check that the output of
@llvm.expect.with.probability's generic lowering is reasonable. This
replaces a generic test which only asserts that llc does not crash.
2024-12-01 17:46:08 -05:00
Fangrui Song
a09df64f40 [ELF] postParse: remove some branches in the fast path 2024-12-01 14:18:10 -08:00
Fangrui Song
603d41ab7b [ELF] decompress: remove mutex
decompress() is in the parallel code path splitIntoPieces
and we should avoid mutex.
2024-12-01 14:02:44 -08:00
Martin Storsjö
2a5e1da57a
Revert "[ARM] Stop gluing ALU nodes to branches / selects" (#118232)
Reverts llvm/llvm-project#116970.

This change broke Wine compiled for armv7, causing segfaults when
starting Wine. See llvm/llvm-project#116970 for more detailed discussion
about the issue.
2024-12-02 00:02:25 +02:00
Fangrui Song
9becc4a3c9 [ELF] ObjFile::parse: check EM_AARCH64 for SHT_AARCH64_MEMTAG_GLOBAL_STATIC
and reorder sh_type checks to make SHT_PROGBITS/SHT_GROUP fast.
2024-12-01 12:03:35 -08:00
Florian Hahn
77767986ed
[LV] Use IsaPred in a few more places (NFC).
Simplifies the code slightly by removing explicit lambdas.
2024-12-01 18:47:53 +00:00
Timm Baeder
31bde711c4
[clang][bytecode] Support __builtin_reduce_add (#117672) 2024-12-01 17:39:11 +01:00
Timm Baeder
82ed9c0319
[clang][bytecode][NFC] Remove APValue Result argument where unnecessary (#118199)
This is unneeded in almost all circumstances. We only return an APValue
back to clang when the evaluation is finished, and that is always done
by an EvalEmitter - which has its own implementation of the Ret
instructions.
2024-12-01 17:36:19 +01:00
Chris Apple
4a074330c6
[rtsan] Intercept various file system functions (#118183)
Adds interceptors for
* chmod
* fchmod
* mkdir
* rmdir
* umask
2024-12-01 07:40:04 -08:00
Yingwei Zheng
1a3eace82a
[InstCombine] Fold umax(X, C) + -C into usub.sat(X, C) (#118195)
Alive2: https://alive2.llvm.org/ce/z/oSWe5S
Closes https://github.com/llvm/llvm-project/issues/118155
2024-12-01 23:29:40 +08:00
Haohai Wen
22417ec6cc
[Driver] Do not add gno-column-info when using sampling PGO (#117954)
Column info is important for sampling PGO to generate/load profile file.
On windows, it will be automatically added when using -gdwarf to
generate
profile file. It should also be generated when fprofile-sample-use= is
used.
2024-12-01 20:54:38 +08:00
Yingwei Zheng
f7ef0721d6
[SCEV] Do not allow refinement in the rewriting of BEValue (#117152)
See the following case:
```
; bin/opt -passes="print<scalar-evolution>" test.ll --disable-output
define i32 @widget() {
b:
  br label %b1

b1:                                              ; preds = %b5, %b
  %phi = phi i32 [ 0, %b ], [ %udiv6, %b5 ]
  %phi2 = phi i32 [ 1, %b ], [ %add, %b5 ]
  %icmp = icmp eq i32 %phi, 0
  br i1 %icmp, label %b3, label %b8

b3:                                              ; preds = %b1
  %udiv = udiv i32 10, %phi2
  %urem = urem i32 %udiv, 10
  %icmp4 = icmp eq i32 %urem, 0
  br i1 %icmp4, label %b7, label %b5

b5:                                              ; preds = %b3
  %udiv6 = udiv i32 %phi2, 0
  %add = add i32 %phi2, 1
  br label %b1

b7:                                              ; preds = %b3
  ret i32 5

b8:                                              ; preds = %b1
  ret i32 7
}
```
```
%phi2 = phi i32 [ 1, %b ], [ %add, %b5 ] -->  {1,+,1}<nuw><nsw><%b1>
%udiv6 = udiv i32 %phi2, 0 --> ({1,+,1}<nuw><nsw><%b1> /u 0)
%phi = phi i32 [ 0, %b ], [ %udiv6, %b5 ] --> ({0,+,1}<nuw><nsw><%b1> /u 0)
```
`ScalarEvolution::createAddRecFromPHI` gives a wrong SCEV result for
`%phi`:

d7d6fb1804/llvm/lib/Analysis/ScalarEvolution.cpp (L5926-L5950)
It converts `phi(0, ({1,+,1}<nuw><nsw><%b1> /u 0))` into `phi(0 / 0,
({1,+,1}<nuw><nsw><%b1> /u 0))`. Then it simplifies the expr into
`{0,+,1}<nuw><nsw><%b1> /u 0`.

As we did in
acd700a24b,
this patch disallows udiv simplification if we cannot prove that the
denominator is a well-defined non-zero value.

Fixes https://github.com/llvm/llvm-project/issues/117133.
2024-12-01 20:11:09 +08:00
Simon Pilgrim
94df95de6b
[TTI][X86] getShuffleCosts - for SK_PermuteTwoSrc, if the masks are known to be "inlane" no need to scale the costs by worst-case legalization (#117999)
SK_PermuteTwoSrc legalization has to assume any of the legalised source registers could be referenced in split shuffles, but if we already know that each 128-bit lane only references elements from the same lane of the source operands, then this scaling won't occur.

Hopefully this can help with #113356 without us having to get full processShuffleMasks canonicalization finished first.
2024-12-01 12:01:47 +00:00
Sudharsan Veeravalli
6881c6d2a6
[RISCV] Add Qualcomm uC Xqcia (Arithmetic) extension (#118113)
This extension adds 11 instructions that perform integer arithmetic.

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

This patch adds assembler only support.
2024-12-01 17:06:22 +05:30
Kai Sasaki
017c75bfac
[mlir] Fix typo in test vector transform pass descriptions (#118194)
Fix some typos in the description of vector transform passes.
2024-12-01 15:48:02 +09:00
Yingwei Zheng
6568ceb9fa
[CodeGenPrepare] Drop nsw flags in optimizeLoadExt (#118180)
Alive2: https://alive2.llvm.org/ce/z/pMcD7q
Closes https://github.com/llvm/llvm-project/issues/118172.
2024-12-01 11:25:31 +08:00
Jonas Devlieghere
1c7e4074b1
[lldb] Fix warning: 'sprintf' is deprecated in RNBSocketTest
Fixes warning: 'sprintf' is deprecated: This function is provided for
compatibility reasons only.  Due to security concerns inherent in the
design of sprintf(3), it is highly recommended that you use snprintf(3)
instead.
2024-11-30 17:40:00 -08:00
Matt Arsenault
92ba7e3973
AMDGPU/GlobalISel: Do not try to form v_bitop3_b32 for SGPR results (#117940) 2024-11-30 20:21:20 -05:00
Florian Hahn
9a0f25158c
[SelectOpt] Support ADD and SUB with zext operands. (#115489)
Extend the support for implicit selects in the form of OR with a ZExt
operand to support ADD and SUB binops as well. They similarly can form
implicit selects which can be profitable to convert back the branches.

PR: https://github.com/llvm/llvm-project/pull/115489
2024-11-30 21:05:41 +00:00
Jinsong Ji
2e30df740e
[TableGen] Fix validateOperandClass for non Phyical Reg (#118146)
https://github.com/llvm/llvm-project/commit/b71704436e61
Rewrote the register operands handling,
but the Table only contains physical regs, we will SEGV when there are
non physical regs.

---------

Co-authored-by: Sergei Barannikov <barannikov88@gmail.com>
2024-11-30 12:07:15 -05:00
Joseph Huber
4148aa63e2 [Reland][Runtimes] Merge 'compile_commands.json' files from runtimes build (#116303)
Summary:
When building a project in a runtime mode, the compilation database is a
separate CMake invocation. So its `compile_commands.json` file will be
placed elsewhere in the `runtimes/runtime-bins` directory. This is
somewhat annoying for ongoing development when a runtimes build is
necessary. This patch adds some CMake magic to merge the two files.

Fixed issue w/ standalone runtimes build by checking if the LLVM src and
CMake src are the same.
2024-11-30 08:50:08 -06:00
Congcong Cai
f89fa238fa
[clang-tidy][use-internal-linkage]fix false positives for global overloaded operator new and operator delete (#117945) 2024-11-30 22:14:36 +08:00
Florian Hahn
1c702d3854
[SCEV] Add tests where one wrap predicate implies another. 2024-11-30 14:12:54 +00:00
NAKAMURA Takumi
39209724e6
[YAML] Fix incorrect dash output in nested sequences (#116488)
Nested sequences could be defined but the YAML output was incorrect.
`Output::newLineCheck()` was not able to emit multiple dashes `- ` and
YAML parser sometimes didn't accept its output as the result.

This fixes for emitting corresponding dashes for consecutive
`inSeqFirstElement`, but suppresses emission to the top
`inSeqFirstElement`.

This also fixes for emitting flow elements onto nested sequences.
2024-11-30 22:10:31 +09:00