Commit Graph

443378 Commits

Author SHA1 Message Date
Tobias Gysi 36fa80b046 [mlir][llvm] Make additional int debug attribute parameters optional.
The revision makes additional integer debug info parameters such as
line or column numbers optional (e.g. the line and column numbers 0 are
elided when printing, which is in line with the LLVM implementation).

Depends on D138405

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D138437
2022-11-29 14:02:58 +02:00
Thomas Symalla 5f77ee4011 [NFC][AMDGPU] Pre-commit tests for D136432 2022-11-29 12:57:59 +01:00
Jens Massberg 849b650cf3 [clang] Skip defaulted functions in zero-as-null-pointer-constant.
The zero-as-null-pointer-constant check should not fire if it is inside
a defaulted function, e.g. defaulted spaceship operators.
Add C++20 tests with spaceship operators.

Fixes #50221

Differential Revision: https://reviews.llvm.org/D138727
2022-11-29 11:56:10 +01:00
bipmis e9393789a9 [AggressiveInstCombine] Handle the insert point of the merged load correctly.
This patch updates the load insert point of the merged load in AggressiveInstCombine().
This is done to handle the reported test breaks by handling Alias Analysis correctly.

Differential Revision: https://reviews.llvm.org/D137201
2022-11-29 10:53:51 +00:00
Sjoerd Meijer 3ea6a9a469 Recommit "[LoopFlatten] Enable it by default"
The problem in 58441 that was reported after enabling this last time was fixed
in 8e9e22f07b.
2022-11-29 10:45:13 +00:00
Roy Jacobson 3faf1f17a5 [Clang] Implement static operator[]
After accepted in Kona, update the code to accept static operator[] as well.

No big code changes: accept this operator as static in SemaDeclCXX, update AST call generation in SemaOverload and update feature macros + tests accordingly.

Reviewed By: cor3ntin, erichkeane, #clang-language-wg

Differential Revision: https://reviews.llvm.org/D138387
2022-11-29 12:39:52 +02:00
Tobias Gysi be4b49407e [mlir][llvm] Import debug intrinsics from LLVMIR.
Currently, the import of LLVMIR fails if the program contains debug
intrinsics. The revision adds support to import debug intrinsics that
have no debug expression attached and drops all debug intrinsics with a
non-empty debug expression. It also moves the existing debug intrinsics
into the "intr" namespace by deriving from LLVM_IntrOp.

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D138405
2022-11-29 12:31:54 +02:00
Pavel Labath 6335deb68b [lldb/test] Use SBPlatform info for lldbplatformutil.getPlatform()
Previously, we just used the platform name. This worked mostly OK, but
it required adding special handling for any unusual (and potentially
downstream) platform plugins, as evidenced by the hardcoding of the
qemu-user platform.

The current implementation was added in
D121605/21c5bb0a636c23ec75b13681c0a6fdb03ecd9c0d, which this essentially
reverts and goes back to the previous method of retrieving the platform
name from the platform triple (the "OS" field).

The motivation for D121605 was the ability to retrieve the process
without constructing an SBDebugger object (which would be necessary in a
world where SBPlatforms are managed by SBDebuggers). However, this world
did not arrive (mainly due to other commitments on my part), and I now
think that if we do want to go in that direction, that we should just
create a dummy/empty SBDebugger object for holding the initial
SBPlatform.

One benefit of D121605 was the unification of getPlatform and
getHostPlatform code paths, and I preserve that benefit by unifying them
in the other direction -- using the host SBPlatform for getHostPlatform.

Differential Revision: https://reviews.llvm.org/D138430
2022-11-29 11:29:58 +01:00
Qihan Cai 1147e70e7e [flang] Enable RISC-V for x86CompatibleBehavior in floating point flag
Fixes #59132 by mitigating the behavior of not setting underflow flag on RISC-V platform.

Reviewed By: vzakhari

Differential Revision: https://reviews.llvm.org/D138503
2022-11-29 21:15:19 +11:00
Simon Tatham e45cbf9923 [ARM,MVE] Update MVE_VMLA_qr for architecture change.
In revision B.q and before of the Armv8-M architecture reference
manual, the vector/scalar forms of the `vmla` and `vmlas` instructions
came in signed and unsigned integer forms, such as `vmla.s8 q0,q1,r2`
or `vmlas.u32 q3,q4,r5`.

