Commit Graph

544229 Commits

Author SHA1 Message Date
Daniel Chen
13ead00049 [Flang] Fix PowerPC build failure due to the deprecation of ArrayRef(std::nullopt_t) {}. (#147816)
Our local Flang build on PowerPC was broken as
```
llvm/flang/../mlir/include/mlir/IR/ValueRange.h:401:20: error: 'ArrayRef' is deprecated: Use {} or ArrayRef<T>() instead [-Werror,-Wdeprecated-declarations]
  401 |       : ValueRange(ArrayRef<Value>(std::forward<Arg>(arg))) {}
      |                    ^
llvm/flang/lib/Optimizer/CodeGen/CodeGen.cpp:2243:53: note: in instantiation of function template specialization 'mlir::ValueRange::ValueRange<const std::nullopt_t &, void>' requested here
 2243 |                              /*cstInteriorIndices=*/std::nullopt, fieldIndices,
      |                                                     ^
 llvm/include/llvm/ADT/ArrayRef.h:70:18: note: 'ArrayRef' has been explicitly marked deprecated here
   70 |     /*implicit*/ LLVM_DEPRECATED("Use {} or ArrayRef<T>() instead", "{}")
      |                  ^
llvm/include/llvm/Support/Compiler.h:244:50: note: expanded from macro 'LLVM_DEPRECATED'
  244 | #define LLVM_DEPRECATED(MSG, FIX) __attribute__((deprecated(MSG, FIX)))
      |                                                  ^
1 error generated.
```

This patch is to fix it.
2025-07-10 09:53:03 -04:00
Matt Arsenault
d801b54bcd ARM: Fix calling convention for gnu half conversion functions (#147951)
I'm surprised at how bad the test coverage is here. There is some
overlap with existing tests, but they aren't comprehensive and do
not cover all the ABIs, or all the different types.

Fixes #147935
2025-07-10 22:47:44 +09:00
Aiden Grossman
498aeada7b [CI] Generate Test Report With No Test Results
This patch makes it so that generate_test_report_github.py generates a
test report even when we don't get any test results. This otherwise
created a pretty confusing user experience on the Github side if the
build failed before any tests ran or in cases like running check-libc
where none of the tests are run through lit.

Reviewers: lnihlen, cmtice

Pull Request: https://github.com/llvm/llvm-project/pull/147871
2025-07-10 06:41:37 -07:00
csstormq
d14aa0cd46 [InlineSpiller] Drop unused elements in Virt2SiblingsMap. NFC (#147866) 2025-07-10 21:35:44 +08:00
Aiden Grossman
1469c339f2 [CI] Remove Style from generate_test_report_lib
This is another Buildkite relic that we can get rid of now to simplify
things a bit.

Reviewers: cmtice, DavidSpickett, lnihlen

Reviewed By: DavidSpickett

Pull Request: https://github.com/llvm/llvm-project/pull/147791
2025-07-10 06:29:18 -07:00
Aiden Grossman
2877d80155 [CI] Remove Remaining Buildkite References in generate_test_report_lib
This patch removes the buildkite_info object from
generate_test_report_lib as we no longer support buildkite so it is dead
code now. Eventually we should set up equivalent functionality on the
Github side for downloading the logs from a convenient link, but for now
clean up the code.

Reviewers: cmtice, DavidSpickett, lnihlen

Reviewed By: DavidSpickett

Pull Request: https://github.com/llvm/llvm-project/pull/147784
2025-07-10 06:28:07 -07:00
Tcc100
7daa1defd2 Reland "[CodeGen] Expose the extensibility of PassConfig to plugins (#139059)"
Add missing dependencies to unittest target
Original patch broke BUILD_SHARED bots and required revert #147947
2025-07-10 15:26:48 +02:00
Aiden Grossman
896575eb74 [clang] Prefer clang_setup over use_clang
This patch switches over uses of use_clang to clang_setup to fix a
potential race condition that has been impacting CI.

This is split from the refactoring to ensure I'm not missing anything
major here on the clang-tools-extra side.

This should fix #145703.

Reviewers: AaronBallman, HighCommander4, HerrCai0907, petrhosek, Keenuts

Reviewed By: petrhosek

Pull Request: https://github.com/llvm/llvm-project/pull/147437
2025-07-10 06:14:06 -07:00
Ryotaro Kasuga
cd474bb801 [DA] Add test where access size differs from stride size (NFC) (#147715)
Add a test case that is mentioned in #144088 but not added yet.
2025-07-10 22:08:51 +09:00
Timm Baeder
130e6121f5 [clang][bytecode][NFC] Move Pointer::StorageKind above the union (#147942)
This is easier to read in debuggers and more common.
2025-07-10 15:05:28 +02:00
Matt Arsenault
7bbb65c8fe RuntimeLibcalls: Make getLibcallImplName static. NFC. (#147919) 2025-07-10 21:19:23 +09:00
Mészáros Gergely
7a089bc4c0 [libclc] Delete .gitignore (#147939)
The file is listing build artifacts to ignore, but LLVM has long had the
policy that in-tree builds are not supported, so the ignore rules
shouldn't serve their original purpose anymore.
The rules however are annoying because although they probably intended
only to ignore top-level build artifacts, they lack the leading `/` so
they match any file with the ignored name anywhere under `libclc/`.
2025-07-10 14:07:59 +02:00
Corentin Jabot
78e84e5779 [Clang] A lone [ does not an attribute make (#147306)
In some tentative parses, we would always consider `[` as the start of
an attribute - only `[[` should be.

Fixes #63880
2025-07-10 14:06:02 +02:00
Corentin Jabot
39ea9b71d9 [Clang] Correctly handle taking the address of an explicit object member function template (#147046)
When implementing #93430, I failed to consider some cases involving
function templates.

```
struct A {
    template <typename T>
    void a(this T self);
};
(&A::a<A>)(A{});
```

This fixes that
2025-07-10 14:05:23 +02:00
Jan Patrick Lehr
0481d2a161 Revert "[CodeGen] Expose the extensibility of PassConfig to plugins" (#147947)
Reverts llvm/llvm-project#139059

This broke
https://lab.llvm.org/buildbot/#/builders/10/builds/9125/steps/8/logs/stdio

The bot does a SHARED_LIBS=ON build. I can reproduce locally with the
CMake cache file in offload/cmake/caches/AMDGPUBot.cmake as the build
config.
2025-07-10 14:00:55 +02:00
Luke Lau
1d8b51667a [TTI] Don't drop VP intrinsic args when delegating to non-vp equivalent (#147677)
Previously we only carried the type arguments which caused value-based
costs to be inadvertantly changed into type-based costs.

I'm just using vp.is.fpclass as an example intrinsic for now since the
type based cost seems to differ from the value based cost, and most
normal intrinsics e.g. min/max have the same value + type based cost.

We still need to handle the cost properly for is.fpclass in a second
patch.

This is needed for an upcoming patch to handle the cost of
llvm.experimental.vp.reverse which suffers from the same problem.
2025-07-10 19:41:49 +08:00
Shashi Shankar
d0a038296e [Clang] Ignore invalid base classes (#147213)
When building a RecordDecl, ignore invalid base classes. This solves crashes later on and leads to better recovery.

Fixes #147186
2025-07-10 13:31:41 +02:00
agozillon
75f81ded8f [Flang][FlangRT][Runtime] Add RT_OFFLOAD_API_GROUP_BEGIN to missing symbols on AMDGPU (#147612)
After the recent move to work queues, in certain cases when linking in
the fortran runtime built for offload on AMDGPU as required in certain
cases, we'll get missing symbols when linking. This PR tries to address
this issue by encompassing more of the library in
RT_OFFLOAD_API_GROUP_BEGIN, which has the affect of compiling these
functions for AMDGPU, resolving the missing symbols.

This PR should address the following issue:
https://github.com/llvm/llvm-project/issues/145888
2025-07-10 13:19:58 +02:00
Simon Pilgrim
59a99c6f2c [SLP] Drop unnecessary '' from around -passes=... arg lists to appease update_test_checks.py when run on DOS. NFC. 2025-07-10 12:18:41 +01:00
David Green
2052d7bf9a [AArch64] Expand fcmp cost model tests. NFC 2025-07-10 12:13:35 +01:00
Ross Brunton
abb878438a [Offload] Allow querying the size of globals (#147698)
The `GlobalTy` helper has been extended to make both the Size and Ptr be
optional. Now `getGlobalMetadataFromDevice`/`Image` is able to write the
size of the global to the struct, instead of just verifying it.
2025-07-10 12:05:31 +01:00
Paul Walker
343e3c6bb8 [LLVM][CodeGen][SVE] Make bf16 fabs/fneg isel consistent with fp16. (#147543)
Whilst at first glance there appears to be no native bfloat instructions
to modify the sign bit, this is only the case when FEAT_AFP is
implemented. Without this feature vector FABS/FNEG does not care about
the floating point format beyond needing to know the position of the
sign bit. From what I can see LLVM has no support for FEAT_AFP in terms
of feature detection or ACLE builtins and so I believe the compiler can
work under the assumption the feature is not enabled. In fact, if
FEAT_AFP is enabled then I believe the current isel is likely broken for
half, float and double anyway.
2025-07-10 11:54:19 +01:00
Michael Kruse
628c735010 [MLIR][OpenMP] Add canonical loop operations (#147061)
Add the supporting OpenMP Dialect operations, types, and interfaces for
modelling

MLIR Operations:
 * omp.newcli
 * omp.canonical_loop

MLIR Types:
 * !omp.cli

MLIR Interfaces:
 * LoopTransformationInterface

As a first loop transformations to be able to use these new operation in
follow-up PRs (#144785)
 * omp.unroll_heuristic
2025-07-10 12:53:07 +02:00
Simon Pilgrim
d3ea7f29ec [AMDGPU] mad-combine.ll - regenerate test checks and remove duplicate safe/unsafe RUN line 2025-07-10 11:52:02 +01:00
Kenneth Benzie (Benie)
cea33304c0 [Offload] Add Offload API Sphinx documentation (#147323)
* Add spec generation to offload-tblgen tool
* This patch adds generation of Sphinx compatible reStructuedText
utilizing the C domain to document the Offload API directly from the
spec definition `.td` files.
* Add Sphinx HTML documentation target
* Introduces the `docs-offload-html` target when CMake is configured
with `LLVM_ENABLE_SPHINX=ON` and `SPHINX_OUTPUT_HTML=ON`. Utilized
`offload-tblgen -gen-spen` to generate Offload API specification docs.
2025-07-10 11:50:51 +01:00
Tcc100
56a8655f4a [CodeGen] Expose the extensibility of PassConfig to plugins (#139059)
This PR exposes the backend pass config to plugins via a callback.
Plugin authors can register a callback that is being triggered before
the target backend adds their passes to the pipeline. In the callback
they then get access to the `TargetMachine`, the `PassManager`, and the
`TargetPassConfig`. This allows plugins to call
`TargetPassConfig::insertPass`, which is honored in the subsequent
`addPass` of the main backend. We implemented this using the legacy pass
manager since backends still use it as the default.
2025-07-10 12:43:09 +02:00
Matt Arsenault
953416ae40 ARM: Start moving runtime libcalls into tablegen (#146084)
We still need to manually set the calling conventions of
some libcalls until the lowering is separated out.
2025-07-10 19:38:31 +09:00
Ricardo Jesus
71150f2310 [AArch64] Use SVE2 bit-sel instructions for some binary patterns. (#147544)
We can use NBSL/BSL2N to implement the following operations via the
corresponding identities:
* EON(a, b) = BSL2N(a, a, b) = BSL2N(b, b, a)
* NAND(a, b) = NBSL(a, b, b) = NBSL(b, a, a)
* NOR(a, b) = NBSL(a, b, a) = NBSL(b, a, b)
* ORN(a, b) = BSL2N(a, b, a)

Most of these operations are currently lowered into at least two
instructions because we don't have dedicated Neon/SVE instructions
for them. With the appropriate pattern of NBSL/BSL2N we can lower
them in a single instruction.

We could also use NBSL to implement an unpredicated NOT(a) =
NBSL(a, a, a), but because of the tied register constraint, this
may not always be profitable.
2025-07-10 11:36:01 +01:00
Matt Arsenault
a446300d1b TargetLowering: Avoid a use of PointerType::getUnqual (#147884)
Use the default globals address space
2025-07-10 19:00:59 +09:00
Christian Sigg
361a659796 [mlir][bazel] Port ddf9b91 2025-07-10 11:45:04 +02:00
Ramkumar Ramachandra
19c2fb2325 [ISel/RISCV] Custom-lower vector [l]lround (#147713)
Lower it just like the vector [l]lrint, using vfcvt, with the right
rounding mode. Updating costs to account for this custom-lowering is
left to a companion patch.
2025-07-10 10:33:46 +01:00
Mariusz Sikora
d7859ed047 [AMDGPU][NFC] Remove unused return (#147912) 2025-07-10 11:33:35 +02:00
Simon Pilgrim
d844384ad9 [AMDGPU] fneg-combines.ll - regenerate test checks 2025-07-10 10:23:09 +01:00
Simon Pilgrim
0f29e7dadc Fix MSVC warning - "'llvm::AMDGPUResourceUsageAnalysis': type name first seen using 'class' now seen using 'struct'". NFC. 2025-07-10 10:20:40 +01:00
Juan Manuel Martinez Caamaño
8fb1699972 [NFC] Fix typo in comment in LowerMemIntrinsics.h (#147903) 2025-07-10 11:14:45 +02:00
Takuto Ikuta
f7cdff7bdd [compiler-rt] Include missing headers for libFuzzer (#146828)
This is to fix modules build errors in chromium like
*
https://ci.chromium.org/ui/p/chromium/builders/try/linux-libfuzzer-asan-rel/2292144/overview
*
https://ci.chromium.org/ui/p/chromium/builders/try/linux-libfuzzer-asan-rel/2292444/overview

---------

Co-authored-by: Petr Hosek <phosek@google.com>
2025-07-10 10:56:08 +02:00
Christian Sigg
96e4b50ffe [llvm][bazel] Port 7f3afab 2025-07-10 10:55:36 +02:00
Haojian Wu
a709621cd5 [Lex] Use SourceLocation::UIntTy for the MacroDefStart, NFC
Avoid using the underlying type, and be more consistent -- MacroDefStart stores
the result of SourceManager::getNextLocalOffset() which returns the
SourceLocation::UIntTy.
2025-07-10 10:46:27 +02:00
macurtis-amd
cff4a00d3f AMDGPU: Fix runtime unrolling when cascaded GEPs present (#147700)
Cascaded GEP (i.e. GEP of GEP) are not handled when determining if it is
ok to runtime unroll loops.

This change simply uses `getUnderlyingObjects` to look through cascaded
GEPs.
2025-07-10 03:44:04 -05:00
Christian Sigg
2e38beebcf [libc][bazel] Port bb7cea0 2025-07-10 10:36:10 +02:00
Wendi
63f19f1c5c [QualGroup] Add slides and documentation updates after July 2025 sync-up (#147196)
This patch updates the Qualification Working Group documentation with
improvements based on our first sync-up meeting in July 2025:

- Added July 2025 meeting slides to `qual-wg/slides/`
- Updated Participation section to include clickable links to Discourse
and Discord
- Clarified contributor recognition to include async contributors
- Added new sections for Meeting Minutes and Presentation Slides
- Linked to the initial RFC and Discord channel in the Contact section
- Added Code of Conduct section
- Minor formatting consistency fixes across the document

This change also updates `GettingInvolved.rst` to add the Qualification
WG with calendar links and Discourse minutes.

These updates aim to improve clarity, traceability, and contributor
onboarding.

---------

Co-authored-by: Wendi Urribarri (Woven by Toyota <wendi.urribarri@woven-planet.global>
2025-07-10 17:32:16 +09:00
Simon Pilgrim
75656d8c11 [X86] combineStore - remove rangedata when converting 64-bit copies to f64 load/store (#147904)
We're changing from i64 to f64 - we can't retain any range metadata

Fixes #147781
2025-07-10 09:32:09 +01:00
Urvi Rav
8055c0f380 [OpenMP-5.2] deprecate delimited form of 'declare target' (#145854)
According to OpenMP 5.2 (Section 7.8.2), the directive name `declare
target` may be used as a synonym for `begin declare target` only when no
clauses are specified. This clause-less delimited form is now deprecated
and should emit a deprecation warning.

```
// Deprecated usage (should trigger warning):
#pragma omp declare target // deprecated in OpenMP 5.2
void foo1() {
}
#pragma omp end declare target
// Valid usage with clause (should not trigger warning):
#pragma omp declare target enter(foo2)
void foo2() {
}
```
```
// Recommended replacement for deprecated delimited form:
#pragma omp begin declare target
void foo() {
}
#pragma omp end declare target
```

---------

Co-authored-by: urvi-rav <urvi.rav@hpe.com>
2025-07-10 13:55:20 +05:30
Younan Zhang
adcd1bb32a [Clang] Fix the template argument collection after CWG2369 (#147894)
Since the function template isn't instantiated before constraint
checking, we'll not be able to find the outer template arguments through
function specialization when evaluating the inner constraint that is
nested within a larger constraint expression.

The only practical solution is to get them back through the code
synthesis context, which also allows us to eliminate an overload of
getTemplateInstantiationArgs.

No release note because it's a regression on trunk.

Fixes https://github.com/llvm/llvm-project/issues/147772
2025-07-10 16:17:34 +08:00
Vikram Hegde
1ccd779324 [AMDGPU][NewPM] Port "AMDGPUResourceUsageAnalysis" to NPM (#130959) 2025-07-10 13:35:43 +05:30
Matt Arsenault
f573f6b886 CodeGen: Convert test to opaque pointers (#147886)
Apparently we have this weird CodeGen/Inputs directory which
got missed
2025-07-10 17:01:19 +09:00
Luke Lau
da8d7f49ff [RISCV] Unify non-vp and vp rounding intrinsic costing (#147872)
Currently we have slightly different costing for the vp and non-vp
version of the rounding intrinsics.

We can delete this code and use the generic BasicTTIImpl code for the vp
intrinsics which falls back to the non-vp versions.

I'm not sure if the zvfh costing is correct, this should probably be
fixed in a follow up patch. At the moment the non-vp cost is more
important since it is what the loop vectorizer will use.
2025-07-10 15:46:05 +08:00
Jim Lin
60c14ac582 [RISCV] +zve64x is sufficient for the zvfbfmin and zvfbfwma intrinsic tests. NFC. 2025-07-10 15:41:59 +08:00
Vikram Hegde
fcd4a2fe7a [CodeGen][NewPM] Port "PostRAMachineSink" pass to NPM (#129690) 2025-07-10 13:10:46 +05:30
Pierre van Houtryve
ed87f0afba [AMDGPU] Visit all PHIs in each call to optimizeLiveType (#147522)
Make the Visited set a local variable, otherwise we can reject a PHI
(those that do not have a zeroinitializer constant) but mark it as
visited,
and the rest of the function thinks the PHI is ok when it isn't.
This is a bit crude but it's the only fix that consistently worked in my
testing.

Fixes SWDEV-541767
2025-07-10 09:29:48 +02:00