529663 Commits

Author SHA1 Message Date
erichkeane
7d8da04c26 [OpenACC] Implement 'nohost' construct AST/Sema
'nohost' is only valid on routine, and states that the compiler
shouldn't compile this routine for the host. It has no arguments, so no
checking is required besides putting it in the AST.
2025-03-06 12:50:49 -08:00
Kelvin Li
996092d5a5
[flang] probably convert Fortran logical to i1 in expanding hlfir.maxloc/hlfir.minloc opcodes (#129791)
If mask is a scalar, it always converts to !fir.box<!fir.array<1xi1>>.
The wrong value may be picked up when passing to the function
on the big endian platform. This patch is to do the conversion 
based on the original type of the mask and convert the value to 
i1 after the load.
2025-03-06 15:47:44 -05:00
Evgenii Kudriashov
5b9e1a5758
[X86][AsmParser] Improve rel8 validation (#126073)
* Check the size of immediate operand of rel8
* Rename AbsMem16 related names to AbsMemMode16 to disambiguate mem size
and mode checks.
2025-03-06 21:45:16 +01:00
Marcus Boay
50219c8af2
[PowerPC] [NFC] Refine PowerPC GISel files according to clang-tidy checks (#129780)
Code cleanup for PowerPC GISel files such as renaming header guards and
removing unused includes.
2025-03-06 15:38:12 -05:00
Paige Lewis
1073a23ca0
Updating variable names (#130136)
Updating variable names within the SystemZAsmParser to comply with
naming conventions.

Co-authored-by: Paige Lewis <paige.lewis@ibm.com>
2025-03-06 15:31:32 -05:00
Florian Hahn
72376e19df
[VPlan] Remove unused VPWidenIntrinsicRecipe constructor (NFC) 2025-03-06 20:24:30 +00:00
erichkeane
1b75b9e665 [OpenACC] Handle sema for gang, worker, vector, seq clauses on routine
These 4 clauses are mutually exclusive, AND require at least one of
them. Additionally, gang has some additional restrictions in that only
the 'dim' specifier is permitted. This patch implements all of this, and
ends up refactoring the handling of each of these clauses for
readabililty.
2025-03-06 11:53:46 -08:00
Ramkumar Ramachandra
c9e250af8e
[LoopUtils] Rename a var in addDiffRuntimeChecks (NFC) (#130128) 2025-03-06 19:31:18 +00:00
Ramkumar Ramachandra
ddffb74afd
[LV] Strip unreachable SCEV-check blocks (#130079)
emitSCEVChecks checks if SCEVCheckCond matches zero, and returns
nullptr. However, it sets SCEVCheckCond as used before it does this,
which prevents it from being removed during cleanup, resulting in
unreachable blocks being emitted. Fix this.
2025-03-06 19:30:25 +00:00
Ramkumar Ramachandra
00f3089c2e
[LV] Use PatternMatch in emitTransformedIndex (NFC) (#130081) 2025-03-06 19:23:31 +00:00
Peter Collingbourne
d58c793673
Pass: Do not use llvm::array_pod_sort to sort OpPassManagers.
OpPassManager contains a field of type std::unique_ptr which
is not guaranteed to be trivially relocatable so we cannot use
llvm::array_pod_sort.

Reviewers: River707, joker-eph

Reviewed By: joker-eph

Pull Request: https://github.com/llvm/llvm-project/pull/129968
2025-03-06 11:20:23 -08:00
Mircea Trofin
5f70ed5bda
[nfc] Small fixups (coding style) post- PR #129626 (#129935) 2025-03-06 10:58:14 -08:00
Michael Jones
1df59b3817
[libc][bazel] Add targets for float16 math (#129965)
Add targets for some float16 math functions that were missing them, but
mostly add targets for the smoke tests.
2025-03-06 10:46:20 -08:00
Dmitry Sidorov
7a44ff13d9
[SPIR-V] Add SPV_INTEL_memory_access_aliasing extension (#129800)
Spec can be found here https://github.com/intel/llvm/pull/15225
 TODO for future patches:
- During spec review need to decide whether only FunctionCall or Atomic
instructions can be decorated and if not - move the code around adding
handling for other instructions;
- Handle optional string metadata;
- Handle LLVM atomic instructions;
- Handle SPIR-V friendly atomic calls returning via sret argument.

Signed-off-by: Sidorov, Dmitry <dmitry.sidorov@intel.com>
2025-03-06 19:44:21 +01:00
Aiden Grossman
0ce4b685d2
[Github] Prefer ubuntu-24.04 over ubuntu-latest (#129936)
This patch replaces all instances of ubuntu-latest with ubuntu-24.04
(outside of the entries in libc++) based on the guidelines in the LLVM
CI best practices doc (https://llvm.org/docs/CIBestPractices.html).
2025-03-06 10:32:02 -08:00
Aiden Grossman
a17a155081
[Github][libc++] Prefer ubuntu-24.04 over ubuntu-latest (#129949)
This patch replaces all instances of ubuntu-latest with ubuntu-24.04
based on the guidelines in the LLVM CI best practices doc
(https://llvm.org/docs/CIBestPractices.html).
2025-03-06 10:31:43 -08:00
PiJoules
1a09adae9f
[libc] Add link to stdfix.h on headers page (#129138)
Co-authored-by: Petr Hosek <phosek@google.com>
2025-03-06 10:31:26 -08:00
Kunwar Grover
d10dca6ba7
[mlir][Vector] Move vector.insert canonicalizers for DenseElementsAttr to folders (#128040)
This PR moves vector.insert canonicalizers for DenseElementsAttr (splat
and non splat case) to folders. Folders are local, and it's always
better to implement a folder than a canonicalizer.

This PR is mostly NFC-ish, because the functionality mostly remains
same, but is now run as part of a folder, which is why some tests are
changed, because GreedyPatternRewriter tries to fold by default.
2025-03-06 18:24:38 +00:00
Andrzej Warzyński
6701669835
[mlir][vector][nfc] Replace failure() with notifyMatchFailure() (#129278)
Updates some instances of plain `return failure();` in VectorToSCF.cpp
with `return notifyMatchFailure();` and a description (usually copied
from the nearby comment).

There's many more "plain" `return failure();` left, but ATM I only
have the cycles for the ones updated here.
2025-03-06 18:22:46 +00:00
Michael Liao
d01a06b844 [clang][test] Fix shared build after Module Triple change. NFC 2025-03-06 13:20:06 -05:00
Morris Hafner
710de09f17
[CIR] Upstream global variable linkage types (#129072)
This change implements variable linkage types in ClangIR except for
common linkage which requires Comdat support.

---------

Co-authored-by: Morris Hafner <mhafner@nvidia.com>
Co-authored-by: Henrich Lauko <xlauko@mail.muni.cz>
2025-03-06 10:17:58 -08:00
Zequan Wu
0efaad00a9 Revert "[LLD][COFF] Support CF guards on ARM64X (#128440)"
This reverts commit 14bab65cbfb2bf9a410c3ce206a6b7a273441f26.
It causes lld-link to crash, posted repro at https://github.com/llvm/llvm-project/pull/128440#issuecomment-2702493683.
2025-03-06 10:13:30 -08:00
Alexey Bataev
4959025bbc [SLP]Fix non-determinism in reused elements analysis
Need to use consistent storages for unique elements, when going to
iterate over them to avoid non-determinism in reused elements analysis.

Fixes #130082
2025-03-06 10:12:49 -08:00
Tom Honermann
a907246fb2
[Clang][Docs][NFC] Correct documentation for the CPATH environment variable (#129113)
Clang's prior documentation for the `CPATH` environment variable stated that
paths it specifies are added as system header search paths. The actual behavior
is that such paths are treated as though they were passed via `-I` options at
the end of the driver command line and are thus added as non-system (user)
header search paths.

The documentation additionally claimed that empty path entries in the `CPATH`
environment variable are ignored. This was also incorrect; Clang treats empty
entries as nominating the compiler's current working directory; as though `.`
was specified.

Clang's behavior is consistent with gcc as documented at
https://gcc.gnu.org/onlinedocs/gcc/Environment-Variables.html#index-CPATH.

This change aligns Clang's documentation with the behavior actually observed.
Additional editorial changes are included to clarify that the related
`C_INCLUDE_PATH`, `CPLUS_INCLUDE_PATH`, `OBJC_INCLUDE_PATH`, and
`OBJCPLUS_INCLUDE_PATH` environment variables specify additional paths that
are treated as system header search paths (in contrast to `CPATH`).

Fixes issue #49742.
2025-03-06 13:01:30 -05:00
Matheus Izvekov
a24523ac8d
[clang] Implement instantiation context note for checking template parameters (#126088)
Instead of manually adding a note pointing to the relevant template
parameter to every relevant error, which is very easy to miss, this
patch adds a new instantiation context note, so that this can work using
RAII magic.

This fixes a bunch of places where these notes were missing, and is more
future-proof.

Some diagnostics are reworked to make better use of this note:
- Errors about missing template arguments now refer to the parameter
which is missing an argument.
- Template Template parameter mismatches now refer to template
parameters as parameters instead of arguments.

It's likely this will add the note to some diagnostics where the
parameter is not super relevant, but this can be reworked with time and
the decrease in maintenance burden makes up for it.

This bypasses the templight dumper for the new context entry, as the
tests are very hard to update.

This depends on #125453, which is needed to avoid losing the context
note for errors occuring during template argument deduction.
2025-03-06 14:58:42 -03:00
Janek van Oirschot
37aad2c119
[AMDGPU][NFC] Update premerged test from #129703 to reflect upstream (#130154) 2025-03-06 17:58:23 +00:00
Amr Hesham
9ecb0f58eb
[Clang][diagnostics] Improve the diagnostics for chained comparisons (#129285)
Improve the diagnostics for chained comparisons to report actual
expressions and operators

Fixes #129069
2025-03-06 18:55:18 +01:00
erichkeane
52552ce53b Reapply "[NFC] Change the return type of getTraversalScope to ArrayRef"
vitalybuka identified a fix here that fixes the issue, and lets us make
fewer copies!  This applies his patch plus reapplys the original.

This reverts commit c4c29b95a6e6809017e71e85f33faecfe85d88b2.
2025-03-06 09:43:37 -08:00
erichkeane
c4c29b95a6 Revert "[NFC] Change the return type of getTraversalScope to ArrayRef"
This reverts commit 9189d84abbfc643db0053200c1c2e16b1e78e8f9.

ASan catches that someone actually DOES modify the collection somewhere
it looks.
2025-03-06 09:32:01 -08:00
Daniel Paoliello
16e051f0b9
[win] NFC: Rename EHCatchret to EHCont to allow for EH Continuation targets that aren't catchret instructions (#129953)
This change splits out the renaming and comment updates from #129612 as a non-functional change.
2025-03-06 09:28:44 -08:00
A. Jiang
ba9aeedf8e
[libc++] Implement part of P2562R1: constexpr ranges::stable_sort (#128860)
Drive-by: Enables test coverage for `ranges::stable_sort` with proxy
iterators, and changes "constexpr in" to "constexpr since" in comments
in `<algorithm>`.
2025-03-07 01:27:48 +08:00
Craig Topper
6e2fd4b269 [ScheduleDAGInstrs] Use Register. NFC 2025-03-06 09:18:26 -08:00
apple-fcloutier
c628e8e9ea
[clang] Fix FP -Wformat in functions with 2+ attribute((format)) (#129954)
When defining functions with two or more format attributes, if the
format strings don't have the same format family, there is a false
positive warning that the incorrect kind of format string is being
passed at forwarded format string call sites.

This happens because we check that the format string family of each
format attribute is compatible before we check that we're using the
associated format parameter. The fix is to move the check down one
scope, after we've established that we are checking the right parameter.

Tests are updated to include a true negative and a true positive of this
situation.
2025-03-06 09:12:22 -08:00
Craig Topper
81089f0fd1 [CodeGen] Use Register::id(). NFC 2025-03-06 09:08:21 -08:00
Craig Topper
bdf50f0292 [CodeGen] Use Register or MCRegister. NFC 2025-03-06 09:08:21 -08:00
Craig Topper
d0b8f5d8b3 [RegisterBankInfo] Use MCRegister instead of Register for getMinimalPhysRegClass. NFC 2025-03-06 09:07:53 -08:00
Craig Topper
68b1fe8628 [LivePhysRegs] Use MCRegister instead of MCPhysReg in interface. NFC 2025-03-06 09:07:53 -08:00
Luke Lau
6d89c042e3
[VPlan] Remove dead AnyOf reduction case in VPReductionRecipe. NFCI (#130048)
From what I understand, we only create VPReductionRecipes for in-loop
reductions, and we don't currently support in-loop AnyOf reductions.

We only create VPReductionRecipes in the !PhiR->isInLoop() section of
adjustRecipesForReductions, and this comment from the initial patch
seems to confirm this
https://reviews.llvm.org/D108136#anchor-inline-1038338, so I think we
can remove this check in the condition logic.

I checked compiling SPEC 2017 with -prefer-inloop-predicates and the
added assertion doesn't trigger.
2025-03-07 01:05:53 +08:00
Janek van Oirschot
cc98b35d0d
[AMDGPU] Masked load vectortype test (#129703) 2025-03-06 17:02:07 +00:00
Alexey Bataev
31845cf06c Revert "[SLP]Fix non-determinism in reused elements analysis"
This reverts commit 3158525afdc3677457712963ef45c83f4f8f900f to fix
a bug revealed in https://lab.llvm.org/buildbot/#/builders/123/builds/14930
2025-03-06 08:59:08 -08:00
erichkeane
93b022944c [OpenACC] fix 'loop' restriction of auto/seq/independent
We previously allowed duplicates of auto/seq/independent on a 'loop'
construct. This is disallowed by the restriction (which says exactly one
    of...), so this patch ensures they are disallowed.
2025-03-06 08:55:32 -08:00
Alexey Bataev
3158525afd [SLP]Fix non-determinism in reused elements analysis
Need to use consistent storages for unique elements, when going to
iterate over them to avoid non-determinism in reused elements analysis.

Fixes #130082
2025-03-06 08:51:31 -08:00
Kazu Hirata
92dfc0ffc3
[llvm-jitlink] Avoid repeated hash lookups (NFC) (#129993) 2025-03-06 08:50:21 -08:00
Kazu Hirata
abcab4f7ba
[llvm-dwarfdump] Avoid repeated hash lookups (NFC) (#129991) 2025-03-06 08:50:00 -08:00
Kazu Hirata
afe14bb0e4
[Utils] Avoid repeated hash lookups (NFC) (#129990) 2025-03-06 08:49:36 -08:00
Kazu Hirata
0222b5544e
[IPO] Avoid repeated hash lookups (NFC) (#129987) 2025-03-06 08:49:11 -08:00
Valentin Clement (バレンタイン クレメン)
c8898b09f9
[flang][rt] Use allocator registry to allocate the pointer payload (#129992)
pointer allocation is done through `AllocateValidatedPointerPayload`.
This function was not updated to use the registered allocators in the
descriptor to perform the allocation. This patch makes use of the
allocator.
The footer word is not set and not checked for allocator other than the
default one. The support will likely come in a follow up patch but this
will necessitate more functions to be registered to be able to set and
get the footer value when the allocation in on the device.
2025-03-06 08:47:27 -08:00
Hongren Zheng
5ae19fad3f
[mlir] Allow trailing digit for alias in AsmPrinter (#127993)
When generating aliases from `OpAsm{Dialect,Type,Attr}Interface`, the
result would be sanitized and if the alias provided by the interface has
a trailing digit, AsmPrinter would attach an underscore to it to
presumably prevent confliction.

#### Motivation

There are two reasons to motivate the change from the old behavior to
the proposed behavior

1. If the type/attribute can generate unique alias from its content,
then the extra trailing underscore added by AsmPrinter will be strange

```mlir
  func.func @add(%ct: !ct_L0_) -> !ct_L0_
    %ct_0 = bgv.add %ct, %ct : (!ct_L0_, !ct_L0_) -> !ct_L0_
    %ct_1 = bgv.add %ct_0, %ct_0 : (!ct_L0_, !ct_L0_) -> !ct_L0_
    %ct_2 = bgv.add %ct_1, %ct_1 : (!ct_L0_, !ct_L0_) -> !ct_L0_
    return %ct_2 : !ct_L0_
  }
```

Which aesthetically would be better if we have `(!ct_L0, !ct_L0) ->
!ct_L0`

2. The Value name behavior is that, for the first instance, use no
suffix `_N`, which can be similarly applied to alias name. See the IR
above where the first one is called `%ct` and others are called `%ct_N`.
See `uniqueValueName` for detail.

#### Conflict detection


```mlir
!test.type<a = 3> // suggest !name0
!test.type<a = 4> // suggest !name0
!test.another<b = 3> // suggest !name0_
!test.another<b = 4> // suggest !name0_
```

The conflict detection is based on `nameCounts` in `initializeAliases`,
where

In the original way, the first two will get sanitized to `!name0_` and
`initializeAlias` can assign unique id `0, 1, 2, 3` to them.

In the current way, the `initializeAlias` uses `usedAliases` to track
which name has been used, and use such information to generate a suffix
id that will make the printed alias name unique.

The result for the above example is `!name0, !name0_1, !name0_,
!name0_2` now.
2025-03-07 00:35:00 +08:00
Augie Fackler
35842f354e [bazel] add missing another missing dep in mlir 2025-03-06 11:33:19 -05:00
Matt Arsenault
15ba2ce7ac
InferAddressSpaces: Replace undef with poison in tests (#130083) 2025-03-06 23:20:46 +07:00