Commit Graph

429837 Commits

Author SHA1 Message Date
Ben Langmuir 6626f6fec3 [clang][deps] Override dependency and serialized diag files for modules
When building modules, override secondary outputs (dependency file,
dependency targets, serialized diagnostic file) in addition to the pcm
file path. This avoids inheriting per-TU command-line options that
cause non-determinism in the results (non-deterministic command-line for
the module build, non-determinism in which TU's .diag and .d files will
contain the module outputs). In clang-scan-deps we infer whether to
generate dependency or serialized diagnostic files based on an original
command-line. In a real build system this should be modeled explicitly.

Differential Revision: https://reviews.llvm.org/D129389
2022-07-12 08:19:52 -07:00
Paul Robinson 2b9055cee6 [PS4/PS5] NFC: Use preferred predicate in a triple check
Also add a test to verify this difference in the PS4/PS5 ABIs,
now that we have identified it.
2022-07-12 08:10:25 -07:00
Nico Weber 7f83dae7f5 try to fix lldb build after d489268392 2022-07-12 11:08:44 -04:00
Alex Zinenko a5c802a429 [mlir] fold more eagerly in structured op splitting
Existing implementation of structured op splitting creates several
affine.apply and affine.min operations in its subshape computation.
As these shapes are further used in data slice extraction, this may lead
to slice shapes being dynamic even when the original shapes and the
splitting point are static. This is particularly visible when splitting
is combined with further subsetting transformations such as tiling. Use
composition and folding more aggressively in splitting to avoid this.

In particular, introduce a `createComposedAffineMin` function that the
affine map used in "min" with the maps used by any `affine.apply` that
may be feeding the operands to the "min". This enables production of
more static shapes. Also introduce a `createComposedFoldedAffineApply`
function that combines the existing `createComposedAffineApply` with
in-place folding to propagate constants produced by zero-input affine
maps. Using these when splitting allows the subsequent canonicalizer
pass to recover static shapes for structured ops.

Reviewed By: nicolasvasilache

Differential Revision: https://reviews.llvm.org/D129379
2022-07-12 15:06:55 +00:00
Nico Weber d489268392 [clang/mac] Make -mmacos-version-min the canonical spelling over -mmacosx-version-min
This was promised 5 years ago in https://reviews.llvm.org/D32796,
let's do it.

Both flags are still accepted. No behavior change except for which
form shows up in --help output and in dumps of internal state
(such as with RC_DEBUG_OPTIONS).

Differential Revision: https://reviews.llvm.org/D129226
2022-07-12 11:03:51 -04:00
Igor Kudrin 9ff10a0d62 [NVPTX] Add missing pass names
Differential Revision:
2022-07-12 07:58:13 -07:00
Thomas Raoux 051b36ba28 [mlir][vector] Add accumulator operand to MultiDimReduce op
This allows vectorizing linalg reductions without changing the operation
order. Therefore this produce a valid vectorization even if operations
are not associative.

Differential Revision: https://reviews.llvm.org/D129535
2022-07-12 14:28:30 +00:00
David Sherwood 6b694d600a [LoopVectorize] Change PredicatedBBsAfterVectorization to be per VF
When calculating the cost of Instruction::Br in getInstructionCost
we query PredicatedBBsAfterVectorization to see if there is a
scalar predicated block. However, this meant that the decisions
being made for a given fixed-width VF were affecting the cost for a
scalable VF. As a result we were returning InstructionCost::Invalid
pointlessly for a scalable VF that should have a low cost. I
encountered this for some loops when enabling tail-folding for
scalable VFs.

Test added here:

  Transforms/LoopVectorize/AArch64/sve-tail-folding-cost.ll

Differential Revision: https://reviews.llvm.org/D128272
2022-07-12 14:53:20 +01:00
Simon Pilgrim ded62411f7 [DAG] SimplifyDemandedBits - AND/OR/XOR - attempt basic knownbits simplifications before calling SimplifyMultipleUseDemandedBits
Noticed while investigating the SystemZ regressions in D77804, prefer handling the knownbits analysis/simplification in the bitop nodes directly before falling back to SimplifyMultipleUseDemandedBits
2022-07-12 14:09:00 +01:00
Dawid Jurczak 165240fe38 [NFC] Fix compile time regression seen on some benchmarks after a630ea3003 commit
The goal of this change is fixing most of compile time slowdown seen after a630ea3003 commit on lencod and sqlite3 benchmarks.
There are 3 improvements included in this patch:

