Commit Graph

473767 Commits

Author SHA1 Message Date
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
Vladislav Dzhidzhoev
6b37a65264 [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:00:48 +02:00
Fabian Mora
d0e6fd99aa [mlir] Extend the promise interface mechanism
This patch pairs a promised interface with the object (Op/Attr/Type/Dialect) requesting the promise, ie:
```
declarePromisedInterface<MyAttr, MyInterface>();
```
Allowing to make fine grained promises. It also adds a mechanism to query if `Op/Attr/Type` has an specific promise returning true if the promise is there or if an implementation has been added. Finally it adds a couple of `Attr|TypeConstraints` that can be used in ODS to query if the promise or an implementation is there.

This patch tries to solve 2 issues:
1. Different entities cannot use the same promise.
```
declarePromisedInterface<MyInterface>();
// Resolves a promise.
MyAttr1::attachInterface<MyInterface>(ctx);
// Doesn't resolves a promise, as the previous attachment removed the promise.
MyAttr2::attachInterface<MyInterface>(ctx);
```
2. Is not possible to query if a promise has been declared.

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D158464
2023-09-05 09:55:27 -04:00
Nico Weber
5857fe0647 [gn] port bc45acbddc 2023-09-05 09:49:21 -04:00
Joseph Huber
ead92ae5fe [libc] Prevent system headers from being included for the GPU build
It's very important that the GPU build does not include any system
directories. We currently use `-ffreestanding` to disable a lot of these
features, but we can still accidentally include them if they are not
provided by `libc` yet. This patch changes this to use `-nostdinc` to
disable all standard search paths. Then we use the compiler's resource
directory to pick up the provided headers like `stdint.h`.

Differential Revision: https://reviews.llvm.org/D159445
2023-09-05 08:43:07 -05:00
Jingu Kang
67fc0d3d39 [AArch64] Remove copy instruction between uaddlv and dup
If there are copy instructions between uaddlv and dup for transfer from gpr to
fpr, try to remove them with duplane.

Differential Revision: https://reviews.llvm.org/D159267
2023-09-05 14:41:28 +01:00
cor3ntin
d17e6cc9e7
[Github] Add labels on pull requests based on paths. (#65308)
Using https://github.com/actions/labeler, this add a workflow to
automatically label PRs, in hope to reduce the work needed to triage new
PRs.

"new-prs-labeler.yml" has been seeded taking inspiration from the
CODEOWNERS file when there was an existing corresponding label on the
issue tracker.
2023-09-05 15:26:48 +02:00
Corentin Jabot
836f2470fb [Github] Move the issue labeler data out of workflows
To avoid it being considered a workflow script.
2023-09-05 15:10:42 +02:00
pvanhout
1456dd1a65 Fix GlobalISel TableGen CODEOWNERS patterns
- GICombinerEmitter is no more, now it's GlobalISelCombinerEmitter
- Change the pattern so it also covers the MatchTable files
2023-09-05 15:09:15 +02:00
Stephen Tozer
323270451d Reapply "[Dexter] Remove builder from Dexter"
Fixes a test which was broken on the green dragon buildbot, and further
failures on the SIE buildbot.

This reverts commit 8df9eff90f.
2023-09-05 13:59:53 +01:00
cor3ntin
3301edf45d
[Github] Improve automatic new issue labelling (#65309)
This patch:
* Replaces `andymckay/labeler` which does not appear to be maintained by
github official solution
* Removes the closed issue workflow which was disabled a few years ago
and never fixed.
* Adds a few rules to add label based on PR title, hopefully that can
make triaging simpler. If that turns out to be useful, we can consider
adding more rules for backends, etc. We could technically also pattern
match the body of the issue but I'm concerned about trying to be _too_
clever.

The new system is only triggered on PR open so manual labels should not
be removed.
2023-09-05 14:53:56 +02:00
Simon Pilgrim
5463503ae1 [DAG] Move scalar BITCAST constant folds from getNode to FoldConstantArithmetic 2023-09-05 13:11:20 +01:00
Kristina Bessonova
2fbd1323e7 [Sema] Make C++ functional-style cast warn about dropped qualifiers (-Wcast-qual)
Functional-style cast (i.e. a simple-type-specifier or typename-specifier
followed by a parenthesize single expression [expr.type.conv]) is equivalent
to the C-style cast, so that makes sense they have identical behavior
including warnings.

This also matches GCC https://godbolt.org/z/b8Ma9Thjb.

Reviewed By: rnk, aaron.ballman

Differential Revision: https://reviews.llvm.org/D159133
2023-09-05 12:48:38 +02:00
David Sherwood
50598f0ff4 [DAGCombiner][SVE] Add support for illegal extending masked loads
In some cases where the same mask is used for multiple
extending masked loads it can be more efficient to combine
the zero- or sign-extend into the load even if it's not a
legal or custom operation. This leads to splitting up the
extending load into smaller parts, which also requires
splitting the mask. For SVE at least this improves the
performance of the SPEC benchmark x264 slightly on
neoverse-v1 (~0.3%), and at least one other benchmark
improves by around 30%. The uplift for SVE seems due to
removing the dependencies (vector unpacks) introduced
between the loads and the vector operations, since this
should increase the level of parallelism.

See tests:

  CodeGen/AArch64/sve-masked-ldst-sext.ll
  CodeGen/AArch64/sve-masked-ldst-zext.ll

https://reviews.llvm.org/D159191
2023-09-05 10:41:21 +00:00
David Sherwood
64094e3e6d [DAGCombiner] Pre-commit tests for D159191
I've added some missing tests for the following cases:

1. Zero- and sign-extends from unpacked vector types to wide,
   illegal types. For example,
   %aext = zext <vscale x 4 x i8> %a to <vscale x 4 x i64>
2. Normal loads combined with 1
3. Masked loads combined with 1

Differential Revision: https://reviews.llvm.org/D159192
2023-09-05 10:41:21 +00:00
Timm Bäder
fde2b0d6db [clang][Interp][NFC] Add [[nodiscard]] to a few Pointer methods
These methods are all const and return a new Pointer instance instead of
modifying the given instance.
2023-09-05 12:35:06 +02:00
Timm Bäder
5704dde307 [clang][Interp] Reject calling virtual constexpr functions in pre-c++20
Differential Revision: https://reviews.llvm.org/D157619
2023-09-05 12:21:26 +02:00
Timm Bäder
adb1fb40e8 [clang][Interp] Handle mixed floating/integral compound assign operators
Differential Revision: https://reviews.llvm.org/D157596
2023-09-05 12:10:00 +02:00
Florian Hahn
168e23c741
[VPlan] Remove reference to Instr when setting debug loc. (NFCI)
This allows untangling references to underlying IR for various recipes.
2023-09-05 10:59:13 +01:00
Benjamin Kramer
e8144c7011 [bazel] Port bc45acbddc 2023-09-05 11:48:04 +02:00
Amara Emerson
12e4921709
[GlobalISel] Constant fold sitofp/uitofp of 0. (#65307) 2023-09-05 17:33:57 +08:00
Timm Bäder
6d79f985b5 [clang][Interp] Implement zero-init of record types
Differential Revision: https://reviews.llvm.org/D154189
2023-09-05 11:20:35 +02:00
David Spickett
f6b6234d14 [lldb][AArch64] Remove bool return from UpdateARM64SVERegistersInfos
This always succeeds. While I'm here, document why we check the size
of p0 against the value of VG.

Reviewed By: omjavaid

Differential Revision: https://reviews.llvm.org/D157845
2023-09-05 10:03:50 +01:00
Timm Bäder
a13f036949 [clang][Interp] Check one-past-the-end pointers in GetPtrField
Rename CheckBaseDerived to something more general and call it in
GetPtrField() as well, so we don't crash later in Pointer::toAPValue().

Differential Revision: https://reviews.llvm.org/D149149
2023-09-05 11:00:40 +02:00
Koakuma
a21a0a64db [SPARC][IAS] Add more instruction aliases
This adds some commonly-used instruction aliases from various sources:

- GNU
- SPARCv9 manual
- JPS1 ASR names

Reviewed By: barannikov88

Differential Revision: https://reviews.llvm.org/D157236
2023-09-05 04:59:58 -04:00