Revision B.r has changed this. There are no longer signed and unsigned
versions of these instructions, since they were functionally identical
anyway. Now there is just `vmla.i8` (or `i16` or `i32`, and similarly
for `vmlas`). Bit 28 of the instruction encoding, which was previously
0 for signed or 1 for unsigned, is now expected to be 0 always.

This change updates LLVM to the new version of the architecture. The
obsoleted encodings for unsigned integers are now decoding errors, and
only the still-valid encoding is ever emitted. This shouldn't break
any existing assembly code, because the old signed and unsigned
versions of the mnemonic are still accepted by the assembler (which is
standard practice anyway for all signedness-agnostic MVE integer
instructions).

Reviewed By: dmgreen, lenary

Differential Revision: https://reviews.llvm.org/D138827
2022-11-29 08:47:00 +00:00
Dmitry Makogon a580d2e430 [Test] Update tests for LoopPredication constant ranges widening 2022-11-29 14:09:47 +07:00
Freddy Ye 67e253c354 [NFC][X86] Correct _axor_i32 's pseudo code. 2022-11-29 15:08:17 +08:00
Vitaly Buka ca3c58f0d1 [lsan] Add logs for debugging 2022-11-28 22:59:38 -08:00
Douglas Yung 2f8ac18048 Revert "[clang][deps] During scanning don't emit warnings-as-errors that are ignored with diagnostic pragmas."
This reverts commit eac90d1236.

This change is causing a test failure on the PS4/PS5 bots:
https://lab.llvm.org/buildbot/#/builders/139/builds/31784
https://lab.llvm.org/buildbot/#/builders/216/builds/13476
2022-11-28 21:22:29 -08:00
Petr Hosek bec8a372fc [CMake] Use LLVM_TARGET_TRIPLE in runtimes
This variable is derived from LLVM_DEFAULT_TARGET_TRIPLE by default,
but using a separate variable allows additional normalization to be
performed if needed.

Differential Revision: https://reviews.llvm.org/D137451
2022-11-29 04:08:24 +00:00
Diego Caballero eb7e2998d1 Reland "[mlir][Vector] Re-define masking semantics in vector.transfer ops""
This relands commit 847b5f82a4.

Differential Revision: https://reviews.llvm.org/D138079
2022-11-29 03:36:54 +00:00
Quinn Dawkins c0321edc26 [mlir][gpu] Adding support for transposed mma_load_matrix
Enables transposed gpu.subgroup_mma_load_matrix and updates the lowerings in Vector to GPU and GPU to SPIRV. Needed to enable B transpose matmuls lowering to wmma ops.

Taken over from author: stanley-nod <stanley@nod-labs.com>

Reviewed By: ThomasRaoux, antiagainst

Differential Revision: https://reviews.llvm.org/D138770
2022-11-29 03:35:49 +00:00
Uday Bondhugula f49d069ac0 [MLIR] Make promote single iteration optional on affine-loop-normalize
Make promote single iteration optional on affine-loop-normalize:
introduce a command-line flag and an argument on the utility. Disable it
by default since such a promotion isn't normally expected with loop
normalization: it could drop certain structure or information on the
loops that a user wanted to preserve.

Reviewed By: dcaballe

Differential Revision: https://reviews.llvm.org/D137605
2022-11-29 07:58:10 +05:30
Uday Bondhugula 9de01f3cff [MLIR] NFC. Change debug name LoopUtils -> loop-utils
Rename DEBUG_TYPE for LoopUtils -> loop-utils to be consistent with the
names used for the other files. Fix clang-tidy warnings on argument name
mismatches.

Reviewed By: bondhugula

Differential Revision: https://reviews.llvm.org/D138752
2022-11-29 07:56:49 +05:30
Peter Rong a7def9f7f2 [FuzzMutate] New strategy `ShuffleBlockStrategy`
`ShuffleBlockStrategy` will shuffle the instructions in a basic block without breaking the dependency of instructions.
It is implemented as a topological sort, only we randomly select instructions with no dependency.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D138339
2022-11-28 17:57:26 -08:00
Ron Lieberman a1066569b8 [check-openmp] fix bug49334 bot fails - temporary 2022-11-28 19:10:43 -06:00
wlei ef0cb372dc [llvm_stats] Do not import llvm.stats metadata for thinlto
The stats are computed per module and will all be merged in the binary, importing the metadata will cause duplication of the stats.

