525695 Commits

Author SHA1 Message Date
Alex Bradbury
8fcb1263f4
[PreISelIntrinsicLowering] Produce a memset_pattern16 libcall for llvm.experimental.memset.pattern when available (#120420)
This is to enable a transition of LoopIdiomRecognize to selecting the
llvm.experimental.memset.pattern intrinsic as requested in #118632 (as
opposed to supporting selection of the libcall or the intrinsic). As
such, although it _is_ a TODO to add costing considerations on whether
to lower to the libcall (when available) or expand directly, lacking
such logic is helpful at this stage in order to minimise any unexpected
code gen changes in this transition.
2025-01-30 07:12:53 +00:00
Craig Topper
dd3edc8365
[CodeGen] Add Register::stackSlotIndex(). Replace uses of Register::stackSlot2Index. NFC (#125028) 2025-01-29 23:02:07 -08:00
Nathan Ridge
7fd84264ed
[clang][Sema] Handle pointer and reference type more robustly in HeuristicResolver::resolveMemberExpr() (#124451)
Fixes https://github.com/llvm/llvm-project/issues/124450
2025-01-30 01:54:30 -05:00
Thurston Dang
928cad49be
Revert "[ubsan] Connect -fsanitize-skip-hot-cutoff to LowerAllowCheckPass<cutoffs>" (#125032)
Reverts llvm/llvm-project#124857 due to buildbot breakage
(https://lab.llvm.org/buildbot/#/builders/46/builds/11310)
2025-01-29 22:03:05 -08:00
Nico Weber
fd94c85122 [gn] port c4a019747c98 more
c4a019747c98 did a great job updating the GN build files, but it
missed this one detail.
2025-01-29 21:47:35 -08:00
Jordan Rupprecht
31fa4e0b32
[bazel] Port cdc09a118a7107b8e13ba5a254d3d794f51f9818 (#125030) 2025-01-29 23:43:42 -06:00
Srinivasa Ravi
ab9e447fb1
[MLIR][NVVM] Add support for mapa MLIR Ops (#124514)
Adds `mapa` and `mapa.shared.cluster` MLIR Ops to generate mapa
instructions.

`mapa` - Map the address of the shared variable in the target CTA.

- `mapa` - source is a register containing generic address pointing to
shared memory.
- `mapa.shared.cluster` - source is a shared memory variable or a
register containing a valid shared memory address.

PTX Spec Reference:

https://docs.nvidia.com/cuda/parallel-thread-execution/#data-movement-and-conversion-instructions-mapa
2025-01-30 11:05:12 +05:30
Carl Ritson
1f38d38d54 [AMDGPU] Fix documentation table formatting from #118750 (NFC) 2025-01-30 14:27:25 +09:00
Jordan Rupprecht
f50ca2e8a6
[bazel] Remove more references to ARCMigrate (#125027)
c4a019747c98ad9326a675d3cb5a70311ba170a2 removed arc_migrate targets but
accidentally left a few references to the now deleted target. Remove
those.
2025-01-29 23:25:48 -06:00
Thurston Dang
dccd271127
[ubsan] Connect -fsanitize-skip-hot-cutoff to LowerAllowCheckPass<cutoffs> (#124857)
This adds the plumbing between -fsanitize-skip-hot-cutoff (introduced in
https://github.com/llvm/llvm-project/pull/121619) and
LowerAllowCheckPass<cutoffs> (introduced in
https://github.com/llvm/llvm-project/pull/124211).
    
The net effect is that -fsanitize-skip-hot-cutoff now combines the
functionality of -ubsan-guard-checks and
-lower-allow-check-percentile-cutoff (though this patch does not remove
those yet), and generalizes the latter to allow per-sanitizer cutoffs.
    
Note: this patch replaces Intrinsic::allow_ubsan_check's
SanitizerHandler parameter with SanitizerOrdinal; this is necessary
because the hot cutoffs are specified in terms of SanitizerOrdinal
(e.g., null, alignment), not SanitizerHandler (e.g., TypeMismatch).
Likewise, CodeGenFunction::EmitCheck is changed to emit
allow_ubsan_check() for each individual check.

---------

Co-authored-by: Vitaly Buka <vitalybuka@gmail.com>
Co-authored-by: Vitaly Buka <vitalybuka@google.com>
2025-01-29 21:03:26 -08:00
Sebastian Pop
4b2d615774
[DA] use alias analysis cross iteration mode (#116628)
This patch fixes two bugs:
https://github.com/llvm/llvm-project/issues/41488
https://github.com/llvm/llvm-project/issues/53942

The dependence analysis assumes that the base address of array accesses
is invariant across loop iterations. In both bugs the base address
evolves following loop iterations: the base address flip-flops between
two different memory objects.

The patch uses the cross iteration mode of alias analysis to disambiguate the
base objects.
2025-01-29 22:53:24 -06:00
Sirraide
c4a019747c
[Clang] Remove ARCMigrate (#119269)
In the discussion around #116792, @rjmccall mentioned that ARCMigrate
has been obsoleted and that we could go ahead and remove it from Clang,
so this patch does just that.
2025-01-30 05:32:25 +01:00
Akshat Oke
11026a8d8b
[CodeGen][NewPM] Preserve all MF analyses in MFPM (#124707)
Invalidation is already handled in the passes loop for MFAM, so all of
the rest analyses are preserved. (See `PassManager::run()`)

This won't change the number of invalidations, but will prevent needless
`MFAM::Invalidator::invalidate()` invocations made by results depending
on other results (since the invalidate shorts if `<AllAnalysesOn<MF>>`
is preserved)
2025-01-30 10:01:58 +05:30
Matt Arsenault
1cbfac04d0
SystemZ: Handle copies between gr64 and fp64 (#124890)
I'm guessing based on tablegen definitions. I also don't
really understand how this could have been missing.

This defends against regressions in a future peephole-opt
patch.
2025-01-30 11:08:08 +07:00
Matt Arsenault
6017480461
MachineVerifier: Fix check for range type (#124894)
We need to permit scalar extending loads with range annotations.

Fix expensive_checks failures after 11db7fb09b36e656a801117d6a2492133e9c2e46
2025-01-30 10:56:12 +07:00
Matt Arsenault
97a1f494a6
DAG: Avoid breaking legal vector_shuffle with multiple uses (#123712)
Previously this combine would undo AMDGPU's new custom legalization of
wide vector shuffles into 2 element pieces. The comment also
states that this combine is only done before legalization,
but the case with a build_vector source was unconditional.

We probably don't want to do this if the multiple uses are full
scalarization of the vector, but this seems to work well enough.
Scalarizing extracts should have folded out pre-legalize.
2025-01-30 10:55:21 +07:00
Teresa Johnson
edb7f6c0da
[MemProf] Add more assertion checking to the edge removal helper (#125017)
Check a few unexpected cases (edge already removed, edge not in its
caller or callee edge lists).
2025-01-29 19:23:35 -08:00
LLVM GN Syncbot
1fdf3340fb [gn build] Port d6524c8dfa37 2025-01-30 02:49:25 +00:00
Lang Hames
b1bd73700a [ORC] Add missing files from d6524c8dfa3. 2025-01-30 13:48:08 +11:00
Lang Hames
d6524c8dfa Reapply "[ORC] Enable JIT support for the compact-unwind frame..." with fixes.
This reapplies 4f0325873fa (and follow up patches 26fc07d5d88, a001cc0e6cdc,
c9bc242e387, and fd174f0ff3e), which were reverted in 212cdc9a377 to
investigate bot failures (e.g.
https://lab.llvm.org/buildbot/#/builders/108/builds/8502)

The fix to address the bot failures was landed in d0052ebbe2e. This patch also
restricts construction of the UnwindInfoManager object to Apple platforms (as
it won't be used on other platforms).
2025-01-30 13:42:10 +11:00
LLVM GN Syncbot
1fcba94add [gn build] Port a3a3e6997bd7 2025-01-30 02:29:17 +00:00
Vitaly Buka
751ae26b95 [asan][android] XFAIL suppressions-alloc-dealloc-mismatch
Android is missing suppression file on device.

Follow up to #124197.
2025-01-29 18:24:43 -08:00
Teresa Johnson
6c3bf34114
[MemProf] Fix summary identification for imported locals (#124659)
When we apply cloning decisions in the ThinLTO backend, we need to find
the corresponding summary for each function in the IR, and in some cases
for callee functions. This is complicated when the function was a
promoted local, in which case the GUID was formed from the hash of the
original source file prepended to the function name. Those functions
can be identified by the fact that they were given a ".llvm." suffix
during promotion.

We previously didn't do this correctly for promoted locals imported from
other modules, as we only tried the current module source name. This led
to crashes, in particular when the current module also had an local
function of the same original name. In particular, we were attempting to
iterate through the wrong summary's callsites, and there were fewer than
in the actual function so we accessed data off the end (in a release
build with assertion checking off - with assertion checking on we double
check the stack ids and that would have failed). Even if we hadn't
crashed or hit an assert, we could have applied the wrong cloning
decisions, leading to unsats at link time.

Luckily, function importing attaches thinlto_src_file metadata
containing the original source file name to all imported functions. It
normally doesn't do this by default, however, it always does if MemProf
context disambiguation is enabled. Therefore, we can just look to see if
the function contains this metadata and if so use it to recreate the
original GUID.

A similar issue can occur when looking for the ValueInfo / GUID of
a direct tail call to see if we synthesized a callsite record for a
missing tail call frame. In that case, the callee function may be a
declaration, if we imported its caller but not the callee function
definition. Because imported declarations don't get the thinlto_src_file
metadata, we instead look at its caller (which works because this
happens very early in the backend before any inlining).
2025-01-29 18:22:14 -08:00
Carl Ritson
a3a3e6997b
[AMDGPU] Rewrite GFX12 SGPR hazard handling to dedicated pass (#118750)
- Algorithm operates over whole IR to attempt to minimize waits.
- Add support for VALU->VALU SGPR hazards via VA_SDST/VA_VCC.
2025-01-30 11:21:11 +09:00
Brad Smith
59613ac237
Revert "[asan] Enable wait4 test on Android" (#125011)
Reverts llvm/llvm-project#124879
2025-01-29 20:34:24 -05:00
Kelvin Li
a8d4335ee0
[flang][AIX] Handle more trig functions with complex argument to have consistent results in folding (#124203)
This patch extends 71d4f34 to all trig functions that take complex
arguments. On AIX, the `libm` routines are called in compile time
folding instead of the STL routines.
2025-01-29 20:26:39 -05:00
Matheus Izvekov
00c096e604
[clang] StmtPrinter: Handle DeclRefExpr to a Decomposition (#125001)
A DeclRefExpr could never refer to a Decomposition in valid C++ code,
but somehow the Analyzer creates these entities and then it tries to
print them.

There is no sensible answer here, so we print 'decomposition' followed
by the names of all of its bindings, separated by dashes.
2025-01-29 21:58:55 -03:00
Yingwei Zheng
3c6aa04cf4
[CodeGenPrepare] Replace deleted ext instr with the promoted value. (#71058)
This PR replaces the deleted ext with the promoted value in `AddrMode`.
Fixes #70938.
2025-01-30 08:58:23 +08:00
Maksim Panchenko
69c24684f6
[BOLT] Fix test. NFC (#124851)
Keep output files different for multiple tool invocations. Otherwise, it
causes issues with our internal testing infra.
2025-01-29 16:57:49 -08:00
Tom Stellard
b32e55df24
workflows/release-binaries: Stop using ccache (#124415)
Using ccache relies on the GitHub Actions Cache, which may be
susceptible to cache poisoning. See
https://adnanthekhan.com/2024/05/06/the-monsters-in-your-build-cache-github-actions-cache-poisoning/

Even though these attacks may be difficult, it's better to err on the
side of caution and ensure that the build environment for our releases
is as isolated as possible. Additionally, ccache was only being used for
the stage1 build, which is a small part of the overall build, so the
speed up from using it was not that large.
2025-01-29 16:51:19 -08:00
Krzysztof Drewniak
cdc09a118a
[mlir][IntRangeInference] Infer values for {memref,tensor}.dim (#122945)
Implement the integer range inference niterface for memref.dim and
tetnor.dim using shared code. The inference will infer the `dim` of
dynamic dimensions to [0, index_max] and take the union of all the
dimensions that the `dim` argument could be validly referring to.
2025-01-29 18:43:53 -06:00
Alex MacLean
de7438e472
[NVPTX] Auto-Upgrade some nvvm.annotations to attributes (#119261)
Add a new AutoUpgrade function to convert some legacy nvvm.annotations
metadata to function level attributes. These attributes are quicker to
look-up so improve compile time and are more idiomatic than using
metadata which should not include required information that changes the
meaning of the program.

Currently supported annotations are:

- !"kernel" -> ptx_kernel calling convention
- !"align" -> alignstack parameter attributes (return not yet supported)
2025-01-29 16:27:27 -08:00
Ben Langmuir
f0d05b099d
[asan][test] Attempt to fix suppressions-alloc-dealloc-mismatch.cpp on Darwin (#124987)
Add %env_asan_opts=alloc_dealloc_mismatch=1 since it is disabled by
default.

rdar://143830493
2025-01-29 16:07:15 -08:00
vporpo
e094c0fa67
[SandboxVec][Legality] Don't vectorize when instructions repeat (#124479)
This patch adds a legality check that checks for repeated instrs in a
bundle and won't vectorize if such pattern is found.
2025-01-29 15:54:15 -08:00
gulfemsavrun
62f6d637c0
[libc++] Add clang-21 to failing tests on Windows (#124955)
After we switched to LLVM version 21, some libc++ tests started failing
on Windows. This patch adds the clang-21 condition to XFAIL to fix the
issue.
2025-01-29 14:55:32 -08:00
Prabhuk
fdd4e9f101
[clang] UEFI handle unsupported triples. (#124824)
The only architecture currently being supported (still a WIP) is
x86_64. Other UEFI triples targeting other architectures will now
report an `unknown target triple` error.
2025-01-29 14:42:29 -08:00
Kazu Hirata
774b12c4a0
[memprof] Initialize AllocInfoIter and CallSitesIter (NFC) (#124972)
This patch initializes AllocInfoIter and CallSitesIter to their
respective end().  I'm doing this not because I'm worried about
uninitialized iterators, but because the resulting code looks shorter
and makes it clear which data structure each iterator is associated
with.
2025-01-29 14:31:00 -08:00
Teresa Johnson
8a86e6aefe
[MemProf] Constify a couple of methods used during cloning (#124994)
This also helps ensure we don't inadvartently create map entries
by forcing use of at() instead of operator[].
2025-01-29 14:18:11 -08:00
Simon Pilgrim
5921295dca
Revert "[SLP] getSpillCost - fully populate IntrinsicCostAttributes to improve cost analysis." (#124962)
Reverts llvm/llvm-project#124129 as its currently causing a regression at #124499 - avoids the regression until a proper fix can be added to getSpillCost
2025-01-29 22:17:53 +00:00
Sebastian Pop
4479a2273a
[DA] add testcase (#116631)
Make sure the testcase for this bug continues to work:
https://github.com/llvm/llvm-project/issues/31196
2025-01-29 16:10:21 -06:00
Jerry-Ge
956c0707d9
[mlir][tosa] Change the start and size of slice to tosa shape type (#124209)
Update to use getConstShapeValue to collect shape information along the
graph.

Change-Id: Ic6fc2341e3bcfbec06a1d08986e26dd08573bd9c

Co-authored-by: TatWai Chong <tatwai.chong@arm.com>
2025-01-29 13:43:35 -08:00
Sebastian Pop
46f9cddfd7
[DA] enable update_analyze_test_checks.py (#123435)
Modify the DA pretty printer to match the output of other analysis
passes. This enables update_analyze_test_checks.py to also work on DA
tests. Auto generate all the Dependence Analysis tests.
2025-01-29 15:40:22 -06:00
quic-areg
61ea63baaf
[Hexagon] Add support for decoding PLT symbols (#123425)
Describes PLT entries for hexagon.
2025-01-29 15:37:23 -06:00
Valentin Clement (バレンタイン クレメン)
ab1ee912be
[flang][cuda] Remove the need of special compile definition for CUFInit (#124965)
This patch addresses post commit review comments from #124859. 

The extra compile definition is not necessary and goes against the
effort to separate the runtimes from the flang compiler itself. The
function declaration for `CUFInit` can be accessed anyway since the
header are always present. The insertion of the call is only based on
the language feature options from the folding context.

A program compiled with cuda enabled but no cufruntime would just fail
at link time as expected.
2025-01-29 13:12:04 -08:00
Krzysztof Parzyszek
15ab7be2e0
[flang][OpenMP] Parse WHEN, OTHERWISE, MATCH clauses plus METADIRECTIVE (#121817)
Parse METADIRECTIVE as a standalone executable directive at the moment.
This will allow testing the parser code.

There is no lowering, not even clause conversion yet. There is also no
verification of the allowed values for trait sets, trait properties.
2025-01-29 15:07:20 -06:00
Jason Rice
abc8812df0
[Clang][P1061] Add stuctured binding packs (#121417)
This is an implementation of P1061 Structure Bindings Introduce a Pack
without the ability to use packs outside of templates. There is a couple
of ways the AST could have been sliced so let me know what you think.
The only part of this change that I am unsure of is the
serialization/deserialization stuff. I followed the implementation of
other Exprs, but I do not really know how it is tested. Thank you for
your time considering this.

---------

Co-authored-by: Yanzuo Liu <zwuis@outlook.com>
2025-01-29 21:43:52 +01:00
Nikolas Klauser
608012ace4
[libc++] Simplify the implementation of iostream.cpp (#124103)
This refactors the standard stream implementation in multiple ways:
- The streams are now `stream_data` structs, which contain all the data
required for a stream
- The windows mangling is generated via a macro instead of having magic
strings for the different streams. (i.e. it's now only partially magic)
2025-01-29 21:24:58 +01:00
Matheus Izvekov
07a0e2be86
[clang] Track function template instantiation from definition (#112241)
This fixes instantiation of definition for friend function templates,
when the declaration found and the one containing the definition have
different template contexts.

In these cases, the the function declaration corresponding to the
definition is not available; it may not even be instantiated at all.

So this patch adds a bit which tracks which function template
declaration was instantiated from the member template. It's used to find
which primary template serves as a context for the purpose of
obtainining the template arguments needed to instantiate the definition.

Fixes #55509

Relanding patch, with no changes, after it was reverted due to revert of
commit this patch depended on.
2025-01-29 17:23:36 -03:00
lntue
bcf306e0eb
[libc] Update include directory for libcMPCWrapper target when LIBC_MPC_INSTALL_PATH is set. (#124810) 2025-01-29 15:19:25 -05:00
QuietMisdreavus
a368402d63
[ExtractAPI] merge anon declarators even if they're array types (#120801) 2025-01-29 13:03:33 -07:00