Hassnaa Hamdi [Tue, 29 Nov 2022 11:51:21 +0000 (11:51 +0000)]
[AArch64][SME]: Generate streaming-compatible code for bit counting/select
To generate code compatible to streaming mode:
- enable custom-lowering ISD::CTLZ and ISD::CTPOP.
- disable combining OR into BSL.
- Testing files:
- bit-counting.ll
- bitselect.ll
Reviewed By: david-arm, sdesmalen
Differential Revision: https://reviews.llvm.org/D138682
Hassnaa Hamdi [Thu, 24 Nov 2022 19:05:25 +0000 (19:05 +0000)]
[AArch64][SME]: Add precursory tests for D138682
Add testing files:
- bit-counting.ll
- bitselect.ll
Jordan Rupprecht [Tue, 29 Nov 2022 12:22:30 +0000 (04:22 -0800)]
[test] Implement layout for unstable std::string garbage formatter tests.
The layout is essentially just reversed from the stable std::string layout.
Reviewed By: labath
Differential Revision: https://reviews.llvm.org/D138850
Valentin Clement [Tue, 29 Nov 2022 12:21:56 +0000 (13:21 +0100)]
[flang][NFC] Retrieve binding table from fir.dispatch_table operations
Change how the binding tables are retrived. Use the newly lowered
fir.dispatch_table operations instead of the fir.global type infos.
Reviewed By: jeanPerier
Differential Revision: https://reviews.llvm.org/D138903
Sam McCall [Sat, 8 Oct 2022 04:39:48 +0000 (06:39 +0200)]
[clangd] Heuristic to avoid desync if editors are confused about newline-at-eof
As strange as it seems to our files-are-strings view of the world, some editors
that treat files as arrays of lines can get confused about whether the last line
has a newline or not.
The consequences of failing to handle a bad incremental update are catastrophic.
If an update would be valid except for a missing newline at end of file, pretend
one exists.
This fixes problems still present in neovim where deleting all text often leads
to a desync shortly afterwards: https://github.com/neovim/neovim/issues/17085
Differential Revision: https://reviews.llvm.org/D135508
Jordan Rupprecht [Tue, 29 Nov 2022 12:14:55 +0000 (04:14 -0800)]
[NFC] Make headers self-contained.
Some headers in LLDB work only when considered as textual inclusion, but not if one attempts to use them on their own or with a different context.
- python-typemaps.h: uses Python definitions without using "Python.h".
- RISCVCInstructions.h uses RISC-V register enums without including the enums header.
- RISCVInstructions.h includes EmulateInstructionRISCV.h, but is unnecessary since we forward-declare EmulateInstructionRISCV anyway. Including the header is problematic because EmulateInstructionRISCV.h uses DecodeResult which isn't defined until later in RISCVInstructions.h.
This makes LLDB build cleanly with the "parse_headers" feature [1]. I'm not sure what the analagous CMake option is.
[1] I didn't find public documentation but @MaskRay wrote this up: https://maskray.me/blog/2022-09-25-layering-check-with-clang#parse_headers
Reviewed By: labath, MaskRay
Differential Revision: https://reviews.llvm.org/D138310
Tobias Gysi [Tue, 29 Nov 2022 11:50:01 +0000 (13:50 +0200)]
[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
Thomas Symalla [Tue, 29 Nov 2022 11:09:24 +0000 (12:09 +0100)]
[NFC][AMDGPU] Pre-commit tests for D136432
Jens Massberg [Fri, 25 Nov 2022 16:18:03 +0000 (17:18 +0100)]
[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
bipmis [Tue, 29 Nov 2022 10:53:51 +0000 (10:53 +0000)]
[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
Sjoerd Meijer [Tue, 29 Nov 2022 10:39:08 +0000 (10:39 +0000)]
Recommit "[LoopFlatten] Enable it by default"
The problem in 58441 that was reported after enabling this last time was fixed
in
8e9e22f07bcbe2ee95478684cf31948370e4e51e.
Roy Jacobson [Sun, 20 Nov 2022 22:30:59 +0000 (00:30 +0200)]
[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
Tobias Gysi [Tue, 29 Nov 2022 10:11:55 +0000 (12:11 +0200)]
[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
Pavel Labath [Mon, 21 Nov 2022 13:17:07 +0000 (14:17 +0100)]
[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
Qihan Cai [Tue, 22 Nov 2022 16:12:26 +0000 (03:12 +1100)]
[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
Simon Tatham [Tue, 29 Nov 2022 08:46:49 +0000 (08:46 +0000)]
[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
Dmitry Makogon [Tue, 29 Nov 2022 07:08:42 +0000 (14:08 +0700)]
[Test] Update tests for LoopPredication constant ranges widening
Freddy Ye [Tue, 29 Nov 2022 07:08:17 +0000 (15:08 +0800)]
[NFC][X86] Correct _axor_i32 's pseudo code.
Vitaly Buka [Tue, 29 Nov 2022 06:58:46 +0000 (22:58 -0800)]
[lsan] Add logs for debugging
Douglas Yung [Tue, 29 Nov 2022 05:22:29 +0000 (21:22 -0800)]
Revert "[clang][deps] During scanning don't emit warnings-as-errors that are ignored with diagnostic pragmas."
This reverts commit
eac90d1236cfd2935fac5cbe5634f09e2cd0981a.
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
Petr Hosek [Wed, 16 Feb 2022 06:59:08 +0000 (22:59 -0800)]
[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
Diego Caballero [Fri, 18 Nov 2022 18:35:32 +0000 (18:35 +0000)]
Reland "[mlir][Vector] Re-define masking semantics in vector.transfer ops""
This relands commit
847b5f82a4a34218bf16d6f83f1b7c32df3117ba.
Differential Revision: https://reviews.llvm.org/D138079
Quinn Dawkins [Tue, 29 Nov 2022 03:25:09 +0000 (03:25 +0000)]
[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
Uday Bondhugula [Tue, 29 Nov 2022 02:28:04 +0000 (07:58 +0530)]
[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
Uday Bondhugula [Tue, 29 Nov 2022 01:28:14 +0000 (06:58 +0530)]
[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
Peter Rong [Sat, 19 Nov 2022 00:17:08 +0000 (16:17 -0800)]
[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
Ron Lieberman [Tue, 29 Nov 2022 01:10:43 +0000 (19:10 -0600)]
[check-openmp] fix bug49334 bot fails - temporary
wlei [Mon, 28 Nov 2022 18:02:14 +0000 (10:02 -0800)]
[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
Stanislav Mekhanoshin [Fri, 22 Apr 2022 00:02:40 +0000 (17:02 -0700)]
[AMDGPU] Fine tune LDS misaligned access speed
Differential Revision: https://reviews.llvm.org/D124219
Usman Nadeem [Mon, 28 Nov 2022 23:51:15 +0000 (15:51 -0800)]
[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
Diego Caballero [Mon, 28 Nov 2022 23:48:38 +0000 (23:48 +0000)]
[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
Stanislav Mekhanoshin [Thu, 21 Apr 2022 23:45:19 +0000 (16:45 -0700)]
[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
Kazu Hirata [Mon, 28 Nov 2022 23:39:32 +0000 (15:39 -0800)]
[Analysis] Remove unused fields in MemorySSA.cpp (NFC)
The last uses of AR were removed on July 28, 2022 in commit
f96ea53e892e0dfc1ee778868c1ed33616b95a82.
Differential Revision: https://reviews.llvm.org/D138730
Hanhan Wang [Mon, 28 Nov 2022 22:17:55 +0000 (14:17 -0800)]
[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
Koakuma [Sun, 27 Nov 2022 04:45:45 +0000 (23:45 -0500)]
[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
Hanhan Wang [Mon, 28 Nov 2022 21:40:17 +0000 (13:40 -0800)]
[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
Shilei Tian [Mon, 28 Nov 2022 23:13:55 +0000 (18:13 -0500)]
[OpenMP][Test] Fixed the issue that lit complains test doesn't have run line
Shilei Tian [Mon, 28 Nov 2022 23:08:14 +0000 (18:08 -0500)]
[OpenMP][Test] Disable bug49334.cpp because of its flaky failure
Matt Arsenault [Tue, 22 Nov 2022 17:47:32 +0000 (12:47 -0500)]
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.
Qihan Cai [Sun, 23 Oct 2022 07:52:09 +0000 (18:52 +1100)]
[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
Florian Hahn [Mon, 28 Nov 2022 22:43:11 +0000 (22:43 +0000)]
Revert "[VPlan] Add VPDerivedIVRecipe, use for VPScalarIVStepsRecipe."
This reverts commit
0fa666ecedc3f36471c0fee925d664512e7525a8.
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
Erich Keane [Mon, 28 Nov 2022 20:09:58 +0000 (12:09 -0800)]
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
Louis Dionne [Mon, 28 Nov 2022 16:49:23 +0000 (11:49 -0500)]
[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
Thomas Raoux [Mon, 28 Nov 2022 21:58:37 +0000 (21:58 +0000)]
[mlir][spirv] Add lowering for gpu shuffle idx
Differential Revision: https://reviews.llvm.org/D138863
Corentin Jabot [Mon, 28 Nov 2022 22:09:54 +0000 (23:09 +0100)]
[Clang] Update the status of mostly-editorial defect reports
- CWG2644 and CWG2650 fix examples
- CWG2636 updates Annex E
- CWG2642 is editorial
Hanhan Wang [Wed, 23 Nov 2022 18:46:46 +0000 (10:46 -0800)]
[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
Volodymyr Sapsai [Fri, 18 Nov 2022 02:12:48 +0000 (18:12 -0800)]
[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
Mircea Trofin [Mon, 28 Nov 2022 18:02:14 +0000 (10:02 -0800)]
[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
Martin Storsjö [Mon, 28 Nov 2022 21:08:10 +0000 (23:08 +0200)]
Revert "[openmp] [test] XFAIL many-microtask-args.c on ARM"
This reverts commit
03bf001b6d95f7c6a88a2b95f3cad752b9d1ed45.
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
Janek van Oirschot [Mon, 28 Nov 2022 20:40:31 +0000 (15:40 -0500)]
[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
Sanjay Patel [Mon, 28 Nov 2022 20:35:06 +0000 (15:35 -0500)]
[InstCombine] improve readability of combineLoadToOperationType(); NFC
Sanjay Patel [Mon, 28 Nov 2022 15:11:23 +0000 (10:11 -0500)]
[PhaseOrdering] add test for vector load combining; NFC
This is another example from issue #17113
Slava Zakharin [Mon, 28 Nov 2022 17:17:28 +0000 (09:17 -0800)]
[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
Philip Reames [Mon, 28 Nov 2022 20:38:50 +0000 (12:38 -0800)]
[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.
Martin Storsjö [Tue, 8 Nov 2022 08:50:33 +0000 (10:50 +0200)]
[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
Martin Storsjö [Fri, 25 Nov 2022 14:26:50 +0000 (16:26 +0200)]
[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
Martin Storsjö [Sat, 5 Nov 2022 19:54:37 +0000 (21:54 +0200)]
[openmp] [test] Set __COMPAT_LAYER=RunAsInvoker when running tests on Windows
Windows heuristics may decide to want to run some tested processes
as elevated (since it may think some of them are installers - executables
with "dispatch" in the name may hit a heuristic looking for "patch").
Set this environment variable to disable this heuristic and just run
the executable with whatever privileges the caller has.
This fixes a couple tests on such versions of Windows where this
heuristic is active.
Differential Revision: https://reviews.llvm.org/D137772
Martin Storsjö [Wed, 16 Nov 2022 09:42:16 +0000 (11:42 +0200)]
[openmp] Use GCC style intrinsics for atomics on Clang-cl on aarch64 too
This fixes compilation in the Clang-cl configuration on aarch64;
Clang doesn't implement all the aarch64 MSVC atomic intrinsics yet.
Differential Revision: https://reviews.llvm.org/D138737
Martin Storsjö [Mon, 28 Nov 2022 10:36:36 +0000 (12:36 +0200)]
[llvm-objcopy] [COFF] Always set PointerToRawData when writing a COFF file
If we don't want to set PointerToRawData, for an empty section,
we do must set it to zero explicitly. Some object file generators
do set it to zero for empty sections, while others set a nonzero
value pointing at the end of the previous section.
If the value was nonzero on input, we need to update it - either
setting it to zero, or to a valid offset in the output file (not
out of bounds)
This fixes https://github.com/mstorsjo/llvm-mingw/issues/313.
Testing this is tricky, because we can't use yaml2obj, since that
doesn't produce object files with nonzero PointerToRawData for
empty sections. We can use llvm-mc to assemble a small file
(assuming that LLVM's MC layer keeps this behaviour), or bundle
a small binary object file. I opted for using llvm-mc for now here
(with a test that it actually does keep this property), but I don't
mind changing it to a canned object file to make the test less brittle.
Differential Revision: https://reviews.llvm.org/D138783
Matt Arsenault [Mon, 28 Nov 2022 20:34:12 +0000 (15:34 -0500)]
AMDGPU: Code simplification for ctor/dtor lowering
Move the shared global variable lookup into the function.
Corentin Jabot [Mon, 28 Nov 2022 20:05:07 +0000 (21:05 +0100)]
[Clang] Permit static constexpr variables in constexpr functions
This implement the C++23 paper P2647R1 (adopted in Kona)
Reviewed By: #clang-language-wg, erichkeane
Differential Revision: https://reviews.llvm.org/D138851
Raul Ferrando [Mon, 28 Nov 2022 20:32:40 +0000 (15:32 -0500)]
Update wrong Unicode code point in confusable-identifiers.rst
In confusable-identifiers.rst the description refers to wrong Unicode code point.
The shown code point is U+1D41F, not U+1234.
Updated the code point and it's description.
Fixes #58934
Differential Revision: https://reviews.llvm.org/D138838
Matt Arsenault [Mon, 28 Nov 2022 20:24:16 +0000 (15:24 -0500)]
Utils: Use StringRef and rename variable for clarity
Matt Arsenault [Mon, 28 Nov 2022 20:06:09 +0000 (15:06 -0500)]
GlobalValue: Move trivial getAddressSpace getter to header
Arthur Eubanks [Mon, 28 Nov 2022 17:05:45 +0000 (09:05 -0800)]
[MCJIT][test] Use new pass manager API
Arthur Eubanks [Mon, 24 Oct 2022 17:21:39 +0000 (10:21 -0700)]
[LegacyPM] Remove pipeline extension mechanism
Part of gradually removing the legacy PM optimization pipeline.
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D136622
chenglin.bi [Mon, 28 Nov 2022 20:07:43 +0000 (04:07 +0800)]
[InstSimplify] add precommit test for pattern !(X || Y) && X --> false; NFC
Valentin Clement [Mon, 28 Nov 2022 19:55:00 +0000 (20:55 +0100)]
[flang] Handle polymorphic argument when expecting boxed derived-type
Perform a rebox instead of a convert operation when the input type is
polymorphic and the output type is a boxed derived-type.
Reviewed By: PeteSteinfeld
Differential Revision: https://reviews.llvm.org/D138831
Ben Barham [Fri, 18 Nov 2022 20:32:39 +0000 (12:32 -0800)]
[Index] Add various missing USR generation
Over the years there's been many builtin types added without
corresponding USRs. Add a `@BT@<name>` USR for all these types. Also add
a comment so that hopefully this doesn't continue happening.
`MSGuid` was also missing a USR, use `@MG@GUID{<uuid>}` for it.
Resolves rdar://
102198268.
Differential Revision: https://reviews.llvm.org/D138322
chenglin.bi [Mon, 28 Nov 2022 19:47:22 +0000 (03:47 +0800)]
[InstSimplify] add precommit test for pattern (X || Y) ? false : X -> false; NFC
Arthur Eubanks [Mon, 28 Nov 2022 19:30:09 +0000 (11:30 -0800)]
[opt] Hoist errors between flags and legacy PM interaction
Jakub Kuderski [Mon, 28 Nov 2022 19:24:04 +0000 (14:24 -0500)]
[mlir][vector] Add fold pattern to constant-fold InsertStridedSliceOp
Fold InsertStridedOp(ConstantOp into ConstantOp) -> ConstantOp.
This pattern comes with vector size threshold to make sure we do not
introduce too many large constants.
This help clean up code created by the Wide Integer Emulation pass.
Reviewed By: antiagainst
Differential Revision: https://reviews.llvm.org/D138739
Matt Arsenault [Mon, 28 Nov 2022 19:13:14 +0000 (14:13 -0500)]
AMDGPU: Bulk update some intrinsic tests to opaque pointers
Done entirely with the script.
Vlad Serebrennikov [Mon, 28 Nov 2022 19:19:59 +0000 (11:19 -0800)]
[clang] Update DR status to Revision 110
Also update a hack in make_cxx_dr_status that handles tests for CWGs
that are still open.
Differential Revision: https://reviews.llvm.org/D138835
Matt Arsenault [Mon, 28 Nov 2022 17:23:19 +0000 (12:23 -0500)]
AMDGPU: Convert some memcpy test to opaque pointers
memcpy-scoped-aa.ll required manually updating the IR references in
the MMOs
Arthur Eubanks [Mon, 28 Nov 2022 19:00:45 +0000 (11:00 -0800)]
[opt] Remove "new-pm" from some cl::opt names
Arthur Eubanks [Mon, 28 Nov 2022 18:57:32 +0000 (10:57 -0800)]
[NFC][opt] Move some cl::opts into the only file they're used in
Luke Nihlen [Thu, 17 Nov 2022 15:24:05 +0000 (15:24 +0000)]
[clang] Require parameter pack to be last argument in concepts.
Fixes GH48182.
Erich Keane [Mon, 28 Nov 2022 18:21:38 +0000 (10:21 -0800)]
Stop accepting 'bool' in a concept declaration as an extension.
We no longer support the concepts-ts flag for this release, so stop
supporting this concepts-ts compat extension as well.
Aaron Ballman [Mon, 28 Nov 2022 18:11:31 +0000 (13:11 -0500)]
Remove this type from Parser.h; NFC
TypeVector is only used once and isn't used in any interfaces, so this
removes the typedef.
Philip Reames [Mon, 28 Nov 2022 17:26:21 +0000 (09:26 -0800)]
[RISCV] Simplify eliminateFrameIndex in advance of reuse [nfc-ish]
The prior code intermixed several concerns - the actual materialization of the offset, the choice of destination register, and whether to prune the ADDI. This version factors the first part out, and then reasons only about the later two. My intention is to merge the adjustReg routine with the one from frame lowering, and then explore using the merged result to simplify frame setup and tear down.
This change is conceptually NFC, but since it results in slightly different vreg usage, the end result can change register allocation in minor ways.
Differential Revision: https://reviews.llvm.org/D138502
Simon Pilgrim [Mon, 28 Nov 2022 17:43:10 +0000 (17:43 +0000)]
[X86] Fix SLM ldmxcsr/stmxcsr schedule classes
Fix a long standing FIXME comment using a mixture of llvm-exegesis and Agner numbers
Arthur Eubanks [Mon, 28 Nov 2022 17:29:08 +0000 (09:29 -0800)]
[opt][NFC] Simplify GetCodeGenOptLevel()
Removed code is unreachable after D137663.
Ayke van Laethem [Wed, 23 Nov 2022 16:24:44 +0000 (17:24 +0100)]
[AVR] Do not use R0/R1 on avrtiny
This patch makes sure the compiler uses R16/R17 on avrtiny (attiny10
etc) instead of R0/R1.
Some notes:
* For the NEGW and ROLB instructions, it adds an explicit zero
register. This is necessary because the zero register is different
on avrtiny (and InstrInfo Uses lines need a fixed register).
* Not entirely sure about putting all tests in features/avr-tiny.ll,
but it doesn't seem like the "target-cpu"="attiny10" attribute
works.
Updates: https://github.com/llvm/llvm-project/issues/53459
Differential Revision: https://reviews.llvm.org/D138582
Philip Reames [Mon, 28 Nov 2022 17:00:57 +0000 (09:00 -0800)]
[RISCV] Add cost model for integer and float vector arithmetic instructions.
This patch implements getArithmeticInstrCost for RISCV, supports cost
model for integer and float vector arithmetic instructions.
Differential Revision: https://reviews.llvm.org/D133552 (Original patch by jacquesguan. Subset by me with todos added.)
Florian Hahn [Mon, 28 Nov 2022 16:54:58 +0000 (16:54 +0000)]
[ConstraintElim] Use collectOffset instead of custom GEP idx iteration.
Use collectOffset to collect scaled indices and constant offset for GEP
instead of custom code. This simplifies the logic in decomposeGEP and
allows to handle all cases supported by the generic helper.
Matt Arsenault [Mon, 28 Nov 2022 16:31:25 +0000 (11:31 -0500)]
AMDGPU: Bulk update all GlobalISel tests to use opaque pointers
Nicola Lancellotti [Tue, 22 Nov 2022 15:35:29 +0000 (15:35 +0000)]
[AArch64] Add patterns for SVE predicated add/sub and mov combine
Differential Revision: https://reviews.llvm.org/D138570
Nicola Lancellotti [Tue, 22 Nov 2022 15:25:13 +0000 (15:25 +0000)]
[AArch64] Pre-commit test for "Add patterns for SVE predicated add/sub and mov combine"
Nicola Lancellotti [Tue, 22 Nov 2022 15:13:42 +0000 (15:13 +0000)]
Revert "[AArch64] Canonicalize ZERO_EXTEND to VSELECT"
This reverts commit
43fe14c056458501990c3db2788f67268d1bdf38.
Valentin Clement [Mon, 28 Nov 2022 16:32:26 +0000 (17:32 +0100)]
[flang] Adapt target rewrite for fir.dispatch operation
Handle rewriting dispatch operation with complex arguments or
return.
sret will be done in a separate patch.
Reviewed By: jeanPerier, PeteSteinfeld
Differential Revision: https://reviews.llvm.org/D138820
Simon Pilgrim [Mon, 28 Nov 2022 16:30:24 +0000 (16:30 +0000)]
[X86] Remove unnecessary (V)?PBLENDW(Y)?rm overrides
The znver1/znver2 overrides shouldn't need 2uops for the xmm case (but znver1 should double-pump for the ymm case).
Found with the help of D138359
Florian Hahn [Mon, 28 Nov 2022 16:32:31 +0000 (16:32 +0000)]
[VPlan] Add VPDerivedIVRecipe, use for VPScalarIVStepsRecipe.
This patch splits off the logic to transform the canonical IV to a
a value for an induction with a different start and step. This
transformation only needs to be done once (independent of VF/UF) and
enables sinking of VPScalarIVStepsRecipe as follow-up.
Reviewed By: Ayal
Differential Revision: https://reviews.llvm.org/D133758
Matt Arsenault [Mon, 28 Nov 2022 16:14:03 +0000 (11:14 -0500)]
AMDGPU: Bulk update some r600 tests to opaque pointers
r600.amdgpu-alias-analysis.ll has something strange going on where
AliasAnalyisEvaluator's printing is reproducing the typed pointer
syntax.
Joseph Huber [Wed, 23 Nov 2022 19:24:56 +0000 (13:24 -0600)]
[OpenMP] Do not add wrapper headers if using '-nogpuinc'
The OpenMP offloading toolchain uses wrapper headers to implement some
standard features on the GPU. Currently there is no way to turn these
off without also disabling all the standard includes altogether. This
patch makes `-nogpuinc` apply to these wrapper headers so we can use a
sterile toolchain. This was causing problems when attempting to compile
a `libc` for the GPU using OpenMP.
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D138598
Louis Dionne [Mon, 28 Nov 2022 13:52:13 +0000 (08:52 -0500)]
[libc++] Remove CMake workaround for the discontinued Projects build
Differential Revision: https://reviews.llvm.org/D138801
Louis Dionne [Mon, 28 Nov 2022 13:39:42 +0000 (08:39 -0500)]
[libc++][NFC] Add assertions before calling memmove
Since we're checking preconditions for calling memmove, we might
as well do that properly.
Differential Revision: https://reviews.llvm.org/D138798
OCHyams [Mon, 28 Nov 2022 16:06:10 +0000 (16:06 +0000)]
Revert "[Assignment Tracking][13/*] Account for assignment tracking in SROA"
This reverts commit
e16d59973ffec77eeef73409570bdf04a69c2405.
Buildbot failure:
https://lab.llvm.org/buildbot/#/builders/236/builds/1205
OCHyams [Mon, 28 Nov 2022 16:04:45 +0000 (16:04 +0000)]
Revert "[Assignment Tracking][SROA] Follow-up for failing test"
This reverts commit
285d46ef4b60c0919c00661199c1b010996cc2c1.
Failing buildbot:
https://lab.llvm.org/buildbot/#/builders/236/builds/1205
bixia1 [Tue, 22 Nov 2022 01:50:16 +0000 (17:50 -0800)]
[mlir][sparse] Improve concatenate operator rewriting for dense tensor results.
Reviewed By: Peiming
Differential Revision: https://reviews.llvm.org/D138465