1. In getNumOperands when possible get value directly from SmallNumOps.
2. Inline getLargePtr by moving its definition to header.
3. In TBAAStructTypeNode::getField get all operands once instead taking operands in loop one after one.

Differential Revision: https://reviews.llvm.org/D129468
2022-07-12 15:00:27 +02:00
Alex Zinenko 81b62f7feb [mlir] Handle linalg.index correctly in TilingInterface
The existing implementation of the TilingInterface for Linalg ops was not
modifying the `linalg.index` ops contained within other Linalg ops (they need
to be summed up with the values of respective tile loop induction variables),
which led to the interface-based tiling being incorrect for any Linalg op with
index semantics.

In the process, fix the function performing the index offsetting to use the
pattern rewriter API instead of RAUW as it is being called from patterns and
may mess up the internal state of the rewriter. Also rename the function to
clearly catch all uses.

Depends On D129365

Reviewed By: mravishankar

Differential Revision: https://reviews.llvm.org/D129366
2022-07-12 12:36:33 +00:00
Alex Zinenko e15b855e09 [mlir] Use semantically readable functions for transform op effects
A recent commit introduced helper functions with semantically meaningful names
to populate the lists of memory effects in transform ops, use them whenever
possible.

Depends On D129287

Reviewed By: springerm

Differential Revision: https://reviews.llvm.org/D129365
2022-07-12 12:36:31 +00:00
Alex Zinenko 3963b4d0dc [mlir] Transform op for multitile size generation
Introduce a structured transform op that emits IR computing the multi-tile
sizes with requested parameters (target size and divisor) for the given
structured op. The sizes may fold to arithmetic constant operations when the
shape is constant. These operations may then be used to call the existing
tiling transformation with a single non-zero dynamic size (i.e. perform
strip-mining) for each of the dimensions separately, thus achieving multi-size
tiling with optional loop interchange. A separate test exercises the entire
script.

Depends On D129217

Reviewed By: nicolasvasilache

Differential Revision: https://reviews.llvm.org/D129287
2022-07-12 12:36:28 +00:00
Corentin Jabot cc309721d2 [Clang] Add a warning on invalid UTF-8 in comments.
Introduce an off-by default `-Winvalid-utf8` warning
that detects invalid UTF-8 code units sequences in comments.

Invalid UTF-8 in other places is already diagnosed,
as that cannot appear in identifiers and other grammar constructs.

The warning is off by default as its likely to be somewhat disruptive
otherwise.

This warning allows clang to conform to the yet-to be approved WG21
"P2295R5 Support for UTF-8 as a portable source file encoding"
paper.

Reviewed By: aaron.ballman, #clang-language-wg

Differential Revision: https://reviews.llvm.org/D128059
2022-07-12 14:34:30 +02:00
Alex Zinenko 4e4a4c0576 [mlir] Allow Tile transform op to take dynamic sizes
Extend the definition of the Tile structured transform op to enable it
accepting handles to operations that produce tile sizes at runtime. This is
useful by itself and prepares for more advanced tiling strategies. Note that
the changes are relevant only to the transform dialect, the tiling
transformation itself already supports dynamic sizes.

Depends On D129216

Reviewed By: nicolasvasilache

Differential Revision: https://reviews.llvm.org/D129217
2022-07-12 12:21:54 +00:00
Muhammad Omair Javaid 7b69843f0b [LLDB] Catagory decorator for watchpoint test in TestCompletion.py
This patch adds watchpoint catagory decorator to watchpoint dependent
tests in TestCompletion.py.
2022-07-12 17:15:33 +05:00
Joseph Huber d214bfe78d [OpenMP] Do not link static library with `-nogpulib`
Normally we do not link the device libraries if the user passed
`nogpulib` we do this for the standard bitcode library. This behaviour
was not added when using the static library for LTO, causing it to
always be linked in. This patch fixes that.

Reviewed By: JonChesterfield

Differential Revision: https://reviews.llvm.org/D129534
2022-07-12 08:15:15 -04:00
Joseph Huber b1d574867d [Libomptarget] Allow static assert to work on 32-bit systems
Summary:
We use a static assert to make sure that someone doesn't change the size
of an argument struct without properly updating all the other logic.
This originally only checked the size on a 64-bit system with 8-byte
pointers, causing builds on 32-bit systems to fail. This patch allows
either pointer size to work.

Fixes #56486
2022-07-12 08:05:01 -04:00
Peixin Qiao 13019955bf [NFC][flang][OpenMP] Add comment for handling the data race problem in copyin clause
The reference and description is missed before.

