Commit Graph

551620 Commits

Author SHA1 Message Date
Matt Arsenault
727e9f5ea5 CodeGen: Pass SubtargetInfo to TargetGenInstrInfo constructors (#157337)
This will make it possible for tablegen to make subtarget
dependent decisions without adding new arguments to every
target.

---------

Co-authored-by: Sergei Barannikov <barannikov88@gmail.com>
2025-09-08 12:12:19 +09:00
Maksim Levental
27af6bc240 [MLIR] fix LLVM::InsertValueOp::create 2025-09-07 22:23:12 -04:00
Yanzuo Liu
2ec6b3bced [Clang-Tidy] Handle nested-name-specifier in "llvm-prefer-isa-or-dyn-cast-in-conditionals" (#155982)
Use `declRefExpr` matcher to match callee so that we can get the
`SourceRange` of the identifier of the callee for replacement.

Drive-by changes:

- Use `hasConditionVariableStatement` matcher to handle `if` statements
with init-statement.
- Support `for` loops.

Fixes #154790
2025-09-08 10:19:52 +08:00
Jakub Kuderski
2ed3f49c49 [mlir] Use free op create functions. NFC. (#157374)
The builder create methods are deprecated:
https://mlir.llvm.org/deprecation/. See
https://discourse.llvm.org/t/psa-opty-create-now-with-100-more-tab-complete/87339.
2025-09-07 22:13:20 -04:00
Vitaly Buka
dcd0ee0872 [NFC][LowerTypeTests] Make buildBitSet is now a static function (#157375) 2025-09-08 01:22:08 +00:00
Jakub Kuderski
2b3d3fce73 [mlir][gpu] Revert gpu.subgroup_broadcast with any_lane (#157373)
This partially reverts https://github.com/llvm/llvm-project/pull/152808.

Post-commit comments revealed that the `any_lane` variant hasn't been
fully agreed upon at the time of landing.
2025-09-08 00:43:57 +00:00
Alexey Bataev
fd93dc5ac5 [SLP]Correctly schedule standalone schedule data, which is part of tree entry
If a standalone schedule data relates to a vectorized instruction, still
need to schedule it as a part of pseudo-bundle to correctly handle
dependencies between its child nodes.
2025-09-07 17:08:37 -07:00
Philip Reames
c2c7b7efab [RISCV] Add coverage for the tryFoldSelectIntoOp combine with constants
An upcoming change will relax the requirement that the operands be
non-constant.
2025-09-07 17:01:26 -07:00
Mehdi Amini
1d848cfe1a [MLIR] Apply clang-tidy fixes for misc-use-internal-linkage in OpenMPToLLVMIRTranslation.cpp (NFC) 2025-09-07 14:55:38 -07:00
Chris B
799d3466fa [NFC] Change const char* to StringRef (#154179)
This API takes a const char* with a default nullptr value and immdiately
passes it down to an API taking a StringRef. All of the places this is
called from are either using compile time string literals, the default
argument, or string objects that have known length. Discarding the
length known from a calling API to just have to strlen it to call the
next layer down that requires a StringRef is a bit silly, so this change
updates CodeGenModule::GetAddrOfConstantCString to use StringRef instead
of const char* for the GlobalName parameter.

It might be worth also replacing the first parameter with an llvm ADT
type that avoids allocation, but that change would have wider impact so
we should consider it separately.
2025-09-07 16:05:37 -05:00
Alexey Bataev
c4d927ce09 Revert "[SLP]Correctly schedule standalone schedule data, which is part of tree entry"
This reverts commit 57cae2b6a2 to fix
a buildbot https://lab.llvm.org/buildbot/#/builders/169/builds/14776
2025-09-07 13:27:12 -07:00
St. Muench
6fc32e9306 [clang-tidy] do not diagnose array types within implicit instantiations of a template (#132924)
So far, the clang-tidy check `modernize-avoid-c-arrays` also diagnosed
array types for type template parameters even though no actual array
type got written there but it got deduced to one. In such case, there is
nothing a developer can do at that location to fix the diagnostic. Since
in this case, the location where the template got actually instantiated
would have to be adjusted. And this is in most cases some totally
distant code where implementers of a template do not have access to.
Also adding suppressions to the declaration of the template is not an
option since that would clutter the code unnecessarily and is in many
cases also simply not possible (e.g. for users of a template). Hence, we
propose to not diagnose any occurrence of an array type in an implicit
instantiation of a template but rather at the point where template
arguments involve array types.
2025-09-07 22:54:37 +03:00
Sergei Barannikov
ac60477295 [Mips] Decode the operand of JrcRx16 (#157357)
This change will allow to remove `-ignore-non-decodable-operands`
TableGen option.

The J(AL)R(C) instructions still have incorrect encodings, but it seems
there is only one mips16 test that only checks that `nop` can be
assembled.
2025-09-07 18:53:05 +00:00
Mircea Trofin
96c1201504 [nfc][ir2vec] Remove Valid field (#157132)
It is tied to the vocab having had been set. Checking that vector's
`emtpy` is sufficient. Less state to track (for a maintainer)
2025-09-07 11:26:23 -07:00
Mehdi Amini
96195e7d44 [MLIR] Apply clang-tidy fixes for performance-unnecessary-value-param in Transport.cpp (NFC) 2025-09-07 10:55:50 -07:00
Mehdi Amini
8feb754510 [MLIR] Apply clang-tidy fixes for misc-use-internal-linkage in NVVMDialect.cpp (NFC) 2025-09-07 10:55:50 -07:00
Mehdi Amini
1b6d404ed1 [MLIR] Apply clang-tidy fixes for llvm-else-after-return in ScalableValueBoundsConstraintSet.cpp (NFC) 2025-09-07 10:55:50 -07:00
Alexey Bataev
57cae2b6a2 [SLP]Correctly schedule standalone schedule data, which is part of tree entry
If a standalone schedule data relates to a vectorized instruction, still
need to schedule it as a part of pseudo-bundle to correctly handle
dependencies between its child nodes.
2025-09-07 10:54:40 -07:00
Kazu Hirata
b9e546d24b [Support] Simplify Object::operator== (NFC) (#157311)
This patch simplifies Object::operator== with DenseMap::operator==.
2025-09-07 10:46:02 -07:00
Aiden Grossman
859dc6b0c0 [lit] Move pipefail test into lit tests
These removes another test that otherwise needs a shell. This does
remove test coverage for pipefail in the external shell, but the
external shell should be disabled by default pretty soon. This also adds
test coverage for the internal shell which did not exist before.

Reviewers: jh7370, ilovepi, petrhosek

Reviewed By: ilovepi, petrhosek

Pull Request: https://github.com/llvm/llvm-project/pull/157223
2025-09-07 10:43:59 -07:00
Kazu Hirata
fc01a55755 [Support] Refactor IsResizableBase with "constexpr if" (NFC) (#157326)
We have two implementations of IsResizableBase that are selected with
a boolean template parameter.  This patch consolidates them into one
with "constexpr if".  The "constexpr if" condition uses
llvm::is_detected to check the availability of resize().
2025-09-07 10:39:53 -07:00
Kazu Hirata
7ef9530213 [ADT] Simplify StringSet::contains (NFC) (#157325)
We can use Base::contains.
2025-09-07 10:39:46 -07:00
Kazu Hirata
13647d82eb [ADT] Refactor DenseSet::insert (NFC) (#157324)
DenseMap::try_emplace can default-construct DenseSetEmptyKey, so we
don't need to pass Empty on our own.
2025-09-07 10:39:38 -07:00
Kazu Hirata
574ff7fdff [ADT] Clean up fwd_or_bidi_tag with std::conditional_t (NFC) (#157310)
fwd_or_bidi_tag selects one of two implementations of
fwd_or_bidi_tag_impl depending on the condition.  We can replace it
with std::conditional_t, eliminating the need for helper structs
fwd_or_bidi_tag_impl.

This patch also converts the fwd_or_bidi_tag struct into an alias
template, making "using filter_iterator" a little more readable.
2025-09-07 10:39:31 -07:00
Kazu Hirata
456e49e805 [ADT] Use "constexpr if" in get_hashable_data (NFC) (#157309)
This patch combines two implementations of get_hashable_data into one
with "constexpr if".  I'm retaining the original return type of the
second variant, size_t, with static_cast<size_t>.  Moving away from
template metaprogramming should improve readability.
2025-09-07 10:39:23 -07:00
Florian Hahn
b50ad945dd [InstSimplify] Simplify extractvalue (umul_with_overflow(x, 1)). (#157307)
Look through extractvalue to simplify umul_with_overflow where one of
the operands is 1.

This removes some redundant instructions when expanding SCEVs, which in
turn makes the runtime check cost estimate more accurate, reducing the
minimum iterations for which vectorization is profitable.

PR: https://github.com/llvm/llvm-project/pull/157307
2025-09-07 18:32:40 +01:00
Timm Baeder
e9499e82ed [clang][bytecode][NFC] Remove some unnecessary if statements (#157329)
We already checked that `IsStatic` is true above.
2025-09-07 18:55:48 +02:00
AZero13
7bc342ef9d [AArch64] Use DAG.getNegative instead of getNegatedInteger (NFC) (#157342) 2025-09-07 17:41:19 +01:00
Sergei Barannikov
e41da79198 [CodeGen] Make TargetRegisterInfo destructor public (NFC) (#157341)
All in-tree targets store target-specific TRI in target-specific
Subtarget/InstrInfo class by value, but some downstream targets may
prefer to store it as `std::unique_ptr<const TargetRegisterInfo>` (to
avoid inclusion of MyTargetRegisterInfo.h in MySubtarget.h).

Making the destructor public makes this possible, and also follows
general C++ guidelines (the destructor should be either public virtual
or protected non-virtual).

All other related classes already have their destructors public.
2025-09-07 18:57:38 +03:00
Abhinav Kumar
645dd324d1 [clang-repl] Sink RemoteJITUtils into Interpreter class. NFC (#155140)
This is a refactoring PR. It sinks RemoteJITUtils into Interpreter and IncrementalExecutor classes.

---------

Co-authored-by: kr-2003 <kumar.kr.abhinav@gmail.com>
2025-09-07 18:35:29 +03:00
Matt Arsenault
3216bf1b96 CodeGen: Make TargetInstrInfo constructor protected (#157336) 2025-09-08 00:26:52 +09:00
Florian Hahn
2654690006 [LV] Add additional test with SCEV predicate.
The SCEV predicate in the existing tests for optimizing for size is
known to be false. Add additional test with a predicate that cannot be
proven true/false.

Also generate checks with latest version of script.
2025-09-07 16:14:52 +01:00
Michał Górny
7a88ddd3b1 Revert "[Offload] Run unit tests as a part of check-offload" (#157346)
Reverts llvm/llvm-project#156675 due to regressions in standalone build
and test errors without all plugins enabled (#157345).
2025-09-07 15:12:15 +00:00
Sergei Barannikov
fa59e61e65 [CSKY] Decode CARRY / GPRSP operands not encoded into instruction (NFCI) (#157338)
The generated decoder can now decode these operands. All we need to do
is to add `bits<0>` for these operands to instruction records and
provide operand decoders.

While here, reformat adjacent lines.
2025-09-07 13:47:23 +00:00
camc
59d69bfc20 [clang] Detect int-to-float narrowing when the back-conversion is unspecified (#157174)
Resolves #157067 

APFloat::convertToInteger returns opInvalidOp when the conversion has
unspecified value. The int-to-float narrowing detection logic doesn't
check for this when comparing the converted-back integer with the
original integer.

PR adds a check for this, and test cases.
2025-09-07 20:59:58 +08:00
David Green
6d6122eaff [AArch64][GlobalISel] Add regbank information to other sha1 intrinsics. 2025-09-07 13:50:25 +01:00
Florian Hahn
ee29611427 [LV] Remove ILV::LoopVectorPreHeader (NFC).
Remove LoopVectorPreheader member variable from ILV as it is only used
by epilogue skeleton creation.
2025-09-07 13:48:00 +01:00
David Green
d4450bb8ec [AArch64][GlobalISel] Move special selection for aarch64_crypto_sha1h.
This appears to just need to select FPR registers.
2025-09-07 13:45:00 +01:00
Giuseppe Cesarano
9892dc1d34 [AArch64] Fix vectorToScalarBitmask BE (#156314)
Closes #156312
2025-09-07 13:33:13 +01:00
Chandler Carruth
c000c9e4bf [Bazel] Export compiler-rt builtins sources (#157200)
This provides a structured collection of the source files used in the
compiler-rt builtins library in Bazel.

Normal build rules often don't work for runtime libraries as they may
need to be built for a specific target platform and in an environment
with the associated SDK available to build for that target. Instead,
this PR exports the sources in a structured way that can be used by
downstream users to collect and build these runtimes in a
target-appropriate manner.

Currently, this includes AArch64, AArch32 (with and without VFP),
x86-64, i386, PPC, and RISC-V. Where I could see a useful division of
functionality, those are also exposed.

The rules use over-wide globs to minimize the need to manually update
lists of files or to risk things slipping out of date.
2025-09-07 03:36:49 -07:00
moorabbit
49f28f6efb [Headers][X86] Add constexpr support for some AVX[512] intrinsics. (#157260)
The following AVX[512] intrinsics are now constexpr:
- `_mm_cvtepi64_pd`
- `_mm_mask_cvtepi64_pd`
- `_mm_maskz_cvtepi64_pd`
- `_mm_cvtepu64_pd`
- `_mm_mask_cvtepu64_pd`
- `_mm_maskz_cvtepu64_pd`
- `_mm256_cvtepi64_pd`
- `_mm256_mask_cvtepi64_pd`
- `_mm256_maskz_cvtepi64_pd`
- `_mm256_cvtepu64_pd`
- `_mm256_mask_cvtepu64_pd`
- `_mm256_maskz_cvtepu64_pd`
- `_mm256_cvtepi64_ps`
- `_mm256_mask_cvtepi64_ps`
- `_mm256_maskz_cvtepi64_ps`
- `_mm256_cvtepu64_ps`
- `_mm256_mask_cvtepu64_ps`
- `_mm256_maskz_cvtepu64_ps`
- `_mm_cvtepi16_ph`
- `_mm_mask_cvtepi16_ph`
- `_mm_maskz_cvtepi16_ph`
- `_mm_set1_ph`
- `_mm_cvtepu16_ph`
- `_mm_mask_cvtepu16_ph`
- `_mm_maskz_cvtepu16_ph`
- `_mm256_cvtepi16_ph`
- `_mm256_mask_cvtepi16_ph`
- `_mm256_set1_ph`
- `_mm256_maskz_cvtepi16_ph`

This PR is part 3 [[part
1](https://github.com/llvm/llvm-project/pull/156187) - [part
2](https://github.com/llvm/llvm-project/pull/156567)] of a series of PRs
fixing #155798
2025-09-07 10:29:58 +00:00
Florian Hahn
afa0e70cc6 [LV] Remove instcombine,simplifycfg and dce from some tests.
Remove instcombine, simplifycfg and dce from some tests, as they make it
a bit more difficult to see the codegen coming out of LV and most
simplifications are already done on the VPlan-level.

Also modernizes some check lines.
2025-09-07 10:28:25 +01:00
Benjamin Kramer
d41842180c [bazel] Add missing dependency for 5622a92df0 2025-09-07 11:02:21 +02:00
Oliver Hunt
c75c136169 [clang][PAC] Enable the PAC dynamic_cast to final class optimization (#152601)
Update the codegen for the the dynamic_cast to a final class
optimization when pointer authentication is enabled.
2025-09-06 20:02:43 -07:00
Teresa Johnson
5311057bb6 [MemProf] Always add hints to allocations with memprof attributes (#157222)
Apply hints even if the attribute is the default "notcold" or
"ambiguous", to enable better tracking through the allocator.

Add an option to control the ambiguous allocation hint value.
2025-09-06 18:41:04 -07:00
Lang Hames
88a5429a8c [orc-rt] Add allocation-action execution support. (#157244)
This commit contains executor-side support for ORC allocation actions
(see e50aea58d5).

An AllocAction is a function pointer with type
orc_rt_WrapperFunctionBuffer (*)(const char *ArgData, size_t ArgSize),
along with an associated blob of argument bytes.

An AllocActionPair is a pair of AllocActions, one to be run at memory
finalization time and another to be run at deallocation time.

The runFinalizeActions function can be used to run all non-null finalize
actions in a sequence of AllocActionPairs, returning the corresponding
sequence of deallocation actions on success.

The runDeallocActions function can be used to run a sequence of dealloc
actions returned by runFinalizeActions.
2025-09-07 11:09:28 +10:00
Kazu Hirata
609bcd51c8 [llvm] Proofread ExceptionHandling.rst (#157313) 2025-09-06 17:11:32 -07:00
Kazu Hirata
37a1fc52a5 [Support] Remove an unnecessary cast (NFC) (#157312)
dli_fname is of type const char *.
2025-09-06 17:11:24 -07:00
Aiden Grossman
bbd48fbb2f Reapply "[compiler-rt] Remove %T from shared object substitutions (#155302)"
This reverts commit 36ca6748bc.

This broke a couple Android buildbots, theoretically due to different
directory structure that has now been addressed.
2025-09-06 22:41:10 +00:00
Thurston Dang
69c777bf3d Revert "[compiler-rt][sanitizer-common] adding C23 memset_explicit interception." (#157317)
Reverts llvm/llvm-project#154428 due to buildbot breakages (e.g.,
https://lab.llvm.org/buildbot/#/builders/51/builds/22984)
2025-09-06 14:57:45 -07:00