Reviewed By: hoy, wenlei

Differential Revision: https://reviews.llvm.org/D138833
2022-11-28 16:47:20 -08:00
Stanislav Mekhanoshin 28eb9ed3bb [AMDGPU] Fine tune LDS misaligned access speed
Differential Revision: https://reviews.llvm.org/D124219
2022-11-28 16:12:02 -08:00
Usman Nadeem 54dc764db7 [Flang][Test] Add support to change the default target triple for tests
In this patch I added support to change the default target triple used
by flang tests using the cmake variable: FLANG_TEST_TARGET_TRIPLE.

This functionality is implemented using the LLVM_TARGET_TRIPLE_ENV
variable, so that must be defined as well.

An example use:
`-DLLVM_TARGET_TRIPLE_ENV="LLVM_TARGET_TRIPLE_ENV" -DFLANG_TEST_TARGET_TRIPLE="aarch64-linux-gnu"`

Differential revision: https://reviews.llvm.org/D138530

Change-Id: I38e4a46a65109d415a9b72c8a0bf8a955e937280
2022-11-28 16:02:22 -08:00
Diego Caballero f6d90055fd [mlir][Vector] Remove 'lower-permutation-maps' option from VectorToSCF
This patch is part of a larger simplification effort of vector transfer
operations. It removes the flag `lower-permutation-maps` from
VectorToSCF conversion and enables the lowering of permutation maps
by default. This means that VectorToSCF will always lower permutation
maps to independent broadcast/transpose operations before lowering
vector operations to SCF.

Reviewed By: nicolasvasilache

Differential Revision: https://reviews.llvm.org/D138742
2022-11-28 23:56:43 +00:00
Stanislav Mekhanoshin c46634554d [LoadStoreVectorizer] Consider if operation is faster than before
Compare a relative speed of misaligned accesses before and
after vectorization, not just check the new instruction is
not going to be slower.

Since no target now returns anything but 0 or 1 for Fast
argument of the allowsMisalignedMemoryAccesses this is still NFCI.

The subsequent patch will tune actual vaues of Fast on AMDGPU.

Differential Revision: https://reviews.llvm.org/D124218
2022-11-28 15:52:32 -08:00
Kazu Hirata 55378ae87c [Analysis] Remove unused fields in MemorySSA.cpp (NFC)
The last uses of AR were removed on July 28, 2022 in commit
f96ea53e89.

Differential Revision: https://reviews.llvm.org/D138730
2022-11-28 15:39:32 -08:00
Hanhan Wang 0a1569a400 [mlir][NFC] Remove trailing whitespaces from `*.td` and `*.mlir` files.
This is generated by running

```
sed --in-place 's/[[:space:]]\+$//' mlir/**/*.td
sed --in-place 's/[[:space:]]\+$//' mlir/**/*.mlir
```

Reviewed By: rriddle, dcaballe

Differential Revision: https://reviews.llvm.org/D138866
2022-11-28 15:26:30 -08:00
Koakuma 17d0a15478 [SPARC][clang] Enable frame pointer optimization by default
Enable frame pointer optimization by default to match it with other targets.

This brings a small reduction in generated binary sizes.

Fixes bug #48327

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D138532
2022-11-28 18:22:46 -05:00
Hanhan Wang e86169f090 [mlir][tensor] Add a custom builder for pack op.
The `paddingValue` and `outerDimsPerm` are optional to the op;
`innerTiles` can be variadic in terms of static sizes and dynamic sizes.
Add a custom builder for building pack op easier.

Reviewed By: mravishankar

Differential Revision: https://reviews.llvm.org/D138860
2022-11-28 15:18:42 -08:00
Shilei Tian fa06d4d3e2 [OpenMP][Test] Fixed the issue that lit complains test doesn't have run line 2022-11-28 18:13:55 -05:00
Shilei Tian 3523f94bfa [OpenMP][Test] Disable bug49334.cpp because of its flaky failure 2022-11-28 18:08:14 -05:00
Matt Arsenault aa4acea8cd clang/HIP: Add another math header test
This needs more exhaustive checks for the other things here;
for now just test the ones directly calling ocml functions.
2022-11-28 18:02:20 -05:00
Qihan Cai bac88e898f [flang] Add RISCV-64 support to Optimizer/CodeGen/Target.cpp
As an attempt to fix errors in Flang regression tests on RISCV64 platform, RISCV64 target was added, and subsequent tests were provided.

