526954 Commits

Author SHA1 Message Date
Fraser Cormack
64735ad639
[libclc] Move sign to the CLC builtins library (#115699)
This commit moves the sign builtin's implementation to the CLC library.
It simultaneously optimizes it (for vector types) by removing
control-flow from the implementation.

The __CLC_INTERNAL preprocessor definition has been repurposed (without
the leading underscores) to be passed when building the internal CLC
library. It was only used in one other place to guard an extra maths
preprocessor definition, which we can do unconditionally.
2025-02-11 11:14:49 +00:00
Tai Ly
1a8d2a4016
[mlir][tosa] Use generic QuantizedType in Conv verifiers (#126275)
Replace UniformQuantizedType by the more generic QuantizedType in Conv verifiers.

Change-Id: Ie1961af931864f801914a62976bc988881ee075e

Signed-off-by: Tai Ly <tai.ly@arm.com>
Co-authored-by: Thibaut Goetghebuer-Planchon <thibaut.goetghebuer-planchon@arm.com>
2025-02-11 10:58:16 +00:00
jeanPerier
06f4fe3317
[flang][NFC] fix rewrite-out_of_range.F90 tests (#126699)
There was a typo in the target, and REAL(16) parts needed to be
protected too.
2025-02-11 11:49:32 +01:00
Ben Shi
9fdb063305
[clang][analyzer][NFC] Fix typos in comments (#126676) 2025-02-11 18:40:32 +08:00
David Spickett
19fc8e3846 [GitHub] Correct word in commit access request greeting 2025-02-11 10:28:31 +00:00
Victor Campos
dd369c771e
[compiler-rt] Fix tests of __aeabi_(idivmod|uidivmod|uldivmod) to support big endian (#126277)
This patch makes these functions' tests work in big endian mode:
 - `__aeabi_idivmod`.
 - `__aeabi_uidivmod`.
 -  `__aeabi_uldivmod`.

The three functions return a struct containing two fields, quotient and
remainder, via *value in regs* calling convention. They differ in the
integer type of each field.

In the tests of the first two, a 64-bit integer is used as the return
type of the call. And as consequence of the ABI rules for structs
(Composite Types), the quotient resides in `r0` and the remainder in
`r1` regardless of endianness. So, in order to access each component
from the 64-bit integer in the caller code, care must be taken to access
the correct bits as they do depend on endianness in this case.

In the test of the third one, the caller code has inline assembly to
access the components. This assembly code assumed little endian, so it
had to be made flexible for big endian as well.

`_YUGA_BIG_ENDIAN` is defined in `int_endianness.h`. It's a macro
internal to compiler-rt that's in theory compatible with more toolchains
than gcc and clang.
2025-02-11 09:49:56 +00:00
Adam Siemieniuk
67f59a642f
[mlir][xegpu] Improve scatter attribute definition (#126540)
Refactors XeGPU scatter attribute introducing following:
  - improved docs formatting
  - default initialized parameters
  - invariant checks in attribute verifier
  - removal of additional parsing error
 
The attribute's getters now provide default values simplifying their
usage and scattered tensor descriptor handling.
Related descriptor verifier is updated to avoid check duplication.
2025-02-11 10:05:23 +01:00
Benjamin Maxwell
701223ac20
[IR] Add llvm.sincospi intrinsic (#125873)
This adds the `llvm.sincospi` intrinsic, legalization, and lowering
(mostly reusing the lowering for sincos and frexp).

The `llvm.sincospi` intrinsic takes a floating-point value and returns
both the sine and cosine of the value multiplied by pi. It computes the
result more accurately than the naive approach of doing the
multiplication ahead of time, especially for large input values.

```
declare { float, float }          @llvm.sincospi.f32(float  %Val)
declare { double, double }        @llvm.sincospi.f64(double %Val)
declare { x86_fp80, x86_fp80 }    @llvm.sincospi.f80(x86_fp80  %Val)
declare { fp128, fp128 }          @llvm.sincospi.f128(fp128 %Val)
declare { ppc_fp128, ppc_fp128 }  @llvm.sincospi.ppcf128(ppc_fp128  %Val)
declare { <4 x float>, <4 x float> } @llvm.sincospi.v4f32(<4 x float>  %Val)
```

Currently, the default lowering of this intrinsic relies on the
`sincospi[f|l]` functions being available in the target's runtime (e.g.
libc).
2025-02-11 09:01:30 +00:00
Abhilash Majumder
6a961dc03d
[NVPTX] Add intrinsics for prefetch.* (#125887)
\[NVPTX\] Add Prefetch intrinsics

This PR adds prefetch intrinsics with the relevant eviction priorities.
* Lit tests are added as part of prefetch.ll
* The generated PTX is verified with a 12.3 ptxas executable.
* Added docs for these intrinsics in NVPTXUsage.rst.

For more information, refer PTX ISA
`<https://docs.nvidia.com/cuda/parallel-thread-execution/#data-movement-and-conversion-instructions-prefetch-prefetchu>`_.

---------

Co-authored-by: abmajumder <abmajumder@nvidia.com>
2025-02-11 14:24:46 +05:30
jeanPerier
99e1308c41
[mlir][LLVM] handle argument and result attributes in llvm.call and llvm.invoke (#123177)
Update llvm.call/llvm.invoke pretty printer/parser and the llvm ir import/export
to deal with the argument and result attributes.

This patch is made on top of PR 123176 that modified the
CallOpInterface and added the argument and result attributes to
llvm.call and llvm.invoke without doing anything with them.

RFC: https://discourse.llvm.org/t/mlir-rfc-adding-argument-and-result-attributes-to-llvm-call/84107
2025-02-11 09:39:51 +01:00
Nathan Ridge
d78b5ceb16
[clang][HeuristicResolver] Additional hardening against an infinite loop in simplifyType() (#126690) 2025-02-11 09:17:41 +01:00
Rainer Orth
a0587414cb
[sanitizer_common][test] Remove second SanitizerCommon.ReportFile tem… (#126509)
…p file

The `SanitizerCommon.ReportFile` test leaves a temp file behind on every
run. While this is not a problem for manual builds, on buildbots those
files accumulate over time, interfering with other bots on the same
system.

The files in question are named like
`sanitizer_common.reportfile.tmp.XXXXXX.<pid>`. The issue can be seen in
Solaris `truss` output:
```
22633:	fstatat64(AT_FDCWD, "/tmp/sanitizer_common.reportfile.tmp.rzVEja", 0xFEFFBAD0, AT_SYMLINK_NOFOLLOW) Err#2 ENOENT
22633:	openat64(AT_FDCWD, "/tmp/sanitizer_common.reportfile.tmp.rzVEja", O_RDWR|O_CREAT|O_EXCL, 0600) = 3
22633:	openat64(AT_FDCWD, "/tmp/sanitizer_common.reportfile.tmp.rzVEja.22633", O_WRONLY|O_CREAT|O_TRUNC, 0660) = 4
22633:	unlinkat(AT_FDCWD, "/tmp/sanitizer_common.reportfile.tmp.rzVEja", 0) = 0
```
The first temp file, created by `temp_file_name`, is removed at the end
of the test, the second one, created in `ReportFile::GetReportPath`
using `OpenFile`, is not.

This patch fixes this, simply removing the file.

Tested on `amd64-pc-solaris2.11` and `x86_64-pc-linux-gnu`.
2025-02-11 09:02:05 +01:00
Petr Hosek
7af4ab4f07
[libc] Don't manually override the optimization level for math (#126322)
This was originally done for testing purposes, but after #126315 we now
do testing through GitHub Actions and should be instead using the
optimization setting chosen by the user.
2025-02-10 23:56:47 -08:00
Timm Baeder
dfbd764a55
[clang][bytecode][NFC] Add failing memmove testcase (#126682)
Reduced from
libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char32_t/move.pass.cpp
2025-02-11 08:45:24 +01:00
Piyou Chen
2cd8207b26
[RISCV][compiler-rt] drop __riscv_vendor_feature_bits (#126460)
Address https://github.com/riscv-non-isa/riscv-c-api-doc/pull/101
2025-02-11 15:19:19 +08:00
higher-performance
90192e8872
Fix false positive of [[clang::require_explicit_initialization]] on copy/move constructors (#126553)
Fixes #126490
2025-02-11 07:52:13 +01:00
Longsheng Mou
be354cf381
[mlir][transforms] Process RegionBranchOp with empty region (#123895)
This PR adds process for RegionBranchOp with empty region, such as
'else' region of `scf.if`. Fixes #123246.
2025-02-11 14:43:15 +08:00
YunQiang Su
0d8d354b0c Revert "[Mips] Support llvm.readcyclecounter intrinsic (#114953)"
This reverts commit 9cc7ee16e3bb849fb3c0155a843bfe349a2d2175.
2025-02-11 14:37:17 +08:00
Amir Bishara
1d6b31f770
[mlir]linalg][NFC]-Add lit test for tile and fuse transformation (#126216)
Add coverage for the fuse consumer transform for
`linalg.generic` operation with projected permutation indexing maps.
2025-02-11 08:33:20 +02:00
Chuanqi Xu
569e94f8f1 [C++20] [Modules] Don't diagnose duplicated declarations in different modules which is not in file scope
Close https://github.com/llvm/llvm-project/issues/126373

Although the root problems should be we shouldn't place the friend
declaration to the incorrect module, let's avoid bleeding the edge by
stoping diagnosing declarations not in file scope.
2025-02-11 14:12:32 +08:00
Ben Shi
170b9caf33
[clang][Sema] Emit warnings about incorrect AVR interrupt/signal handlers (#125997)
1. interrupt/signal handlers can not have parameters
2. interrupt/signal handlers must be 'void' type
2025-02-11 14:04:28 +08:00
Sudharsan Veeravalli
27c034a9c6
[Hexagon] Fix typos discovered by codespell (NFC) (#126233)
Found using https://github.com/codespell-project/codespell

```
codespell Hexagon --write-changes \
     --ignore-words-list=CarryIn,CreateOr,ORE,COPYs,ArchVer,predicable,UE,MIs,isNT,Vor,CountR,DUM,GEs,AddD,ToI, \
     CopyIn,TheI,TotalIn,vor,MOne,contigious,Contigious 
```
2025-02-11 11:31:31 +05:30
Miguel A. Arroyo
9d134f26ea
[LLVM][CMake][MSVC] Install PDBs alongside executables (#120683)
* When building on Windows hosts, PDBs aren't installed to the
`CMAKE_INSTALL_PREFIX`.

* This PR addresses it solely for `llvm-*` executables. 
* Similar changes are required in `AddClang.cmake`, `AddLLD.cmake`, etc.
I'd be happy to queue those PRs after this one.
2025-02-10 21:40:51 -08:00
Vikram Hegde
3293bff5d2
[AMDGPU][NewPM] Port "GCNPreRAOptimizations" pass to NPM (#126040) 2025-02-11 11:09:38 +05:30
Helena Kotas
1a0de96c95
[HLSL] Constant buffer layout struct update (#124840)
Updates layout struct to be `struct` with public fields instead of
`class` with private fields and chang the name prefix to `__cblayout_`.
Also adds Packed attribute to prevent struct padding and filters
additional types from the layout that were missed previously (arrays of
resources and groupshared declarations).
2025-02-10 21:19:13 -08:00
Louis Dionne
2d66ab5e8e
[libc++][NFC] Run the container tests through clang-format (#126499)
We've been improving these the tests for vector quite a bit and we are
probably not done improving our container tests. Formatting everything
at once will make subsequent reviews easier.
2025-02-11 06:17:39 +01:00
Phoebe Wang
0c955167c2
[X86] Generate cvtpd2dq for (v2i32 lrint(v2f64)) (#126508)
Found when addressing comment on #126477
2025-02-11 13:14:41 +08:00
Mikołaj Piróg
af522c5dd3
[AVX10.2] Fix wrong mask casting in some convert intrinsics (#126627)
Found during work on #120927. This caused the compiler to silently drop
ignore half of the mask in the specific intrinsics.
2025-02-11 13:13:36 +08:00
Ryosuke Niwa
595195e86e
[WebKit checkers] Treat an implicit value initialization as trivial (#126203)
Implicit value initialization is trivial for our purposes.
2025-02-10 20:40:34 -08:00
Jens Reidel
c9f1d2cbf1
[compiler-rt][Mips] Fix mips SP register definition (#124493)
The mainline Linux kernel defines EF_R29, not EF_REG29 [1]. Further, the
asm/reg.h header requires `_MIPS_SIM_*` to be defined, which reside in
asm/sgidefs.h [2].

[1]:
https://github.com/torvalds/linux/blob/v6.13/arch/mips/include/uapi/asm/reg.h#L151
[2]:
https://github.com/torvalds/linux/blob/v6.13/arch/mips/include/uapi/asm/sgidefs.h#L33-L35

---------

Signed-off-by: Jens Reidel <adrian@travitia.xyz>
2025-02-10 19:28:04 -08:00
Sam Elliott
ea6827cacf
[RISCV] Improve Errors for GPRNoX0 Reg Class (#126397)
More adoption of better diagnostics for RISC-V register classes:
- GPRNoX0 (GPRs excluding `zero`)
2025-02-10 17:21:51 -08:00
Baranov Victor
0b922d66e5
[clang-tidy] Added support for 3-argument std::string ctor in bugprone-string-constructor check (#123413)
This PR add diagnostics for 3-parameter `std::basic_string(const char*
t, size_type pos, size_type count)` constructor in
bugprone-string-constructor check:

```cpp
  std::string r1("test", 1, 0); // constructor creating an empty string
  std::string r2("test", 0, -4); // negative value used as length parameter
  // more examples in test file
  ```

Fixes false-positives reported in https://github.com/llvm/llvm-project/issues/123198.
2025-02-11 09:09:57 +08:00
yingopq
9cc7ee16e3
[Mips] Support llvm.readcyclecounter intrinsic (#114953)
The llvm.readcyclecounter intrinsic can be implemented via the `rdhwr
$3, $hwr_cc` instruction.
$hwr_cc: High-resolution cycle counter. This register provides read
access to the coprocessor 0 Count Register.

Fix #106318.
2025-02-11 08:47:50 +08:00
Shilei Tian
15412d9d83 [FIX] Add REQUIRES: asserts to llvm/test/Transforms/StructurizeCFG/simple-structurizecfg-crash.ll 2025-02-10 19:43:37 -05:00
Oleksandr T.
aeeeeabe58
[Clang] disallow attributes on void parameters (#124920)
Fixes #108819 

--- 

This PR introduces diagnostics to disallow the use of attributes on void
parameters

```cpp
void f([[deprecated]] void) {}
```
2025-02-11 02:42:39 +02:00
Florian Mayer
0c6c4a9993
Revert "[Driver][ROCm][OpenMP] Fix default ockl linking for OpenMP." (#126628)
Reverts llvm/llvm-project#126186

This broke the sanitizer buildbot:
https://lab.llvm.org/buildbot/#/builders/55/builds/6846
2025-02-10 16:35:26 -08:00
Uday Bondhugula
001ba42fe0
[MLIR][Affine] Make affine fusion MDG API const correct (#125994)
Make affine fusion MDG API const correct. NFC changes otherwise.
2025-02-11 05:28:15 +05:30
A. Jiang
998f2422a5
[libc++][test] Fixes for hash<Emplaceable> and value discarding (#126566)
Currently `std::hash<Emplaceable>::operator()` relies implicit
conversion from `int` to `size_t`, which makes MSVC compelling. This PR
switches to use `static_cast`.

In `flat.map/flat.map.access/at_transparent.pass.cpp`, there's one
value-discarding use of `at` that wasn't marked `TEST_IGNORE_NODISCARD`.
This PR adds the missing `TEST_IGNORE_NODISCARD`.
2025-02-11 07:56:53 +08:00
Kazu Hirata
622b8edfc2 [lldb] Fix a warning
This patch fixes:

  lldb/source/Core/Telemetry.cpp:44:20: error: unused function
  'MakeUUID' [-Werror,-Wunused-function]
2025-02-10 15:54:57 -08:00
Slava Zakharin
754d896ca7
[flang] Propagate fast-math flags to FIROpBuilder. (#126316)
One constructor was missing to propagate fast-math flags
from an operation to the builder. It is fixed now.
And the builder creation in one opt-bufferization case should take
the rewriter, I think.
2025-02-10 15:23:34 -08:00
Keith Smiley
1932ed040c
[lldb-dap] Silence Wunused-result warning (#126580) 2025-02-10 15:20:34 -08:00
Jonas Devlieghere
f451d27b38
[lldb] Assert on invalid default {S,U}Int64 (NFC) (#126590)
Both the default value and the min/max value are within LLDB's control,
so an assert is more appropriate than a runtime check.
2025-02-10 15:10:21 -08:00
Jason Molenda
fb623a3524 [lldb] Fix two old UUID method calls in ObjectFileMachO
A section of ObjectFileMachO is ifdef compiled only when
building to run on iOS etc natively, so this old method
call rename wasn't detected by normal on-mac building.
2025-02-10 15:08:03 -08:00
Nico Weber
44fcc5cdac [clang] Disaqble test/Analysis/live-stmts.cpp on aarch64
See https://github.com/llvm/llvm-project/issues/126619 and discussion
on https://github.com/llvm/llvm-project/pull/125840
2025-02-10 18:04:01 -05:00
Rahul Joshi
0f674cce82
[NFC][LLVM] Remove unused TargetIntrinsicInfo class (#126003)
Remove `TargetIntrinsicInfo` class as its practically unused (its pure
virtual with no subclasses) and its references in the code.
2025-02-10 14:56:30 -08:00
Jason Molenda
d90399603c
[lldb] [darwin] Upstream a few DriverKit cases (#126604)
A DriverKit process is a kernel extension that runs in userland, instead
of running in the kernel address space/priv levels, they've been around
a couple of years. From lldb's perspective a DriverKit process is no
different from any other userland level process, but it has a different
Triple so we need to handle those cases in the lldb codebase. Some of
the DriverKit triple handling had been upstreamed to llvm-project, but I
noticed a few cases that had not yet. Cleaning that up.
2025-02-10 14:49:53 -08:00
Jonas Devlieghere
d81b604656
[lldb] Add a test for terminal dimensions (#126598)
Add a test for the `term-width` and `term-height` settings. I thought I
was hitting bug because in my statusline test I was getting the default
values when running under PExpect. It turned out hat the issue is that
we clear the settings at the start of the test. The Editline tests
aren't affected by this because Editline provides its own functions to
get the terminal dimensions and explicitly does not rely on LLDB's
settings (presumably exactly because of this behavior).
2025-02-10 14:46:03 -08:00
Gábor Horváth
3c6d1dd362
Revert "[analyzer] Remove some false negatives in StackAddrEscapeChec… (#126614)
…ker (#125638)"

This reverts commit 7ba3c55d91dcd7da5a5eb1c58225f648fb38b740.

Co-authored-by: Gabor Horvath <gaborh@apple.com>
2025-02-10 22:34:45 +00:00
Joseph Huber
07f2154142 [NVPTX] Remove unused static functions following #126544 2025-02-10 16:23:50 -06:00
Chelsea Cassanova
7c269cf0f6
[lldb][sbapi] Namespace CommandReturnObjectCallbackResult in SBDefines (#126606)
A new callback was added with the type
CommandReturnObjectCallbackResult, this commit namespaces that type to
match the format of other callback functions that have a non-primitive
return type in the lldb namespace.

rdar://144553496
2025-02-10 14:20:31 -08:00