hsmahesha [Fri, 10 Sep 2021 04:51:58 +0000 (10:21 +0530)]
Revert "[AMDGPU] Split entry basic block after alloca instructions."
This reverts commit
98f47131228cc73b5308e3cc6fd70375808594e3.
Without any (theoretical/practical) guarantee that all the allocas within
*entry* basic block are clustered together at the beginning of the block,
this patch is doomed to fail. Hence reverting it.
Max Kazantsev [Fri, 10 Sep 2021 04:16:13 +0000 (11:16 +0700)]
[Test] Add tests showing missed opportunity for SimplifyCFG for switches
Patch by Dmitry Bakunevich!
Yonghong Song [Fri, 10 Sep 2021 01:31:18 +0000 (18:31 -0700)]
BPF: change BTF_KIND_TAG format
Previously we have the following binary representation:
struct bpf_type { name, info, type }
struct btf_tag { __u32 component_idx; }
If the tag points to a struct/union/var/func type, we will have
kflag = 1, component_idx = 0
if the tag points to struct/union member or func argument, we will have
kflag = 0, component_idx = 0, ..., vlen - 1
The above rather makes interface complex to have both kflag and
component needed to determine its legality and index.
This patch simplifies the interface by removing kflag involvement.
component_idx = (u32)-1 : tag pointing to a type
component_idx = 0 ... vlen - 1 : tag pointing to a member or argument
and kflag is always 0 and there is no need to check.
Differential Revision: https://reviews.llvm.org/D109560
Zequan Wu [Thu, 9 Sep 2021 23:00:15 +0000 (16:00 -0700)]
[DebugInfo] Emit DW_AT_inline under -g1/-gmlt
Differential Revision: https://reviews.llvm.org/D109554
Arthur O'Dwyer [Sat, 4 Sep 2021 16:48:10 +0000 (12:48 -0400)]
[libc++] Clean up test_iterators.h. NFCI.
The majority of the changes here are whitespace.
Also simplify `ThrowingIterator`'s bookkeeping (NFC).
Also move some free operators into hidden friends, for sanity's sake.
Also `=delete` some more comma operators.
Also use `constexpr` in C++20 instead of `TEST_CONSTEXPR_CXX14`.
Differential Revision: https://reviews.llvm.org/D103341
Jason Molenda [Fri, 10 Sep 2021 00:02:42 +0000 (17:02 -0700)]
Add specific error messages around gdb RSP handshake failures
Report timeout exceeded and connection lost error messages
when sending the initial handshake packet in a gdb remote
serial protocol connection, an especially fragile time.
Differential Revision: https://reviews.llvm.org/D108888
Jason Molenda [Thu, 9 Sep 2021 00:34:00 +0000 (17:34 -0700)]
Don't re-define constants that are now in compact_unwind_encoding.h.
Fangrui Song [Thu, 9 Sep 2021 23:51:11 +0000 (16:51 -0700)]
[lld] Enable ANSI escape code for Windows
Buffered diagnostics need ENABLE_VIRTUAL_TERMINAL_PROCESSING after D87272.
Do it unconditionally like FileCheck.
Haowei Wu [Thu, 9 Sep 2021 22:15:47 +0000 (15:15 -0700)]
[clang_format] Add fallback-style flag to clang-format-diff.py
This change adds fallback-style flag to clang-format-diff.py
Differential Revision: https://reviews.llvm.org/D109550
natashaknk [Thu, 9 Sep 2021 22:57:22 +0000 (15:57 -0700)]
[mlir][tosa] Add lowering for tosa.clz using scf::whileOp
Reviewed By: rsuderman
Differential Revision: https://reviews.llvm.org/D109540
Aart Bik [Thu, 9 Sep 2021 21:20:52 +0000 (14:20 -0700)]
[mlir][sparse] add folding to sparse_tensor.convert
folds conversion between identical types (with tests)
Reviewed By: ThomasRaoux
Differential Revision: https://reviews.llvm.org/D109545
Matt Arsenault [Sat, 14 Aug 2021 01:45:46 +0000 (21:45 -0400)]
AMDGPU: Optimize amdgpu-no-* attributes
This allows clobbering a few extra registers in the fixed ABI, and
avoids some workitem ID packing instructions.
Matt Arsenault [Sat, 14 Aug 2021 18:32:35 +0000 (14:32 -0400)]
AMDGPU: Use attributor to propagate uniform-work-group-size
Drop the legacy version in AMDGPUAnnotateKernelFeatures. This has the
side effect of now respecting the linkage, and not changing externally
visible functions.
Matt Arsenault [Sat, 14 Aug 2021 15:20:04 +0000 (11:20 -0400)]
AMDGPU: Invert ABI attribute handling
Previously we assumed all callable functions did not need any
implicitly passed inputs, and added attributes to functions to
indicate when they were necessary. Requiring attributes for
correctness is pretty ugly, and it makes supporting indirect and
external calls more complicated.
This inverts the direction of the attributes, so an undecorated
function is assumed to need all implicit imputs. This enables
AMDGPUAttributor by default to mark when functions are proven to not
need a given input. This strips the equivalent functionality from the
legacy AMDGPUAnnotateKernelFeatures pass.
However, AMDGPUAnnotateKernelFeatures is not fully removed at this
point although it should be in the future. It is still necessary for
the two hacky amdgpu-calls and amdgpu-stack-objects attributes, which
would be better served by a trivial analysis on the IR during
selection. Additionally, AMDGPUAnnotateKernelFeatures still
redundantly handles the uniform-work-group-size attribute to be
removed in a future commit.
At this point when not using -amdgpu-fixed-function-abi, we are still
modifying the ABI based on these newly negated attributes. In the
future, this option will be removed and the locations for implicit
inputs will always be fixed. We will then use the new attributes to
avoid passing the values when unnecessary.
Philip Reames [Thu, 9 Sep 2021 22:18:47 +0000 (15:18 -0700)]
[ScalarEvolution] Add an additional bailout to avoid NOT of pointer.
It's possible in some cases for the LHS to be a pointer where the RHS is not. This isn't directly possible for an icmp, but the analysis mixes up operands of different icmp expressions in some cases.
This does not include a test case as the smallest reduced case we've managed is extremely fragile and unlikely to test anything meaningful in the long term.
Also add an assertion to getNotSCEV() to make tracking down this sort of issue a bit easier in the future.
Fixes https://bugs.llvm.org/show_bug.cgi?id=51787 .
Differential Revision: https://reviews.llvm.org/D109546
thomasraoux [Thu, 9 Sep 2021 20:29:18 +0000 (13:29 -0700)]
[mlir][sparse] Mark convert op as noSideEffect
Differential Revision: https://reviews.llvm.org/D109543
Philip Reames [Thu, 9 Sep 2021 21:07:22 +0000 (14:07 -0700)]
[SCEV] Allow negative steps for LT exit count computation for unsigned comparisons
This bit of code is incredibly suspicious. It allows fully unknown (but potentially negative) steps, but not steps known to be negative. The comment about scev flag inference is worrying, but also not correct to my knowledge.
At best, this might be covering up some related miscompile. However, there's no test in tree for it, the review history doesn't include obvious motivation, and the C++ example doesn't appear to give wrong results when hand translated to IR. I think it's time to remove this and see what falls out.
During review, there were concerns raised about the correctness of the corresponding signed case. This change was deliberately narrowed to the unsigned case which has been auditted and appears correct for negative values. We need to get back to the known-negative signed case, but that'll be a future patch if nothing falls out from this one.
Differential Revision: https://reviews.llvm.org/D104140
Siva Chandra Reddy [Thu, 9 Sep 2021 18:46:22 +0000 (18:46 +0000)]
[libc] Skip fenv exception tests on aarch64 if HW doesn't support exceptions.
Reviewed By: michaelrj
Differential Revision: https://reviews.llvm.org/D109538
Amy Kwan [Thu, 9 Sep 2021 20:37:02 +0000 (15:37 -0500)]
[PowerPC] Update PC-Relative Load/Store Patterns to use the refactored Load/Store Implementation
This patch updates the PC-Relative load and store patterns to utilize the
refactored load/store implementation introduced in D93370.
PC-Relative implementation has been added to PPCISelLowering.cpp, and also the
patterns in PPCInstrPrefix.td have been updated and no longer require AddedComplexity.
All existing test cases pass with this update.
Differential Revision: https://reviews.llvm.org/D95116
Julian Lettner [Mon, 6 Sep 2021 17:53:08 +0000 (19:53 +0200)]
[TSan][Darwin] Add integration tests for dyld interposition
Add integration tests for dyld interposition: DYLD_LIBRARY_PATH and
DYLD_INSERT_LIBRARIES.
DYLD_INSERT_LIBRARIES is also relevant for TSan thread
finalization/destruction sequence in the presence of additional pthread
introspection hooks (libBacktraceRecording.dylib for Xcode 'Queue
Debugging' feature).
rdar://
78739125
Differential Revision: https://reviews.llvm.org/D109332
Nilay Vaish [Thu, 9 Sep 2021 19:10:36 +0000 (19:10 +0000)]
Add "profiling" to the list of absl libraries.
Reviewed By: ymandel
Differential Revision: https://reviews.llvm.org/D109470
Craig Topper [Thu, 9 Sep 2021 20:10:55 +0000 (13:10 -0700)]
[SelectionDAG] Add isZero/isAllOnes methods to ConstantSDNode.
Soft deprecrate isNullValue/isAllOnesValue and update in tree
callers. This matches the changes to the APInt interface from
D109483.
Reviewed By: lattner
Differential Revision: https://reviews.llvm.org/D109535
Xing Xue [Thu, 9 Sep 2021 20:20:36 +0000 (16:20 -0400)]
[libc++] Add missing short wchar handling for codecvt_utf8, codecvt_utf16 and codecvt_utf8_utf16
Summary:
AIX have 2 byte wchar in 32 bit mode and 4 byte wchar in 64 bit mode.
This patch add more missing short wchar handling under the existing _LIBCPP_SHORT_WCHAR macro.
Marked test case ctor_move.pass.cpp as XFAIL for 32-bit mode on AIX because UTF-8 constants used cannot be converted to 2-byte wchar (by xingxue).
Authored by: jasonliu
Reviewed by: ldionne, zibi, SeanP, libc++
Differential Revision: https://reviews.llvm.org/D100777
Nikita Popov [Thu, 9 Sep 2021 19:55:28 +0000 (21:55 +0200)]
[IR] Handle constant expressions in containsUndefinedElement()
If the constant is a constant expression, then getAggregateElement()
will return null. Guard against this before calling HasFn().
Joe Nash [Thu, 9 Sep 2021 17:42:36 +0000 (13:42 -0400)]
[AMDGPU] Make fexp.ll test autogenerated
This test is very verbose and appears generated by a script.
Make it truly autogenerated for easy updates.
NFC
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D109530
Change-Id: I1352b17b6d13ab9c5650dbe95ef0da97f71f1930
Craig Topper [Thu, 9 Sep 2021 19:23:36 +0000 (12:23 -0700)]
[RISCV] Add test cases showing failure to fold splatted shift amounts across basic blocks.
We should have CGP copy the splats into the same basic block as the
shift so that SelectionDAG can fold them.
Eli Friedman [Wed, 8 Sep 2021 21:32:07 +0000 (14:32 -0700)]
[ScalarEvolution] Fix pointer/int confusion in howManyLessThans.
In general, howManyLessThans doesn't really want to work with pointers
at all; the result is an integer, and the operands of the icmp are
effectively integers. However, isLoopEntryGuardedByCond doesn't like
extra ptrtoint casts, so the arguments to isLoopEntryGuardedByCond need
to be computed without those casts.
Somehow, the values got mixed up with the recent howManyLessThans
improvements; fix the confused values, and add a better comment to
explain what's happening.
Differential Revision: https://reviews.llvm.org/D109465
Alexander Slepko [Thu, 9 Sep 2021 18:48:22 +0000 (11:48 -0700)]
Adding min(f/s/u) and max(f/s/u) cases for vector reduction
This PR adds missing AtomicRMWKind::min/max cases which we would like to use for min/max reduction loop vectorizations.
Reviewed By: aartbik
Differential Revision: https://reviews.llvm.org/D104881
Louis Dionne [Thu, 9 Sep 2021 19:16:03 +0000 (15:16 -0400)]
[libc++][NFC] Consistently reindent test cases for stringbuf
Steven Wu [Thu, 9 Sep 2021 19:08:51 +0000 (12:08 -0700)]
[CMake][Darwin] Ignore stderr during SDKSetting.plist parsing
Don't print stderr to commandline when configuring compiler-rt for
darwin platforms. NFC.
Reviewed By: delcypher
Differential Revision: https://reviews.llvm.org/D108156
Sanjay Patel [Thu, 9 Sep 2021 18:16:28 +0000 (14:16 -0400)]
[InstCombine] add tests for insertelement with cast ops; NFC
Louis Dionne [Thu, 9 Sep 2021 18:46:06 +0000 (14:46 -0400)]
[libc++][NFC] Move misplaced XFAIL annotation
For consistency with the other surrounding tests.
Louis Dionne [Thu, 9 Sep 2021 18:43:02 +0000 (14:43 -0400)]
[libc++][NFC] Add #endif comment for long #if-#endif block
Jameson Nash [Thu, 9 Sep 2021 17:44:38 +0000 (13:44 -0400)]
[Aarch64] Correct register class for pseudo instructions
This constrains the Mov* and similar pseudo instruction to take
GPR64common register classes rather than GPR64. GPR64 includs XZR
which is invalid here, because this pseudo instructions expands
into an adrp/add pair sharing a destination register. XZR is invalid
on add and attempting to encode it will instead increment the stack
pointer causing crashes (downstream report at [1]). The test case
there reproduces on LLVM11, but I do not have a test case that
reaches this code path on main, since it is being masked by
improved dead code elimination introduced in D91513. Nevertheless,
this seems like a good thing to fix in case there are other cases
that dead code elimination doesn't clean up (e.g. if `optnone` is
used and the optimization is skipped).
I think it would be worth auditing uses of GPR64 in pseudo
instructions to see if there are any similar issues, but I do not
have a high enough view of the backend or knowledge of the
Aarch64 architecture to do this quickly.
[1] https://github.com/JuliaLang/julia/issues/39818
Reviewed By: t.p.northover
Differential Revision: https://reviews.llvm.org/D97435
Artem Belevich [Fri, 27 Aug 2021 18:18:11 +0000 (11:18 -0700)]
[NVPTX] Simplify and generalize constant printer.
This allows handling i128 values and fixes
https://bugs.llvm.org/show_bug.cgi?id=51789.
Differential Revision: https://reviews.llvm.org/D109458
Louis Dionne [Thu, 9 Sep 2021 18:26:43 +0000 (14:26 -0400)]
[libc++][NFC] Remove remnants of _LIBCPP_HAS_NO_STDOUT, which should have been removed by
87dd51983cf9
Saiyedul Islam [Thu, 9 Sep 2021 18:22:16 +0000 (23:52 +0530)]
[clang-nvlink-wrapper][docs][NFC] Fix sphinx warning about asterisk
Sphinx was giving warning on unescaped special symbol *. It was
an issue on systems treating warning as error.
Simon Pilgrim [Thu, 9 Sep 2021 18:15:35 +0000 (19:15 +0100)]
[X86][AVX] Update _mm256_loadu2_m128* intrinsics to use _mm256_set_m128* (PR51796)
As reported on PR51796, the _mm256_loadu2_m128i in particular was inserting bitcasts and shuffles with different types making it trickier for some combines, and prevented the value tracker from identifying the shuffle sequences as a single insert_subvector style concat_vectors pattern.
This patch instead concatenate the 128-bit unaligned loads with _mm256_set_m128*, which was written to avoid the unnecessary bitcasts and only emits a single shuffle.
Differential Revision: https://reviews.llvm.org/D109497
Louis Dionne [Thu, 9 Sep 2021 18:00:22 +0000 (14:00 -0400)]
[libc++][NFC] Fix typo in comment
Louis Dionne [Thu, 9 Sep 2021 17:52:38 +0000 (13:52 -0400)]
[libc++][NFC] Reorder includes in locale.cpp
Also, include <type_traits> unconditionally. There really isn't much
of a benefit in skipping it when exceptions are disabled.
Craig Topper [Thu, 9 Sep 2021 17:51:06 +0000 (10:51 -0700)]
[SelectionDAG] Use DAG.getNOT to further simplify some code. NFC
Followup to D109483
Stella Stamenova [Thu, 9 Sep 2021 17:49:34 +0000 (10:49 -0700)]
Remove obsolete msvc workaround from AddLLVM.cmake
The original change to add the workaround is from 10 years ago and a lot has happened with msvc and cmake and llvm's usage of cmake since and we no longer need the workaround for any scenarios that I am aware of. Build more is now correctly configured for multi-configuration generators such as Visual Studio.
The workaround is, however, causing issues with some of the recent mlir tests as because of the workaround we cannot correctly determine whether assertions are enabled (see https://reviews.llvm.org/D105961).
The original change is:
```
commit
b46fdac4609df2613177813d43a124e3d9a8a306
Author: Andrew Trick <atrick@apple.com>
Date: Tue Jun 28 16:32:01 2011
cmake: Our MSVC build does not support config-time build mode.
llvm-svn: 134008
```
Reviewed By: mehdi_amini
Differential Revision: https://reviews.llvm.org/D109521
Nick Desaulniers [Thu, 9 Sep 2021 17:42:10 +0000 (10:42 -0700)]
[NFC] rename member of BitTestBlock and JumpTableHeader
Follow up to suggestions in D109103 via hans:
I think UnreachableDefault (or UnreachableFallthrough) would be a
better name now, since it doesn't just omit the range check, it also
omits the last bit test.
Reviewed By: hans
Differential Revision: https://reviews.llvm.org/D109455
Louis Dionne [Thu, 9 Sep 2021 17:29:24 +0000 (13:29 -0400)]
[libc++][NFC] Move misplaced comment about implementation of ctype<wchar_t>
Louis Dionne [Thu, 9 Sep 2021 17:26:11 +0000 (13:26 -0400)]
[libc++] Add missing include of <cstddarg> for va_xxx functions
Louis Dionne [Thu, 9 Sep 2021 17:23:26 +0000 (13:23 -0400)]
[libc++][NFC] Move __char_traits_length_checked outside of wchar_t definitions
This will simplify an upcoming diff.
Chris Lattner [Thu, 9 Sep 2021 17:22:29 +0000 (10:22 -0700)]
[CodeGen] Use DAG.getAllOnesConstant where possible to simplify code. NFC.
Craig Topper [Thu, 9 Sep 2021 16:46:47 +0000 (09:46 -0700)]
[X86] Disable muloti4 libcalls for x86-64.
This library function only exists in compiler-rt not libgcc. So
this would fail to link unless we were linking with compiler-rt.
This is consistent with the recent removal of calls to mulodi4 on
32-bit targets like D108928.
I suppose maybe we could keep the libcalls for platforms like
Darwin that use compiler-rt exclusively?
Reviewed By: nickdesaulniers, MaskRay
Differential Revision: https://reviews.llvm.org/D109385
Chris Lattner [Thu, 9 Sep 2021 05:13:13 +0000 (22:13 -0700)]
[APInt] Normalize naming on keep constructors / predicate methods.
This renames the primary methods for creating a zero value to `getZero`
instead of `getNullValue` and renames predicates like `isAllOnesValue`
to simply `isAllOnes`. This achieves two things:
1) This starts standardizing predicates across the LLVM codebase,
following (in this case) ConstantInt. The word "Value" doesn't
convey anything of merit, and is missing in some of the other things.
2) Calling an integer "null" doesn't make any sense. The original sin
here is mine and I've regretted it for years. This moves us to calling
it "zero" instead, which is correct!
APInt is widely used and I don't think anyone is keen to take massive source
breakage on anything so core, at least not all in one go. As such, this
doesn't actually delete any entrypoints, it "soft deprecates" them with a
comment.
Included in this patch are changes to a bunch of the codebase, but there are
more. We should normalize SelectionDAG and other APIs as well, which would
make the API change more mechanical.
Differential Revision: https://reviews.llvm.org/D109483
Sam Clegg [Thu, 9 Sep 2021 15:55:08 +0000 (11:55 -0400)]
[lld][WebAssembly] Fix crash on un-used __tls_base symbol
In the case that TLS is used in the single-threaded program, and
therefore effectively lowered away, we still optionally create a
`__tls_base` symbols, but the code for setting it was assuming it was
always created.
Differential Revision: https://reviews.llvm.org/D109518
Aart Bik [Thu, 9 Sep 2021 16:35:38 +0000 (09:35 -0700)]
[mlir][sparse] fix broken test
new flag requirements crossed the checkin of this new test
Reviewed By: ftynse
Differential Revision: https://reviews.llvm.org/D109524
Jon Chesterfield [Thu, 9 Sep 2021 16:28:10 +0000 (17:28 +0100)]
[libomptarget][amdgpu] Precisely manage hsa lifetime
The hsa library must be initialized before any calls into it and
destructed after the last call into it. There have been a number of bugs in
this area related to member variables which would like to use raii to manage
resources acquired from hsa.
This patch moves the init/shutdown of hsa into a class, such that when used as
the first member variable (could be a base), the lifetime of other member
variables are reliably scoped within it. This will allow other classes to use
raii reliably when used as member variables within the global.
Reviewed By: pdhaliwal
Differential Revision: https://reviews.llvm.org/D109512
Fangrui Song [Thu, 9 Sep 2021 16:27:14 +0000 (09:27 -0700)]
[lld] Buffer writes when composing a single diagnostic
llvm::errs() is unbuffered. On a POSIX platform, composing a diagnostic
string may invoke the ::write syscall multiple times, which can be slow.
Buffer writes to a temporary SmallString when composing a single diagnostic to
reduce the number of ::write syscalls to one (also easier to read under
strace/truss).
For an invocation of ld.lld with 62000+ lines of
`ld.lld: warning: symbol ordering file: no such symbol: ` warnings (D87121),
the buffering decreases the write time from 1s to 0.4s (for /dev/tty) and
from 0.4s to 0.1s (for a tmpfs file). This can speed up
`relocation R_X86_64_PC32 out of range` diagnostic printing as well
with `--noinhibit-exec --no-fatal-warnings`.
Reviewed By: jhenderson
Differential Revision: https://reviews.llvm.org/D87272
Neumann Hon [Thu, 9 Sep 2021 15:39:55 +0000 (11:39 -0400)]
[SystemZ] [NFC] Add SystemZELFFrameLowering and SystemZXPLINKFrameLowering classes.
This patch adds class SystemZFrameLowering which is a SystemZ-specific class
detailing special registers used by calling conventions on the target.
SystemZELFFrameLowering and SystemZXPLINKFrameLowering implement this class
for ELF and XPLINK64 respectively. Previous functionality in SystemZFrameLowering
is moved to SystemZELFFrameLowering. SystemZXPLINKFrameLowering can then be
implemented in future patches.
Reviewed By: uweigand, Kai
Differential Revision: https://reviews.llvm.org/D108777
Jon Chesterfield [Thu, 9 Sep 2021 16:16:41 +0000 (17:16 +0100)]
[openmp] No longer use LIBRARY_PATH to find devicertl
Given D109057, change test runner to use the libomptarget-x-bc-path
argument instead of the LIBRARY_PATH environment variable to find the device
library.
Also drop the use of LIBRARY_PATH environment variable as it is far
too easy to pull in the device library from an unrelated toolchain by accident
with the current setup. No loss in flexibility to developers as the clang
commandline used here is still available.
Reviewed By: jdoerfert, tianshilei1992
Differential Revision: https://reviews.llvm.org/D109061
Ryan Mansfield [Thu, 9 Sep 2021 15:40:12 +0000 (17:40 +0200)]
[lldb] Fix format string in Communication::Write
Reviewed By: teemperor
Differential Revision: https://reviews.llvm.org/D109508
Akira Hatanaka [Thu, 9 Sep 2021 05:24:07 +0000 (22:24 -0700)]
[clang-scan-deps] Add an API for clang dependency scanner to perform
module lookup by name alone
This removes the need to create a fake source file that imports a
module.
rdar://
64538073
Differential Revision: https://reviews.llvm.org/D109485
Kazu Hirata [Thu, 9 Sep 2021 15:50:10 +0000 (08:50 -0700)]
[IR, Transforms] Use arg_empty (NFC)
Aart Bik [Wed, 8 Sep 2021 21:30:53 +0000 (14:30 -0700)]
[mlir][sparse] add casts to operations to lattice and exp builders
Further enhance the set of operations that can be handled by the sparse compiler
Reviewed By: bixia
Differential Revision: https://reviews.llvm.org/D109413
Nathan Sidwell [Tue, 25 May 2021 14:04:25 +0000 (07:04 -0700)]
[clang] Array list initialization (pre-p0388)
Extends handling of list initialization of bounded array parameters.
This adds the missing checks on converting each initializer for both
std::initializer_list and arrays. And extends
CompareImplicitConversionSequence to compares array size, for two
conversions to array type.
As noted in this patch, there's a defect in the std concerning the
partial orderability of conversion sequences. DR2492 has a suggested
direction that will be simple to add once it (hopefully) is accepted.
Differential Revision: https://reviews.llvm.org/D103088
Louis Dionne [Thu, 9 Sep 2021 15:25:10 +0000 (11:25 -0400)]
[libc++][NFC] Remove #endif comments for really small conditionals on _LIBCPP_HAS_NO_UNICODE_CHARS
We generally don't put a comment on the #endif when the #if block is so small
that it's unambiguous what the #endif refers to.
Louis Dionne [Thu, 9 Sep 2021 15:14:33 +0000 (11:14 -0400)]
[libc++][NFC] Reindent documentation for LIBCXX_ENABLE_UNICODE
LLVM GN Syncbot [Thu, 9 Sep 2021 15:10:21 +0000 (15:10 +0000)]
[gn build] Port
b1fb3d75c953
Jon Chesterfield [Thu, 9 Sep 2021 15:07:30 +0000 (16:07 +0100)]
[libomptarget][nfc] Hoist hsa_init into rtl.cpp
Louis Dionne [Thu, 28 May 2020 18:28:38 +0000 (14:28 -0400)]
[libc++] Implement C++20's P0476R2: std::bit_cast
Thanks to Arthur O'Dwyer for fixing up some of the tests.
Differential Revision: https://reviews.llvm.org/D75960
Alex Zinenko [Thu, 9 Sep 2021 14:06:10 +0000 (16:06 +0200)]
[mlir] Factor type reconciliation out of Standard-to-LLVM conversion
Conversion to the LLVM dialect is being refactored to be more progressive and
is now performed as a series of independent passes converting different
dialects. These passes may produce `unrealized_conversion_cast` operations that
represent pending conversions between built-in and LLVM dialect types.
Historically, a more monolithic Standard-to-LLVM conversion pass did not need
these casts as all operations were converted in one shot. Previous refactorings
have led to the requirement of running the Standard-to-LLVM conversion pass to
clean up `unrealized_conversion_cast`s even though the IR had no standard
operations in it. The pass must have been also run the last among all to-LLVM
passes, in contradiction with the partial conversion logic. Additionally, the
way it was set up could produce invalid operations by removing casts between
LLVM and built-in types even when the consumer did not accept the uncasted
type, or could lead to cryptic conversion errors (recursive application of the
rewrite pattern on `unrealized_conversion_cast` as a means to indicate failure
to eliminate casts).
In fact, the need to eliminate A->B->A `unrealized_conversion_cast`s is not
specific to to-LLVM conversions and can be factored out into a separate type
reconciliation pass, which is achieved in this commit. While the cast operation
itself has a folder pattern, it is insufficient in most conversion passes as
the folder only applies to the second cast. Without complex legality setup in
the conversion target, the conversion infra will either consider the cast
operations valid and not fold them (a separate canonicalization would be
necessary to trigger the folding), or consider the first cast invalid upon
generation and stop with error. The pattern provided by the reconciliation pass
applies to the first cast operation instead. Furthermore, having a separate
pass makes it clear when `unrealized_conversion_cast`s could not have been
eliminated since it is the only reason why this pass can fail.
Reviewed By: nicolasvasilache
Differential Revision: https://reviews.llvm.org/D109507
Hansang Bae [Wed, 8 Sep 2021 21:47:35 +0000 (16:47 -0500)]
[OpenMP] Fix line truncation in omp_lib.h
Fixed code that exceeds 72-column.
Differential Revision: https://reviews.llvm.org/D109469
Uday Bondhugula [Thu, 9 Sep 2021 11:39:03 +0000 (17:09 +0530)]
[MLIR] Avoid double space print on llvm global op
Fix extra space print for llvm global op when the 'unamed_addr'
attribute was empty. This led to two spaces being printed in the custom
form between non-whitespace chars. A round trip would add an extra space
to a typical spaced form. NFC.
Differential Revision: https://reviews.llvm.org/D109502
Sam Clegg [Wed, 8 Sep 2021 08:53:13 +0000 (04:53 -0400)]
[WebAssembly] Add explict TLS symbol flag
As before we maintain backwards compat with older object files
by also infering the TLS flag based on the name of the segment.
This change is was split out from https://reviews.llvm.org/D108877.
Differential Revision: https://reviews.llvm.org/D109426
Louis Dionne [Thu, 9 Sep 2021 13:59:44 +0000 (09:59 -0400)]
[libc++] Provide a way to trigger rebuild of Docker images in the CI
Louis Dionne [Mon, 31 May 2021 16:44:48 +0000 (12:44 -0400)]
[libc++] Move additional build bots to the from-scratch config
Once all the bots are passing with from-scratch configs, we can attempt
to make the from-scratch config the default configuration.
Differential Revision: https://reviews.llvm.org/D103417
Sanjay Patel [Thu, 9 Sep 2021 12:45:56 +0000 (08:45 -0400)]
[InstCombine] remove a buggy set of zext-icmp transforms
The motivating case is an infinite loop shown with a reduced test from:
https://llvm.org/PR51762
To solve this, I'm proposing we delete the most obviously broken part of this code.
The bug example shows a fundamental problem: we ask computeKnownBits if a transform
will be profitable, alter the code by creating new instructions, then rely on
computeKnownBits to return the same answer to actually eliminate instructions.
But there's no guarantee that the results will be the same between the 1st and 2nd
calls. In the infinite loop example, we get different answers, so we add
instructions that conflict with some other transform, and we're stuck.
There's at least one other problem visible in the test diff for
`@zext_or_masked_bit_test_uses`: the code doesn't check uses properly, so we can
end up with extra instructions created.
Last, it's not clear if this set of transforms actually improves analysis or
codegen. I spot-checked a few targets and don't see a clear win:
https://godbolt.org/z/x87EWovso
If we do see a regression from this change, codegen seems like the right place to
add a cmp -> bit-hack fold.
If this is too big of a step, we could limit the computeKnownBits calls by not
passing a context instruction and/or limiting the recursion. I checked that those
would stop the infinite loop for PR51762, but that won't guarantee that some other
example does not fall into the same loop.
Differential Revision: https://reviews.llvm.org/D109440
Corentin Jabot [Thu, 9 Sep 2021 12:45:47 +0000 (08:45 -0400)]
Mark as P0692R1 as implemented; NFC
P0692R1 was implemented in https://reviews.llvm.org/D92024
but the status page was not updated.
Louis Dionne [Thu, 9 Sep 2021 12:38:09 +0000 (08:38 -0400)]
[libc++] Clean up the no-unicode CI job
It was added after we changed the way the CI jobs are run, in particular
how they are pinned down to Linux instances only. As a result, the job
would sometimes run on Mac machines, which we're trying to keep only for
jobs that absolutely need it due to capacity concerns.
Florian Mayer [Wed, 8 Sep 2021 15:32:23 +0000 (16:32 +0100)]
[NFC] [hwasan] move prints closer together.
this makes the code slightly more readable.
Reviewed By: eugenis
Differential Revision: https://reviews.llvm.org/D109442
Martin Storsjö [Wed, 11 Aug 2021 11:14:31 +0000 (14:14 +0300)]
Reapply [runtimes] Set more paths when building runtimes standalone
These paths are needed when building with per-target runtime directories.
(It's possible to fix this by manually setting these when invoking
cmake, but one isn't supposed to need to do that.)
Also set LLVM_TOOLS_BINARY_DIR while touching this area (as it's
also unset in this case) even if it isn't specifically needed by the
per-target runtime configuration.
Fixed since previous attempt: Don't check if the runtimes directory
is the root of the CMake invocation; when the main LLVM CMake
build builds runtimes, it does invoke a sub-CMake with this directory
as the root too, just as if manually invoking CMake at the runtimes
directory. Instead check whether LLVM_TOOLS_BINARY_DIR was set and
whether find_package(LLVM) succeeded or not.
Differential Revision: https://reviews.llvm.org/D107895
Louis Dionne [Tue, 31 Aug 2021 22:13:33 +0000 (18:13 -0400)]
[libc++] Implement P1951, default arguments for pair's forwarding constructor
Differential Revision: https://reviews.llvm.org/D109066
Nico Weber [Thu, 9 Sep 2021 12:12:58 +0000 (08:12 -0400)]
[gn build] Make lldb build on Windows
Differential Revision: https://reviews.llvm.org/D109478
Florian Mayer [Thu, 9 Sep 2021 12:07:10 +0000 (13:07 +0100)]
[NFC] [stack-safety] add placeholder addRange.
This is in preparataion of D108457.
Raphael Isemann [Tue, 31 Aug 2021 11:02:39 +0000 (13:02 +0200)]
[lldb][NFC] Add some tests for function-local classes and document some bugs
This feature doesn't seem to have any dedicated test. Instead some random tests
(e.g. the bitfield tests) are declaring function-local classes for some reason.
This adds a dedicated test so we can clean up those other tests.
Also add FIXME's for some basic stuff that doesn't work. The first FIXME is a
good beginner bug which just requires prepending the function name (in case we
decide to fix it instead of documenting this behaviour). The second FIXME is
caused by LLDB searching for definitions by name (which also seems to miss the
function name so there is a conflict with the outer type).
Some more things that should be tested (and might not work):
* Local classes with member functions with local classes.
* Classes in different functions with same name.
* Classes with the same name in different TUs with internal linkage functions of
the same name.
* Empty classes are parsed by the DWARF parser in a fast path, so that requires
dedicated tests.
* Repeat some of the tested logic for C.
Cullen Rhodes [Thu, 9 Sep 2021 11:27:17 +0000 (11:27 +0000)]
[OptParser] NFC: Remove unused template arg 'name' from bool opt
Identified in D109359.
Reviewed By: jansvoboda11
Differential Revision: https://reviews.llvm.org/D109489
Florian Mayer [Thu, 9 Sep 2021 09:08:11 +0000 (10:08 +0100)]
[stack-safety] [NFC] do not terminate print with blank line.
LLVM GN Syncbot [Thu, 9 Sep 2021 11:25:54 +0000 (11:25 +0000)]
[gn build] Port
c58c7a6ea053
Marco Gartmann [Mon, 9 Aug 2021 12:08:00 +0000 (14:08 +0200)]
[clang-tidy] cppcoreguidelines-virtual-base-class-destructor: a new check
Finds base classes and structs whose destructor is neither public and
virtual nor protected and non-virtual.
A base class's destructor should be specified in one of these ways to
prevent undefined behaviour.
Fixes are available for user-declared and implicit destructors that are
either public and non-virtual or protected and virtual.
This check implements C.35 [1] from the CppCoreGuidelines.
Reviewed By: aaron.ballman, njames93
Differential Revision: http://reviews.llvm.org/D102325
[1]: http://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rc-dtor-virtual
Florian Mayer [Thu, 9 Sep 2021 09:04:06 +0000 (10:04 +0100)]
[NFC] [stack-safety] remove unused return value.
Simon Pilgrim [Thu, 9 Sep 2021 11:16:08 +0000 (12:16 +0100)]
[X86][AVX] Add missing X86ISD::VBROADCAST(v2f64 -> v4f64) isel pattern for AVX1 targets
As discussed on the ticket, I'm intending to add additional 128->256 patterns when we have test coverage, but this addresses a known crash.
Differential Revision: https://reviews.llvm.org/D109434
Muhammad Omair Javaid [Thu, 9 Sep 2021 11:04:43 +0000 (16:04 +0500)]
AArch64 SVE restore SVE registers after expression
This patch fixes register save/restore on expression call to also include SVE registers.
This will fix expression calls like:
re re p1
<Register Value P1 before expression>
p <var-name or function call>
re re p1
<Register Value P1 after expression>
In above example register P1 should remain the same before and after the expression evaluation.
Reviewed By: DavidSpickett
Differential Revision: https://reviews.llvm.org/D108739
Alex Zinenko [Wed, 25 Aug 2021 09:07:17 +0000 (11:07 +0200)]
[mlir] support reductions in SCF to OpenMP conversion
OpenMP reductions need a neutral element, so we match some known reduction
kinds (integer add/mul/or/and/xor, float add/mul, integer and float min/max) to
define the neutral element and the atomic version when possible to express
using atomicrmw (everything except float mul). The SCF-to-OpenMP pass becomes a
module pass because it now needs to introduce new symbols for reduction
declarations in the module.
Reviewed By: chelini
Differential Revision: https://reviews.llvm.org/D107549
Bradley Smith [Tue, 7 Sep 2021 15:52:39 +0000 (15:52 +0000)]
[AArch64][SVE] Add missing patterns for unpredicated subr intrinsics
Differential Revision: https://reviews.llvm.org/D109369
Simon Pilgrim [Thu, 9 Sep 2021 10:23:36 +0000 (11:23 +0100)]
[X86] Move _mm256_set_m128* intrinsics before _mm256_loadu2_m128* intrinsics. NFC.
This is necessary for PR51796 where we'll update _mm256_loadu2_m128* to use _mm256_set_m128*
Alfonso Sánchez-Beato [Thu, 9 Sep 2021 10:14:52 +0000 (11:14 +0100)]
[yaml2obj][COFF] Allow variable number of directories
Allow variable number of directories, as allowed by the
specification. NumberOfRvaAndSize will default to 16 if not specified,
as in the past.
Reviewed by: jhenderson
Differential Revision: https://reviews.llvm.org/D108825
Sjoerd Meijer [Thu, 9 Sep 2021 09:11:28 +0000 (10:11 +0100)]
[FuncSpec] Fixed minor formatting issues. NFC.
Roman Lebedev [Sun, 15 Aug 2021 16:01:44 +0000 (19:01 +0300)]
[SimplifyCFG] performBranchToCommonDestFolding(): require block-closed SSA form for bonus instructions (PR51125)
I can't seem to wrap my head around the proper fix here,
we should be fine without this requirement, iff we can form this form,
but the naive attempt (https://reviews.llvm.org/D106317) has failed.
So just to unblock the release, put up a restriction.
Fixes https://bugs.llvm.org/show_bug.cgi?id=51125
Jun Ma [Fri, 20 Aug 2021 09:27:00 +0000 (17:27 +0800)]
Recommit "Revert "[CVP] processSwitch: Remove default case when switch cover all possible values.""
Differential Revision: https://reviews.llvm.org/D106056
Michał Górny [Thu, 22 Apr 2021 19:39:53 +0000 (21:39 +0200)]
[lldb] [test] Add tests for coredumps with multiple threads
Differential Revision: https://reviews.llvm.org/D101157
Cullen Rhodes [Thu, 9 Sep 2021 07:14:54 +0000 (07:14 +0000)]
[SelectionDAG] NFC: Remove unused template args
Identified in D109359.
Jean Perier [Thu, 9 Sep 2021 07:11:49 +0000 (09:11 +0200)]
[flang] Fix common block size extension mistake in D109156
https://reviews.llvm.org/D109156 did not properly update the case where
the equivalence symbol appearing in the common statement is the
"base symbol of an equivalence group" (this was the only case that previously
worked ok, and the patch broke it).
Fix this and add a test that actually uses this code path.
Differential Revision: https://reviews.llvm.org/D109439
Cullen Rhodes [Thu, 9 Sep 2021 06:44:09 +0000 (06:44 +0000)]
[AArch64][SVE] NFC: Remove unused template args
For sve_fp_3op_p_zds_zx we have zero patterns downstream but the
intrinsic args can be added again if/when the patterns are implemented.
Identified in D109359.
Reviewed By: sdesmalen
Differential Revision: https://reviews.llvm.org/D109429
Cullen Rhodes [Thu, 9 Sep 2021 06:43:24 +0000 (06:43 +0000)]
[AArch64][SVE] NFC: Use stepvector directly in index multiclasses
Also fixes a couple of warnings identified in D109359:
SVEInstrFormats.td:5099:59: warning: unused template argument: sve_int_index_ri::step_vector
SVEInstrFormats.td:5133:59: warning: unused template argument: sve_int_index_rr::step_vector
Reviewed By: david-arm
Differential Revision: https://reviews.llvm.org/D109422
Alexander Pivovarov [Fri, 3 Sep 2021 21:16:29 +0000 (14:16 -0700)]
[RISCV] Add SiFive cores E and S series
Add SiFive cores E20, E21, E24, E34, S21, S54 and S76
Differential Revision: https://reviews.llvm.org/D109260