Reviewed By: vzakhari

Differential Revision: https://reviews.llvm.org/D136547
2022-11-29 09:49:26 +11:00
Florian Hahn bf15f1e489
Revert "[VPlan] Add VPDerivedIVRecipe, use for VPScalarIVStepsRecipe."
This reverts commit 0fa666eced.

This triggers an assertion during AArch64 stage2 builds. Revert while I
investigate.

See https://lab.llvm.org/buildbot/#/builders/179/builds/4967/steps/11/logs/stdio
2022-11-28 22:43:11 +00:00
Erich Keane 07008a8df5 CWG2635: Disallow constrained structured bindings.
CWG2635 prohibits adding a constraint to a structured as a defect
report.  This patch implements that restriction.

Differential Revision: https://reviews.llvm.org/D138852
2022-11-28 14:41:14 -08:00
Louis Dionne 5935db6ebd [libc++] Fix incorrect guard against the presence of wide characters
TEST_HAS_NO_WIDE_CHARACTERS should only be used in the tests.

Differential Revision: https://reviews.llvm.org/D138828
2022-11-28 14:33:49 -08:00
Thomas Raoux df47f3ea0d [mlir][spirv] Add lowering for gpu shuffle idx
Differential Revision: https://reviews.llvm.org/D138863
2022-11-28 22:17:19 +00:00
Corentin Jabot e6624a2f36 [Clang] Update the status of mostly-editorial defect reports
- CWG2644 and CWG2650 fix examples
- CWG2636 updates Annex E
- CWG2642 is editorial
2022-11-28 23:16:04 +01:00
Hanhan Wang 9b16d9d271 [mlir][linalg] Add a new pattern to handle folding unit reduction dims.
The output operands will be added to input operands if the generic op (on tensors)
becomes an elementwise operation. The outputs of the generic op is still the same.
They will be cleaned up by ReplaceWithEmptyTensorIfUnused pattern.

This is https://reviews.llvm.org/D138251, plus a cmake dep fix.

Reviewed By: mravishankar

Differential Revision: https://reviews.llvm.org/D138843
2022-11-28 14:14:43 -08:00
Volodymyr Sapsai eac90d1236 [clang][deps] During scanning don't emit warnings-as-errors that are ignored with diagnostic pragmas.
Before the fix the scanning would fail with
`-Werror,-Wnon-modular-include-in-module` despite the warning being
suppressed in the source code.

Existing approach with `-Wno-error` is not sufficient because it negates
only general `-Werror` but not specific `-Werror=...` and some warnings
can still emitted as errors. Make the approach stricter by using `-w`
flag and ignore all warnings, including those upgraded to errors. This
approach is still valid as it doesn't affect the dependencies.

rdar://101588531

