Commit Graph

473641 Commits

Author SHA1 Message Date
Spenser Bauman
f32427e044 [mlir][linalg] Fix lowering of tensor.pack operations
Tensor pack operations are optimistically lowered to pad + insert_slice
when the pack operation only pads the input tensor. The existing
lowering emits insert_slice operations which do not meet the
rank-reducibility requirements of insert_slice.

This change updates the logic in linalg::lowerPack to first check the
rank-reducibility requirement. When the requirement is not met, the
lowering will emit the full sequence of pad + expand + transpose.

Reviewed By: chelini

Differential Revision: https://reviews.llvm.org/D159382
2023-09-05 21:08:13 +02:00
Owen Pan
4146b30785 Revert "[Format] Modernize SpaceBeforeParensCustom (NFC)"
This reverts commit ad183b927b which seems to break
clang/docs/tools/dump_format_style.py.
2023-09-05 12:03:14 -07:00
Jakub Kuderski
c8544d280a [mlir] Support attributes in matchPattern
The primary motivation is to we have a simple mechanism to extract
values from attributes in folders and canon patterns without having to
re-fold constants or write nested conditions over attribute types.

Matching over attributes composes especially well with fold adaptors.

Update folds in Arith and SPIRV dialects to match over attributes, where
applicable.

Reviewed By: mehdi_amini, zero9178

