522405 Commits

Author SHA1 Message Date
Shourya Goel
abd9102344
[libc][complex] add cfloat16 and cfloat128 compiler flags (#121140)
Proper fix for the temporary fix in #114696
2024-12-26 12:50:07 +05:30
Michał Górny
03093b62d4
[Polly] Fix gtest logic for standalone builds (#121114)
Fix the gtest logic to account for llvm_gtest being installed as part of
LLVM, as of 91b3ca39667b6341a8c1983a1467fae14b58318b.
2024-12-26 07:09:18 +00:00
Hervé Poussineau
a72bfc5a1e
[llvm-dlltool] Handle MIPS R4000 architecture (#114621) 2024-12-26 13:56:02 +08:00
Sergei Barannikov
a0e1fcc093
[TableGen][GISel] Refactor node renderers emission (#121071)
Split importExplicitUseRenderer into several smaller functions and
add a bunch of TODOs and FIXMEs.

This is an NFCI change to simplify review of future functional changes.

Pull Request: https://github.com/llvm/llvm-project/pull/121071
2024-12-26 08:40:47 +03:00
Sergei Barannikov
6f72d28dd9
[TableGen][GISel] Don't copy dead def from a sub-instruction to the root (#121094)
Sub-instruction can have a def with the same name as a def in a
top-level instruction.
Previously this could result in both defs copied to the instruction
being built.
2024-12-26 08:36:35 +03:00
DaPorkchop_
cea738bc9a
[SimplifyCFG] Replace unreachable switch lookup table holes with poison (#94990)
As discussed in #94468, this causes switch lookup table entries which
are unreachable to be poison instead of filling them with a value from
one of the reachable cases.

---------

Co-authored-by: DianQK <dianqk@dianqk.net>
2024-12-26 07:47:26 +08:00
Andrei Safronov
d6e435362d
[Xtensa] Fix Code Density test. (#121073)
Fix dissambler test for Code Density feature.
2024-12-26 01:02:53 +03:00
TilakChad
70965ef259
[Clang] Prevent assignment to captured structured bindings inside immutable lambda (#120849)
For structured bindings, a call to getCapturedDeclRefType(...) was
missing. This PR fixes that behavior and adds the related diagnostics
too.

This fixes https://github.com/llvm/llvm-project/issues/95081.
2024-12-25 18:59:33 +01:00
Shourya Goel
ff97daadcd
Revert "[libc][complex] enable CFP128 entrypoints on X86_64 (#121111)" (#121113)
This reverts commit dd9c5c118230fc9adde668f2c96323b73a677400.
2024-12-25 20:56:13 +05:30
Shourya Goel
dd9c5c1182
[libc][complex] enable CFP128 entrypoints on X86_64 (#121111) 2024-12-25 20:45:32 +05:30
Brandon Wu
8e7f1bee84
[clang][RISCV] Remove unneeded RISCV tuple code (#121024)
These code are no longer needed because we've modeled tuple type using
target extension type rather than structure of scalable vectors.
2024-12-25 22:48:54 +08:00
adam-bzowski
6d7cf5206f
[ValueTracking] Improve KnownBits for signed min-max clamping (#120576)
A signed min-max clamp is the sequence of smin and smax intrinsics,
which constrain a signed value into the range: smin <= value <= smax.
The patch improves the calculation of KnownBits for a value subjected to
the signed clamping.
2024-12-25 22:39:56 +08:00
Igor Kirillov
3469996d0d
[SelectOpt] Optimise big select groups in the latch of a non-inner loop to branches (#119728)
Loop latches often have a loop-carried dependency, and if they have
several SelectLike instructions in one select group, it is usually
profitable to convert it to branches rather than keep selects.
2024-12-25 12:58:21 +00:00
Sergei Barannikov
4884b1b08a
[TableGen][GISel] Simplify checks for BasicBlockSDNode (NFC) (#121098) 2024-12-25 13:32:02 +03:00
xilinbai-intel
7226b39926
[X86] Support vectorized llvm.fmaximum/fminimum.vXf16 lowering (#120988)
Support the lowering of vectorized FMINIMUM and FMAXIMUM to vminph and
vmaxph on types v8f16, v16f16 when AVX512FP, AVX512VL features are
present, and on type v32f16 when AVX512FP is present.
2024-12-25 17:54:13 +08:00
Chuanqi Xu
676b48d1cc [C++20] [Modules] Diagnose if import statement lakcs a semicolon
Close https://github.com/llvm/llvm-project/issues/121066

Now we will diagnose that the import statement lacks a semicolon as
expected. Note that the original "not found" diagnose message remains.
I meant to remove that, but the test shows it might be more complex
process (other unexpected diagnose shows up). Given the importance of
the issue, I chose to not dig deeper.
2024-12-25 17:45:28 +08:00
Usman Nadeem
5fb57131b7
[DFAJumpThreading] Don't bail early after encountering unpredictable values (#119774)
After #96127 landed, mshockwave reported that the pass was no longer
threading SPEC2006/perlbench.

After 96127 we started bailing out in `getStateDefMap` and rejecting the
transformation because one of the unpredictable values was coming from
inside the loop. There was no fundamental change in that function except
that we started calling `Loop->contains(IncomingBB)` instead of
`LoopBBs.count(IncomingBB)`. After some analysis I came to the
conclusion that even before 96127 we would reject the transformation if
we provided large enough limits on the path traversal (large enough so
that LoopBBs contained blocks corresponding to that unpredictable
value).

In this patch I changed `getStateDefMap` to not terminate early on
finding an unpredictable value, this is because
`getPathsFromStateDefMap`, later, actually has checks to ensure that the
final list of paths only have predictable values. As a result we can now
partially thread functions like `negative6` in the tests that have some
predictable paths.

This patch does not really have any compile-time impact on the test
suite without `-dfa-early-exit-heuristic=false` (early exit is enabled
by default).

Change-Id: Ie1633b370ed4a0eda8dea52650b40f6f66ef49a3
2024-12-25 01:29:01 -08:00
LLVM GN Syncbot
ae435adabb [gn build] Port 2d6e7c2b359d 2024-12-25 08:56:33 +00:00
Alexey Gerenkov
2d6e7c2b35
[Clang][Xtensa] Add Xtensa target. (#118008)
This PR implements support for generic Xtensa target in CLang.

Co-authored-by: Andrei Safronov <safronov@espressif.com>
2024-12-25 09:56:15 +01:00
Matthias Springer
c870632ef6
[flang] Fix some memory leaks (#121050)
This commit fixes some but not all memory leaks in Flang. There are
still 91 tests that fail with ASAN.

- Use `mlir::OwningOpRef` instead of `std::unique_ptr`. The latter does
not free allocations of nested blocks.
- Pass `ModuleOp` as value instead of reference.
- Add few missing deallocations in test cases and other places.
2024-12-25 09:42:03 +01:00
Sergei Barannikov
c29536b033
[test] Group GlobalISelEmitter tests under a subdirectory (#121093)
Remove extra command line arguments while here.
2024-12-25 11:32:37 +03:00
Ivan Aksamentov
2d3d62d77e
[flang] fix: split ifndef for CHECK and CHECK_MSG (#114707)
Resolves https://github.com/llvm/llvm-project/issues/114703

I think it's the best practice that each macro has it's own `ifndef`
check and this way the build issue is resolved for me.

I also find the names of these macro a bit too generic - an easy recipe
for conflicts. In my case, the error was likely caused by something else
defining `CHECK` but not `CHECK_MSG`, so likely these `CHECK` and
`CHECK_MSG` weren't actually working at all because the result of
`ifndef` is always false.

As a definitive fix, perhaps it makes sense to rename them to something
more specific, e.g. `FLANG_CHECK` and `FLANG_CHECK_MSG`.
2024-12-25 07:47:30 +00:00
Vitaly Buka
74496b03f7 [asan][hwasan] Link RTUbsan_cxx into shared runtime
There is no shared version RTUbsan_cxx.
Fix android after #121006.
2024-12-24 23:37:59 -08:00
Fangrui Song
319b891973 MCAsmInfo: remove unused DwarfSectionSizeRequired 2024-12-24 23:20:33 -08:00
Michał Górny
9e38e87c8c
[mlir] [test] Do not add dependencies on llvm tools in standalone builds (#120911)
Since LLVM tools are installed system-wide, adding dependencies on them
is unnecessary. Furthermore, it is problematic for multilib builds,
where the tools are only built once, for the native ABI, and therefore
are not listed in CMake files for non-native ABIs.
2024-12-25 07:13:07 +00:00
Michał Górny
6b471b30d7
[mlir] [test] Fix unittests in standalone builds (#120910)
Fix the logic used to run unit tests to account for `llvm_gtest` targets
being installed, since 91b3ca39667b6341a8c1983a1467fae14b58318b. This
involves removing a rule that would cause a duplicate `llvm_gtest`
target being created, and updates the method for determining whether
unittests can be run to checking whether the target is present, rather
than the source directory (that is no longer actually necessary).
2024-12-25 07:12:47 +00:00
Michał Górny
e3846c0fec
[mlir] [test] Fix missing SHLIB definition in standalone builds (#120907)
Define the `LLVM_SHLIB_OUTPUT_INTDIR` variable that is used by
`configure_lit_site_cfg` to fill `SHLIBDIR`. This fixes tool tests that
would otherwise be unable to find MLIR's runtime shared libraries (e.g.
`libmlir_runner_utils.so`). The logic is copied verbatim from Clang.
2024-12-25 07:12:23 +00:00
Vitaly Buka
32962f2b77 [ubsan] Try to fix Windows 2024-12-24 23:08:20 -08:00
Fangrui Song
25bb6592c9 MCAsmInfo: replace AIX-specific variables with IsAIX
AIX assembly is very different from the gas syntax. We don't expect
other targets to share these differences. Unify the numerous,
essentially AIX-specific variables.
2024-12-24 22:46:13 -08:00
Pranav Kant
5d81b14900 [clang-tidy][bazel] Fix #120547 2024-12-25 06:14:04 +00:00
Owen Pan
141c544c03
[clang-format] Skip line splices when sorting C++ includes (#120680)
Fixes #109864.
2024-12-24 21:47:53 -08:00
Maksim Levental
6a7687c455
[mlir][python] Support CLANG_CL (#121075) 2024-12-24 23:35:58 -05:00
Vitaly Buka
a1328c077c [ubsan] Fix android build
Broken by #121006.
2024-12-24 20:26:31 -08:00
Vitaly Buka
1de228fa9b
[ubsan] Remove UBSAN_CAN_USE_CXXABI (#121082)
It's should be enough to provide weak implementation.

Fixes solaris and android linking after #121006.
2024-12-24 20:21:40 -08:00
Kai Sasaki
d3846eca20
[mlir] Guard sccp pass from crashing with different source type (#120656)
Vector::BroadCastOp expects the identical element type in folding. It
causes the crash if the different source type is given to the SCCP pass.
We need to guard the pass from crashing if the nonidentical element type
is given, but still compatible. (e.g. index vs integer type)

https://github.com/llvm/llvm-project/issues/120193
2024-12-25 12:19:52 +09:00
Congcong Cai
34f7000734
[clang-tidy]link LLVMTargetParser (#121072)
Fix build issue introduced in #120547
2024-12-25 11:07:05 +08:00
Fangrui Song
56600c11ad MCAsmInfo: replace HLASM-specific variables with IsHLASM
HLASM is very different from the gas syntax. We don't expect other
targets to customize the differences. Unify the numerous variables.
2024-12-24 18:37:46 -08:00
Konstantin Varlamov
ac1d560709
[libc++][hardening] Add a bounds check for valarray and bitset. (#120685)
Add a `valid-element-access` check to `valarray::operator[]` and
`bitset::operator[]`.
2024-12-24 18:22:18 -08:00
LiqinWeng
b5f0ec80d5
[VPlan] Remove redundant printing final in VPlan::execute (#121048)
Multiple prints will cause problems when testing ir-bb
2024-12-25 10:11:02 +08:00
Kinoshita Kotaro
88d04be815
[AArch64][docs] Add release notes for FUJITSU-MONAKA support (#120684)
Adds release notes for the FUJITSU-MONAKA support introduced in PR #118432.
These notes were missing from the original PR.
2024-12-25 10:59:59 +09:00
Hervé Poussineau
970f65a98a
[Clang][MIPS] Create specific targets for MIPS PE/COFF (#121040)
Implement GNU and MSVC variants.
When using them, _WIN32 and _M_MRX000/_MIPS_ macros are correctly
defined.
2024-12-25 09:26:31 +08:00
Joseph Huber
34f8573a51
[OpenMP] Use generic IR for the OpenMP DeviceRTL (#119091)
Summary:
We previously built this for every single architecture to deal with
incompatibility. This patch updates it to use the 'generic' IR that
`libc` and other projects use. Who knows if this will have any
side-effects, probably worth testing more but it passes the tests I
expect to pass on my side.
2024-12-24 18:05:28 -06:00
Vitaly Buka
cd66c9b6a0
[Ubsan][Driver] Remove UBSAN C++ runtime from other sanitizers (#121006)
Linking this runtime requires C++ ABI, which breaks -nostdlib++ builds.
However, UBSAN C++ runtime is only needed for CFI and VPTR checks.

Unblocks #120370.
2024-12-24 13:57:03 -08:00
Aiden Grossman
48a6e51445 [llvm-exegesis] Fix typo in f2334c5919ec077e6a8deeaf43a5b5188baf0251
This should have been in the original commit, but I somehow forgot to
run git add && git commit --amend --no-edit between making the change in
my editor, saving the file, and pushing the commit.
2024-12-24 21:54:30 +00:00
Aiden Grossman
24ff23fb3a [llvm-exegesis][Docs] Add documentation on benchmark-process-cpu option
This patch adds documentation on the benchmark-process-cpu option. I
apparently did not add any documentation when originally implementing
the feature.
2024-12-24 21:54:30 +00:00
Fangrui Song
4b3d439e7e [test] Replace -riscv-no-alises with -M no-aliases
The new option from https://reviews.llvm.org/D103004 is preferred.
2024-12-24 13:53:26 -08:00
Aiden Grossman
f2334c5919 [llvm-exegesis] Make benchmark pinning actually work
When originally writing this feature up, I apparently completely forgot
to actually make the test exercise it and left an extra exit in the
function implementing the functionality without the appropriate
preprocessor macros around it, causing things to never work. This patch
should fix that.
2024-12-24 21:48:44 +00:00
Alexey Bataev
07d284d4eb
[SLP]Add cost estimation for gather node reshuffling
Adds cost estimation for the variants of the permutations of the scalar
values, used in gather nodes. Currently, SLP just unconditionally emits
shuffles for the reused buildvectors, but in some cases better to leave
them as buildvectors rather than shuffles, if the cost of such
buildvectors is better.

X86, AVX512, -O3+LTO
Metric: size..text

Program                                                                        size..text
                                                                               results     results0    diff
                 test-suite :: External/SPEC/CINT2006/445.gobmk/445.gobmk.test   912998.00   913238.00  0.0%
 test-suite :: MultiSource/Benchmarks/MiBench/consumer-lame/consumer-lame.test   203070.00   203102.00  0.0%
     test-suite :: External/SPEC/CFP2017speed/638.imagick_s/638.imagick_s.test  1396320.00  1396448.00  0.0%
      test-suite :: External/SPEC/CFP2017rate/538.imagick_r/538.imagick_r.test  1396320.00  1396448.00  0.0%
                       test-suite :: MultiSource/Benchmarks/Bullet/bullet.test   309790.00   309678.00 -0.0%
      test-suite :: External/SPEC/CFP2017rate/526.blender_r/526.blender_r.test 12477607.00 12470807.00 -0.1%

CINT2006/445.gobmk - extra code vectorized
MiBench/consumer-lame - small variations
CFP2017speed/638.imagick_s
CFP2017rate/538.imagick_r - extra vectorized code
Benchmarks/Bullet - extra code vectorized
CFP2017rate/526.blender_r - extra vector code

RISC-V, sifive-p670, -O3+LTO
CFP2006/433.milc - regressions, should be fixed by https://github.com/llvm/llvm-project/pull/115173
CFP2006/453.povray - extra vectorized code
CFP2017rate/508.namd_r - better vector code
CFP2017rate/510.parest_r - extra vectorized code
SPEC/CFP2017rate - extra/better vector code
CFP2017rate/526.blender_r - extra vectorized code
CFP2017rate/538.imagick_r - extra vectorized code
CINT2006/403.gcc - extra vectorized code
CINT2006/445.gobmk - extra vectorized code
CINT2006/464.h264ref - extra vectorized code
CINT2006/483.xalancbmk - small variations
CINT2017rate/525.x264_r - better vectorization

Reviewers: RKSimon

Reviewed By: RKSimon

Pull Request: https://github.com/llvm/llvm-project/pull/115201
2024-12-24 15:35:29 -05:00
Florian Hahn
2d038caeeb
[VPlan] Remove stray space when printing VPWidenCastRecipe.
printFlags() already takes care of printing a single space if there are
no flags. Remove the extra space when printing a recipe without flags.
2024-12-24 20:23:48 +00:00
Kunwar Grover
6e3631d0e3
[mlir][scf] Track replacements using a listener in TileAndFuse (#120999)
This PR makes TileAndFuse explicitly track replacements using a listener
instead of assuming that the results always come from the outer most
tiling loop. scf::tileUsingInterface can introduce merge operations
whose results are the actual replacements to use, instead of the outer
most loop results.
2024-12-24 18:01:41 +00:00