Commit Graph

535484 Commits

Author SHA1 Message Date
Aiden Grossman
e4feb2d5ca [CI] Hash pin CI python deps (#137489)
The CI scripts install some python dependencies primarily for testing
this patch moves these over to a single requirements file that also hash
pins everything using pip-compile to conform to best security and
reproducibility practices.
2025-04-27 08:21:20 -07:00
Aiden Grossman
2c1d4b0404 [Github] Install sccache from apt repo in CI container (#137491)
This patch installs sccache using apt-get in the CI container build
process rather than manually downloading it from github releases. This
makes things quite a bit simpler and means we are not manually handling
things like hash/signature verification. This is only possible now that
we are using ubuntu 24.04 by default.
2025-04-27 08:20:55 -07:00
Fabian Mora
e7313421f1 [mlir][ptr] Switch LogicalResult to bool in MemorySpaceAttrInterrface (#137513)
This patch switches the return type in `MemorySpaceAttrInterface`
methods from `LogicalResult` to `bool`. As `is*` methods are predicates.

Users of the `MemorySpaceAttrInterface` API must note that, if
`emitError` is non-null and the result of a `is*` method is `false`,
then an error was likely emitted. To avoid the emission of an error the
user can pass a default constructed `emitError`.
2025-04-27 11:16:03 -04:00
Ebuka Ezike
ee4b34cf32 [NFC][lldb] Fix unresolved test in buildbot lldb-aarch64-windows (#137516)
object indexing causes key error.

Initial commit #290ba2
2025-04-27 15:32:43 +01:00
Mehdi Amini
4149ec9970 [MLIR] Remove redundant verifier code in arith::ConstantOp
This is already checked by the `AllTypesMatch` traits defined in ODS.
2025-04-27 06:56:14 -07:00
Ebuka Ezike
7670af5a27 [lldb][lldb-dap] Respect x86 disassembly flavor setting (#134722)
Ensure the disassembly respects the "target.x86-disassembly-flavor"
setting for x86 and x86_64 targets.

Depends on #134626

---------

Signed-off-by: Ebuka Ezike <yerimyah1@gmail.com>
Co-authored-by: Jonas Devlieghere <jonas@devlieghere.com>
2025-04-27 12:13:38 +01:00
Pengcheng Wang
9b39c82bfd [RISCV][NFC] Remove attributes in pr107950.ll (#137500)
There exists some stale experimental features and the llc complains
it.

We can simply remove these attributes and add the desired features
in `-mattr`.
2025-04-27 19:12:02 +08:00
Ebuka Ezike
d1adb0b8cd Complete ToJSON for OptionValues (#137375)
Completes the ToJSON function for `OptionValue` types and make the interface function pure virtual

---------

Co-authored-by: Jonas Devlieghere <jonas@devlieghere.com>
2025-04-27 12:11:14 +01:00
YunQiang Su
e9a34e4236 [RISCV] Support vectorizing FMINIMUMNUM and FMAXIMUMNUM (#135727)
RISC-V V extension support vfmax and vfmin, which follow IEEE754-2019.
We can use them directly.
2025-04-27 19:10:02 +08:00
Krishna Pandey
d8e81756b3 [libc][stdfix] Fix riscv entrypoints for idivfx (#137499)
Fixes a typo in riscv entrypoints that caused buildbot failures.

https://lab.llvm.org/buildbot/#/builders/196/builds/7352

Signed-off-by: krishna2803 <kpandey81930@gmail.com>
2025-04-27 06:54:01 -04:00
Michael Buch
d605a0d70e [lldb][test] FrameFormat tests: Specify filename when setting breakpoints
Try to work around following error on some of the Linux CI:
```
            8: (lldb) settings set -f frame-format "custom-frame '${function.basename}'\n"
check:50'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
check:50'1                                          ?                                       possible intended match
            9: (lldb) break set -l 5
check:50'0     ~~~~~~~~~~~~~~~~~~~~~~
           10: error: No selected frame to use to find the default file.
check:50'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           11: error: No file supplied and no default file available.
check:50'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           12: (lldb) exit
check:50'0     ~~~~~~~~~~~~
```
2025-04-27 11:21:01 +01:00
Sergei Barannikov
edb05c405e [VE] Add missing dependency on TargetParser
Resolves a link failure in shared library debug build:
```
ld.lld: error: undefined symbol: llvm::Triple::isArch64Bit() const
>>> referenced by BasicTTIImpl.h:626 (../llvm/include/llvm/CodeGen/BasicTTIImpl.h:626)
>>>               lib/Target/VE/CMakeFiles/LLVMVECodeGen.dir/VETargetMachine.cpp.o:(llvm::BasicTTIImplBase<llvm::VETTIImpl>::shouldBuildRelLookupTables() const)
```
2025-04-27 11:23:57 +03:00
MingYan
e43d64ebe9 [RISCV] Sink vp.splat operands of VP intrinsic. (#133245)
This patch introduces a `vp.splat` matching method for VP support by
sinking the `vp.splat` operand of VP operations back into the same basic
block as the VP operation, facilitating the generation of .vx
instructions to reduce vector register pressure.

---------

Co-authored-by: yanming <ming.yan@terapines.com>
2025-04-27 15:42:49 +08:00
Timm Baeder
031101c66f [clang][bytecode] Diagnose delete of non-heap-allocated blocks (#137475)
With std::allocator::deallocate() calls
2025-04-27 08:57:57 +02:00
Kazu Hirata
2e230f5685 [llvm] Use llvm::interleaved (NFC) (#137496) 2025-04-26 23:28:46 -07:00
Kazu Hirata
60641e0abd [ADT] Use llvm::partition_point (NFC) (#137495) 2025-04-26 23:28:29 -07:00
Kazu Hirata
9c356b233c [Utils] Use llvm::partition (NFC) (#137494) 2025-04-26 23:28:07 -07:00
Kazu Hirata
4f71e1ebfc [AMDGPU] Use llvm::count_if (NFC) (#137492) 2025-04-26 23:27:54 -07:00
Phoebe Wang
a87d8e9442 [X86][AVX512FP16] Decouple AVX512VL and AVX512DQ from AVX512FP16 (#137450)
Fixes: #136209
2025-04-27 14:01:37 +08:00
Aiden Grossman
f11d46c151 [Github] Remove invalid comment from pr-code-format.yaml
The comment was originally added in
b3af755254, but
2898c3e0bb greatly simplified things
making the previous comment invalid. We no longer need to look at
diffing main versus the PR and whether we are doing a two dot or three
dot diff as we are just diffing the merge commit.
2025-04-27 04:12:54 +00:00
Pengcheng Wang
6c33735343 [RISCV] Allow Zicsr/Zifencei to duplicate with g (#136842)
This matches GCC and we supported it in LLVM 17/18.

Fixes #136803
2025-04-27 11:12:47 +08:00
Aiden Grossman
0132451b2c [CI] Fix command not found error in monolithic-linux (#137486)
When editing the premerge.yaml file it seems like I left some extra yaml
in there that ended up in the run section of one of the steps that ended
up throwing the error.
2025-04-26 20:08:40 -07:00
Phoebe Wang
af223bc696 [X86] Avoid zero extend i16 when inserting fp16 (#126194) 2025-04-27 09:51:13 +08:00
Kazu Hirata
4c1dc85e26 [TableGen] Use llvm::interleaved (NFC) (#137483) 2025-04-26 18:18:46 -07:00
Kazu Hirata
654c00aaf3 [IR] Use llvm::interleaved (NFC) (#137482) 2025-04-26 18:18:27 -07:00
Kazu Hirata
8210cdd764 [llvm] Use llvm::replace (NFC) (#137481) 2025-04-26 18:18:09 -07:00
Kazu Hirata
fda8b751bd [llvm] Use llvm::copy_if (NFC) (#137480) 2025-04-26 18:17:56 -07:00
Kazu Hirata
8ba3a232d1 [llvm] Use llvm::copy (NFC) (#137470) 2025-04-26 15:50:38 -07:00
Jon Roelofs
fd3ca29fa0 [lit] Support GoogleTest test discovery through prefixes, too (#137423) 2025-04-26 15:12:38 -07:00
Florian Hahn
826f237cb4 [VPlan] Don't added separate vector latch block (NFC).
Simplify initial VPlan construction by not creating a separate
vector.latch block, which isn't needed and will get folded away later.
This has been suggested as independent clean-up multiple times.
2025-04-26 22:03:18 +01:00
Owen Pan
d403c70ff3 [clang-format] Annotate tok::star in a*b*c as BinaryOperator (#137433)
Fix #137400
2025-04-26 12:55:00 -07:00
Owen Pan
ae07f48913 [clang-format] Correctly handle C# new modifier (#137430)
Fix #75815
2025-04-26 12:54:38 -07:00
Quinton Miller
165acd3734 [LLVM-C] Support debug info for enumerators of arbitrary sizes (#76735)
Since `LLVMDIBuilderCreateEnumerator` only supports up to 64 bits, this
PR adds a new `LLVMDIBuilderCreateEnumeratorOfArbitraryPrecision`
function that takes an arbitrary number of words, based on
`LLVMConstIntOfArbitraryPrecision`. This allows even larger enumeration
types to represent their values exactly. (It seems LLVM should already
support i128 enums since 13.0.0.)
2025-04-26 21:47:09 +02:00
sallto
419a2cb218 [Inliner] Preserve alignment of byval arguments (#137455)
Previously the inliner always produced a memcpy with alignment 1 for src
and destination, leading to potentially suboptimal Codegen.

Since the Src ptr alignment is only available through the CallBase it
has to be passed to HandleByValArgumentInit. Dst Alignment is already
known so it doesn't have to be passed along.

If there is no specified Src Alignment my changes cause the ptr to have
no align data attached instead of align 1 as before (see
inline-tail.ll), I believe this is fine but since I'm a first time
contributor, please confirm.

My changes are already covered by 4 existing regression tests, so I did
not add any additional ones.

The example from #45778 now results in:
```C
opt -S -passes=inline,instcombine,sroa,instcombine test.ll

define dso_local i32 @test(ptr %t) {
entry:
  %.sroa.0.0.copyload = load ptr, ptr %t, align 8       # this used to be align 1 in the original issue
  %arrayidx.i = getelementptr inbounds nuw i8, ptr %.sroa.0.0.copyload, i64 24
  %0 = load i32, ptr %arrayidx.i, align 4
  ret i32 %0
}
```

Fixes #45778.
2025-04-26 21:38:58 +02:00
Aiden Grossman
2f08927fd5 Reland "[CMake] Do not set CMP0116 explicitly to old (#90385)"
This reverts commit fa65a228f4.

This relands commit ab405fb6e9.

There was an issue where CMake versions <3.23.0 would not properly parse
dep files, causing the build to file. This patch fixes that by just
making CMake versions <3.23.0 use the fallback behavior.
2025-04-26 17:59:41 +00:00
Michael Buch
3f5dc586ef [lldb][test] XFAIL TestCxxFrameFormat.test for Windows target
Fails on Windows CI:
```
|            10: (lldb) break set -l 3
| check:30'0     ~~~~~~~~~~~~~~~~~~~~~~
|            11: error: No selected frame to use to find the default file.
| check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|            12: error: No file supplied and no default file available.
| check:30'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|            13: (lldb) exit
```

This passes fine when compiling on Windows for Linux targets.
2025-04-26 18:40:53 +01:00
Reid Kleckner
ccdd55c518 [clang] Fix unused variable warning in MS mangler from constant matrix patch 2025-04-26 09:17:56 -07:00
Losy001
f5a30f111d [Clang][MicrosoftMangle] Implement mangling for ConstantMatrixType (#134930)
This pull request implements mangling for ConstantMatrixType, allowing
matrices to be used on Windows.

Related issues: #53158, #127127

This example code:
```cpp
#include <typeinfo>
#include <stdio.h>

typedef float Matrix4 __attribute__((matrix_type(4, 4)));

int main()
{
  printf("%s\n", typeid(Matrix4).name());
}
```
Outputs this:
```
struct __clang::__matrix<float,4,4>
```
2025-04-26 09:04:12 -07:00
Reid Kleckner
7afbffb5c2 [clang] Split out and disable tests that break relative rpaths (#137411)
These two tests copy the clang binary into the test tree and assume it
will run from a new location. This is incompatible with relative rpath
values, which is what you typically get in a dylib developer build.
Disable these tests if shared libraries are involved. Another way to
make these tests work would be to update the loader search path
environment variables, but it is difficult to do that portably.
2025-04-26 08:29:08 -07:00
Koakuma
41f7a85317 [SPARC] Promote i32 CTTZ when we have VIS3
CTTZ can be implemented in terms of CTLZ, for which there's a native
instruction in VIS3.
Promote i32 CTTZ in that case so that the native instruction gets used.

Reviewers: rorth, brad0, s-barannikov

Reviewed By: s-barannikov

Pull Request: https://github.com/llvm/llvm-project/pull/135894
2025-04-26 22:16:21 +07:00
Rainer Orth
e71c8ea3cc [Driver] Fix _XOPEN_SOURCE definition on Solaris (#137141)
Since commit 613a077b05, `flang` doesn't
build any longer on Solaris/amd64:
```
flang/lib/Evaluate/intrinsics-library.cpp:225:26:
error: address of overloaded function 'acos' does not match required type '__float128 (__float128)'
  225 |       FolderFactory<F, F{std::acos}>::Create("acos"),
      |                          ^~~~~~~~~
```
That patch led to the version of `quadmath.h` deep inside `/usr/gcc/<N>`
to be found, thus `HAS_QUADMATHLIB` is defined. However, the `struct
HostRuntimeLibrary<__float128, LibraryVersion::Libm>` template is
guarded by `_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600`, while
`clang` only predefines `_XOPEN_SOURCE=500`.

This code dates back to commit 0c1941cb05
back in 2012. Currently, this is long obsolete and `gcc` prefefines
`_XOPEN_SOURCE=600` instead since GCC 4.6 back in 2011.

This patch follows that.

Tested on `amd64-pc-solaris2.11` and `sparcv9-sun-solaris2.11`.
2025-04-26 17:06:04 +02:00
Amr Hesham
d59163092d [CIR] Upstream initial support for fixed size VectorType (#136488)
This change adds the initial support for VectorType

Issue #136487
2025-04-26 16:11:43 +02:00
Sergei Barannikov
bb1765179e [TTI] Simplify implementation (NFCI) (#136674)
Replace "concept based polymorphism" with simpler PImpl idiom.

This pursues two goals:
* Enforce static type checking. Previously, target implementations hid
base class methods and type checking was impossible. Now that they
override the methods, the compiler will complain on mismatched
signatures.
* Make the code easier to navigate. Previously, if you asked your
favorite LSP server to show a method (e.g. `getInstructionCost()`), it
would show you methods from `TTI`, `TTI::Concept`, `TTI::Model`,
`TTIImplBase`, and target overrides. Now it is two less :)

There are three commits to hopefully simplify the review.

The first commit removes `TTI::Model`. This is done by deriving
`TargetTransformInfoImplBase` from `TTI::Concept`. This is possible
because they implement the same set of interfaces with identical
signatures.

The first commit makes `TargetTransformImplBase` polymorphic, which
means all derived classes should `override` its methods. This is done in
second commit to make the first one smaller. It appeared infeasible to
extract this into a separate PR because the first commit landed
separately would result in tons of `-Woverloaded-virtual` warnings (and
break `-Werror` builds).

The third commit eliminates `TTI::Concept` by merging it with the only
derived class `TargetTransformImplBase`. This commit could be extracted
into a separate PR, but it touches the same lines in
`TargetTransformInfoImpl.h` (removes `override` added by the second
commit and adds `virtual`), so I thought it may make sense to land these
two commits together.

Pull Request: https://github.com/llvm/llvm-project/pull/136674
2025-04-26 15:25:40 +03:00
Michael Buch
28293ea023 [lldb][test] XFAIL FrameFormat tests on Windows again
These are failing for various reasons on CI, most likely due to us
requiring the Microsoft mangler. So XFAIL these.
2025-04-26 13:23:47 +01:00
Michael Buch
8a5bc9e340 [lldb][test] Un-XFAIL TestCxxFrameFormat.test for now
This was XPASSing on the linux-win remote CI jobs.
Since we're now compiling with DWARF (not PDB), lets see if these pass
on Windows again.
2025-04-26 13:04:23 +01:00
Michael Buch
7581aa1d8e [lldb][test] Make sure we compile FrameFormat tests with DWARF
These don't make sense for PDB on Windows
2025-04-26 11:28:32 +01:00
Abid Qadeer
1b2671f10d Remove a debugging message left in a unit test. (#137451)
This should fix the regression reported in
https://github.com/llvm/llvm-project/pull/136016#issuecomment-2831987288
2025-04-26 11:16:28 +01:00
David Green
76545d7ddf [AArch64] Correctly detect X reg from W reg in isCopyImpl (#137348)
The MachineCopyPropagation pass was incorrectly removing copy (ORRWrs)
instruction that appeared to be a nop. The instruction should not have
been marked as a copy though, the code was incorrectly assuming that
w29 - w0 + x0 == x29, but as x29 is fp it was out of order with the other
registers.

Fixes an issue reported on #129889.
2025-04-26 11:09:13 +01:00
Simon Pilgrim
5d91d12d91 [X86] getFauxShuffleMask - generalise logical shifts to work with non-uniform shift amounts (#137349)
Still doesn't help pre-AVX2 targets which might have lowered SHL to a MUL by that point.
2025-04-26 11:05:30 +01:00
David Green
b9e32749d2 [GlobalISel] Clear nsw flags when converting sub to add. (#137288)
As shown in https://alive2.llvm.org/ce/z/PVwcTL we need to clear the nsw
flags too when converting a sub to a add if the constant is INT_MIN.

Fixes #137254
2025-04-26 11:00:53 +01:00