Nikita Popov [Sat, 6 Mar 2021 11:14:48 +0000 (12:14 +0100)]
[ConstantFold] Handle vectors in ConstantFoldLoadThroughBitcast()
There seems to be an impedance mismatch between what the type
system considers an aggregate (structs and arrays) and what
constants consider an aggregate (structs, arrays and vectors).
Rather than adjusting the type check, simply drop it entirely,
as getAggregateElement() is well-defined for non-aggregates: It
simply returns null in that case.
Nikita Popov [Sat, 6 Mar 2021 11:10:52 +0000 (12:10 +0100)]
[GVN] Regenerate test checks (NFC)
David Zarzycki [Sat, 6 Mar 2021 11:06:55 +0000 (06:06 -0500)]
Partially revert "[runtimes] Use add_lit_testsuite to register lit testsuites"
This partially reverts commit
e1173c8794f4942d2cdddb090489ba5a6cc193e8
until we find out why libcxx tests are failing under runtimes build.
Juneyoung Lee [Sat, 6 Mar 2021 09:42:17 +0000 (18:42 +0900)]
[LangRef] dos2unix (NFC)
Nikita Popov [Sat, 6 Mar 2021 09:24:34 +0000 (10:24 +0100)]
[LVI] Simplify and generalize handling of clamp patterns
Instead of handling a number of special cases for selects, handle
this generally when inferring ranges from conditions. We already
infer ranges from `x + C pred C2` to `x`, so doing the same for
`x pred C2` to `x + C` is straightforward.
Nikita Popov [Sat, 6 Mar 2021 09:35:30 +0000 (10:35 +0100)]
[CVP] Add additional tests for clamp patterns (NFC)
These are the same as the existing tests, but using different
predicates that are not handled by the current code.
Raul Tambre [Wed, 3 Mar 2021 14:25:25 +0000 (16:25 +0200)]
[runtimes] Fix crosscompiling after
a7cad6680b4087eff8994f1f99ac40c661a6621f (D97451)
It moved the logic for CMake target arguments into llvm_ExternalProject_Add().
No handling was added for CMAKE_CROSSCOMPILING, which has a separate set of compiler_args.
This broke crosscompiling, as now the runtimes builds defaulted to the compiler's default.
I've also added passing of CMAKE_ASM_COMPILER, which was missing before although we were passing the triple for it.
Reviewed By: zero9178
Differential Revision: https://reviews.llvm.org/D97855
Nikita Popov [Sat, 6 Mar 2021 09:18:07 +0000 (10:18 +0100)]
[LVI] Pass offset by reference (NFC)
Instead of by pointer. This allows us to use offsets that are not
materialized in the IR.
Nikita Popov [Sat, 6 Mar 2021 09:12:17 +0000 (10:12 +0100)]
[CVP] Fix tests for clamp patterns (NFC)
These tests didn't test the pattern they were supposed to, because
%a instead of %add was used in the select, which turned this into
a normal min/max).
Noticed this when commenting out the clamp handling code did not
result in any test failures...
Jay Foad [Sat, 6 Mar 2021 08:52:23 +0000 (08:52 +0000)]
Revert "Revert "[AMDGPU] Restore the s_memtime instruction in gfx1030""
This reverts commit
e58d68fcd06ddc7743e0419c0b364df3d44121b6.
This reinstates commit
fc28f600e558c1344618bda149a068d6162b6f0b
with a fix to initialize HasShaderCyclesRegister. See
https://reviews.llvm.org/D97928.
Aleksandr Platonov [Sat, 6 Mar 2021 07:44:05 +0000 (10:44 +0300)]
[clangd] Use URIs instead of paths in the index file list
Without this patch the file list of the preamble index contains URIs, but other indexes file lists contain file paths.
This makes `indexedFiles()` always returns `IndexContents::None` for the preamble index, because current implementation expects file paths inside the file list of the index.
This patch fixes this problem and also helps to avoid a lot of URI to path conversions during indexes merge.
Reviewed By: kadircet
Differential Revision: https://reviews.llvm.org/D97535
Martin Storsjö [Fri, 5 Mar 2021 15:27:55 +0000 (17:27 +0200)]
[libcxx] [test] Move the is_<platform> functions down to subclasses
If cross testing (and manually specifying a LIBCXX_TARGET_INFO in the
cmake configuration, as the default is to match the build platform),
we want the accessors for querying the target platform, is_windows,
is_darwin, to return the right value depending on which target info
class is used, not based on what platform is running the build and
driving the tests.
When LIBCXX_TARGET_INFO isn't defined, the right target info class
is chosen automatically based on the platform one is running on, so
this shouldn't make any practical difference for such setups.
Differential Revision: https://reviews.llvm.org/D98045
Martin Storsjö [Thu, 4 Mar 2021 20:19:47 +0000 (22:19 +0200)]
[clang] Don't default to a specifically shared libunwind on mingw with a g++ driver
For MinGW targets, we distinguish between an explicitly shared unwinder
library (requested via -shared-libgcc), an explicitly static one
(requested via -static-libgcc or -static) and the default case (which
just passes -lunwind to the linker, which will pick either shared or
static depending on what's available, with the normal linker logic).
This makes the implicit default case (as added in D79995) actually work as
it was intended, when using the g++ driver (which is the main usecase for
libunwind as far as I know).
Differential Revision: https://reviews.llvm.org/D98023
Martin Storsjö [Thu, 4 Mar 2021 20:33:11 +0000 (22:33 +0200)]
[clang] Fix typos in the default logic for CLANG_DEFAULT_UNWINDLIB
CLANG_DEFAULT_RTLIB had a typo, and libunwind isn't a valid
option for it.
This keeps the actual behaviour from before, defaulting to none if
using compiler-rt as rtlib.
Differential Revision: https://reviews.llvm.org/D98022
Fangrui Song [Sat, 6 Mar 2021 05:45:11 +0000 (21:45 -0800)]
[MC][RISCV] Support .reloc *, BFD_RELOC_{NONE,32,64}, *
BFD_RELOC_NONE is useful for ld --gc-sections: it provides a generic way indicating a dependency between two sections.
Fangrui Song [Sat, 6 Mar 2021 05:39:15 +0000 (21:39 -0800)]
[MC][ARM] Support .reloc *, BFD_RELOC_{NONE,8,16,32}, *
BFD_RELOC_NONE is useful for ld --gc-sections: it provides a generic way indicating a dependency between two sections.
Fangrui Song [Sat, 6 Mar 2021 05:37:29 +0000 (21:37 -0800)]
[MC][test] Fix reloc-directive-elf-*.s
Mehdi Amini [Sat, 6 Mar 2021 05:31:51 +0000 (05:31 +0000)]
Use gen-dialect-doc instead of gen-op-doc for the Builtin dialect
This is fixing the missing title and menu entry on the MLIR website.
Fangrui Song [Sat, 6 Mar 2021 05:31:45 +0000 (21:31 -0800)]
[MC][PowerPC] Support .reloc *, BFD_RELOC_{NONE,16,32,64}, *
BFD_RELOC_NONE is useful for ld --gc-sections: it provides a generic way indicating a dependency between two sections.
Fangrui Song [Sat, 6 Mar 2021 05:17:31 +0000 (21:17 -0800)]
[MC][AArch64] Support .reloc *, BFD_RELOC_{NONE,16,32,64}, *
BFD_RELOC_NONE is useful for ld --gc-sections: it provides a generic way indicating a dependency between two sections.
Fangrui Song [Sat, 6 Mar 2021 05:01:32 +0000 (21:01 -0800)]
[MC][X86] Support .reloc *, BFD_RELOC_{NONE,8,16,32,64}, *
The names are unfortunate, but BFD_RELOC_NONE provides a generic way indicating
a dependency between two sections, which is useful for ld --gc-sections.
See https://sourceware.org/bugzilla/show_bug.cgi?id=27530
Vitaly Buka [Sat, 6 Mar 2021 03:19:00 +0000 (19:19 -0800)]
[sanitizer] Don't expect ABORTING in print-module-map
ABORTING message is inconsistent across sanitizers.
Another followup for D98089
Christopher Di Bella [Thu, 4 Mar 2021 06:47:06 +0000 (22:47 -0800)]
[libcxx] adds std::ranges::swap, std::swappable, and std::swappable_with
Implements parts of:
- P0898R3 Standard Library Concepts
- P1754 Rename concepts to standard_case for C++20, while we still can
Depends on D96742
Differential Revision: https://reviews.llvm.org/D97162
Jianzhou Zhao [Sat, 6 Mar 2021 02:32:57 +0000 (02:32 +0000)]
[dfsan] Re-enable origin tracking test cases
Mitch Phillips [Sat, 6 Mar 2021 01:13:33 +0000 (17:13 -0800)]
Revert "[AMDGPU] Restore the s_memtime instruction in gfx1030"
Broke the ASan/MSan buildbots. See more comments in the original patch,
https://reviews.llvm.org/D97928.
Build failure at http://lab.llvm.org:8011/#/builders/5/builds/5327
This reverts commit
fc28f600e558c1344618bda149a068d6162b6f0b.
Matheus Izvekov [Sat, 6 Mar 2021 01:16:58 +0000 (17:16 -0800)]
[clang] Fix constrained decltype(auto) deduction
Prior to this fix, constrained decltype(auto) behaves exactly the same
as constrained regular auto.
This fixes it so it deduces like decltype(auto).
Signed-off-by: Matheus Izvekov <mizvekov@gmail.com>
Reviewed By: rsmith
Differential Revision: https://reviews.llvm.org/D98087
Vitaly Buka [Sat, 6 Mar 2021 01:59:01 +0000 (17:59 -0800)]
[dfsan] Remove dfsan_get_origin from done_abilist.txt
Followup for D95835
Shoaib Meenai [Wed, 3 Mar 2021 19:32:06 +0000 (11:32 -0800)]
[DirectoryWatcher] Increase timeout to make test less flaky
We've observed this test being significantly flaky on our Mac CI
machines when we're running the full check-clang suite. It fails because
the wait_for condition isn't met within 3 seconds. We believe it's
because our CI machines are somewhat underpowered and pretty heavily
loaded when we're running the full check-clang suite.
I ran some experiments on increasing the timeout. I ran the full
check-clang suite 100 times with each timeout value and recorded how
many flaky failures we encountered in these tests. The results are:
3 second timeout (baseline): 20 failures
10 second timeout: 14 failures
20 second timeout: 4 failures
30 second timeout: 2 failures
40 second timeout: 1 failure
50 second timeout: 0 failures
60 second timeout: 0 failures
I ran another set of 100 tests for the 50 second timeout and observed
one flaky failure. By contrast, I ended up running check-clang 500 times
for the 60 second timeout and didn't observe a single flaky failure.
That's how the 60 second timeout value used in this patch was derived.
While a 60 second timeout might seem high, keep in mind that:
- This is a timeout, not a sleep; the test should require much less time
the vast majority of instances, especially on more powerful machines.
- The long timeout is most likely to occur when other tests are also
running at the same time, so the latency of the timeout will also be
masked by the latency of the other tests.
See https://reviews.llvm.org/D58418?id=200123#inline-554211 for where
this timeout was originally introduced and the possibility of raising it
if it wasn't enough was discussed.
Reviewed By: plotfi
Differential Revision: https://reviews.llvm.org/D97878
Vitaly Buka [Sat, 6 Mar 2021 01:22:22 +0000 (17:22 -0800)]
[NFC] Fix module map test
Followup for D98089
Jianzhou Zhao [Sat, 6 Mar 2021 01:12:54 +0000 (01:12 +0000)]
[dfsan] Disable origin test cases temporarily
Jessica Clarke [Sat, 6 Mar 2021 01:00:22 +0000 (01:00 +0000)]
[benchmark] Replace references to M680x0 with M68k
The former was the old unusual name of the out-of-tree backend but it
was renamed to M68k during the code review process to conform with how
almost everything refers to the Motorola 68000 family of processors.
Thus, update the comments to avoid confusion when the backend lands.
Matthias Springer [Fri, 5 Mar 2021 04:08:05 +0000 (13:08 +0900)]
[mlir][AVX512] Add mask.compress to AVX512 dialect.
Adds mask.compress to the AVX512 dialect and defines a lowering to the LLVM dialect.
Differential Revision: https://reviews.llvm.org/D97611
Nemanja Ivanovic [Sat, 6 Mar 2021 00:24:28 +0000 (18:24 -0600)]
[PowerPC] Add missing double precision vec_all overloads to altivec.h
We somehow missed vec_all_nlt, vec_all_nle and vec_all_numeric
overloads for double precision vectors when VSX is enabled.
Emily Shi [Sat, 6 Mar 2021 00:26:22 +0000 (16:26 -0800)]
[sanitizers] fix print-module-map test on linux
Looks like the default options for halt_on_error are different between linux and mac. set it to 0 in the test so the behavior is the same on both platforms.
rdar://
75110847
Reviewed By: delcypher
Differential Revision: https://reviews.llvm.org/D98089
Rainer Orth [Sat, 6 Mar 2021 00:28:17 +0000 (01:28 +0100)]
[asan][test] Handle Solaris in large_func_test.cpp etc.
Two ASan tests currently `FAIL' on Solaris
AddressSanitizer-i386-sunos :: TestCases/large_func_test.cpp
AddressSanitizer-i386-sunos :: TestCases/use-after-delete.cpp
both for the same reason:
error: no check strings found with prefix 'CHECK-SunOS:'
Fixed by adding the appropriate check strings.
Tested on `amd64-pc-solaris2.11` and `x86_64-pc-linux-gnu`.
Differential Revision: https://reviews.llvm.org/D97931
Jianzhou Zhao [Thu, 4 Mar 2021 02:35:13 +0000 (02:35 +0000)]
[dfsan] Add utils to get and print origin paths and some test cases
This is a part of https://reviews.llvm.org/D95835.
Reviewed By: morehouse, gbalats
Differential Revision: https://reviews.llvm.org/D97962
Richard Smith [Fri, 5 Mar 2021 23:50:30 +0000 (15:50 -0800)]
PR49260: Improve diagnostics for no matching 'operator new'.
Fix duplicate diagnostic for an over-aligned allocation with no matching
function, and add custom diagnostic for the case where the
non-allocating placement new was intended but <new> was not included.
Mehdi Amini [Fri, 5 Mar 2021 21:04:23 +0000 (21:04 +0000)]
Fix Dialect doc generation to special case for the Builtin dialect empty name
This should fix the issue with an empty entry for the builtin dialect on
the website.
Differential Revision: https://reviews.llvm.org/D98074
Jez Ng [Fri, 5 Mar 2021 23:42:22 +0000 (18:42 -0500)]
[lld-macho] Move a bunch of options into the "obsolete" category
These are mostly things that ld64 has itself marked obsolete.
In the case of `-sectorder`, it's suggested in ld64's manpage that it
could be deprecated, so let's skip implementing it for now.
Reviewed By: #lld-macho, thakis
Differential Revision: https://reviews.llvm.org/D98066
Emily Shi [Fri, 5 Mar 2021 22:39:18 +0000 (14:39 -0800)]
[sanitizers] run print module map test run on posix
Previously, this test only ran for mac because platforms have different messaging. This diff enables the test for all posix
rdar://
75110847
Reviewed By: vitalybuka
Differential Revision: https://reviews.llvm.org/D98079
Michael Kruse [Fri, 5 Mar 2021 23:22:42 +0000 (17:22 -0600)]
[clang][OpenMP][docs] Update loop transformation status.
Mark tiling as done and unrolling as being worked on.
Petr Hosek [Fri, 5 Mar 2021 23:24:38 +0000 (15:24 -0800)]
Partially revert "[runtimes] Use add_lit_testsuite to register lit testsuites"
This partially reverts commit
e1173c8794f4942d2cdddb090489ba5a6cc193e8
until we find out why compiler-rt tests are failing under runtimes build.
Philip Reames [Fri, 5 Mar 2021 23:21:23 +0000 (15:21 -0800)]
[tests] precommit tests for D98082
Martin Storsjö [Sun, 2 Feb 2020 21:22:49 +0000 (23:22 +0200)]
[libcxx] [test] Fix detection of clang-cl when cross compiling
When cross compiling, the compiler tool doesn't have a .exe suffix.
Differential Revision: https://reviews.llvm.org/D98026
Petr Hosek [Fri, 5 Mar 2021 09:23:39 +0000 (01:23 -0800)]
[Fuchsia] Enable Polly for first stage as well
We want Polly enabled for both stages of the toolchain build.
Differential Revision: https://reviews.llvm.org/D98018
Vy Nguyen [Thu, 4 Mar 2021 21:58:21 +0000 (16:58 -0500)]
[lld-macho] Check platform and version when constructor ObjFile
Differential Revision: https://reviews.llvm.org/D97979
Alex Zinenko [Fri, 5 Mar 2021 18:19:06 +0000 (19:19 +0100)]
[mlir] Squash LLVM_ArmNeon dialect into ArmNeon
The two dialects are largely redundant. The former was introduced as a mirror
of the latter operating on LLVM dialect types. This is no longer necessary
since the LLVM dialect operates on built-in types. Combine the two dialects.
Reviewed By: mehdi_amini
Differential Revision: https://reviews.llvm.org/D98060
Jez Ng [Fri, 5 Mar 2021 22:22:57 +0000 (17:22 -0500)]
[lld-macho] Skip over symbols in un-parsed debug info sections
clang appears to emit symbols in `__debug_aranges`, at least
for arm64... in the examples I've seen, it doesn't seem like those
symbols are referenced outside of `__DWARF`, so I think they're safe to
ignore. But hopefully @clayborg can confirm.
Reviewed By: clayborg
Differential Revision: https://reviews.llvm.org/D98073
Jez Ng [Fri, 5 Mar 2021 22:22:56 +0000 (17:22 -0500)]
[lld-macho] Replace debug-info-related assert with FIXME
We'll need to properly handle object files with multiple source inputs
eventually, but remove the assert for now so we can successfully emit binaries
for testing.
Reviewed By: #lld-macho, smeenai
Differential Revision: https://reviews.llvm.org/D98067
Philip Reames [Fri, 5 Mar 2021 22:24:08 +0000 (14:24 -0800)]
[tests] precommit tests for phi handling in GVN
Aart Bik [Fri, 5 Mar 2021 17:32:15 +0000 (09:32 -0800)]
[mlir][vector] canonicalize unmasked gather/scatter/compress/expand directly into l/s
With the new vector.load/store operations, there is no need to go through
unmasked transfer operations (which will canonicalized to l/s anyway).
Reviewed By: dcaballe
Differential Revision: https://reviews.llvm.org/D98056
Diego Caballero [Fri, 5 Mar 2021 21:47:36 +0000 (23:47 +0200)]
[mlir] Add 'Skip' result to Operation visitor
This patch is a follow-up on D97217. It adds a new 'Skip' result to the Operation visitor
so that a callback can stop the ongoing visit of an operation/block/region and
continue visiting the next one without fully interrupting the walk. Skipping is
needed to be able to erase an operation/block in pre-order and do not continue
visiting the internals of that operation/block.
Related to the skipping mechanism, the patch also introduces the following changes:
* Added new TestIRVisitors pass with basic testing for the IR visitors.
* Fixed missing early increment ranges in visitor implementation.
* Updated documentation of walk methods to include erasure information and walk
order information.
Reviewed By: rriddle
Differential Revision: https://reviews.llvm.org/D97820
Diego Caballero [Fri, 5 Mar 2021 21:46:56 +0000 (23:46 +0200)]
[mlir] Extend Operation visitor with pre-order traversal
This patch extends the Region, Block and Operation visitors to also support pre-order walks.
We introduce a new template argument that dictates the walk order (only pre-order and
post-order are supported for now). The default order for Regions, Blocks and Operations is
post-order. Mixed orders (e.g., Region/Block pre-order + Operation post-order) could easily
be implemented, as shown in NumberOfExecutions.cpp.
Reviewed By: rriddle, frgossen, bondhugula
Differential Revision: https://reviews.llvm.org/D97217
Diego Caballero [Fri, 5 Mar 2021 21:43:56 +0000 (23:43 +0200)]
[mlir][Affine][NFC] Return BlockArgument in AffineForOp::getInductionVar
This avoids unnecessary casts when a BlockArgument is required.
Reviewed By: bondhugula
Differential Revision: https://reviews.llvm.org/D97879
Emily Shi [Tue, 2 Mar 2021 00:33:20 +0000 (16:33 -0800)]
[ubsan] support print_module_map flag in standalone mode
Currently, `print_module_map` is only respected for ubsan if it is ran in tandem with asan. This patch adds support for this flag in standalone mode. I copied the pattern used to implement this for asan.
Also added a common `print_module_map` lit test for Darwin only. Since the print messages are different per platform, we need to write a regex test to cover them. This test is coming in a separate patch
rdar://
56135732
Reviewed By: vitalybuka, vsk, delcypher
Differential Revision: https://reviews.llvm.org/D97746
Martin Storsjö [Fri, 5 Mar 2021 12:46:30 +0000 (14:46 +0200)]
[libcxx] Don't add -Wall when building in MSVC mode
The MSVC -Wall (or /Wall) option maps (in clang-cl) to the GCC style
option -Weverything, which we don't really want. Instead use -W4 which
is the corresponding MSVC option.
This silences the build with clang-cl, which previously used to
output 100 warnings per translation unit.
Differential Revision: https://reviews.llvm.org/D98035
Sriraman Tallam [Fri, 5 Mar 2021 18:49:47 +0000 (10:49 -0800)]
Refactor -funique-internal-linakge-names implementation.
The option -funique-internal-linkage-names was added in D73307 and D78243 as a
LLVM early pass to insert a unique suffix to internal linkage functions and
vars. The unique suffix was the hash of the module path. However, we found
that this can be done more cleanly in clang early and the fixes that need to
be done later can be completely avoided. The fixes in particular are trying
to modify the DW_AT_linkage_name and finding the right place to insert the
pass.
This patch ressurects the original implementation proposed in D73307 which
was reviewed and then ditched in favor of the pass based approach.
Differential Revision: https://reviews.llvm.org/D96109
Nico Weber [Fri, 5 Mar 2021 21:28:38 +0000 (16:28 -0500)]
[lld/mac] tweak comment based on feedback on D98053
KareemErgawy-TomTom [Fri, 5 Mar 2021 20:45:09 +0000 (15:45 -0500)]
[MLIR][SPIRV] Rename `spv.undef` to `spv.Undef`.
To unify the naming scheme across all ops in the SPIR-V dialect, we are
moving from spv.camelCase to spv.CamelCase everywhere. For ops that
don't have a SPIR-V spec counterpart, we use spv.mlir.snake_case.
Reviewed By: antiagainst
Differential Revision: https://reviews.llvm.org/D98016
River Riddle [Fri, 5 Mar 2021 20:42:24 +0000 (12:42 -0800)]
[mlir][AsmPrinter] Don't use string comparison when filtering list attributes
In .mlir modules with larges amounts of attributes, e.g. a function with a larger number of argument attributes, the string comparison filtering greatly affects compile time. This revision switches to using a SmallDenseSet in these situations, resulting in over a 10x speed up in some situations.
Differential Revision: https://reviews.llvm.org/D97980
KareemErgawy-TomTom [Fri, 5 Mar 2021 20:35:35 +0000 (15:35 -0500)]
[MLIR][SPIRV] Rename `spv.loop` to `spv.mlir.loop`.
To unify the naming scheme across all ops in the SPIR-V dialect,
we are moving from spv.camelCase to spv.CamelCase everywhere.
Reviewed By: antiagainst
Differential Revision: https://reviews.llvm.org/D97918
Tim Wojtulewicz [Fri, 5 Mar 2021 20:30:47 +0000 (21:30 +0100)]
[clang-format] Rework Whitesmiths mode to use line-level values in UnwrappedLineParser
This commit removes the old way of handling Whitesmiths mode in favor of just setting the
levels during parsing and letting the formatter handle it from there. It requires a bit of
special-casing during the parsing, but ends up a bit cleaner than before. It also removes
some of switch/case unit tests that don't really make much sense when dealing with
Whitesmiths.
Differential Revision: https://reviews.llvm.org/D94500
Björn Schäpers [Thu, 4 Mar 2021 10:13:46 +0000 (11:13 +0100)]
[clang-format] Rename case sorting
As discussed in D95017 the names case sensitive and insensitive should
be switched.
This amends
a8105b3766e4.
Differential Revision: https://reviews.llvm.org/D97927
Björn Schäpers [Tue, 16 Feb 2021 09:12:22 +0000 (10:12 +0100)]
[clang-format] Suppress diagnostics on second parse
This amends
25f753c51e7b17bfca08155c1d777c5667110970.
When applying the child configurations we don't need any diagnostic,
because it was issued when first parsing them. So just drop everything
on the second parse.
Differential Revision: https://reviews.llvm.org/D96760
PremAnand Rao [Fri, 5 Mar 2021 20:05:41 +0000 (12:05 -0800)]
[OpenMP] Handle non-function context before checking for diagnostic
emission
Ensure that we are in a function declaration context before checking
the diagnostic emission status, to avoid dereferencing a NULL function
declaration.
Differential Revision: https://reviews.llvm.org/D97573
Jay Foad [Thu, 4 Mar 2021 10:56:36 +0000 (10:56 +0000)]
[AMDGPU] Restore the s_memtime instruction in gfx1030
gfx1030 added a new way to implement readcyclecounter using the
SHADER_CYCLES hardware register, but the s_memtime instruction still
exists, so the MC layer should still accept it and the
llvm.amdgcn.s.memtime intrinsic should still work.
Differential Revision: https://reviews.llvm.org/D97928
Valentin Clement [Fri, 5 Mar 2021 19:56:14 +0000 (14:56 -0500)]
[flang][fir] Add FIR Types parser diagnostic tests + cleanup
Add diagnostic tests for Types parsers and remove duplicated diagnostics handled by the MLIR
parser.
Reviewed By: schweitz
Differential Revision: https://reviews.llvm.org/D97643
Stella Laurenzo [Thu, 4 Mar 2021 23:08:56 +0000 (15:08 -0800)]
[mlir][linalg] Add linalg_opdsl tool first draft.
* Mostly imported from experimental repo as-is with cosmetic changes.
* Temporarily left out emission code (for building ops at runtime) to keep review size down.
* Documentation and lit tests added fresh.
* Sample op library that represents current Linalg named ops included.
Differential Revision: https://reviews.llvm.org/D97995
Martin Storsjö [Fri, 5 Mar 2021 12:47:31 +0000 (14:47 +0200)]
[libcxx] Apply pragma for silencing warning when building with clang-cl too
This silences warnings about unused functions (in an anonymous
namespace).
Differential Revision: https://reviews.llvm.org/D98036
Petr Hosek [Thu, 4 Mar 2021 06:40:11 +0000 (22:40 -0800)]
[runtimes] Use add_lit_testsuite to register lit testsuites
The runtimes build uses variables set by add_lit_testsuite to collect
testsuites from all the runtimes.
Differential Revision: https://reviews.llvm.org/D97913
Med Ismail Bennani [Fri, 5 Mar 2021 18:30:10 +0000 (18:30 +0000)]
[lldb/API] Add CommandInterpreter::{Get,Set}PrintErrors to SBAPI (NFC)
This patch exposes the getter and setter methods for the command
interpreter `print_errors` run option.
rdar://
74816984
Differential Revision: https://reviews.llvm.org/D98001
Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
Med Ismail Bennani [Fri, 5 Mar 2021 18:30:48 +0000 (18:30 +0000)]
[lldb/Interpreter] Add `interpreter.repeat-previous-command` setting
This patch introduces a new interpreter setting to prevent LLDB from
re-executing the previous command when passing an empty command.
This can be very useful when performing actions that requires a long
time to complete.
To preserve the original behaviour, the setting defaults to `true`.
rdar://
74983516
Differential Revision: https://reviews.llvm.org/D97999
Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
Vy Nguyen [Thu, 4 Mar 2021 17:13:07 +0000 (12:13 -0500)]
Reland
293e8fa13d3f05e993771577a4c022deee5cbf6e
[llvm-exegesis] Disable the LBR check on AMD
https://bugs.llvm.org/show_bug.cgi?id=48918
The bug reported a hang (or very very slow runtime) on a Zen2. Unfortunately, we don't have the hardware right now to debug it and I was not able to reproduce the bug on a HSW.
Theory we've got is that the lbr-checking code could be confused on AMD.
Differential Revision: https://reviews.llvm.org/D97504
New change:
- Surround usages of x86 helper in llvm-exegesis/X86/Target.cpp with ifdef
- Fix bug which caused the caller of getVendorSignature to not have a copy of EAX that it expected.
Stella Laurenzo [Fri, 5 Mar 2021 04:46:47 +0000 (20:46 -0800)]
NFC: Glob all python sources in the MLIR Python bindings.
* Also switches to use symlinks vs copy as that enables edit-and-continue python development.
* Broken out of https://reviews.llvm.org/D97995 per request from reviewer.
Differential Revision: https://reviews.llvm.org/D98005
Philip Reames [Fri, 5 Mar 2021 18:16:12 +0000 (10:16 -0800)]
[gvn] CSE gc.relocates based on meaning, not spelling
The last two operands to a gc.relocate represent indices into the associated gc.statepoint's gc bundle list. (Effectively, gc.relocates are projections from the gc.statepoints multiple return values.)
We can use this to recognize when two gc.relocates are equivalent (and can be CSEd), even when the indices are non-equal. This is particular useful when considering a chain of multiple statepoints as it lets us eliminate all duplicate gc.relocates in a single pass.
Differential Revision: https://reviews.llvm.org/D97974
(Note: Part of the reviewed change was split and landed as
f352463a)
Philip Reames [Fri, 5 Mar 2021 18:07:17 +0000 (10:07 -0800)]
Mark gc.relocate and gc.result as readnone
For some reason, we had been marking gc.relocates as reading memory. There's no known reason for this, and I suspect it to be a legacy of very early implementation conservatism. gc.relocate and gc.result are simply projections of the return values from the associated statepoint. Note that the LangRef has always declared them readnone.
The EarlyCSE change is simply moving the special casing from readonly to readnone handling.
As noted by the test diffs, this does allow some additional CSE when relocates are separated by stores, but since we generate gc.relocates in batches, this is unlikely to help anything in practice.
This was reviewed as part of https://reviews.llvm.org/D97974, but split at reviewer request before landing. The motivation is to enable the GVN changes in that patch.
Philip Reames [Fri, 5 Mar 2021 18:04:07 +0000 (10:04 -0800)]
[tests] precommit some additional tests for D97974
Philip Reames [Fri, 5 Mar 2021 17:55:36 +0000 (09:55 -0800)]
[rs4gc] avoid insert base computation instructions for deopt uses
If we have a value live over a call which is used for deopt at the call, we know that the value must be a base pointer. We can avoid potentially inserting IR to materialize a base for this value.
In it's current form, this is mostly a compile time optimization. Building the base pointer graph (and then optimizing it away again) is a relatively expensive operation. We also sometimes end up with better codegen in practice - due to failures in optimizing away the inserted base pointer propogation - but those are optimization bugs we're fixing concurrently.
The alternative to this would be to extend the base pointer inference with the ability to generally reuse multiple-base input instructions (phis and selects). That's somewhat invasive and complicated, so we're defering it a bit longer.
Differential Revision: https://reviews.llvm.org/D97885
Zarko Todorovski [Fri, 5 Mar 2021 17:36:45 +0000 (12:36 -0500)]
[PowerPC][AIX] Enable the default AltiVec ABI on AIX
This patch adds support for the default AltiVec ABI for AIX.
Vector registers 20 through 31 are marked as reserved and cannot
be used in the default ABI. This patch adds handling for this case
and also remove the default AltiVec ABI errors.
Reviewed By: sfertile
Differential Revision: https://reviews.llvm.org/D96351
Martin Storsjö [Tue, 20 Oct 2020 18:23:41 +0000 (21:23 +0300)]
[libcxx] [test] Add an option to ssh.py for using a different temp path
If cross testing on Windows via WSL (at least with WSL 1), the Windows
executables can't be executed if they are in WSL specific directories
(like /tmp).
Differential Revision: https://reviews.llvm.org/D98028
Martin Storsjö [Thu, 15 Oct 2020 09:52:56 +0000 (12:52 +0300)]
[libcxx] [test] Fix path.decompose for windows
Add ifdefs to the test reference tables for cases where paths are
interpreted differently (paths that contain a root name).
Fix test assumptions regarding has_root_name() and is_absolute() and
add logic to verify the results of is_absolute() for the test cases in
the table.
Also add a testcase for the path "//net/", which seemed like an
omission.
Differential Revision: https://reviews.llvm.org/D89943
Andrzej Warzynski [Fri, 5 Mar 2021 17:36:09 +0000 (17:36 +0000)]
[Utils] Add missing attributes in syntax files
Added the following attributes to all LLVM syntax files:
* allocsize
* cold
* convergent
* dereferenceable_or_null
* hot
* inaccessiblemem_or_argmemonly
* inaccessiblememonly
* inalloca
* jumptable
* nocallback
* nocf_check
* noduplicate
* nofree
* nomerge
* noprofile
* nosync
* null_pointer_is_valid
* optforfuzzing
* preallocated
* safestack
* sanitize_hwaddress
* sanitize_memtag
* shadowcallstack
* speculative_load_hardening
* swifterror
* syncscope
* tailcc
* willreturn
I generated that list by comparing:
* Attributes.inc (generated from Attributes.td), and
* the Vim syntax file: llvm/utils/vim/syntax/llvm.vim
My original intention was to focus on the Vim syntax file. Since other
syntax files are also out-of-date, I added these attributes (if missing)
to other files as well. Note that in the other sytnax files (i.e. for
Emacs, VScode and Kate), there will be other attributes missing too.
I've also sorted all attributes alphabetically. Otherwise it's really
hard to automate adding new attributes. And I think that it was the
original intent to keep all of them ordered alphabetically.
Differential Revision: https://reviews.llvm.org/D97627
Nico Weber [Fri, 5 Mar 2021 16:17:08 +0000 (11:17 -0500)]
[mac/lld] Fix scale computation for vector ops in PAGEOFF12 relocations
With this, llvm-tblgen no longer tries and fails to allocate 7953 petabyte
when it runs during the build. Instead, `check-llvm` with lld/mac as host
linker now completes without any failures on an m1 mac.
This vector op handling code matches what happens in:
- ld64's OutputFile::applyFixUps() in OutputFile.cpp for kindStoreARM64PageOff12
- lld.ld64.darwinold's offset12KindFromInstruction() in
lld/lib/ReaderWriter/MachO/ArchHandler_arm64.cpp for offset12scale16
- RuntimeDyld's decodeAddend() in
llvm/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldMachOAArch64.h for
ARM64_RELOC_PAGEOFF12
Fixes PR49444.
Differential Revision: https://reviews.llvm.org/D98053
LemonBoy [Fri, 5 Mar 2021 15:46:10 +0000 (16:46 +0100)]
[LegalizeDAG] Implement promotion rules for SELECT_CC
Implement the promotion rule for SELECT_CC nodes by upcasting all the parameters and downcasting the result.
The AArch64 target makes use of this rule and, since it was not implemented, in some cases the instruction selector would hit an assertion upon encountering the illegal node.
This patch requires D97840, the included test cases hit both problems.
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D97859
RamNalamothu [Fri, 5 Mar 2021 08:25:43 +0000 (13:55 +0530)]
[AMDGPU] Do not attempt sgpr spills to vgpr, when it is disabled
This covers a path missed in https://reviews.llvm.org/D95768.
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D98013
Nico Weber [Fri, 5 Mar 2021 17:13:51 +0000 (12:13 -0500)]
[gn build] allow setting clang_base_path to a source-absolute path
With this, you can set `clang_base_path = "//out/gn1"` in `out/gn2/args.gn` and
the build in out/gn2 will use clang and lld from out/gn1.
Setting `clang_base_path` to an absolute path (with e.g.
`clang_base_path = getenv("HOME") + "/src/..."`) should behave as before.
Differential Revision: https://reviews.llvm.org/D97989
Nico Weber [Fri, 5 Mar 2021 17:12:56 +0000 (12:12 -0500)]
[lld/mac] fix clang-format violation from
0e319bd0be2
Jinsong Ji [Fri, 5 Mar 2021 14:25:35 +0000 (14:25 +0000)]
[PowerPC] Update Copy/Paste encodings according to ISA3.1
Copy-paste P9 insns were added back in 2016,
however, looks like the opcodes has changed in ISA3.1.
Reviewed By: #powerpc, nemanjai
Differential Revision: https://reviews.llvm.org/D97416
gbtozers [Wed, 30 Sep 2020 15:29:53 +0000 (16:29 +0100)]
[DebugInfo] Add DIArgList MD to store multple values in DbgVariableIntrinsics
This patch adds a new metadata node, DIArgList, which contains a list of SSA
values. This node is in many ways similar in function to the existing
ValueAsMetadata node, with the difference being that it tracks a list instead of
a single value. Internally, it uses ValueAsMetadata to track the individual
values, but there is also a reasonable amount of DIArgList-specific
value-tracking logic on top of that. Similar to ValueAsMetadata, it is a special
case in parsing and printing due to the fact that it requires a function state
(as it may reference function-local values).
This patch should not result in any immediate functional change; it allows for
DIArgLists to be parsed and printed, but debug variable intrinsics do not yet
recognize them as a valid argument (outside of parsing).
Differential Revision: https://reviews.llvm.org/D88175
Aart Bik [Fri, 5 Mar 2021 03:05:37 +0000 (19:05 -0800)]
[mlir][sparse] mask reduction update
Reduction updates should be masked, just like the load and stores.
Note that alternatively, we could use the fact that masked values are
zero of += updates and mask invariants to get this working but that
would not work for *= updates. Masking the update itself is cleanest.
This change also replaces the constant mask with a broadcast of "true"
since this constant folds much better for various folding patterns.
Reviewed By: nicolasvasilache
Differential Revision: https://reviews.llvm.org/D98000
Simon Pilgrim [Fri, 5 Mar 2021 14:02:00 +0000 (14:02 +0000)]
[X86] X86ISelDAGToDAG.cpp - include cstdint instead of stdint.h NFCI.
Fixes clang-tidy warning
Simon Pilgrim [Fri, 5 Mar 2021 13:55:57 +0000 (13:55 +0000)]
[X86] X86DAGToDAGISel::Select - merge X86::TEST load bitsize checks. NFCI.
Simon Pilgrim [Fri, 5 Mar 2021 11:53:34 +0000 (11:53 +0000)]
Fix Wdocumentation unknown parameter warning. NFCI.
Nathan James [Fri, 5 Mar 2021 15:35:24 +0000 (15:35 +0000)]
[clang-tidy][NFC] Remove unsupported language version checks from vector
tlwilmar [Fri, 5 Mar 2021 15:21:39 +0000 (09:21 -0600)]
Added API for "masked" construct via two entrypoints: __kmpc_masked,
and __kmpc_end_masked. The "master" construct is deprecated. Changed
proc-bind keyword from "master" to "primary". Use of both master
construct and master as proc-bind keyword is still allowed, but
deprecated.
Remove references to "master" in comments and strings, and replace
with "primary" or "primary thread". Function names and variables were
not touched, nor were references to deprecated master construct. These
can be updated over time. No new code should refer to master.
Valentin Clement [Fri, 5 Mar 2021 15:20:51 +0000 (10:20 -0500)]
[flang][fir] Add diagnostic tests for FIR ops verifier
Add diagnostic tests with fir-opt for the diagnostics emitted by the ops verifier
Reviewed By: jeanPerier
Differential Revision: https://reviews.llvm.org/D97996
Nicolas Vasilache [Fri, 5 Mar 2021 15:08:10 +0000 (15:08 +0000)]
[mlir][Linalg] Fix order of dimensions in hoistPaddingOnTensors.
LemonBoy [Fri, 5 Mar 2021 15:01:45 +0000 (16:01 +0100)]
[AArch64] Legalize horizontal fmax/fmin reductions on f16 vectors
Expand the horizontal reduction during the instruction selection phase, but only if the target doesn't support the full fp16 instruction set.
Fixes https://bugs.llvm.org/show_bug.cgi?id=49401
Reviewed By: aemerson
Differential Revision: https://reviews.llvm.org/D97840
Christian Sigg [Fri, 5 Mar 2021 10:29:27 +0000 (11:29 +0100)]
[mlir] Make cuInit() call thread-safe.
Reviewed By: herhut
Differential Revision: https://reviews.llvm.org/D98024
Markus Böck [Fri, 5 Mar 2021 14:30:13 +0000 (15:30 +0100)]
[libcxxabi] Add LIBCXXABI_HAS_WIN32_THREAD_API build option
A few files in libc++abi make use of libc++ headers and a few of those use threading primitives provided by libc++. Since libc++ has multiple threading APIs it may be necessary to override auto-detection.
This patch adds the LIBCXXABI_HAS_WIN32_THREAD_API which does roughly the same as LIBCXXABI_HAS_PTHREAD_API and the similarly named LIBCXX_HAS_WIN32_THREAD_API from libc++. Instead of using autodetection it will force the use of win32 threads instead of pthreads in headers included from libc++.
Without this patch, libc++abi may depend on pthreads if present on the users build environment, even if win32 threading was selected for libc++.
Differential revision: https://reviews.llvm.org/D98021