Reviewed By: kiranchandramohan

Differential Revision: https://reviews.llvm.org/D129437
2022-07-12 19:54:24 +08:00
Muhammad Omair Javaid 68cc1eeb1d [LLDB] Fix NativePDB/local-variables.cpp for AArch64/Windows
This patch fixes NativePDB/local-variables.cpp test for AArch64 Windows.
There are two changes:
1) Replace function breakpoint with line breakpoint required due to pr56288
2) Adjust "target modules dump ast" test as the output was slightly different
on AArch64/Windows.
2022-07-12 16:26:47 +05:00
Nikita Popov 3d475dfeb9 [Mem2Reg] Consistently preserve nonnull assume for uninit load
When performing a !nonnull load from uninitialized memory, we
should preserve the nonnull assume just like in all other cases.
We already do this correctly in the generic mem2reg code, but
don't handle this case when using the optimized single-block
implementation.

Make sure that the optimized implementation exhibits the same
behavior as the generic implementation.
2022-07-12 12:53:08 +02:00
Aaron Ballman 3cfa32a71e Undeprecate ATOMIC_FLAG_INIT in C++
C++20 deprecated ATOMIC_FLAG_INIT thinking it was deprecated in C when it
wasn't. It is expected to be undeprecated in C++23 as part of LWG3659
(https://wg21.link/LWG3659), which is currently Tentatively Ready.

This handles the case where the user includes <stdatomic.h> in C++ code in a
freestanding compile mode. The corollary libc++ changes are in
1544d1f9fd.
2022-07-12 06:48:31 -04:00
Nikita Popov 81af34402d [Mem2Reg] Add test for uninitialized nonnull loads (NFC)
This shows a difference in behavior between the single block and
the multi block case.
2022-07-12 12:42:23 +02:00
Vignesh Balasubramanian 9dc0d6aaa1 Fixing build bot failure due to python-pip unavailability.
commit: 51d3f421f4
failed due to missing python-pip om machine.
Now the ompd gdb-plugin code will be skipped with a warning
if pip is not available in the machine.
2022-07-12 16:01:59 +05:30
David M. Lary 1e3ee766bb [lldb] add SBSection.alignment to python bindings
This commit adds SBSection.GetAlignment(), and SBSection.alignment as a python property to lldb.

Reviewed By: clayborg, JDevlieghere, labath

Differential Revision: https://reviews.llvm.org/D128069
2022-07-12 12:18:38 +02:00
Pavel Labath 918b1e7bbd Revert "[lldb] add SBSection.alignment to python bindings"
The patch didn't get proper attribution. Will recommit.

This reverts commit 4135abca89.
2022-07-12 12:17:29 +02:00
Pavel Labath 4135abca89 [lldb] add SBSection.alignment to python bindings
This commit adds SBSection.GetAlignment(), and SBSection.alignment as a python property to lldb.

Reviewed By: clayborg, JDevlieghere, labath

Differential Revision: https://reviews.llvm.org/D128069
2022-07-12 12:14:54 +02:00
David Green c5d68ca1c8 [AArch64] Fix subtarget features for tests. NFC
These tests were using instructions that require feature predicates that
were not enabled.
2022-07-12 11:03:40 +01:00
LLVM GN Syncbot a4b6c283e1 [gn build] Port 73ebcabff2 2022-07-12 09:49:13 +00:00
Konstantin Varlamov 73ebcabff2 [libc++][ranges][NFC] Implement the repetitive parts of the remaining range algorithms:
- create the headers (but not include them from `<algorithm>`);
- define the niebloid and its member functions with the right signatures
  (as no-ops);
- make sure all the right headers are included that are required by each
  algorithm's signature;
- update `CMakeLists.txt` and the module map;
- create the test files with the appropriate synopses.

The synopsis in `<algorithm>` is deliberately not updated because that
could be taken as a readiness signal. The new headers aren't included
from `<algorithm>` for the same reason.

Differential Revision: https://reviews.llvm.org/D129549
2022-07-12 02:48:31 -07:00
Nikita Popov 00797b88e0 [InlineAsm] Improve error messages for invalid constraint strings
InlineAsm constraint string verification can fail for many reasons,
but used to always print a generic "invalid type for inline asm
constraint string" message -- which is especially confusing if
the actual error is unrelated to the type, e.g. a failure to parse
the constraint string.

Change the verify API to return an Error with a more specific
error message, and print that in the IR parser.
2022-07-12 11:41:16 +02:00
Michael Buch 4d26faa526 [LLDB][ClangExpression] Remove unused StructVars::m_object_pointer_type
This member variable was removed a while ago in
443427357f. It was previously used in
materialization code paths that have since been removed. Nowadays,
`m_object_pointer_type` gets set but not used anywhere.

This patch simply removes all remaining instances of it and any
supporting code.

**Testing**

* API tests pass

Differential Revision: https://reviews.llvm.org/D129367
2022-07-12 10:33:41 +01:00
Alex Zinenko 80e17355cd [mlir] assorted fixes in transform dialect documentation
Various typos and formatting fixes that make the generated documentation
hard to follow.
2022-07-12 09:18:51 +00:00
Michael Buch d1e9d0b27f [LLDB][DataFormatter] Add data formatter for libcxx std::unordered_map iterator
This patch adds a formatter for libcxx's `std::unordered_map` iterators.
The implementation follows a similar appraoch to the `std::map` iterator
formatter. I was hesistant about coupling the two into a common
implementation since the libcxx layouts might change for one of the
the containers but not the other.

All `std::unordered_map` iterators are covered with this patch:
1. const/non-const key/value iterators
2. const/non-const bucket iterators

Note that, we currently don't have a formatter for `std::unordered_map`.
This patch doesn't change that, we merely add support for its iterators,
because that's what Xcode users requested. One can still see contents
of `std::unordered_map`, whereas with iterators it's less ergonomic.

**Testing**

* Added API test

Differential Revision: https://reviews.llvm.org/D129364
2022-07-12 10:13:55 +01:00
Vignesh Balasubramanian 51d3f421f4 [OpenMP][OMPD] GDB plugin code to leverage libompd to provide debugging
support for OpenMP programs.

This is 5th of 6 patches started from https://reviews.llvm.org/D100181
This plugin code, when loaded in gdb, adds a few commands like
ompd icv, ompd bt, ompd parallel.
These commands create an interface for GDB to read the OpenMP
runtime through libompd.

Reviewed By: @dreachem
Differential Revision: https://reviews.llvm.org/D100185
2022-07-12 14:38:41 +05:30
Alex Zinenko 00d1a1a25f [mlir] Add ReplicateOp to the Transform dialect
This handle manipulation operation allows one to define a new handle that is
associated with a the same payload IR operations N times, where N can be driven
by the size of payload IR operation list associated with another handle. This
can be seen as a sort of broadcast that can be used to ensure the lists
associated with two handles have equal numbers of payload IR ops as expected by
many pairwise transform operations.

Introduce an additional "expensive" check that guards against consuming a
handle that is assocaited with the same payload IR operation more than once as
this is likely to lead to double-free or other undesired effects.

Depends On D129110

Reviewed By: nicolasvasilache

Differential Revision: https://reviews.llvm.org/D129216
2022-07-12 09:07:59 +00:00
Konstantin Varlamov d4c53202eb [libc++][ranges][NFC] Consolidate some repetitive range algorithm tests:
- checking that the algorithm supports predicates returning
  a non-boolean type that's implicitly convertible to `bool`;
- checking that predicates and/or projections are invoked using
  `std::invoke`.

Differential Revision: https://reviews.llvm.org/D129414
2022-07-12 02:06:36 -07:00
Jay Foad 0d1b5268e8 [MachineVerifier] Try harder to verify LiveStacks
Verify the LiveStacks analysis after a pass that claims to preserve it,
even if there are no further passes (apart from the verifier itself)
that would use the analysis.

Differential Revision: https://reviews.llvm.org/D129200
2022-07-12 09:54:54 +01:00
jacquesguan 4d7d5c5f00 [mlir][Math] Support fold SqrtOp with constant dense.
This patch uses constFoldUnaryOpConditional to replace current folder in order to support constant dense.

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D129459
2022-07-12 16:46:19 +08:00
Nikita Popov c64aba5d93 [SDAG] Don't duplicate ParseConstraints() implementation SDAGBuilder (NFCI)
visitInlineAsm() in SDAGBuilder was duplicating a lot of the code
in ParseConstraints(), in particular all the logic to determine the
operand value and constraint VT.

Rely on the data computed by ParseConstraints() instead, and update
its ConstraintVT implementation to match getCallOperandValEVT()
more precisely.
2022-07-12 10:42:02 +02:00
Rosie Sumpter e5edc1b5ee [AArch64][SVE] Ensure PTEST operands have type nxv16i1
Currently any legal predicate types will be pattern-matched when
creating a PTEST instruction. This could be a problem in future since
PTEST always uses the .B specifier for the operand, but it is not
always guaranteed that the extra lanes of unpacked types (e.g. nxv4i1)
are zero. This patch ensures the operands of PTEST are type nxv16i1,
where the undef lanes are set to zero.

Differential Revision: https://reviews.llvm.org/D129282/
2022-07-12 09:27:59 +01:00
Cullen Rhodes 767b26a4e2 [MCA] Support multiple comma-separated -mattr features
Reviewed By: myhsu

Differential Revision: https://reviews.llvm.org/D129479
2022-07-12 08:20:11 +00:00
Denis Revunov 7564167885 [BOLT][AArch64] Use all supported CPU features on AArch64
Since we now have +all feature for AArch64 disassembler, we can use it
in BOLT and allow it to disassemble all ARM instructions supported by LLVM.

Reviewed by: rafauler

Differential Revision: https://reviews.llvm.org/D129139
2022-07-12 03:56:04 -04:00
Pavel Labath d4381153ea [lldb/libc++] Simplify the libc++ string formatter
Precise string layout has changed a lot recently, but a long of these
changes did not have any effect on the usages of its fields -- e.g.
introduction/removal of an anonymous struct or union does not change the
way one can access the field in C++. Our name-based variable lookup
rules (deliberately) copy the C++ semantics, which means these changes
would have been invisible to the them, if only we were using name-based
lookup.

This patch replaces the opaque child index accesses with name-based
lookups, which allows us to greatly simplify the data formatter code.
The formatter continues to support all the string layouts that it
previously supported.

It is unclear why the formatter was not using this approach from the
beginning. I would speculate that the original version was working
around some (now fixed) issue with anonymous members or base classes,
and the subsequent revisions stuck with that approach out of inertia.

Differential Revision: https://reviews.llvm.org/D129490
2022-07-12 09:57:13 +02:00
Manuel Klimek f44d28f840 Fix build errors. 2022-07-12 07:43:26 +00:00
Guillaume Chatelet e0aece276f [libc][utils] Add more methods to StringView
Differential Revision: https://reviews.llvm.org/D128908
2022-07-12 07:42:29 +00:00
Nikita Popov 4bb7b6fae3 [IR] Remove support for float binop constant expressions
As part of https://discourse.llvm.org/t/rfc-remove-most-constant-expressions/63179,
this removes support for the floating-point binop constant expressions
fadd, fsub, fmul, fdiv and frem.

As part of this change, the C APIs LLVMConstFAdd, LLVMConstFSub,
LLVMConstFMul, LLVMConstFDiv and LLVMConstFRem are removed.
The LLVMBuild APIs should be used instead.

Differential Revision: https://reviews.llvm.org/D129478
2022-07-12 09:40:49 +02:00
Ulrich Weigand 3c4468e67f [mlir] XFAIL IR/elements-attr-interface.mlir on SystemZ
This is still failing as endianness of binary blob external
resources is still not handled correctly.
2022-07-12 09:37:19 +02:00
Ulrich Weigand de9a7260ac Read/write external resource alignment tag in little-endian
https://reviews.llvm.org/D126446 added support for encoding
binary blobs in MLIR assembly.  To enable cross-architecture
compatibility, these need to be encoded in little-endian format.

This patch is a first step in that direction by reading and
writing the alignment tag that those blobs are prefixed by
in little-endian format.  This fixes assertion failures in
several test cases on big-endian platforms.

The actual content of the blob is not yet handled here.

Differential Revision: https://reviews.llvm.org/D129483
2022-07-12 09:36:53 +02:00
Jean Perier af40f99e2b [flang] Merge GEPs in substring fir.embox codegen
When computing the base addresses of an array slice to make a
descriptor, codegen generated two LLVM GEPs. The first to compute
the address of the base character element, and a second one to
compute the substring base inside that element.
The previous code did not care about getting the result of the first
GEP right: it used the base array LLVM type as the result type.
This used to work when opaque pointer were not enabled (the actual GEP
result type was probably applied in some later pass). But with opaque
pointers, the second GEP ends-up computing an offset of len*<LLVM array
type> instead of len*<character width>. A previous attempt to fix the
issue was done in D129079, but it does not cover the cases where the
array slice contains subcomponents before the substring
(e.g: array(:)%char_field(5:10)).

This patch fix the issue by computing the actual GEP result type in
codegen. There is also enough knowledge now so that a single GEP can be
generated instead of two.

Differential Revision: https://reviews.llvm.org/D129481
2022-07-12 09:27:51 +02:00