Differential Revision: https://reviews.llvm.org/D138252
2022-11-28 13:48:29 -08:00
Mircea Trofin 255e7e1c21 [UpdateTestChecks] Fix `update_*_test_checks.py` to add "unused" prefixes
The support introduced in D124306 was only added to
update_llc_test_checks.py, but the motivating usecases (see
https://lists.llvm.org/pipermail/llvm-dev/2021-February/148326.html)
cover update_test_checks.py, update_cc_test_checks.py, and
update_analyze_test_checks.py, too.

Issue #59220.

Differential Revision: https://reviews.llvm.org/D138836
2022-11-28 13:24:32 -08:00
Martin Storsjö 5611bf69fc Revert "[openmp] [test] XFAIL many-microtask-args.c on ARM"
This reverts commit 03bf001b6d.

This commit broke a number of OpenMP buildbots, e.g.
https://lab.llvm.org/buildbot#builders/84/builds/31839, where
the build ends up with errors like this:

[0/1] Running OpenMP tests
llvm-lit: /b/1/openmp-clang-x86_64-linux-debian/llvm.src/llvm/utils/lit/lit/TestingConfig.py:140: fatal: unable to parse config file '/b/1/openmp-clang-x86_64-linux-debian/llvm.build/projects/openmp/libomptarget/test/x86_64-pc-linux-gnu/lit.site.cfg', traceback: Traceback (most recent call last):
 File "/b/1/openmp-clang-x86_64-linux-debian/llvm.src/llvm/utils/lit/lit/TestingConfig.py", line 129, in load_from_path
   exec(compile(data, path, 'exec'), cfg_globals, None)
 File "/b/1/openmp-clang-x86_64-linux-debian/llvm.build/projects/openmp/libomptarget/test/x86_64-pc-linux-gnu/lit.site.cfg", line 6
   config.test_compiler_features =
                                   ^
SyntaxError: invalid syntax
2022-11-28 23:08:10 +02:00
Janek van Oirschot 322966f8f8 [AMDGPU] Add llvm.is.fpclass intrinsic to existing SelectionDAG fp
class support and introduce GlobalISel implementation for AMDGPU

Uses existing SelectionDAG lowering of the llvm.amdgcn.class intrinsic
for llvm.is.fpclass
2022-11-28 16:00:36 -05:00
Sanjay Patel a00936484b [InstCombine] improve readability of combineLoadToOperationType(); NFC 2022-11-28 16:00:06 -05:00
Sanjay Patel c7bd82dfd8 [PhaseOrdering] add test for vector load combining; NFC
This is another example from issue #17113
2022-11-28 16:00:06 -05:00
Slava Zakharin 5bd8175dd7 [AA] A global cannot escape through nocapture/nocallback call.
When an internal global is passed to a 'nocallback' call as
a 'nocapture' pointer, it cannot escape through this call and
be indirectly referenced in this module.
So it must not alias with any pointer in the module.

This may provide some remedy for Fortran module-private array descriptors
that are usually passed by address to some runtime functions
(e.g. to allocation/deallocation functions). In general, a good aliasing
information derived from Fortran language rules would solve the same issue,
but I think this change may be beneficial as-is (given that nocapture,
nocallback attributes are properly set).

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D138336
2022-11-28 12:50:31 -08:00
Philip Reames 1a5be5265c [RISCV] Move implementation of adjustReg from frame lowering to register info [nfc]
Putting both variants of this function in the same place, in advance of code resuse.  Note that I tweaked the API slightly in advance of additional callers without the alignment requirement.  Some of the existing callers may also be okay with weaker alignment requirements, but that should be it's own set of changes.
2022-11-28 12:41:00 -08:00
Martin Storsjö 4ed8fcc59a [openmp] [test] Fix data structure mismatches for tests that define kmp_depend_info
Use the correct data type for pointer sized integers on Windows;
"long" is always 32 bit, even on 64 bit Windows - don't use it
for the kmp_intptr_t type.

Provide the exact correct definition of the kmp_depend_info
struct - avoid the risk of mismatches (if a platform would pack
things slightly differently when things are declared differently).

Zero initialize the whole dep_info struct before filling it in;
if only setting the in/out bits, the rest of the unallocated bits
in the bitfield can have undefined values. Libomp reads the flags
in combined form as an kmp_uint8 by reading the flag field - thus,
the unused bits do need to be zeroed. (Alternatively, the flag field
could be set to zero before setting the individual bits in the
bitfield).

Use kmp_intptr_t instead of long for casting pointers to integers.

Differential Revision: https://reviews.llvm.org/D137748
2022-11-28 22:40:02 +02:00
Martin Storsjö 03bf001b6d [openmp] [test] XFAIL many-microtask-args.c on ARM
On ARM, a C fallback version of __kmp_invoke_microtask is used,
which only handles up to a fixed number of arguments - while
many-microtask-args.c tests that the function can handle an
arbitrarily large number of arguments (the testcase produces 17
arguments).

On the CMake level, we can't add ${LIBOMP_ARCH} directly to
OPENMP_TEST_COMPILER_FEATURES in OpenMPTesting.cmake, since
that file is parsed before LIBOMP_ARCH is set. Instead
convert the feature list into a proper CMake list, and append
${LIBOMP_ARCH} into it before serializing it to an Python array.

Differential Revision: https://reviews.llvm.org/D138738
2022-11-28 22:40:02 +02:00