Nikolas Klauser [Sun, 22 May 2022 11:43:37 +0000 (13:43 +0200)]
[libc++] Add ranges::max_element to the synopsis and ADL-proof the __min_element_impl calls
Reviewed By: ldionne, #libc
Spies: sstefan1, libcxx-commits
Differential Revision: https://reviews.llvm.org/D126167
Nikolas Klauser [Sun, 22 May 2022 11:34:22 +0000 (13:34 +0200)]
[libc++] Add auto to the list of required extensions in C++03
We use `auto` in C++03, so we shouldn't say that we aren't.
Reviewed By: ldionne, #libc
Spies: libcxx-commits
Differential Revision: https://reviews.llvm.org/D126165
Nikolas Klauser [Fri, 20 May 2022 15:11:58 +0000 (17:11 +0200)]
[libc++] Assume that push_macro and pop_macro are available
All compilers that libc++ supports support `push_macro` and `pop_macro`. So let's remove it.
Reviewed By: ldionne, #libc
Spies: libcxx-commits, mgorny
Differential Revision: https://reviews.llvm.org/D126073
Nikolas Klauser [Thu, 12 May 2022 13:46:18 +0000 (15:46 +0200)]
[libc++] Always enable the ranges concepts
The ranges concepts were already available in libc++13, so we shouldn't guard them with `_LIBCPP_HAS_NO_INCOMPLETE_RANGES`.
Fixes https://github.com/llvm/llvm-project/issues/54765
Reviewed By: #libc, ldionne
Spies: ldionne, libcxx-commits
Differential Revision: https://reviews.llvm.org/D124011
Nikolas Klauser [Fri, 20 May 2022 21:31:13 +0000 (23:31 +0200)]
[libc++] Granularize parts of <type_traits>
`<type_traits>` is quite a large header, so I'll granularize it in a few steps.
Reviewed By: ldionne, #libc
Spies: libcxx-commits, mgorny
Differential Revision: https://reviews.llvm.org/D124755
Jorge Gorbe Moya [Mon, 23 May 2022 18:29:10 +0000 (11:29 -0700)]
Remove `friend` classes from TypeCategoryMap
As far as I can tell, the only thing those friend classes access is the
`ValueSP` typedef.
Given that this is a map-ish class, with "Map" in its name, it doesn't
seem like a stretch to make `KeyType`, `ValueType` and `ValueSP` public.
More so when the public methods of the class have `KeyType` and
`ValueSP` arguments and clearly `ValueSP` needs to be accessed from the
outside.
`friend` complicates local reasoning about who can access private
members, which is valuable in a class like this that has every method
locking a mutex to prevent concurrent access.
Differential Revision: https://reviews.llvm.org/D126103
natashaknk [Mon, 23 May 2022 17:58:33 +0000 (10:58 -0700)]
[mlir][tosa] Change tosa.depthwise_conv2d's ending reshape to a collapse.
TOSAs depthwise_conv2d operation includes a reshape to include the implicit x1 dimension.
Reviewed By: rsuderman
Differential Revision: https://reviews.llvm.org/D126212
Julian Lettner [Mon, 23 May 2022 18:18:15 +0000 (11:18 -0700)]
[Sanitizer][Darwin] Add SANITIZER_DRIVERKIT platform macro
Sanjay Patel [Mon, 23 May 2022 17:31:00 +0000 (13:31 -0400)]
[IR] add and use pattern match specialization for sqrt intrinsic; NFC
This was included in D126190 originally, but it's
independent and a useful change for readability.
Craig Topper [Mon, 23 May 2022 05:38:04 +0000 (22:38 -0700)]
[DAGCombiner][AArch64] Don't fold (smulo x, 2) -> (saddo x, x) if VT is i2.
If the VT is i2, then 2 is really -2.
Test has not been commited yet, but diff shows the change.
Fixes PR55644.
Differential Revision: https://reviews.llvm.org/D126213
Craig Topper [Mon, 23 May 2022 05:32:16 +0000 (22:32 -0700)]
[AArch64] Add test case for pr55644. NFC
Dave Lee [Mon, 23 May 2022 18:00:22 +0000 (11:00 -0700)]
[lldb] Specify aguments of `image list`
Register positional argument details in `CommandObjectTargetModulesList`.
I recently learned that `image list` takes a module name, but the help info
does not indicate this. With this change, `help image list` will show that it
accepts zero or more module names.
This makes it easier to get info about specific modules, without having to
find/grep through the full image list.
Reviewed By: DavidSpickett
Differential Revision: https://reviews.llvm.org/D125154
Stephen Long [Mon, 23 May 2022 14:01:55 +0000 (07:01 -0700)]
[MSVC, ARM64] Add __readx18 intrinsics
https://docs.microsoft.com/en-us/cpp/intrinsics/arm64-intrinsics?view=msvc-170
unsigned char __readx18byte(unsigned long)
unsigned short __readx18word(unsigned long)
unsigned long __readx18dword(unsigned long)
unsigned __int64 __readx18qword(unsigned long)
Given the lack of documentation of the intrinsics, we chose to align the offset with just
`CharUnits::One()` when calling `IRBuilderBase::CreateAlignedLoad()`
Reviewed By: efriedma
Differential Revision: https://reviews.llvm.org/D126024
Dave Lee [Wed, 18 May 2022 23:31:49 +0000 (16:31 -0700)]
[lldb] Improve formatting of dlopen error messages (NFC)
Ensure there's a space between "utility" and "function", and also makes
it easier to grep/search for "utility function".
While making this change, I also re-formatted the other dlopen error messages
(with clang-format). This fix other instances of spaces missing between words,
and makes each of these strings fit a single line, making them greppable.
Differential Revision: https://reviews.llvm.org/D126078
Benjamin Kramer [Mon, 23 May 2022 17:53:40 +0000 (19:53 +0200)]
Fix an unused variable warning in no-asserts build mode
Paul Robinson [Mon, 23 May 2022 17:43:12 +0000 (10:43 -0700)]
[PS5] Disable a test, same as PS4
Philip Reames [Mon, 23 May 2022 17:10:08 +0000 (10:10 -0700)]
[RISCV] Add basic fault-first load coverage for VSETVLI insertion
Simplified version of a test taken from D123581.
Jeffrey Tan [Tue, 17 May 2022 16:21:10 +0000 (09:21 -0700)]
Show error message for optimized variables
This fixes an issue that optimized variable error message is not shown to end
users in lldb-vscode.
Differential Revision: https://reviews.llvm.org/D126014
Jeffrey Tan [Tue, 17 May 2022 16:17:26 +0000 (09:17 -0700)]
Add [opt] suffix to optimized stack frame in lldb-vscode
To help user identify optimized code This diff adds a "[opt]" suffix to
optimized stack frames in lldb-vscode. This provides consistent experience
as command line lldb.
It also adds a new "optimized" attribute to DAP stack frame object so that
it is easy to identify from telemetry than parsing trailing "[opt]".
Differential Revision: https://reviews.llvm.org/D126013
Fangrui Song [Mon, 23 May 2022 16:58:54 +0000 (09:58 -0700)]
[llvm-nm][docs] Document -W and -U
Latest GNU nm (milestone: 2.39) has added -W/--no-weak and changed -U to mean
--defined-only (instead of --unicode=). The changes match our semantics.
Close #55297
Reviewed by: jhenderson, keith
Differential Revision: https://reviews.llvm.org/D126133
Christopher Bate [Tue, 17 May 2022 21:42:47 +0000 (15:42 -0600)]
[mlir][NvGpuToNVVM] Fix byte size calculation in async copy lowering
AsyncCopyOp lowering converted "size in elements" to "size in bytes"
assuming the element type size is at least one byte. This removes
that restriction, allowing for types such as i4 and b1 to be handled
correctly.
Differential Revision: https://reviews.llvm.org/D125838
Matthias Springer [Mon, 23 May 2022 16:49:45 +0000 (18:49 +0200)]
[mlir][bufferize][NFC] Update One-Shot Bufferize pass documentation
Differential Revision: https://reviews.llvm.org/D125637
Christopher Bate [Fri, 20 May 2022 20:41:55 +0000 (14:41 -0600)]
[mlir][NvGpuToNVVM] Fix missing i4 support for nvgpu.mma.sync
This changes adds missing support for the i4 data type. Tests are added
to ensure proper lowering of an nvgpu.mma.sync operation targeting the
16x8x64xi4 and 16x8x32xi4 MMA variants in the NVVM dialect.
Differential Revision: https://reviews.llvm.org/D126092
Matthias Springer [Mon, 23 May 2022 16:37:26 +0000 (18:37 +0200)]
[mlir][bufferize] Support fully dynamic layout maps in BufferResultsToOutParams
Also fixes integration of the pass into One-Shot Bufferize and adds additional test cases.
BufferResultsToOutParams can be used with "identity-layout-map" and "fully-dynamic-layout-map". "infer-layout-map" is not supported.
Differential Revision: https://reviews.llvm.org/D125636
Jonas Devlieghere [Mon, 23 May 2022 16:07:54 +0000 (09:07 -0700)]
[lldb] Fix should_skip_simulator_test decorator
Currently simulator tests get skipped when the reported platform is
macosx rather than darwin. Update the decorator to match both.
Matthias Springer [Mon, 23 May 2022 16:10:12 +0000 (18:10 +0200)]
[mlir][bufferization] Fix Python bindings
Differential Revision: https://reviews.llvm.org/D126179
Nathan Sidwell [Tue, 22 Mar 2022 17:49:08 +0000 (10:49 -0700)]
[clang] Module global init mangling
C++20 modules require emission of an initializer function, which is
called by importers of the module. This implements the mangling for
that function. It is the one place the ABI exposes partition names in
symbols -- but fortunately only needed by other TUs of that same module.
Reviewed By: bruno
Differential Revision: https://reviews.llvm.org/D122741
Stella Laurenzo [Sun, 22 May 2022 04:30:01 +0000 (21:30 -0700)]
NFC: Silence two warnings for unused bufferization symbols in release mode.
Differential Revision: https://reviews.llvm.org/D126182
Richard [Fri, 20 May 2022 23:19:11 +0000 (17:19 -0600)]
[clang-tidy] Improve add_new_check.py to recognize more checks
When looking for whether or not a check provides fixits, the script
examines the implementation of the check. Some checks are not
implemented in source files that correspond one-to-one with the check
name, e.g. cert-dcl21-cpp. So if we can't find the check implementation
directly from the check name, open up the corresponding module file and
look for the class name that is registered with the check. Then consult
the file corresponding to the class name.
Some checks are derived from a base class that implements fixits. So if
we can't find fixits in the implementation file for a check, scrape out
the name of it's base class. If it's not ClangTidyCheck, then consult
the base class implementation to look for fixit support.
Differential Revision: https://reviews.llvm.org/D126134
Fixes #55630
Nikita Popov [Mon, 23 May 2022 15:29:33 +0000 (17:29 +0200)]
[InstCombine] Change operand order in recursive and/or of icmps fold
The order obviously doesn't matter for bitwise and/or, but would
matter for logical and/or, so change it to preserve the original
order.
Nikita Popov [Mon, 23 May 2022 15:24:19 +0000 (17:24 +0200)]
[InstCombine] Add tests for recursive and/or of icmp folds (NFC)
Add variations with bitwise and logical and/or, as well as
commuted operands.
Jingu Kang [Mon, 23 May 2022 11:33:48 +0000 (12:33 +0100)]
Revert "Revert "[AArch64] Set maximum VF with shouldMaximizeVectorBandwidth""
This reverts commit
42ebfa8269470e6b1fe2de996d3f1db6d142e16a.
The commmit from https://reviews.llvm.org/D125918 has fixed the stage 2 build
failure.
Differential Revision: https://reviews.llvm.org/D118979
Matthias Springer [Mon, 23 May 2022 14:53:17 +0000 (16:53 +0200)]
[mlir][bufferization][NFC] Improve assembly format of AllocTensorOp
No longer pass static dim sizes as an attribute. This was redundant and required extra checks in the verifier. This change also makes the op symmetrical to memref::AllocOp.
Differential Revision: https://reviews.llvm.org/D126178
PeixinQiao [Mon, 23 May 2022 14:50:06 +0000 (22:50 +0800)]
[NFC][flang] Change the OpenMP atomic read/write test cases
Remove the integration tests and rename the file.
Reviewed By: shraiysh, NimishMishra
Differential Revision: https://reviews.llvm.org/D126169
Alexander Belyaev [Mon, 23 May 2022 14:29:02 +0000 (16:29 +0200)]
[mlir] Add Expm1 tp ComplexOps.td.
Differential Revision: https://reviews.llvm.org/D126206
Jay Foad [Mon, 23 May 2022 14:18:34 +0000 (15:18 +0100)]
[TableGen] Remove an untrue statement from the docs
You can't use foreach in a record body. This was a mistake in the
documentation dating from when it was first written in D85838.
Alexander Belyaev [Mon, 23 May 2022 14:10:20 +0000 (16:10 +0200)]
[mlir] Add RSqrt tp ComplexOps.td.
Differential Revision: https://reviews.llvm.org/D126202
Alexey Bataev [Wed, 4 Aug 2021 17:58:37 +0000 (10:58 -0700)]
[SLP]Do not emit extract elements for insertelements users, replace with shuffles directly.
SLP vectorizer emits extracts for externally used vectorized scalars and
estimates the cost for each such extract. But in many cases these
scalars are input for insertelement instructions, forming buildvector,
and instead of extractelement/insertelement pair we can emit/cost
estimate shuffle(s) cost and generate series of shuffles, which can be
further optimized.
Tested using test-suite (+SPEC2017), the tests passed, SLP was able to
generate/vectorize more instructions in many cases and it allowed to reduce
number of re-vectorization attempts (where we could try to vectorize
buildector insertelements again and again).
Differential Revision: https://reviews.llvm.org/D107966
Stephen Long [Mon, 23 May 2022 14:00:54 +0000 (07:00 -0700)]
[MSVC, ARM64] Add __writex18 intrinsics
https://docs.microsoft.com/en-us/cpp/intrinsics/arm64-intrinsics?view=msvc-170
void __writex18byte(unsigned long, unsigned char)
void __writex18word(unsigned long, unsigned short)
void __writex18dword(unsigned long, unsigned long)
void __writex18qword(unsigned long, unsigned __int64)
Given the lack of documentation of the intrinsics, we chose to align the offset with just
`CharUnits::One()` when calling `IRBuilderBase::CreateAlignedStore()`.
Reviewed By: efriedma
Differential Revision: https://reviews.llvm.org/D126023
Sanjay Patel [Mon, 23 May 2022 13:26:43 +0000 (09:26 -0400)]
[InstCombine] fold icmp of zext bool based on limited range
X <u (zext i1 Y) --> (X == 0) && Y
https://alive2.llvm.org/ce/z/avQDRY
This is a generalization of
4069cccf3b4ff4a based on the post-commit suggestion.
This also adds the i1 type check and tests that were missing from the earlier
attempt; that commit caused several bot fails and was reverted.
Differential Revision: https://reviews.llvm.org/D126171
Sanjay Patel [Sun, 22 May 2022 17:16:19 +0000 (13:16 -0400)]
[InstCombine] add tests for icmp of zext i1; NFC
Alexey Bataev [Mon, 23 May 2022 13:43:02 +0000 (06:43 -0700)]
[SLP][NFC]Add a test for extracting scalar from undef result vector,
NFC.
Nikita Popov [Mon, 23 May 2022 13:12:15 +0000 (15:12 +0200)]
[InstCombine] Reuse icmp of and/or folds for logical and/or
Similarly to a change recently done for fcmps, add a flag that
indicates whether the and/or is logical to foldAndOrOfICmps, and
reuse the function when folding logical and/or.
We were already calling some parts of it, but this gives us a
clearer indication of which parts may need poison-safe variants,
and would also allow to fold combinations of bitwise and logical
and/or.
This change should be close to NFC, because all folds this enables
were either already called previously, or can make use of implied
poison reasoning.
Anastasia Stulova [Mon, 23 May 2022 13:03:54 +0000 (14:03 +0100)]
[SPIR-V] Allow setting SPIR-V version via target triple.
Currently added versions are from v1.0 to v1.5, other versions
can be added as needed.
This change also adds documentation about SPIR-V target support
in LLVM.
Differential Revision: https://reviews.llvm.org/D124776
Timm Bäder [Mon, 23 May 2022 13:22:27 +0000 (15:22 +0200)]
Revert "[clang][driver] Dynamically select gcc-toolset/devtoolset version"
This reverts commit
8717b492dfcd12d6387543a2f8322e0cf9059982.
The new unittest fails on Windows buildbots, e.g.
https://lab.llvm.org/buildbot/#/builders/119/builds/8647
Dmitry Preobrazhensky [Mon, 23 May 2022 12:48:47 +0000 (15:48 +0300)]
[AMDGPU][MC][GFX940] Disable v_mac_f32_dpp
Differential Revision: https://reviews.llvm.org/D126070
Sylvestre Ledru [Mon, 23 May 2022 11:49:34 +0000 (13:49 +0200)]
Add support of the next Ubuntu (Ubuntu 22.10 - Kinetic Kudu)
Sylvestre Ledru [Mon, 23 May 2022 11:47:13 +0000 (13:47 +0200)]
Add support of the next Debian (Debian 13 - Trixie)
Jay Foad [Mon, 23 May 2022 11:04:43 +0000 (12:04 +0100)]
[AMDGPU] Remove unneeded regex escaping in FileCheck patterns
These must have crept in since D117298 was landed.
Edd Barrett [Mon, 23 May 2022 10:18:30 +0000 (11:18 +0100)]
Test stackmap support for i128
This diff adds tests that check the currently-working stackmap cases for i128.
This will help ensure no regressions are later introduced by D125680 (when
ready).
Note that i128 stackmap support is currently incomplete, so we cant test all
i128 functionality:
i128 constants >= 2^{63} crash LLVM
non-constant i128s crash LLVM
So this change tests only constant i128 operands of value < 2^{63}.
A couple of incorrect comments are also fixed.
Simon Pilgrim [Mon, 23 May 2022 10:48:24 +0000 (11:48 +0100)]
[AArch64] Regenerate andandshift.ll test checks
Timm Bäder [Wed, 18 May 2022 08:31:41 +0000 (10:31 +0200)]
[clang][driver] Dynamically select gcc-toolset/devtoolset version
And pick the highest one, instead of adding all possibilities to the
prefixes.
Differential Revision: https://reviews.llvm.org/D125862
LiaoChunyu [Mon, 23 May 2022 00:59:41 +0000 (08:59 +0800)]
[RISCV][NFC] Test cases for fmuladd intrinsic
These test cases are copy from fma
Reviewed By: reames
Differential Revision: https://reviews.llvm.org/D126049
Nikita Popov [Wed, 18 May 2022 13:34:12 +0000 (15:34 +0200)]
[CGP] Freeze condition when despeculating ctlz/cttz
Freeze the condition of the newly introduced conditional branch,
to avoid immediate undefined behavior if the input to ctlz/cttz
was originally poison.
Differential Revision: https://reviews.llvm.org/D125887
Andre Vieira [Mon, 23 May 2022 08:43:39 +0000 (09:43 +0100)]
[AArch64] Order STP Q's by ascending address
This patch adds an AArch64 specific PostRA MachineScheduler to try to schedule
STP Q's to the same base-address in ascending order of offsets. We have found
this to improve performance on Neoverse N1 and should not hurt other AArch64
cores.
Differential Revision: https://reviews.llvm.org/D125377
Florian Hahn [Mon, 23 May 2022 08:39:00 +0000 (09:39 +0100)]
[AArch64] implement isReassocProfitable, disable for (u|s)mlal.
Currently reassociating add expressions can lead to failing to select
(u|s)mlal. Implement isReassocProfitable to skip reassociating
expressions that can be lowered to (u|s)mlal.
The same issue exists for the *mlsl variants as well, but the DAG
combiner doesn't use the isReassocProfitable hook before reassociating.
To be fixed in a follow-up commit as this requires DAGCombiner changes
as well.
Reviewed By: dmgreen
Differential Revision: https://reviews.llvm.org/D125895
Chuanqi Xu [Mon, 23 May 2022 08:21:42 +0000 (16:21 +0800)]
Revert "[C++20] [Coroutines] Conform the updates for CWG issue 2585"
This reverts commit
1b89a25a9b960886e486eb20b755634613c088f8.
The test would fail in windows versions.
Peter Waller [Mon, 16 May 2022 20:59:17 +0000 (20:59 +0000)]
[LV] Improve register pressure estimate at high VFs
Previously, `getRegUsageForType` was implemented using
`getTypeLegalizationCost`. `getRegUsageForType` is used by the loop
vectorizer to estimate the register pressure caused by using a vector
type. However, `getTypeLegalizationCost` currently only appears to
understand splitting and not scalarization, so significantly
underestimates the register requirements.
Instead, use `getNumRegisters`, which understands when scalarization
can occur (via computeRegisterProperties).
This was discovered while investigating D118979 (Set maximum VF with
shouldMaximizeVectorBandwidth), where under fixed-length 512-bit SVE the
loop vectorizer previously ends up costing an v128i1 as 2 v64i*
registers where it actually occupies 128 i32 registers.
I'm sending this patch early for comment, I'm still doing some sanity checking
with LNT. I note that getRegisterClassForType appears to return VectorRC even
though the type in question (large vNi1 types) end up occupying scalar
registers. That might be worth fixing too.
Differential Revision: https://reviews.llvm.org/D125918
David Green [Mon, 23 May 2022 07:55:54 +0000 (08:55 +0100)]
[AArch64] Fix assumptions on input type of tryCombineFixedPointConvert
It is possible for the input type to not be v2i64 or v4i32, so weaken
the assertion to a return, fixing the crash in the new test.
Fixes #55606
Chuanqi Xu [Mon, 23 May 2022 07:23:00 +0000 (15:23 +0800)]
[C++20] [Coroutines] Conform the updates for CWG issue 2585
According to the updates in CWG issue 2585
https://cplusplus.github.io/CWG/issues/2585.html, we shouldn't find an
allocation function with (size, p0, …, pn) in global scope.
Sergei Trofimovich [Mon, 23 May 2022 07:39:48 +0000 (08:39 +0100)]
[Support] Add missing <cstdint> header to Base64.h
Without the change llvm build fails on this week's gcc-13 snapshot as:
[ 91%] Building CXX object unittests/Support/CMakeFiles/SupportTests.dir/Base64Test.cpp.o
In file included from llvm/unittests/Support/Base64Test.cpp:14:
llvm/include/llvm/Support/Base64.h: In function 'std::string llvm::encodeBase64(const InputBytes&)':
llvm/include/llvm/Support/Base64.h:29:5: error: 'uint32_t' was not declared in this scope
29 | uint32_t x = ((unsigned char)Bytes[i] << 16) |
| ^~~~~~~~
Sergei Trofimovich [Mon, 23 May 2022 07:03:23 +0000 (08:03 +0100)]
[Support] Add missing <cstdint> header to Signals.h
Without the change llvm build fails on this week's gcc-13 snapshot as:
[ 0%] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/Signals.cpp.o
In file included from llvm/lib/Support/Signals.cpp:14:
llvm/include/llvm/Support/Signals.h:119:8: error: variable or field 'CleanupOnSignal' declared void
119 | void CleanupOnSignal(uintptr_t Context);
| ^~~~~~~~~~~~~~~
Gabor Marton [Thu, 19 May 2022 09:14:56 +0000 (11:14 +0200)]
[analyzer][NFC] Factor out the copy-paste code repetition of assumeDual and assumeInclusiveRangeDual
Depends on D125892. There might be efficiency and performance
implications by using a lambda. Thus, I am going to conduct measurements
to see if there is any noticeable impact.
I've been thinking about two more alternatives:
1) Make `assumeDualImpl` a variadic template and (perfect) forward the
arguments for the used `assume` function.
2) Use a macros.
I have concerns though, whether these alternatives would deteriorate the
readability of the code.
Differential Revision: https://reviews.llvm.org/D125954
Gabor Marton [Thu, 19 May 2022 09:05:24 +0000 (11:05 +0200)]
[analyzer] Implement assumeInclusiveRange in terms of assumeInclusiveRangeDual
Depends on D124758. This is the very same thing we have done for
assumeDual, but this time we do it for assumeInclusiveRange. This patch
is basically a no-brainer copy of that previous patch.
Differential Revision:
https://reviews.llvm.org/D125892
Muhammad Omair Javaid [Mon, 23 May 2022 06:17:24 +0000 (11:17 +0500)]
Revert "[lldb] Consider binary as module of last resort"
This reverts commit
a3c3482ceb529206b0ae4e7782e5496da5e0879d.
It broke LLDB API test TestBadAddressBreakpoints.py
Differential revision: https://reviews.llvm.org/D124731
Chenbing Zheng [Mon, 23 May 2022 06:17:01 +0000 (14:17 +0800)]
[InstCombine] add tests for bitcast; NFC
Brad Smith [Mon, 23 May 2022 05:21:06 +0000 (01:21 -0400)]
[Sparc] Have test use IAS
Jeremy Furtek [Sun, 22 May 2022 04:12:11 +0000 (21:12 -0700)]
[mlir][tblgen][ods][python] Use keyword-only arguments for optional builder arguments in generated Python bindings
This diff modifies `mlir-tblgen` to generate Python Operation class `__init__()`
functions that use Python keyword-only arguments.
Previously, all `__init__()` function arguments were positional. Python code to
create MLIR Operations was required to provide values for ALL builder arguments,
including optional arguments (attributes and operands). Callers that did not
provide, for example, an optional attribute would be forced to provide `None`
as an argument for EACH optional attribute. Proposed changes in this diff use
`tblgen` record information (as provided by ODS) to generate keyword arguments
for:
- optional operands
- optional attributes (which includes unit attributes)
- default-valued attributes
These `__init__()` function keyword arguments have default `None` values (i.e.
the argument form is `optionalAttr=None`), allowing callers to create Operations
more easily.
Note that since optional arguments become keyword-only arguments (since they are
placed after the bare `*` argument), this diff will require ALL optional
operands and attributes to be provided using explicit keyword syntax. This may,
in the short term, break any out-of-tree Python code that provided values via
positional arguments. However, in the long term, it seems that requiring
keywords for optional arguments will be more robust to operation changes that
add arguments.
Tests were modified to reflect the updated Operation builder calling convention.
This diff partially addresses the requests made in the github issue below.
https://github.com/llvm/llvm-project/issues/54932
Reviewed By: stellaraccident, mikeurbach
Differential Revision: https://reviews.llvm.org/D124717
Zi Xuan Wu (Zeson) [Fri, 20 May 2022 07:11:43 +0000 (15:11 +0800)]
[CSKY] Fix the conflict of default fpu features and -mfpu option
The arch or cpu has its default fpu features and versions such as fpuv2_sf/fpuv3_sf.
And there is also -mfpu option to specify and override fpu version and features.
For example, C860 has fpuv3_sf/fpuv3_df feature as default, when
-mfpu=fpv2 is given, fpuv3_sf/fpuv3_df is replaced with fpuv2_sf/fpuv2_df.
jacquesguan [Fri, 20 May 2022 08:48:52 +0000 (08:48 +0000)]
[mlir][NFC] Replace some nested if with logical and.
This patch replaces some nested if statement with logical and to reduce the nesting depth.
Differential Revision: https://reviews.llvm.org/D126050
Craig Topper [Sun, 22 May 2022 21:13:30 +0000 (14:13 -0700)]
[SelectionDAG] Add a freeze to ISD::ABS expansion.
I had initially assumed this was the problem with
https://github.com/llvm/llvm-project/issues/55271#issuecomment-
1133426243
But it turns out that was a simpler issue. This patch is still
more correct than what we were doing before so figured I'd submit
it anyway.
No test case because I'm not sure how to get an undef around
until expansion.
Looking at the test deltas I wonder if it be valid to combine
(sext_inreg (freeze (aextload X))) -> (freeze (sextload X)).
Reviewed By: efriedma
Differential Revision: https://reviews.llvm.org/D126175
Craig Topper [Sun, 22 May 2022 19:47:27 +0000 (12:47 -0700)]
[SelectionDAG] Fold abs(undef) to 0 instead of undef.
abs should only produce a positive value or the signed minimum
value. This means we can't fold abs(undef) to undef as that would
allow more values. Fold to 0 instead to match InstSimplify.
Fixes test mentioned in comment on pr55271.
Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/D126174
Florian Hahn [Sun, 22 May 2022 19:11:47 +0000 (20:11 +0100)]
[LV] Add check line to test interleaving only with induction cast.
Also simplify the value names a bit in the test.
Aaron Ballman [Sun, 22 May 2022 17:36:10 +0000 (13:36 -0400)]
Test more C DR conformance (part two of many)
This continues the work started earlier at filling our the C DR status
page based on test coverage.
Florian Hahn [Sun, 22 May 2022 17:27:41 +0000 (18:27 +0100)]
[LV] Use exiting block instead of latch in addUsersInExitBlock.
The latch may not be the exiting block. Use the exiting block instead
when looking up the incoming value of the LCSSA phi node. This fixes a
crash with early-exit loops.
Florian Hahn [Sun, 22 May 2022 17:20:33 +0000 (18:20 +0100)]
[LV] Re-generate check lines for loop-form.ll test.
NAKAMURA Takumi [Sun, 22 May 2022 16:03:15 +0000 (01:03 +0900)]
ADT::GenericCycleInfo: Hide validateTree() in -Asserts.
validateTree() is instantiated with __FILE__.
It will be pruned at link time due to -ffunction-sections but be left in
object files.
Its user is only GenericCycleInfo::compute() with assert(validateTree());
Therefore I think validateTree() may be hidden with NDEBUG.
This is a fixup for https://reviews.llvm.org/D112696
Sanjay Patel [Sun, 22 May 2022 16:13:20 +0000 (12:13 -0400)]
Revert "[InstCombine] fold icmp with sub and bool"
This reverts commit
4069cccf3b4ff4afb743d3d371ead9e2d5491e3a.
This causes bot failures, and there's a possibly a better way to get this and other patterns.
Sanjay Patel [Sun, 22 May 2022 15:02:28 +0000 (11:02 -0400)]
[InstCombine] fold icmp with sub and bool
This is the specific pattern seen in #53432, but it can be extended
in multiple ways:
1. The 'zext' could be an 'and'
2. The 'sub' could be some other binop with a similar ==0 property (udiv).
There might be some way to generalize using knownbits, but that
would require checking that the 'bool' value is created with
some instruction that can be replaced with new icmp+logic.
https://alive2.llvm.org/ce/z/-KCfpa
Sanjay Patel [Fri, 20 May 2022 21:31:01 +0000 (17:31 -0400)]
[InstCombine] add tests for icmp + sub patterns; NFC
Jonas Paulsson [Thu, 19 May 2022 15:16:49 +0000 (17:16 +0200)]
[SystemZ] Bugfix for symbolic displacements.
Properly handle the case where only the second operand of e.g. an MVC
instruction uses a fixup for the displacement.
Reviewed By: Ulrich Weigand
Differential Revision: https://reviews.llvm.org/D125982
Florian Hahn [Sun, 22 May 2022 15:24:13 +0000 (16:24 +0100)]
[LV] Widen ptr-inductions with scalar uses for scalable VFs.
Current codegen only supports scalarization of pointer inductions for
scalable VFs if they are uniform. After
3bebec659 we now may enter the
scalarization code path in VPWidenPointerInductionRecipe::execute for
scalable vectors.
Fall back to widening for scalable vectors if necessary.
This should fix a build failure when bootstrapping LLVM with SVE, e.g.
https://lab.llvm.org/buildbot/#/builders/176/builds/1723
James Y Knight [Sun, 22 May 2022 14:12:50 +0000 (10:12 -0400)]
CWG 1394: Incomplete types as parameters of deleted functions
Follow-up to previous commit: Add a DR test-case so the
make_cxx_dr_status automation works.
Bug: #52802
Fixes:
50b1faf5c188956fb59ea7d9f9d470591771aedb
Paul Walker [Thu, 28 Apr 2022 20:06:05 +0000 (21:06 +0100)]
[SVE] Enable use of 32bit gather/scatter indices for fixed length vectors
Differential Revision: https://reviews.llvm.org/D125193
Nathan James [Sun, 22 May 2022 09:28:52 +0000 (10:28 +0100)]
[clang-tidy] Fix not updating storeOptions after
af77b1d9901
Nathan James [Sun, 22 May 2022 08:28:39 +0000 (09:28 +0100)]
[clang-tidy] add support for Demorgan conversions to readability-simplify-bool-expr
Adds support for recognising and converting boolean expressions that can be simplified using De Morgans Law.
This is a different implementation to D124650.
Fixes https://github.com/llvm/llvm-project/issues/55092
Reviewed By: LegalizeAdulthood
Differential Revision: https://reviews.llvm.org/D124806
Sheng [Sun, 22 May 2022 02:34:25 +0000 (10:34 +0800)]
[NFC][M68k][test] Add disassembler tests for move instructions
Sheng [Sun, 22 May 2022 02:30:08 +0000 (10:30 +0800)]
[M68k][Disassembler] Fix decoding conflict
This diff fixes decoding conflict between move instructions and
their tail-call counterpart
Reviewed By: myhsu
Differential Revision: https://reviews.llvm.org/D125948
Ping Deng [Sun, 22 May 2022 02:13:35 +0000 (02:13 +0000)]
[LegalizeTypes][VP] Add integer promotion support for vp.sitofp/vp.uitofp
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D125960
David Blaikie [Sun, 22 May 2022 01:15:34 +0000 (01:15 +0000)]
Re-add release notes for GCC ABI compatibility for non-POD in packed structs
Min-Yih Hsu [Sun, 22 May 2022 00:23:51 +0000 (17:23 -0700)]
[M68k][Disassembler] Cleanup unused variables. NFC
- Remove `MaxInstrWord` in M68kDisassembler.cpp.
- Remove `MCII` field in `M68kDisassembler` class.
NFC.
owenca [Sat, 21 May 2022 23:13:35 +0000 (16:13 -0700)]
[clang-format] Format unit tests with InsertBraces/RemoveBracesLLVM
owenca [Sat, 21 May 2022 22:50:50 +0000 (15:50 -0700)]
[clang-format] Fix a crash on lambda trailing return type
Fixes #55625.
owenca [Sat, 21 May 2022 22:10:21 +0000 (15:10 -0700)]
[clang-format] Fix a bug in "AfterControlStatement: MultiLine"
Fixes #55582.
Differential Revision: https://reviews.llvm.org/D125959
owenca [Mon, 16 May 2022 20:52:32 +0000 (13:52 -0700)]
[clang-format] Handle "complex" conditionals in RemoveBracesLLVM
Do not remove braces if the conditional of if/for/while might not
fit on a single line even after the opening brace is removed.
Examples:
// ColumnLimit: 20
//
45678901234567890
if (a) { /* Remove. */
foo();
}
if (-b >= c) { // Keep.
bar();
}
Differential Revision: https://reviews.llvm.org/D126052
Lang Hames [Sat, 21 May 2022 20:52:55 +0000 (13:52 -0700)]
[ORC] Check for errors when materializing absolute symbols.
This code previously used cantFail, but both steps (resolution and emission)
can fail if the resource tracker associated with the
AbsoluteSymbolsMaterializationUnit is removed. Checking these errors is
necessary for correct error propagation.
Craig Topper [Sat, 21 May 2022 21:02:22 +0000 (14:02 -0700)]
[TypePromotion] Refine fix sext/zext for promoted constant from D125294.
Reviewing the code again, I believe the sext is needed on the LHS
or RHS for ICmp and only on the RHS for Add.
Add an opcode check before checking the operand number.
Fixes PR55627.
Differential Revision: https://reviews.llvm.org/D125654
Lang Hames [Sat, 21 May 2022 01:38:13 +0000 (18:38 -0700)]
[ORC] Allow FailedToMaterialize errors to outlive ExecutionSessions.
Idiomatic llvm::Error usage can result in a FailedToMaterialize error tearing
down an ExecutionSession instance. Since the FailedToMaterialize error holds
SymbolStringPtrs and JITDylib references this leads to crashes when accessing
or logging the error.
This patch modifies FailedToMaterialize to retain the SymbolStringPool and
JITDylibs involved in the failure so that we can safely report an error message
to the client, even if the error tears down the session.
The contract for JITDylibs allows the getName method to be used even after the
session has been torn down, but no other JITDylib fields should be accessed via
the FailedToMaterialize error if the ssesion has been torn down. Logging the
error is guaranteed to be safe in all cases.
Balazs Benics [Sat, 21 May 2022 20:16:55 +0000 (22:16 +0200)]
[clang-tidy] Add a useful note about -std=c++11-or-later
I and @whisperity spent some time debugging a LIT test case using the
`-std=c++11-or-later` `check_clang_tidy.py` flag when the test had
fixits.
It turns out if the test wants to report a diagnostic into a header
file AND into the test file as well, one needs to first copy the header
somewhere under the build directory.
It needs to be copied since `clang-tidy` sorts the reports into
alphabetical order, thus to have a deterministic order relative to the
diagnostic in the header AND the diagnostic in the test cpp file.
There is more to this story.
The `-std=c++11-or-later` turns out executes the test with multiple
`-std=XX` version substitution, and each execution will also have the
`-fix` tidy parameter. This means that the freshly copied header file I
stated in the previous paragraph gets fixed up and the very next tidy
execution will fail miserably.
Following @whisperity's advice, I'm leaving a reminder about such
//shared// state in the related doc comment.
Reviewed By: LegalizeAdulthood
Differential Revision: https://reviews.llvm.org/D125771
Aaron Ballman [Sat, 21 May 2022 20:08:32 +0000 (16:08 -0400)]
Fix failing test bots from
df46fb40557a14807dd508af32251ceb1cab8b86
Should fix bots like:
https://lab.llvm.org/buildbot/#/builders/188/builds/14403
https://lab.llvm.org/buildbot/#/builders/171/builds/14928
https://lab.llvm.org/buildbot/#/builders/123/builds/10852
(and others)