Differential Revision: https://reviews.llvm.org/D159437
2023-09-05 14:52:27 -04:00
cor3ntin
c144086997
[Github] Workaround a GH action bug causing manually added labels to be removed (#65395)
Fixes https://github.com/llvm/llvm-project/issues/65345
2023-09-05 20:46:41 +02:00
Chia-hung Duan
4c676d5265 [scudo] Clean up decl of RSSLimit funtions (NFC)
Reviewed By: cferris

Differential Revision: https://reviews.llvm.org/D159389
2023-09-05 18:37:15 +00:00
Jakub Kuderski
887e1aa330 [mlir][spirv] Fix sub-word memref.store conversion
Support environments where logical types do not necessarily correspond to allowed storage access types.

Also make pattern match failures more descriptive.

Reviewed By: antiagainst

Differential Revision: https://reviews.llvm.org/D159386
2023-09-05 14:35:27 -04:00
Francis Visoiu Mistrih
c1eacc3c40
[Matrix] Fix test on SystemZ
As reported by @uweigand in https://reviews.llvm.org/D158883:

```
The newly added test cases in ffp-model.c fail on SystemZ, making CI red:
https://lab.llvm.org/buildbot/#/builders/94/builds/16280

The root cause seems to be that by default, the SystemZ back-end targets
a machine without SIMD support, and therefore vector return types are
passed via implicit reference according to the ABI
```

this uses manual stores instead of vector returns.
2023-09-05 14:22:55 -04:00
Arkadiy Yudintsev
f465a482ca [clang-format] Fix segmentation fault when formatting nested namespaces
Fixing the clang-format crash with the segmentation fault error when
formatting code with nested namespaces.

Fixes #64701.

Differential Revision: https://reviews.llvm.org/D158363
2023-09-05 11:12:14 -07:00
Benjamin Kramer
1078627cf8 [bazel] Add missing dependency for e55e36de7a 2023-09-05 19:58:38 +02:00
Alex Langford
5bff905c0d [lldb][NFCI] Remove unused method TypeCategoryMap::Get(uint32_t, ValueSP &)
Differential Revision: https://reviews.llvm.org/D159387
2023-09-05 10:53:56 -07:00
Chris Bowler
fbdf684fae [libc++] Avoid destructor call for error_category singletons
When a handle to an error_category singleton object is used during the
termination phase of a program, the destruction of the error_category
object may have occurred prior to execution of the current destructor
or function registered with atexit, because the singleton object may
have been constructed after the corresponding initialization or call
to atexit. For example, the updated tests from this patch will fail if
using a libc++ built using a compiler that updates the vtable of the
object on destruction.

This patch attempts to avoid the issue by causing the destructor to not
be called in the style of ResourceInitHelper in src/experimental/memory_resource.cpp.
This approach might not work if object lifetime is strictly enforced.

Differential Revision: https://reviews.llvm.org/D65667

Co-authored-by: Louis Dionne <ldionne.2@gmail.com>
2023-09-05 13:44:10 -04:00
Michael Maitland
e6436952e3
[RISCV] Split VFWREDUSUM and VFWREDOSUM SchedWrite (#65386)
WriteVFWRedOV_From and WriteVFWRedV_From SchedWrite classes exist
already, but no pseudos were using the ordered SchedWrite. This change
makes it so that the VFWREDOSUM pseudo used the ordered VFW SchedWrite.
2023-09-05 13:39:44 -04:00
Corentin Jabot
a58c59e679 Revert "Update new-prs.yml"
This was meant to be a test in my personal fork...

This reverts commit ee53efde38.
2023-09-05 19:30:11 +02:00
Slava Zakharin
de8939ffca
[flang] Reset lbounds for allocatable function results. (#65286)
With HLFIR the lbounds for the ALLOCATABLE result are taken from the
mutable box created for the result, so the non-default lbounds might be
propagated further causing incorrect result, e.g.:
```
program p
  real, allocatable :: p5(:)
  allocate(p5, source=real_init())
  print *, lbound(p5, 1) ! must print 1, but prints 7
contains
  function real_init()
    real, allocatable :: real_init(:)
    allocate(real_init(7:8))
  end function real_init
end program p
```

With FIR lowering the box passed for `source` has explicit lower bound 1
at the call site, but the runtime box initialized by `real_init` call
still has lower bound 7. I am not sure if the runtime box initialized by
`real_init` will ever be accessed in a debugger via Fortran variable
names, but I think that having the right runtime bounds that can be
accessible via examining registers/stack might be good in general. So I
decided to update the runtime bounds at the point of return.

This change fixes the test above for HLFIR.

Reviewed By: jeanPerier

Differential Revision: https://reviews.llvm.org/D156187
2023-09-05 10:26:16 -07:00
Amy Kwan
f0b2f69541 [AIX][TLS] Generate .extern and .ref references to __tls_get_addr for local-exec accesses.
Compiling with TLS variables requires -pthread, but if the user omits this
option, the compiler will not show any obvious indication during compilation
that -pthread is needed for programs using TLS variables. Instead, the user will
experience a segmentation fault when running programs with TLS variables in them
and without specifying -pthread.

This patch aims to generate .extern/.ref references to __tls_get_addr[DS] for
local-exec accesses, in order to trigger an error from the linker to indicate
that there is an undefined symbol to __tls_get_addr. Doing so will remind the
user to compile/link with -pthread.

Differential Revision: https://reviews.llvm.org/D151335
2023-09-05 12:15:14 -05:00
Antonio Frighetto
be0e42c16b [lldb][Plugins] Reflect structure changes in ObjectContainer
Reflect recent changes made to MachO
`fileset_entry_command` struct.
2023-09-05 19:13:43 +02:00
cor3ntin
ee53efde38
Update new-prs.yml 2023-09-05 19:05:46 +02:00
Jingu Kang
06ec1ff294 [AArch64] Replace uaddlv intrinsic with uaddlv sdnode
Differential Revision: https://reviews.llvm.org/D159447
2023-09-05 17:57:38 +01:00
Antonio Frighetto
282bf213ee [llvm-nm][MachO] Add support for MH_FILESET
Support printing of symbols for MachO of `MH_FILESET` type.
This is achieved by extending `dumpSymbolNamesFromObject`
to encompass fileset handling, and including an offset in
`MachOObjectFile` class to locate embedded MachO headers.

Differential Revision: https://reviews.llvm.org/D159294
2023-09-05 18:51:12 +02:00
Adrian Prantl
d227c8a120 Add missing nullptr check.
While it's the plugin's moral duty to also set the error, this code
can't depend on that.
2023-09-05 09:48:06 -07:00
Simon Pilgrim
e086e0aeef [X86] Add test coverage for new smulo folds added in D159406
Pulled from the InstCombine with_overflow.ll tests
2023-09-05 17:43:42 +01:00
Michael Maitland
3065ce1ee3 [RISCV][llvm-mca] Fix Fix getLMUL values
These values come from RISCVInstrInfoVPseudos.td. MF8 and MF2 were
swapped by accident.

Differential Revision: https://reviews.llvm.org/D159301
2023-09-05 09:34:47 -07:00
Mark de Wever
6f8b17703d [libc++][C++20 modules] Tests no except build.
Depends on D158661

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D158862
2023-09-05 18:29:27 +02:00
Mark de Wever
98c6c985f1 [libc++][C++20 modules] Tests no wchar_t build.
Depends on D158358

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D158661
2023-09-05 18:22:10 +02:00
Jens Massberg
6d2e756dac Initialize ConceptReference of new AutoTypeLoc with nullptr.
Differential Revision: https://reviews.llvm.org/D159450
2023-09-05 18:17:44 +02:00
Sam McCall
54091d37f2
[AST] Fix nested name specifiers printing as NamespaceNamespace (#65266)
This happens because we print both the kind of the NNS and the kind of
decl (when it refers to one). These are always the same string.
2023-09-05 18:15:06 +02:00
Abhinav271828
61dd539836
[MLIR][Presburger] Fraction: implement arithmetic operations (/, +, -) and printing (#65310) 2023-09-05 21:44:57 +05:30
Sergei Barannikov
18a628ec4e [AST] Use correct APSInt width when evaluating string literals
The width of the APSInt values should be the width of an element.
getCharByteWidth returns the size of an element in _host_ bytes, which
makes the width N times greater, where N is the ratio between target's
CHAR_BIT and host's CHAR_BIT.
This is NFC for in-tree targets because all of them have CHAR_BIT == 8.

Reviewed By: cor3ntin, aaron.ballman

Differential Revision: https://reviews.llvm.org/D154773
2023-09-05 19:14:09 +03:00
Mark de Wever
b9f24033f7 [libc++][C++20 modules] Enabling in C++20.
The vendors of the MSVC STL, libstdc++ and libc++ have agreed [1] to
make the C++23 modules std and std.compat available in C++20. This
provides the std module; libc++ has not implemented the std.compat
module yet.

[1] https://github.com/microsoft/STL/issues/3945

Depends on D158357

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D158358
2023-09-05 18:10:46 +02:00
Philip Reames
de34d39b66 [RISCV] Cap build vector cost to avoid quadratic cost at high LMULs
Each vslide1down operation is linear in LMUL on common hardware. (For instance, the sifive-x280 cost model models slides this way.) If we do a VL unique inserts, each with a cost linear in LMUL, the overall cost is O(VL*LMUL).  Since VL is a linear function of LMUL, this means the current lowering is quadradic in both LMUL and VL.  To avoid the degenerate case, fallback to the stack if the cost is more than a fixed (linear) threshold.

For context, here's the sifive-x280 llvm-mca results for the current lowering and stack based lowering for each LMUL (using e64). Assumes code was compiled for V (i.e. zvl128b).
  buildvector_m1_via_stack.mca:Total Cycles: 1904
  buildvector_m2_via_stack.mca:Total Cycles: 2104
  buildvector_m4_via_stack.mca:Total Cycles: 2504
  buildvector_m8_via_stack.mca:Total Cycles: 3304
  buildvector_m1_via_vslide1down.mca:Total Cycles:  804
  buildvector_m2_via_vslide1down.mca:Total Cycles:  1604
  buildvector_m4_via_vslide1down.mca:Total Cycles:  6400
  buildvector_m8_via_vslide1down.mca:Total Cycles: 25599

There are other schemes we could use to cap the cost. The next best is recursive decomposition of the vector into smaller LMULs. That's still quadratic, but with a better constant. However, stack based seems to cost better on all LMULs, so we can just go with the simpler scheme.

Arguably, this patch is fixing a regression introduced with my D149667 as before that change, we'd always fallback to the stack, and thus didn't have the non-linearity.

Differential Revision: https://reviews.llvm.org/D159332
2023-09-05 09:03:26 -07:00
Oleksandr "Alex" Zinenko
3964d943ec
[mlir] transform.structured.match fix tilingIface condition (#65337)
The matching condition for payload ops implementing TilingInterface was
inverted. Fix it and add a test.
2023-09-05 18:02:33 +02:00
Craig Topper
fa31ce5320
[RISCV][GISel] Add gisel-commandline-option.ll similar to AArch64. (#65299)
This allows us to see the pass pipeline for GlobalISel.
2023-09-05 09:01:50 -07:00
Oleksandr "Alex" Zinenko
e55e36de7a
[mlir] alloc-to-alloca conversion for memref (#65335)
Introduce a simple conversion of a memref.alloc/dealloc pair into an
alloca in the same scope. Expose it as a transform op and a pattern.

Allocas typically lower to stack allocations as opposed to alloc/dealloc
that lower to significantly more expensive malloc/free calls. In
addition, this can be combined with allocation hoisting from loops to
further improve performance.
2023-09-05 17:58:22 +02:00
Paul T Robinson
a4605af26f
[CodeGen][LTO] Rename some misleading variables (#65185)
Some flags named "IsLTO" and "IsThinLTO" implied they described
compilation modes, but with Unified LTO this is no longer true. Rename
these to "PrepForXXX" to be less confusing to readers. Also, deleted
"IsThinOrUnifiedLTO" because Unified implies PrepareForThinLTO.
2023-09-05 08:57:16 -07:00
Oleksandr "Alex" Zinenko
c17735053b
[mlir] transform.structured.match loop-like flag (#65336)
Add an enum option to `transform.structured.match` operation to match
payload operations implementing LoopLikeOpInterface.
2023-09-05 17:56:00 +02:00
Mark de Wever
c5cf4f7e4f
[clang][doc] Don't escape _ in .rst files. (#65277)
The current generated ClangCommandLineReference.rst unconditionally
escapes underscores. This leads odd output on the website
https://clang.llvm.org/docs/ClangCommandLineReference.html

For example

   -fchar8\_t, -fno-char8\_t

Whether an underscore should be escaped depends on the state. Currently
the escape routine doesn't keep track of the state and currently
underscores are not used in places where they need to be escaped.
Therefore remove the underscore from the list of escaped characters.
2023-09-05 17:54:46 +02:00
Alexey Bataev
09b8bbd6e0 [SLP][NFC]Reorder indeces instead of real values, NFC.
May save some memory/compile time.
2023-09-05 08:48:52 -07:00
Amara Emerson
08e04209d8
[GlobalISel] Commute G_FMUL and G_FADD constant LHS to RHS. (#65298) 2023-09-05 23:48:34 +08:00
Alex Brachet
c7cc756ce3 [CMake] Add option to disable driver build in Fuchsia cache file
Linking the driver binary can take a long time, particularly with debug
info. This adds an option to disable the driver build meant for local use.

Differential Revision: https://reviews.llvm.org/D159130
2023-09-05 15:22:15 +00:00
yronglin
111c1ba5b4
[NFC][Clang] Fix test constexpr-function-recovery-crash.cpp (#65269)
Signed-off-by: yronglin <yronglin777@gmail.com>
2023-09-05 23:21:44 +08:00
Sam James
3403686b72
[Clang] Fix JIT test on 32-bit systems
As reported by mgorny at https://reviews.llvm.org/D159115#4638037, the
unsigned long long cast fails on 32-bit systems at least with GCC.

It looks like a pointer provenance/aliasing issue rather than a bug in GCC.

Acked by Vassil Vassilev on the original revision.
2023-09-05 16:04:22 +01:00
Luke Lau
2fc6fadeaf [RISCV] Fix typo in test title. NFC 2023-09-05 15:57:18 +01:00
Joel E. Denny
19b44c2bdf
[lit] Echo full RUN lines in case of external shells (#65267)
Before <https://reviews.llvm.org/D154984> and
<https://reviews.llvm.org/D156954>, lit reported full RUN lines in a
`Script:` section. Now, in the case of lit's internal shell, it's the
execution trace that includes them. However, if lit is configured to use
an external shell (e.g., bash, windows `cmd`), they aren't reported at
all.

A fix was requested at the following:

* <https://reviews.llvm.org/D154984#4627605>
*
<https://discourse.llvm.org/t/rfc-improving-lits-debug-output/72839/35?u=jdenny-ornl>

This patch does not correctly address the case when the external shell
is windows `cmd`. As discussed at
<https://github.com/llvm/llvm-project/pull/65242>, it's not clear
whether that's a use case that people still care about, and it seems to
be generally broken anyway.
2023-09-05 10:48:18 -04:00
Florian Hahn
165e24aa2a
[VPlan] Move DebugLoc to VPRecipeBase (NFCI).
Add a dedicated debug location to VPRecipeBase to remove another
unneeded use of the underlying LLVM IR instruction and also consolidate
various DL fields in sub classes.

Each recipe can have debug location and it shouldn't rely on reference
to the underlying LLVM IR instructions to retain it. See various recipes
that had separate DL fields already.
2023-09-05 15:45:16 +01:00
Siva Chandra Reddy
0f1507af41 [libc] Add a JSON based config option system.
Few printf config options have been setup using this new config system
along with their baremetal overrides. A follow up patch will add generation
of doc/config.rst, which will contain the full list of libc config options
and short description explaining how they affect the libc.

Reviewed By: gchatelet

Differential Revision: https://reviews.llvm.org/D159158
2023-09-05 14:19:18 +00:00
Stephen Tozer
5647f2908d Revert "Reapply "[Dexter] Remove builder from Dexter""
Re-application of the Dexter builder removal reversed due to continued
errors on the green dragon LLDB buildbot:
https://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/59716/

Cause of the error is unclear, but it looks as though there is some
unexpected non-determinism in the test failures.

This reverts commit 323270451d.
2023-09-05 15:18:09 +01:00
Vladislav Dzhidzhoev
13b7629a58 [GlobalISel][AArch64] Combine unmerge(G_EXT v, undef) to unmerge(v).
When having <N x t> d1, unused = unmerge(G_EXT <2*N x t> v1, undef, N),
it is possible to express it just as unused, d1 = unmerge v1.

It is useful for tackling regressions in arm64-vcvt_f.ll, introduced in
https://reviews.llvm.org/D144670.
2023-09-05 16:14:44 +02:00
Vladislav Dzhidzhoev
7eeeeb0cc9 Revert "[GlobalISel][AArch64] Combine unmerge(G_EXT v, undef) to unmerge(v)."
This reverts commit 6b37a65264.
Accindentally pushed before squashing.
2023-09-05 16:13:27 +02:00
Vladislav Dzhidzhoev
bb1a03df47 Addressed @aemerson comments 2023-09-05 16:00:49 +02:00
Vladislav Dzhidzhoev
0e826f0e6d Refactored, added MIR test. 2023-09-05 16:00:48 +02:00