Commit Graph

473788 Commits

Author SHA1 Message Date
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
Koakuma
bc45acbddc [SPARC][IAS] Add named V9 ASI tag constants for memory instructions
This adds named ASI tag constants (such as #ASI_P and #ASI_P_L) for memory
accesses.

This patch adds 64-bit/V9 tag names, given that currently the majority of SPARC
software targets that arch.

Support for 32-bit/V8 tag names will be added in a future patch.

Reviewed By: barannikov88

Differential Revision: https://reviews.llvm.org/D157235
2023-09-05 04:59:58 -04:00
Martin Erhart
8037deb7af [mlir][memref] Add pass to expand realloc operations, simplify lowering to LLVM
There are two motivations for this change:
1. It considerably simplifies adding support for the realloc operation to the
   new buffer deallocation pass by lowering the realloc such that no
   deallocation operation is inserted and the deallocation pass itself can
   insert that dealloc
2. The lowering is expressed on a higher level and thus easier to understand,
   and the lowerings of the memref operations it is composed of don't have to
   be duplicated in the MemRefToLLVM lowering (also see discussion in
   https://reviews.llvm.org/D133424)

Reviewed By: springerm

Differential Revision: https://reviews.llvm.org/D159430
2023-09-05 08:58:40 +00:00
Timm Bäder
12a789710e [clang][Interp] BaseToDerived casts
We can implement these similarly to DerivedToBase casts. We just have to
walk the class hierarchy, sum the base offsets and subtract it from the
current base offset of the pointer.

Differential Revision: https://reviews.llvm.org/D149133
2023-09-05 10:53:54 +02:00
Koakuma
f1246e90c0 [SPARC][IAS] Add support for the full set of CAS instructions
This completes the support for the CAS instructions.

Besides the base CASA and CASXA forms, on v9 the aliases CAS, CASX, CASL, and
CASXL are also available.

Reviewed By: barannikov88

Differential Revision: https://reviews.llvm.org/D157234
2023-09-05 04:40:04 -04:00
Koakuma
af70618e96 [SPARC][IAS] Add complete set of v9 ASI load, store & swap forms
This extends support for ASI-tagged loads, stores, and swaps with the new
stored-ASI form ([reg+imm] %asi) introduced in v9.

CAS instructions are handled differently by the (dis-)assembler, so it will be
handled in a separate patch.

Reviewed By: barannikov88

Differential Revision: https://reviews.llvm.org/D157233
2023-09-05 04:37:19 -04:00
Koakuma
2f3a362cc0 [SPARC][IAS] Add v9 encoding of %fq
While both SPARCv7/v8 and v9 has a register named %fq, they encode it
differently, so we need to differentiate between them.

Reviewed By: barannikov88

Differential Revision: https://reviews.llvm.org/D157232
2023-09-05 04:37:18 -04:00
Timm Bäder
c6ce32d9c3 [clang][Interp][NFC] Fix a comment 2023-09-05 10:28:47 +02:00
Timm Bäder
8ad37a894b [clang][Interp][NFC] Return array element type in Pointer::getType()
This is irrelevant for the current tests, but makes sense and later
changes easier.
2023-09-05 10:28:47 +02:00
Adrian Kuegel
658a4fdb26 [mlir] Apply ClangTidy fix (NFC)
Prefer to use .empty() instead of checking size().
2023-09-05 10:16:55 +02:00
Felix Schneider
2a603deec4 [mlir][Python] Fix conversion of non-zero offset memrefs to np.arrays
Memref descriptors contain an `offset` field that denotes the start of
the content of the memref relative to the `alignedPtr`. This offset is
not considered when converting a memref descriptor to a np.array in the
Python runtime library, essentially treating all memrefs as if they had
an offset of zero. This patch introduces the necessary pointer arithmetic
to find the actual beginning of the memref contents to the memref->numpy
conversion functions.

There is an ongoing discussion about whether the `offset` field is needed
at all in the memref descriptor.
Until that is decided, the Python runtime and CRunnerUtils should
still correctly implement the offset handling.

Related: https://reviews.llvm.org/D157008

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D158494
2023-09-05 08:02:59 +00:00
Lukas Sommer
06918a969c
[MLIR][NFC] Mark barrier elimination helper static (#65303)
Make local helper functions static to avoid symbol name collision.
2023-09-05 09:59:22 +02:00
Kazu Hirata
c86bb3d91a [mlir] Use a range-based for loop (NFC) 2023-09-05 00:30:40 -07:00
Kazu Hirata
a6fa39da39 [StaticAnalyzer] Modernize NSErrorMethodChecker (NFC) 2023-09-05 00:22:53 -07:00
Kazu Hirata
23915fe301 [Serialization] Modernize ModuleInfo (NFC) 2023-09-05 00:22:51 -07:00
Groverkss
d222b69093 [MLIR][Presburger] Add Identifier class to store identifiers and their type
This patch adds a new class Identifier to store identifiers in PresburgerSpace
and their types.

Identifiers were added earlier and were stored as a void pointer, and their type
in the form of mlir::TypeId in PresburgerSpace. To get an identifier, a user of
PresburgerSpace needed to know the type of identifiers. This was a problem for
users of PresburgerSpace like IntegerRelation, which want to work on
identifiers without knowing their type.

The Identifier class allows users like IntegerRelation to work on identifiers
without knowing their type, and also exposes an easier way to work with
Identifiers.

Reviewed By: arjunp

Differential Revision: https://reviews.llvm.org/D146909
2023-09-05 12:46:00 +05:30
Jie Fu
5f667a57b5 [clang][dataflow] Fix -Wunused-const-variable in WatchedLiteralsSolver.cpp (NFC)
/data/llvm-project/clang/lib/Analysis/FlowSensitive/WatchedLiteralsSolver.cpp:62:26: error: unused variable 'NullLit' [-Werror,-Wunused-const-variable]
static constexpr Literal NullLit = 0;
2023-09-05 15:03:07 +08:00
Karl-Johan Karlsson
931df0e662
[opt] Remove reference to new PM from description of optimization level flags (#65169) 2023-09-05 09:01:03 +02:00
iambrj
6c6a2d3445 [MLIR][Presburger] Minor bug-fix in PresburgerRelation::intersectRange from 3dd9931
Fix a typo (incorrectly calling getNumDomainVars instead of
getNumRangeVars) in intersectRange from 3dd9931.

Reviewed By: Groverkss

Differential Revision: https://reviews.llvm.org/D159413
2023-09-05 11:51:19 +05:30
Burak Emir
b50c87d1e6 [clang][dataflow] #llvm #flow-analysis Simplify formula at CNF construction time, and short-cut solving of known contradictory formulas.
In dataflow analysis, SAT solver: simplify formula during CNF construction and short-cut
solving when the formula has been recognized as contradictory.

Reviewed By: sammccall

Differential Revision: https://reviews.llvm.org/D158407
2023-09-05 06:23:04 +00:00
pvanhout
844c0da777 [TableGen][GlobalISel] Add MIR Pattern Builtins
Adds a new feature to MIR patterns: builtin instructions.
They offer some additional capabilities that currently cannot be expressed without falling back to C++ code.
There are two builtins added with this patch, but more can be added later as new needs arise:
 - GIReplaceReg
 - GIEraseRoot

Depends on D158714, D158713

Reviewed By: arsenm, aemerson

Differential Revision: https://reviews.llvm.org/D158975
2023-09-05 08:19:07 +02:00
pvanhout
4e513f69a1 [GlobalISel] Cleanup Combine.td
Now that the old backend is gone, clean-up a few things that no longer make sense and tidy up the file a bit.

Depends on D158710

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D158714
2023-09-05 08:19:06 +02:00
pvanhout
aaf6755631 [GlobalISel] Refactor Combiner API
Remove CodeGen leftovers from the old combiner backend and adapt the API to fit the new backend better.
It's now quite a bit closer to how InstructionSelector works.

- `CombinerInfo` is now a simple "options" struct.
- `Combiner` is now the base class of all TableGen'd combiner implementation.
    - Many fields have been moved from derived classes into that class.
    - It has been refactored to create & own the Observer and Builder.
- `tryCombineAll` TableGen'd method can now be renamed, which allows targets to implement the actual `tryCombineAll` call manually and do whatever they want to do before/after it.

Note: `CombinerHelper` needs to be mutable because none of its methods are const. This can be revisited later.

Depends on D158710

Reviewed By: aemerson, dsanders

Differential Revision: https://reviews.llvm.org/D158713
2023-09-05 08:19:05 +02:00
Cullen Rhodes
538f13584d
[mlir][ArmSME] Fix scalable dims check in isValidSMETileVectorType (#65254)
Check for allDimsScalable is incorrect and currently permits fixed
vectors.
2023-09-05 07:08:16 +01:00
Christian Sigg
4ae0db4ee6
[bazel][mlir] Add missing file after @62e90db 2023-09-05 08:07:15 +02:00
Brad Smith
0a73e1eb47 [analyzer][NFC] Use switch statement in MallocChecker::performKernelMalloc
Reviewed By: steakhal

Differential Revision: https://reviews.llvm.org/D159397
2023-09-05 01:06:43 -04:00
sstwcw
1362206e8a [clang-format][doc] Fix the doc format
There has to be a blank line after a code block.  Otherwise the HTML
docs can't be built.

The problem was brought in by ddc80637cc.  How careless I was that the
same patch broke the build twice.
2023-09-05 03:39:24 +00:00
Qiu Chaofan
082c5d7f63 [PowerPC] Implement builtin for mffsl
mffsl is available since ISA 3.0. The builtin is named with ppc prefix
to follow our convention. For targets earlier than power9, GCC generates
extra code to support the functionality, while this patch does not
implement such behavior.

Reviewed By: nemanjai, tuliom

Differential Revision: https://reviews.llvm.org/D158065
2023-09-05 11:22:09 +08:00
sstwcw
ddc80637cc [clang-format] Break long string literals in C#, etc.
Now strings that are too long for one line in C#, Java, JavaScript, and
Verilog get broken into several lines.  C# and JavaScript interpolated
strings are not broken.

A new subclass BreakableStringLiteralUsingOperators is used to handle
the logic for adding plus signs and commas.  The updateAfterBroken
method was added because now parentheses or braces may be required after
the parentheses or commas are added.  In order to decide whether the
added plus sign should be unindented in the BreakableToken object, the
logic for it is taken out into a separate function
shouldUnindentNextOperator.

The logic for finding the continuation indentation when the option
AlignAfterOpenBracket is set to DontAlign is not implemented yet.  So in
that case the new line may have the wrong indentation, and the parts may
have the wrong length if the string needs to be broken more than once
because finding where to break the string depends on where the string
starts.

The preambles for the C# and Java unit tests are changed to the newer
style in order to allow the 3-argument verifyFormat macro.  Some cases
are changed from verifyFormat to verifyImcompleteFormat because those
use incomplete code and the new verifyFormat function checks that the
code is complete.

The line in the doc was changed to being indented by 4 spaces, that is,
the default continuation indentation.  It has always been the case.  It
was probably a mistake that the doc showed 2 spaces previously.

This commit was fist committed as 16ccba5107.  The tests caused
assertion failures.  Then it was reverted in 547bce3613.

Reviewed By: MyDeveloperDay

Differential Revision: https://reviews.llvm.org/D154093
2023-09-05 03:19:49 +00:00
Takuya Shimizu
ef5217b3c0
[clang][Diagnostics] Fix wrong line number display (#65238)
When the caret location is lower than the lowest source range, clang is
printing wrong line numbers. The first line number should consider caret
location line even when there are source ranges provided.

Current wrong line example: https://godbolt.org/z/aj4qEjzs4
2023-09-05 12:12:42 +09:00