527289 Commits

Author SHA1 Message Date
Kazu Hirata
31c4d17fbc [ExecutionEngine] Fix formatting (NFC) 2025-02-11 16:06:29 -08:00
Kazu Hirata
b72079e75d [ExecutionEngine] Fix a warning
This patch fixes:

  llvm/lib/ExecutionEngine/Orc/TargetProcess/UnwindInfoManager.cpp:53:20:
  error: unused variable 'AddFnName' [-Werror,-Wunused-variable]
2025-02-11 15:54:24 -08:00
Arda Unal
36d8e7056e
[mlir] Enable LICM for ops with only read side effects in scf.for (#120302)
Enable ops with only read side effects in scf.for to be hoisted with a
scf.if guard that checks against the trip count

This patch takes a step towards a less conservative LICM in MLIR as
discussed in the following discourse thread:

[Speculative LICM?](https://discourse.llvm.org/t/speculative-licm/80977)

This patch in particular does the following:

1. Relaxes the original constraint for hoisting that only hoists ops
without any side effects. This patch also allows the ops with only read
side effects to be hoisted into an scf.if guard only if every op in the
loop or its nested regions is side-effect free or has only read side
effects. This scf.if guard wraps the original scf.for and checks for
**trip_count > 0**.
2. To support this, two new interface methods are added to
**LoopLikeInterface**: _wrapInTripCountCheck_ and
_unwrapTripCountCheck_. Implementation starts with wrapping the scf.for
loop into scf.if guard using _wrapInTripCountCheck_ and if there is no
op hoisted into the this guard after we are done processing the
worklist, it unwraps the guard by calling _unwrapTripCountCheck_.
2025-02-11 15:48:57 -08:00
Philip Reames
a6a5507e36 Revert "[RISCV] Allow undef prefix for local repeating VLA shuffle lowering (#126097)"
This reverts commit ab0006ddba3e977c44e1e761909e09603816b32c.  It appears to have rebased badly during web merge.
2025-02-11 15:46:12 -08:00
Justin Fargnoli
022c9c9d3a
[NVPTX] Lower invalid ISD::ADDRSPACECAST (#125607)
Avoid [crashing](https://godbolt.org/z/8T58vcM68) when lowering
`addrspacecast ptr addrspace(<non-zero>) %ptr to ptr
addrspace(<non-zero>)`.
2025-02-11 15:36:07 -08:00
Philip Reames
ab0006ddba
[RISCV] Allow undef prefix for local repeating VLA shuffle lowering (#126097)
Implement the first TODO from #125735, and minorly cleanup code using
same style as the recently landed strict prefix case.
2025-02-11 15:30:36 -08:00
Florian Mayer
9f61a60c77 [NFC] [clang] fixed unused variable warning 2025-02-11 15:30:00 -08:00
lntue
17721b7b14
[libc][NFC] Remove DEFAULT_DOUBLE_SPLIT macro. (#126822) 2025-02-11 18:29:35 -05:00
Daniel Hoekwater
3a22cf9bd8
[CFIFixup] Fixup CFI for split functions with synchronous uwtables (#125299)
- **Precommit tests for synchronous uwtable CFI fixup**
- **[CFIFixup] Fixup CFI for split functions with synchronous uwtables**

Commit
6e54fccede
disables CFI fixup for
functions with synchronous tables, breaking CFI for split functions.
Instead, we can disable *block-level* CFI fixup for functions with
synchronous tables.

Unwind tables can be:
- N/A (not present)
- Asynchronous
- Synchronous

Functions without unwind tables don't need CFI fixup (since they don't
care about CFI).

Functions with asynchronous unwind tables must be accurate for each
basic block, so full CFI fixup is necessary.

Functions with synchronous unwind tables only need to be accurate for
each function (specifically, the portion of a function in a given
section). Disabling CFI fixup entirely for functions with synchronous
uwtables may break CFI for a function split between two sections. The
portion in the first section may have valid CFI, while the portion in
the second section is missing a call frame.

Ex:
```
(.text.hot)
Foo (BB1):
  <Call frame information>
  ...
BB2:
  ...

(.text.split)
BB3:
  ...
BB4:
  <epilogue>
```

Even if `Foo` has a synchronous unwind table, we still need to insert
call frame information into `BB3` so that unwinding the call stack from
`BB3` or `BB4` works properly.
2025-02-11 18:25:08 -05:00
Shoaib Meenai
376f65d865 Revert "[mlir] Silence -Wdangling-assignment-gsl in OperationSupport.h (#126140)"
This reverts commit f6556afce0aa5a72ef42103875101d975e810474.

Buildbots are broken.
2025-02-11 15:05:12 -08:00
Lang Hames
84fe1f63b0
[ORC] Switch to singleton pattern for UnwindInfoManager. (#126691)
The find-dynamic-unwind-info callback registration APIs in libunwind
limit the number of callbacks that can be registered. If we use multiple
UnwindInfoManager instances, each with their own own callback function
(as was the case prior to this patch) we can quickly exceed this limit
(see https://github.com/llvm/llvm-project/issues/126611).

This patch updates the UnwindInfoManager class to use a singleton
pattern, with the single instance shared between all LLVM JITs in the
process.

This change does _not_ apply to compact unwind info registered through
the ORC runtime (which currently installs its own callbacks).

As a bonus this change eliminates the need to load an IR "bouncer"
module to supply the unique callback for each instance, so support for
compact-unwind can be extended to the llvm-jitlink tools (which does not
support adding IR).
2025-02-12 10:00:10 +11:00
Philip Reames
8374d42186
[RISCV] Decompose single source shuffles (without exact VLEN) (#126108)
This is a continuation of the work started in #125735 to lower selected
VLA shuffles in linear m1 components instead of generating O(LMUL^2) or
O(LMUL*Log2(LMUL) high LMUL shuffles.

This pattern focuses on shuffles where all the elements being used
across the entire destination register group come from a single register
in the source register group. Such cases come up fairly frequently via
e.g. spread(N), and repeat(N) idioms.

One subtlety to this patch is the handling of the index vector for
vrgatherei16.vv. Because the index and source registers can have
different EEW, the index vector for the Nth chunk of the destination is
not guaranteed to be register aligned. In fact, it is common for e.g. an
EEW=64 shuffle to have EEW=16 indices which are four chunks per source
register. Given this, we have to pay a cost for extracting these chunks
into the low position before performing each shuffle.

I'd initially expressed this as a naive extract sub-vector for each data
parallel piece. However, at high LMUL, this quickly caused register
pressure problems since we could at worst need 4x the temporary
registers for the index. Instead, this patch uses a repeating slidedown
chained from previous iterations. This increases critical path by at
worst 3 slides (SEW=64 is the worst case), but reduces register pressure
to at worst 2x - and only if the original index vector is reused
elsewhere. I view this as arguably a bit of a workaround (since our
scheduling should have done better with the plain extract variant), but
a probably neccessary one.
2025-02-11 14:40:36 -08:00
Michael Jones
a760e7faac
[libc] create TimeReader to look at a struct tm (#126138)
In the process of adding strftime (#122556) I wrote this utility class
to simplify reading from a struct tm. It provides helper functions that
return basically everything needed by strftime. It's not tested
directly, but it is thoroughly exercised by the strftime tests.
2025-02-11 14:37:15 -08:00
Brox Chen
ad6cd7e8b2
[AMDGPU][True16][CodeGen] true16 codegen for MadFmaMixPat (#124892)
true16 codegen for MadFmaMixPat. GISEL test not enabled and will be
added later when GISEL is supported
2025-02-11 17:36:44 -05:00
lntue
fd41393e2e
[libc][math] Add float-only option for atan2f. (#122979)
For targets that have single precision FPU but not double precision FPU
such as Cortex M4, only using float-float in the intermediate
computations might reduce the code size compared to using double. In
this case, when the exact pass is skipped, the float-only option for
atan2f implemented in this PR reduces the code size of this function by
~1 KB compared to the double precision version.
2025-02-11 17:36:24 -05:00
Nathan Ridge
c7eb5204a6
[clang][HeuristicResolver] Track the expression whose type is being simplified after each step in simplifyType() (#126689)
Fixes https://github.com/llvm/llvm-project/issues/126536
2025-02-11 17:25:15 -05:00
Nick Desaulniers
0419db6b95
[libc][docgen] make note of sys/time.h interfaces removed in POSIX.1-2024 (#126612)
One of these days, we'll be able to specify time to a computer...

Also, POSIX can remove stuff all they want. Folks probably will continue to
depend on broken interfaces forever.

Link: #124654
Link: https://austingroupbugs.net/view.php?id=1330
2025-02-11 14:14:41 -08:00
Shoaib Meenai
f6556afce0
[mlir] Silence -Wdangling-assignment-gsl in OperationSupport.h (#126140)
This warning is causing lots of build spam when I use a recent Clang as
my host compiler. It's a potential false positive, so silence it until
https://github.com/llvm/llvm-project/issues/126600 is resolved.
Fix variable casing while I'm here.
2025-02-11 14:05:01 -08:00
vporpo
07600f80c7
[SandboxVec][Scheduler] Update ready list comparator (#126160)
This patch implements a hierarchical comparator for the ready list. PHIs
have higher priority than non-phis and terminators are always last.
2025-02-11 13:52:02 -08:00
Florian Mayer
ad905f133c [NFC] [clang] Use isa instead of dyn_cast 2025-02-11 13:42:31 -08:00
Alexey Bataev
10844fb9b0 [SLP]Fix attempt to build the reorder mask for non-adjusted reuse mask
When building the reorder for non-single use reuse mask, need to check
if the size of the mask is multiple of the number of unique scalars.
  Otherwise, the compiler may crash when trying to reorder nodes.

Fixes #126304
2025-02-11 13:41:25 -08:00
Andrzej Warzyński
fcbf04e40e
[mlir][vector][nfc] Add clarification on "dim-1" bcast (#125425)
Adds a small note to VectorOps.td on what "dim-1" broadcast is. Also
updates comments to consistently use quotes, i.e.

* "dim-1" broadcasting instead of dim-1 broadcasting.

This way it is clear that we are referring to "stretching" one of the
trailing dims rather than e.g. broadcasting a dim at idx 1.
2025-02-11 21:37:23 +00:00
Florian Mayer
b88b6a2b63
[clang] Assert the enum FPOpts and LangOpts fit into the storage (#126166)
Fix existing failure
2025-02-11 13:35:14 -08:00
Philip Reames
188915535a [RISCV] Add coverage for vmerge.vim shuffle lowering 2025-02-11 13:31:36 -08:00
Alireza Torabian
3c74430320
[DependenceAnalysis][NFC] Removing PossiblyLoopIndependent parameter (#124615)
Parameter PossiblyLoopIndependent has lost its intended purpose. This
flag is always set to true in all cases when depends() is called, hence
we want to reconsider the utility of this variable and remove it from
the function signature entirely. This is an NFC patch.
2025-02-11 16:23:28 -05:00
Florian Mayer
5c7071e996
[NFC] [clang] fix unused variable warning (#126796) 2025-02-11 13:22:22 -08:00
David Green
3ef5348a04 [AArch64] Add a phase-order test for dot patterns. NFC 2025-02-11 21:20:07 +00:00
Joseph Huber
baf7a3c1e5
[Offload] Properly guard modifications to the RPC device array (#126790)
Summary:
If the user deallocates an RPC device this can sometimes fail if the RPC
server is still running. This will happen if the modification happens
while the server is still checking it. This patch adds a mutex to guard
modifications to it.
2025-02-11 14:57:31 -06:00
Philip Reames
e4016bf5c3 [DAG] Use ArrayRef to simplify ShuffleVectorSDNode::isSplatMask 2025-02-11 12:47:10 -08:00
Kazu Hirata
67e1e98811 Revert "[Clang] [OpenMP] Add support for '#pragma omp stripe'. (#119891)"
This reverts commit 070f84ebc89b11df616a83a56df9ac56efbab783.

Buildbot failure:
https://lab.llvm.org/buildbot/#/builders/51/builds/10694
2025-02-11 12:39:01 -08:00
Kevin Gleason
2cf6663d3c
[MLIR] Make generated markdown doc more consistent (#119926)
A few changes to doc generation:

- All summaries are in italics.
- In general each optional block starts and ends with a newline.
- All table elements are enclosed in `|`'s
- Overall reduce the number of >2newlines in a row

Rationale for this change is that our markdown to docs generator
requires a newline before all headers, otherwise it gets inlined into
the line before it, see `### sdy-op-priority-propagate` in the image
below.

<img width="883" alt="image"
src="https://github.com/user-attachments/assets/b795c424-cecb-48df-abbe-aee2030f4491"
/>

That said overall I feel this formatting is more consistent now, here's
a before and after:

- Dialect documentation diff: https://www.diffchecker.com/OVMHoXeL/
- Pass documentation diff: https://www.diffchecker.com/XEJRmW3k/
2025-02-11 14:13:01 -06:00
Nick Sarnie
c2fea0d837
[clang-linker-wrapper][lit] Fix SPIR-V ELF test when spirv-tools feature is available (#126756)
My last change made the test not run when the `spirv-tools` feature is
not available, which is always the case in CI for clang tests, but it
fails if `spirv-tools` is available for the following reasons:
1) We didn't build `spirv-link` as part of the internal `SPIRV-Tools`
build, which is required by the `clang` call in `clang-linker-wrapper`,
I already fixed that
[here](https://github.com/llvm/llvm-project/pull/126319).
2) We didn't depend on the `SPIRV-Tools` CMake targets in clang tests,
so depending on what CMake targets were built before running
`check-clang`, `SPIRV-Tools` might not have been built.
3) We didn't check for `llvm-spirv` being available, which is not part
of `SPIRV-Tools` but is currently required for SPIR-V compilation.

Manually confirmed this works. This test is the bane of my existence.

---------

Signed-off-by: Sarnie, Nick <nick.sarnie@intel.com>
2025-02-11 20:04:53 +00:00
Valentin Clement (バレンタイン クレメン)
401f4b828c
[flang][rt] Add decimal files to device runtime (#126778)
The library FortranDecimal is not used anymore with the runtime but its
files are now integrated. Add the files for the device build as well.
2025-02-11 12:03:19 -08:00
quic-areg
1bf1f13be9
[Hexagon][Disassembler] Set CommentStream of Disassembler (#126766)
Sets CommentStream after assert added in #125962.
2025-02-11 13:20:38 -06:00
Mark de Wever
c4fe4561c7 [libc++] Fixes building with Python 3.8.
This addresses the post-commit issues reported in #101880.
2025-02-11 20:08:12 +01:00
Ryosuke Niwa
8c67f14f62
[WebKit Checkers] Allow operator T&() in a const member function (#126470)
Allow operator T&() in a member function which returns a const member
variable.

In particular, this will allow UniqueRef::operator T&() and
Ref::operator T&() to be treated as a safe pointer origin when they're
called on a const member.
2025-02-11 11:07:52 -08:00
Tai Ly
20ae283d08
[mlir][tosa] Change the shift of mul to be required (#125297)
Change the shift operand for the mul operator to be a required operand.

Also defined shift to be Tosa_ScalarInt8Tensor which requires that it is
a rank-1 tensor
whose shape is [1] (ie, tensor containing a single element)

Signed-off-by: Tai Ly <tai.ly@arm.com>
2025-02-11 11:02:44 -08:00
Zahira Ammarguellat
070f84ebc8
[Clang] [OpenMP] Add support for '#pragma omp stripe'. (#119891)
Implement basic parsing and semantic support for `#pragma omp stripe`
constuct introduced in
https://www.openmp.org/wp-content/uploads/[OpenMP-API-Specification-6-0.pdf](https://www.openmp.org/wp-content/uploads/OpenMP-API-Specification-6-0.pdf),
section 11.7.
2025-02-11 13:58:21 -05:00
Renaud Kauffmann
9d7177a2d7
[flang][NFCI] Stop tracking memory source after a load in a more explicit manner. (#126156)
Typically, we do not track memory sources after a load because of the
dynamic nature of the load and the fact that the alias analysis is a
simple static analysis.

However, the code is written in a way that makes it seem like we are
continuing to track memory but in reality we are only doing so when we
know that the tracked memory is a leaf and therefore when there will
only be one more iteration through the switch statement. In other words,
we are iterating one more time, to gather data about a box, anticipating
that this will be the last time. This is a hack that helped avoid
cut-and-paste from other case statements but gives the wrong impression
about the intention of the code and makes it confusing.

To make it clear that there is no more tracking, we gather all the
necessary data from the memref of the load, in the case statement for
the load, and exit the loop. I am also limiting this data gathering for
the case when we load a box reference while we were actually following
data, as tests have shows, is the only case when we need it for. Other
cases will be handled conservatively, but this can change in the future,
on a case-by-case basis.

---------

Co-authored-by: Joel E. Denny <jdenny.ornl@gmail.com>
2025-02-11 10:47:38 -08:00
Elvin Wang
71e623d878
[llvm] Avoid out-of-order evaluation in DebugInfo (#125116)
This is an upstream proposal from
e60884cb98
We observed malfunctioning StripNonLineTableDebugInfo during debugging
and it's caused by out-of-order evaluation, this is a C++ level semantic
ambiguity issue, refer
https://en.cppreference.com/w/cpp/language/eval_order
Solution is simply separating one line into two.
2025-02-11 10:33:07 -08:00
Vigneshwar Jayakumar
1188b1ff7b
AMDGPU: Handle gfx950 XDL Write-VGPR-VALU-WAW wait state change (#126132)
There are additional wait states for XDL write VALU WAW hazard in gfx950
compared to gfx940.
2025-02-12 01:32:23 +07:00
Vigneshwar Jayakumar
a2263eba4d
AMDGPU: Handle gfx950 XDL-write-VGPR-VALU-Mem-Exp wait state change (#126727) 2025-02-12 01:30:53 +07:00
Ryosuke Niwa
71478ecdb4
[WebKit Checkers] Treat const Objective-C ivar as a safe origin (#126353)
Like const C++ member variables, treat const Ref, RefPtr, CheckedRef,
CheckedPtr Objective-C ivars as a safe pointer origin in WebKit
checkers.
2025-02-11 10:00:09 -08:00
Jonas Devlieghere
918848d03b
[lldb] Devirtualize GetValueProperties (NFC) (#126583)
Nobody is overriding GetValueProperties, so in practice we're always
using `m_collection_sp`, which means we don't need to check the pointer.
The temlated helpers were already operating on `m_collection_sp`
directly so this makes the rest of the class consistent.
2025-02-11 09:51:18 -08:00
Aaron Siddhartha Mondal
55ae118db7
[GitHub] Skip undefcheck if no relevant files changed (#126749)
If the list of filtered files was empty the check would process every
file in the diff.
2025-02-11 18:43:27 +01:00
Balazs Benics
1337b0fe3c
[analyzer][docs] Document how to use perf and uftrace to debug performance issues (#126724) 2025-02-11 18:41:49 +01:00
Wael Yehia
6d58dd4dd9 [Release Notes] Mention -fprofile-continuous in release notes 2025-02-11 17:57:22 +00:00
Nick Desaulniers
b8ba266820
[libc][test][stdbit] fix -Wimplicit-int-conversion (#126616)
When cross compiling the libc-stdbit-tests, the existing tests trigger numerous
instances of -Wimplicit-int-conversion. The truncation of these implicit
promotions is intentional.
2025-02-11 09:31:01 -08:00
S. Bharadwaj Yadavalli
b92bab3c01
[HLSL] Appropriately set function attribute optnone (#125937)
When optimization is disabled, set `optnone` attribute all module entry
functions.

Updated test in accordance with the change.

Closes #124796
2025-02-11 12:29:05 -05:00
Aaron Siddhartha Mondal
42538ca3a0
[GitHub] Add aaronmondal to Bazel codeowners (#126760) 2025-02-11 09:24:05 -08:00