platform/upstream/llvm.git
3 years ago[PowerPC] Use modulo arithmetic for vec_extract in altivec.h
Nemanja Ivanovic [Tue, 2 Mar 2021 01:23:26 +0000 (19:23 -0600)]
[PowerPC] Use modulo arithmetic for vec_extract in altivec.h

These interfaces are not covered in the ELFv2 ABI but are rather
implemented to emulate those available in GCC/XLC. However, the
ones in the other compilers are documented to perform modulo
arithmetic on the element number. This patch just brings clang
inline with the other compilers at -O0 (with optimization, clang
already does the right thing).

3 years ago[ARM] support symbolic expressions as branch target in b.w
Jian Cai [Mon, 1 Mar 2021 23:03:42 +0000 (15:03 -0800)]
[ARM] support symbolic expressions as branch target in b.w

Currently ARM backend validates the range of branch targets before the
layout of fragments is finalized. This causes build failure if symbolic
expressions are used, with the exception of a single symbolic value.
For example, "b.w ." works but "b.w . + 2" currently fails to
assemble. This fixes the issue by delaying this check (in
ARMAsmParser::validateInstruction) of b.w instructions until the symbol
expressions are resolved (in ARMAsmBackend::adjustFixupValue).

Link:
https://github.com/ClangBuiltLinux/linux/issues/1286

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D97568

3 years ago[libunwind] This adds support in libunwind for rv32 hard float
Kamlesh Kumar [Tue, 2 Mar 2021 01:27:54 +0000 (06:57 +0530)]
[libunwind] This adds support in libunwind for rv32 hard float
            and soft-float for both rv32 and rv64.

Differential Revision: https://reviews.llvm.org/D80690

3 years agoFix memleak for 5de2d189e6ad4
Yuanfang Chen [Tue, 2 Mar 2021 00:49:26 +0000 (16:49 -0800)]
Fix memleak for 5de2d189e6ad4

Fix typo `release` -> `reset`

3 years ago[lld][WebAssembly] Minor refactor in preparation for SHF_STRINGS supports. NFC.
Sam Clegg [Sat, 27 Feb 2021 00:54:15 +0000 (16:54 -0800)]
[lld][WebAssembly] Minor refactor in preparation for SHF_STRINGS supports. NFC.

A couple of small changes to match the ELF linker in preparation
for adding support string mergings.

Differential Revision: https://reviews.llvm.org/D97654

3 years ago[lld][WebAssembly] Convert lld/test/wasm/data-layout.ll to asm. NFC.
Sam Clegg [Mon, 1 Mar 2021 02:15:28 +0000 (18:15 -0800)]
[lld][WebAssembly] Convert lld/test/wasm/data-layout.ll to asm. NFC.

Part of ongoing conversion work started in https://reviews.llvm.org/D80361.

Differential Revision: https://reviews.llvm.org/D97651

3 years agoFix build 5de2d189e6ad4
Yuanfang Chen [Tue, 2 Mar 2021 00:06:30 +0000 (16:06 -0800)]
Fix build 5de2d189e6ad4

Remove source_mgr remark diagnose kind.

3 years ago[Diagnose] Unify MCContext and LLVMContext diagnosing
Yuanfang Chen [Tue, 23 Feb 2021 17:47:15 +0000 (09:47 -0800)]
[Diagnose] Unify MCContext and LLVMContext diagnosing

The situation with inline asm/MC error reporting is kind of messy at the
moment. The errors from MC layout are not reliably propagated and users
have to specify an inlineasm handler separately to get inlineasm
diagnose. The latter issue is not a correctness issue but could be improved.

* Kill LLVMContext inlineasm diagnose handler and migrate it to use
  DiagnoseInfo/DiagnoseHandler.
* Introduce `DiagnoseInfoSrcMgr` to diagnose SourceMgr backed errors. This
  covers use cases like inlineasm, MC, and any clients using SourceMgr.
* Move AsmPrinter::SrcMgrDiagInfo and its instance to MCContext. The next step
  is to combine MCContext::SrcMgr and MCContext::InlineSrcMgr because in all
  use cases, only one of them is used.
* If LLVMContext is available, let MCContext uses LLVMContext's diagnose
  handler; if LLVMContext is not available, MCContext uses its own default
  diagnose handler which just prints SMDiagnostic.
* Change a few clients(Clang, llc, lldb) to use the new way of reporting.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D97449

3 years ago[Sanitizer][NFC] Fix typo
Luís Marques [Mon, 1 Mar 2021 23:47:03 +0000 (23:47 +0000)]
[Sanitizer][NFC] Fix typo

3 years ago[lldb] Revert ScriptedProcess patches
Med Ismail Bennani [Mon, 1 Mar 2021 23:23:27 +0000 (23:23 +0000)]
[lldb] Revert ScriptedProcess patches

This patch reverts the following commits:
5a9c34918bb1526b7e8c29aa5e4fb8d8e27e27b4
46796762afe76496ec4dd900f64d0cf4cdc30e99
2cff3dec1171188ce04ab1a4373cc1885ab97be1
182f0d1a34419445bb19d67581d6ac1afc98b7fa
d62a53aaf1d38a55d1affbd3a30d564a4e9d3171

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
3 years ago[mlir] Add canonicaliations for subtensor_insert operation.
MaheshRavishankar [Mon, 1 Mar 2021 20:21:00 +0000 (12:21 -0800)]
[mlir] Add canonicaliations for subtensor_insert operation.

Add canonicalizers to subtensor_insert operations need canonicalizers
that propagate the constant arguments within offsets, sizes and
strides. Also add pattern to propogate tensor_cast operations.

Differential Revision: https://reviews.llvm.org/D97704

3 years ago[lldb] Add scoped timer to HostInfoMacOSX::GetXcodeSDKPath
Jonas Devlieghere [Mon, 1 Mar 2021 22:57:29 +0000 (14:57 -0800)]
[lldb] Add scoped timer to HostInfoMacOSX::GetXcodeSDKPath

3 years ago[GlobalISel] Bail on G_PHI narrowing of odd types (PR48188)
Nikita Popov [Mon, 1 Mar 2021 20:37:26 +0000 (21:37 +0100)]
[GlobalISel] Bail on G_PHI narrowing of odd types (PR48188)

The current narrowing code for G_PHI can only handle the case
where the size is a multiple of the narrow size. If this is not
the case, fall back to SDAG instead of asserting.

Original patch by shepmaster.

Differential Revision: https://reviews.llvm.org/D92446

3 years agoFix test cxx-call-kernel.cpp
Yaxun (Sam) Liu [Mon, 1 Mar 2021 22:10:14 +0000 (17:10 -0500)]
Fix test cxx-call-kernel.cpp

Only test it with x86 since other target may have an ABI
making it difficult to test.

Change-Id: I85423c8bbbbbb8f24cb3ea4cb64a408069b4d61c

3 years ago[clang-tidy] Added command line option `fix-notes`
Nathan James [Mon, 1 Mar 2021 22:07:09 +0000 (22:07 +0000)]
[clang-tidy] Added command line option `fix-notes`

Added an option to control whether to apply the fixes found in notes attached to clang tidy errors or not.
Diagnostics may contain multiple notes each offering different ways to fix the issue, for that reason the default behaviour should be to not look at fixes found in notes.
Instead offer up all the available fix-its in the output but don't try to apply the first one unless `-fix-notes` is supplied.

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D84924

3 years agoGlobalISel: Remove dead code
Matt Arsenault [Mon, 1 Mar 2021 20:29:56 +0000 (15:29 -0500)]
GlobalISel: Remove dead code

Generic code should probably not introduce G_INSERT/G_EXTRACT. The
mirror unpackRegs should also be removed, but AMDGPU still has a use
remaining which needs to be fixed.

3 years ago[AArch64][GlobalISel] NFC: Remove dead G_BUILD_VECTOR legalization rule
Jessica Paquette [Mon, 1 Mar 2021 21:30:30 +0000 (13:30 -0800)]
[AArch64][GlobalISel] NFC: Remove dead G_BUILD_VECTOR legalization rule

Remove a rule which allows larger scalar types than the destination vector
element type.

This appears to be irrelevant now that we have G_BUILD_VECTOR_TRUNC. Plus,
making a G_BUILD_VECTOR which satisfies this introduces a verifier failure
anyway.

Differential Revision: https://reviews.llvm.org/D97727

3 years ago[CUDA] Remove `noreturn` attribute from __assertfail().
Artem Belevich [Mon, 1 Mar 2021 18:52:15 +0000 (10:52 -0800)]
[CUDA] Remove `noreturn` attribute from __assertfail().

`noreturn` complicates control flow and tends to trigger a known bug in ptxas if
the assert is used within loops in sufficiently complicated code.
https://bugs.llvm.org/show_bug.cgi?id=27738

Differential Revision: https://reviews.llvm.org/D97708

3 years ago[ARM] Rename pass to MVETPAndVPTOptimisationsPass
David Green [Mon, 1 Mar 2021 21:57:19 +0000 (21:57 +0000)]
[ARM] Rename pass to MVETPAndVPTOptimisationsPass

This pass has for a while performed Tail predication as well as VPT
block optimizations. Rename the pass to make that clear.

3 years ago[AArch64] Fix emitting an AdrpAddLdr LOH when there's a potential clobber of the
Amara Emerson [Fri, 26 Feb 2021 20:01:14 +0000 (12:01 -0800)]
[AArch64] Fix emitting an AdrpAddLdr LOH when there's a potential clobber of the
def of the adrp before the ldr.

Apparently this pass used to have liveness analysis but it was removed for
scompile time reasons. This workaround prevents the LOH from being emitted
unless the ADD and LDR are adjacent.

Fixes https://github.com/JuliaLang/julia/issues/39820

Differential Revision: https://reviews.llvm.org/D97571

3 years ago[clang-tidy] Added option to uniqueptr delete release check
Nathan James [Mon, 1 Mar 2021 21:52:12 +0000 (21:52 +0000)]
[clang-tidy] Added option to uniqueptr delete release check

Adds an option, `PreferResetCall`, currently defaulted to `false`, to the check.
When `true` the check will refactor by calling the `reset` member function.

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D97630

3 years ago[mlir][lldb] Fix several gcc warnings in mlir and lldb
Stella Stamenova [Mon, 1 Mar 2021 21:48:22 +0000 (13:48 -0800)]
[mlir][lldb] Fix several gcc warnings in mlir and lldb

These warnings are raised when compiling with gcc due to either having too few or too many commas, or in the case of lldb, the possibility of a nullptr.

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D97586

3 years ago[ARM] Update and add extra WLS testing. NFC
David Green [Mon, 1 Mar 2021 21:46:09 +0000 (21:46 +0000)]
[ARM] Update and add extra WLS testing. NFC

3 years agoFix build failure due to dump()
Yaxun (Sam) Liu [Mon, 1 Mar 2021 21:43:04 +0000 (16:43 -0500)]
Fix build failure due to dump()

Change-Id: I86b534223d63bf8bb8f49af5a64b300efbeba77b

3 years ago[InstrProfiling] Place __llvm_prf_vnodes and __llvm_prf_names in llvm.used on ELF
Fangrui Song [Mon, 1 Mar 2021 21:43:23 +0000 (13:43 -0800)]
[InstrProfiling] Place __llvm_prf_vnodes and __llvm_prf_names in llvm.used on ELF

`__llvm_prf_vnodes` and `__llvm_prf_names` are used by runtime but not
referenced via relocation in the translation unit.

With `-z start-stop-gc` (D96914 https://sourceware.org/bugzilla/show_bug.cgi?id=27451),
the linker no longer lets `__start_/__stop_` references retain them.

Place `__llvm_prf_vnodes` and `__llvm_prf_names` in `llvm.used` to make
them retained by the linker.

This patch changes most existing `UsedVars` cases to `CompilerUsedVars`
to reflect the ideal state - if the binary format properly supports
section based GC (dead stripping), `llvm.compiler.used` should be sufficient.

`__llvm_prf_vnodes` and `__llvm_prf_names` are switched to `UsedVars`
since we want them to be unconditionally retained by both compiler and linker.

Behaviors on other COFF/Mach-O are not affected.

Differential Revision: https://reviews.llvm.org/D97649

3 years ago[lldb/Plugins] Fix SWIGPythonBridge build issue
Med Ismail Bennani [Mon, 1 Mar 2021 21:33:16 +0000 (22:33 +0100)]
[lldb/Plugins] Fix SWIGPythonBridge build issue

This patch should fi the build issue on the windows bots:
https://lab.llvm.org/buildbot/#/builders/83/builds/4214/steps/5/logs/stdio

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
3 years ago[SystemZ] Introduce distinction between the jg/jl family of mnemonics for GNU as...
Anirudh Prasad [Mon, 1 Mar 2021 21:31:29 +0000 (16:31 -0500)]
[SystemZ] Introduce distinction between the jg/jl family of mnemonics for GNU as vs HLASM

- This patch adds in the distinction between jg[*] and jl[*] pc-relative
  mnemonics based on the variant/dialect.
- Under the hlasm variant, we use the jl[*] family of mnemonics and under
  the att (GNU as) variant, we use the jg[*] family of mnemonics.
- jgnop which was added in https://reviews.llvm.org/D92185, is now restricted
  to att variant. jlnop is introduced and restricted to hlasm variant.
- The br[*]l additional mnemonics are mapped to either jl[*]/jg[*] based on
  the variant.

Reviewed By: uweigand

Differential Revision: https://reviews.llvm.org/D97581

3 years ago[HIP] Emit kernel symbol
Yaxun (Sam) Liu [Mon, 8 Feb 2021 17:29:29 +0000 (12:29 -0500)]
[HIP] Emit kernel symbol

Currently clang uses stub function to launch kernel. This is inconvenient
to interop with C++ programs since the stub function has different name
as kernel, which is required by ROCm debugger.

This patch emits a variable symbol which has the same name as the kernel
and uses it to register and launch the kernel. This allows C++ program to
launch a kernel by using the original kernel name.

Reviewed by: Artem Belevich

Differential Revision: https://reviews.llvm.org/D86376

3 years ago[SDAG] add helper for select->logic folds; NFC
Sanjay Patel [Mon, 1 Mar 2021 21:23:09 +0000 (16:23 -0500)]
[SDAG] add helper for select->logic folds; NFC

This set of transforms should be extended to handle vector types.

3 years agoRevert "[c++20] Mark class type NTTPs as done and start defining the feature test...
Richard Smith [Mon, 1 Mar 2021 20:17:10 +0000 (12:17 -0800)]
Revert "[c++20] Mark class type NTTPs as done and start defining the feature test macro."

Some of the parts of this work were reverted; stop defining the feature
test macro for now.

This reverts commit b4c63ef6dd90dba9af26a111c9a78b121c5284b1.

3 years ago[lld/mac] Implement the missing bits of -undefined
Nico Weber [Sun, 28 Feb 2021 18:42:14 +0000 (13:42 -0500)]
[lld/mac] Implement the missing bits of -undefined

This adds support for `-undefined dynamic_lookup`, and for
`-undefined warning` and `-undefined suppress` with `-flat_namespace`.

We just replace undefined symbols with a DynamicLookup when we hit them.

With this, `check-llvm` passes when using ld64.lld.darwinnew as host linker.

Differential Revision: https://reviews.llvm.org/D97642

3 years ago[clang-format][PR47290] Add ShortNamespaceLines format option
Krystian Kuzniarek [Mon, 1 Mar 2021 20:15:04 +0000 (21:15 +0100)]
[clang-format][PR47290] Add ShortNamespaceLines format option

clang-format documentation states that having enabled
FixNamespaceComments one may expect below code:

c++
namespace a {
foo();
}

to be turned into:

c++
namespace a {
foo();
} // namespace a

In reality, no "// namespace a" was added. The problem was too high
value of kShortNamespaceMaxLines, which is used while deciding whether
a namespace is long enough to be formatted.

As with 9163fe2, clang-format idempotence is preserved.

Differential Revision: https://reviews.llvm.org/D87587

3 years ago[clang-format] Respect spaces in line comment section...
Björn Schäpers [Sat, 27 Feb 2021 22:23:37 +0000 (23:23 +0100)]
[clang-format] Respect spaces in line comment section...

... without an active column limit.

Before line comments were not touched at all with ColumnLimit == 0.

Differential Revision: https://reviews.llvm.org/D96896

3 years ago[lld/mac] Add support for -flat_namespace
Nico Weber [Mon, 1 Mar 2021 20:25:10 +0000 (15:25 -0500)]
[lld/mac] Add support for -flat_namespace

-flat_namespace makes lld emit binaries that use name lookup that's more in
line with other POSIX systems: Instead of looking up symbols as (dylib,name)
pairs by dyld, they're instead looked up just by name.

-flat_namespace has three effects:

1. MH_TWOLEVEL and MH_NNOUNDEFS are no longer set in the Mach-O header
2. All symbols use BIND_SPECIAL_DYLIB_FLAT_LOOKUP as ordinal
3. When a dylib is added to the link, its dependent dylibs are also added,
   so that lld can verify that no undefined symbols remain at the end of
   a link with -flat_namespace. These transitive dylibs are added for symbol
   resolution, but they are not emitted in LC_LOAD_COMMANDs.

-undefined with -flat_namespace still isn't implemented. Before this change,
it was impossible to hit that combination because -flat_namespace caused a
diagnostic. Now that it no longer does, emit a dedicated temporary diagnostic
when both flags are used.

Differential Revision: https://reviews.llvm.org/D97641

3 years ago[lld/mac] Use libSystem.dylib instead of libSystem.B.dylib in tests
Nico Weber [Mon, 1 Mar 2021 20:23:25 +0000 (15:23 -0500)]
[lld/mac] Use libSystem.dylib instead of libSystem.B.dylib in tests

For -flat_namespace, lld needs to load dylibs in LC_LOAD_DYLIB.
The current setup meant that libSystem.dylib would cause a LC_LOAD_DYLIB
with libSystem.B.dylib, but that didn't exist in our libsysroot for
tests. So just drop the .B.

See https://reviews.llvm.org/D97641#2595237 and
https://reviews.llvm.org/D97641#2595270

3 years ago[lld/mac on non-mac] fix test/MachO/search-paths.test after ab45289d2e7ce
Nico Weber [Mon, 1 Mar 2021 20:21:24 +0000 (15:21 -0500)]
[lld/mac on non-mac] fix test/MachO/search-paths.test after ab45289d2e7ce

3 years ago[flang] Runtime: SCAN and VERIFY
peter klausler [Fri, 26 Feb 2021 22:32:26 +0000 (14:32 -0800)]
[flang] Runtime: SCAN and VERIFY

Implement the related character intrinsic functions
SCAN and VERIFY.

Differential Revision: https://reviews.llvm.org/D97580

3 years ago[lldb/Plugins] Add ScriptedProcess Process Plugin
Med Ismail Bennani [Mon, 1 Mar 2021 19:34:11 +0000 (19:34 +0000)]
[lldb/Plugins] Add ScriptedProcess Process Plugin

This patch introduces Scripted Processes to lldb.

The goal, here, is to be able to attach in the debugger to fake processes
that are backed by script files (in Python, Lua, Swift, etc ...) and
inspect them statically.

Scripted Processes can be used in cooperative multithreading environments
like the XNU Kernel or other real-time operating systems, but it can
also help us improve the debugger testing infrastructure by writting
synthetic tests that simulates hard-to-reproduce process/thread states.

Although ScriptedProcess is not feature-complete at the moment, it has
basic execution capabilities and will improve in the following patches.

rdar://65508855

Differential Revision: https://reviews.llvm.org/D95713

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
3 years ago[lldb/bindings] Add Python ScriptedProcess base class to lldb module
Med Ismail Bennani [Fri, 19 Feb 2021 00:36:05 +0000 (00:36 +0000)]
[lldb/bindings] Add Python ScriptedProcess base class to lldb module

In order to facilitate the writting of Scripted Processes, this patch
introduces a `ScriptedProcess` python base class in the lldb module.

The base class holds the python interface with all the - abstract -
methods that need to be implemented by the inherited class but also some
methods that can be overwritten.

This patch also provides an example of a Scripted Process with the
`MyScriptedProcess` class.

rdar://65508855

Differential Revision: https://reviews.llvm.org/D95712

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
3 years ago[lldb/Interpreter] Add ScriptInterpreter Wrapper for ScriptedProcess
Med Ismail Bennani [Thu, 18 Feb 2021 10:31:10 +0000 (11:31 +0100)]
[lldb/Interpreter] Add ScriptInterpreter Wrapper for ScriptedProcess

This patch adds a ScriptedProcess interface to the ScriptInterpreter and
more specifically, to the ScriptInterpreterPython.

This interface will be used in the C++ `ScriptProcess` Process Plugin to
call the script methods.

At the moment, not all methods are implemented, they will upstreamed in
upcoming patches.

This patch also adds helper methods to the ScriptInterpreter to
convert `SBAPI` Types (SBData & SBError) to `lldb_private` types
(DataExtractor & Status).

rdar://65508855

Differential Revision: https://reviews.llvm.org/D95711

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
3 years ago[lldb/Commands] Add command options for ScriptedProcess to ProcessLaunch
Med Ismail Bennani [Tue, 16 Feb 2021 09:12:41 +0000 (09:12 +0000)]
[lldb/Commands] Add command options for ScriptedProcess to ProcessLaunch

This patch adds a new command options to the CommandObjectProcessLaunch
for scripted processes.

Among the options, the user need to specify the class name managing the
scripted process. The user can also use a key-value dictionary holding
arbitrary data that will be passed to the managing class.

This patch also adds getters and setters to `SBLaunchInfo` for the
class name managing the scripted process and the dictionary.

rdar://65508855

Differential Review: https://reviews.llvm.org/D95710

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
3 years ago[lldb/Commands] Fix short option collision for `process launch`
Med Ismail Bennani [Wed, 20 Jan 2021 22:50:53 +0000 (23:50 +0100)]
[lldb/Commands] Fix short option collision for `process launch`

This patch changes the short option used in `CommandOptionsProcessLaunch`
for the `-v|--environment` command option to `-E|--environment`.

The reason for that is, that it collides with the `-v|--structured-data-value`
command option generated by `OptionGroupPythonClassWithDict` that
I'm using in an upcoming patch for the `process launch` command.

The long option `--environment` remains the same.

Differential Review: https://reviews.llvm.org/D95100

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
3 years ago[lld/mac] Make -v print version and search paths in additon to linking, not instead...
Nico Weber [Mon, 1 Mar 2021 19:58:35 +0000 (14:58 -0500)]
[lld/mac] Make -v print version and search paths in additon to linking, not instead of linking

This matches ld64's behavior.

Differential Revision: https://reviews.llvm.org/D97718

3 years ago[lld/mac] Prefix errors with "ld64.lld" instead of just "lld"
Nico Weber [Mon, 1 Mar 2021 19:45:17 +0000 (14:45 -0500)]
[lld/mac] Prefix errors with "ld64.lld" instead of just "lld"

Matches the ELF and COFF ports, which use ld.lld and lld-link, respectively.

While here, also move up `cleanupCallback` to match ELF / COFF.

Differential Revision: https://reviews.llvm.org/D97715

3 years ago[AArch64] add tests for select-of-bools; NFC
Sanjay Patel [Mon, 1 Mar 2021 19:44:04 +0000 (14:44 -0500)]
[AArch64] add tests for select-of-bools; NFC

3 years ago[x86] add tests for select-of-bools; NFC
Sanjay Patel [Mon, 1 Mar 2021 19:05:16 +0000 (14:05 -0500)]
[x86] add tests for select-of-bools; NFC

3 years ago[WebAssembly] Fix split-dwarf not emitting DW_OP_WASM_location correctly
Wouter van Oortmerssen [Fri, 26 Feb 2021 17:53:16 +0000 (09:53 -0800)]
[WebAssembly] Fix split-dwarf not emitting DW_OP_WASM_location correctly

It was using the regular path for target indices that uses uleb, but TI_GLOBAL_RELOC needs to be uint32_t.
Introduced here: https://reviews.llvm.org/D85685
Fixes: https://github.com/emscripten-core/emscripten/issues/13240

Differential Revision: https://reviews.llvm.org/D97564

3 years agoRevert "[lldb] Fix handling of `DW_AT_decl_file` according to D91014"
Jan Kratochvil [Mon, 1 Mar 2021 19:45:30 +0000 (20:45 +0100)]
Revert "[lldb] Fix handling of `DW_AT_decl_file` according to D91014"

This reverts commit 7ec7876feda412b6edad0d83565395ef2fd5a004.

Non-x86_64 non-Linux bots broke by the testcase.

3 years ago[lld-macho] Partial revert of D95204
Jez Ng [Mon, 1 Mar 2021 19:22:26 +0000 (11:22 -0800)]
[lld-macho] Partial revert of D95204

Trying to unbreak https://lab.llvm.org/buildbot/#/builders/57/builds/4753

I'm not able to repro the failures locally so... here's hoping

3 years ago[lldb] Remove XPCServices symlinking
Shoaib Meenai [Mon, 1 Mar 2021 17:46:21 +0000 (09:46 -0800)]
[lldb] Remove XPCServices symlinking

This is a downstream change that was accidentally included upstream.

Reviewed By: vsk

Differential Revision: https://reviews.llvm.org/D97701

3 years ago[MLIR][TOSA] Lower tosa.transpose to linalg.generic
Rob Suderman [Mon, 1 Mar 2021 19:00:34 +0000 (11:00 -0800)]
[MLIR][TOSA] Lower tosa.transpose to linalg.generic

Lowers the transpose operation to a generic linalg op when permutations
is a constant value.

Reviewed By: mravishankar

Differential Revision: https://reviews.llvm.org/D97508

3 years ago[test/profile] Disable instrprof-write-buffer-internal.c on Windows
Vedant Kumar [Mon, 1 Mar 2021 19:06:09 +0000 (11:06 -0800)]
[test/profile] Disable instrprof-write-buffer-internal.c on Windows

This is failing due to:

"instrprof-write-buffer-internal.c.tmp.buf.profraw: Invalid
instrumentation profile data (file header is corrupt)"

https://lab.llvm.org/buildbot/#/builders/127/builds/6830

3 years ago[test/profile] Pass -w to suppress suggestion to use fopen_s
Vedant Kumar [Mon, 1 Mar 2021 19:04:01 +0000 (11:04 -0800)]
[test/profile] Pass -w to suppress suggestion to use fopen_s

3 years ago[mlir] Add polynomial approximation for math::ExpOp
Ahmed Taei [Sat, 27 Feb 2021 01:05:44 +0000 (17:05 -0800)]
[mlir] Add polynomial approximation for math::ExpOp

Similar to fast_exp in https://github.com/boulos/syrah

Differential Revision: https://reviews.llvm.org/D97599

3 years ago[libcxx] [test] Use the native path types in path.compare
Martin Storsjö [Fri, 26 Feb 2021 14:03:08 +0000 (16:03 +0200)]
[libcxx] [test] Use the native path types in path.compare

This makes sure that it actually tests the right compare() overloads
in windows configurations.

This also fixes the allocation guards that enforce no allocations
while running the compare() functions.

Differential Revision: https://reviews.llvm.org/D97551

3 years agoMake -f[no-]split-dwarf-inlining CC1 default align with driver default (no inlining)
Fangrui Song [Mon, 1 Mar 2021 18:55:19 +0000 (10:55 -0800)]
Make -f[no-]split-dwarf-inlining CC1 default align with driver default (no inlining)

This makes CC1 and driver defaults consistent.
In addition, for more common cases (-g is specified without -gsplit-dwarf), users will not see -fno-split-dwarf-inlining in CC1 options.

Verified that the below is still true:

* `clang -g` => `splitDebugInlining: false` in DICompileUnit
* `clang -g -gsplit-dwarf` => `splitDebugInlining: false` in DICompileUnit
* `clang -g -gsplit-dwarf -fsplit-dwarf-inlining` => no `splitDebugInlining: false`

Reviewed By: dblaikie

Differential Revision: https://reviews.llvm.org/D97706

3 years ago[darwin] switch blocking mutex from osspinlock to os_unfair_lock
Emily Shi [Fri, 26 Feb 2021 00:04:29 +0000 (16:04 -0800)]
[darwin] switch blocking mutex from osspinlock to os_unfair_lock

OSSpinLock is deprecated, so we are switching to `os_unfair_lock`. However, `os_unfair_lock` isn't available on older OSs, so we keep `OSSpinLock` as fallback.

Also change runtime assumption check to static since they only ever check constant values.

rdar://69588111

Reviewed By: delcypher, yln

Differential Revision: https://reviews.llvm.org/D97509

3 years ago[clang-tidy] Tweak misc-static-assert fix in c++17
Nathan James [Mon, 1 Mar 2021 18:51:20 +0000 (18:51 +0000)]
[clang-tidy] Tweak misc-static-assert fix in c++17

If C++17 mode is enabled and the assert doesn't have a string literal, we can emit a static assert with no message in favour of one with an empty message.

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D97313

3 years ago[test/profile] Add test coverage for __llvm_profile_write_buffer_internal
Vedant Kumar [Mon, 1 Mar 2021 16:57:16 +0000 (08:57 -0800)]
[test/profile] Add test coverage for __llvm_profile_write_buffer_internal

Reviewed By: davidxl, MaskRay

Differential Revision: https://reviews.llvm.org/D97697

3 years agoFix the value_type of defusechain_iterator to match its operator*()
Nicolas Guillemot [Fri, 26 Feb 2021 02:56:51 +0000 (18:56 -0800)]
Fix the value_type of defusechain_iterator to match its operator*()

defusechain_iterator has an operator*() and operator->() that return
references to a MachineOperand, but its "reference" and "pointer"
typedefs are set as if the iterator returns a MachineInstr reference.
This causes compilation errors when defusechain_iterator is used in
generic code that uses the "reference" and "pointer" typedefs.
This patch fixes this by updating the typedefs to use MachineOperand
instead of MachineInstr.

Reviewed By: mkitzan

Differential Revision: https://reviews.llvm.org/D97522

3 years ago[clang-tidy] Simplify diagnostics for UniqueptrResetRelease check
Nathan James [Mon, 1 Mar 2021 18:40:35 +0000 (18:40 +0000)]
[clang-tidy] Simplify diagnostics for UniqueptrResetRelease check

Tweak the diagnostics to create small replacements rather than grabbing source text from the lexer.
Also simplified the diagnostic message.

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D97632

3 years agoRevert "Remove use of tuple for multiresult type storage"
Jacques Pienaar [Mon, 1 Mar 2021 18:39:41 +0000 (10:39 -0800)]
Revert "Remove use of tuple for multiresult type storage"

This reverts commit 08f0764ff551c5aa2486c40871453e1ff40fb679.

3 years agoBPF: fix enum value 0 issue for __builtin_preserve_enum_value()
Yonghong Song [Mon, 1 Mar 2021 06:46:39 +0000 (22:46 -0800)]
BPF: fix enum value 0 issue for __builtin_preserve_enum_value()

Lorenz Bauer reported that the following code will have
compilation error for bpf target:
    enum e { TWO };
    bpf_core_enum_value_exists(enum e, TWO);
The clang emitted the following error message:
    __builtin_preserve_enum_value argument 1 invalid

In SemaChecking, an expression like "*(enum NAME)1" will have
cast kind CK_IntegralToPointer, but "*(enum NAME)0" will have
cast kind CK_NullToPointer. Current implementation only permits
CK_IntegralToPointer, missing enum value 0 case.

This patch permits CK_NullToPointer cast kind and
the above test case can pass now.

Differential Revision: https://reviews.llvm.org/D97659

3 years ago[libclang] Remove LIBCLANG_INCLUDE_CLANG_TOOLS_EXTRA
Nico Weber [Mon, 1 Mar 2021 18:20:53 +0000 (13:20 -0500)]
[libclang] Remove LIBCLANG_INCLUDE_CLANG_TOOLS_EXTRA

LIBCLANG_INCLUDE_CLANG_TOOLS_EXTRA causes clang-tools-extra tools
to be included in libclang, which caused a dependency cycle. The option
has been off by default for two releases now, and (based on a web search
and mailing list feedback) nobody seems to turn it on. Remove it, like
planned on https://reviews.llvm.org/D79599

Differential Revision: https://reviews.llvm.org/D97693

3 years ago[PowerPC][AIX] Enable passing vectors in variadic functions.
Sean Fertile [Mon, 1 Mar 2021 17:38:40 +0000 (12:38 -0500)]
[PowerPC][AIX] Enable passing vectors in variadic functions.

Differential Revision: https://reviews.llvm.org/D97474

3 years agoMove EntryExitInstrumentation pass location
Arthur Eubanks [Sat, 27 Feb 2021 04:06:49 +0000 (20:06 -0800)]
Move EntryExitInstrumentation pass location

This seems to be more of a Clang thing rather than a generic LLVM thing,
so this moves it out of LLVM pipelines and as Clang extension hooks into
LLVM pipelines.

Move the post-inline EEInstrumentation out of the backend pipeline and
into a late pass, similar to other sanitizer passes. It doesn't fit
into the codegen pipeline.

Also fix up EntryExitInstrumentation not running at -O0 under the new
PM. PR49143

Reviewed By: hans

Differential Revision: https://reviews.llvm.org/D97608

3 years ago[WebAssembly] Handle empty cleanuppads when adding catch_all
Heejin Ahn [Mon, 1 Mar 2021 13:32:12 +0000 (05:32 -0800)]
[WebAssembly] Handle empty cleanuppads when adding catch_all

In `LateEHPrepare::addCatchAlls`, the current code tries to get the
iterator's debug info even when it is `MachineBasicBlock::end()`. This
fixes the bug by adding empty debug info instead in that case.

Reviewed By: tlively

Differential Revision: https://reviews.llvm.org/D97679

3 years ago[clang-tidy] Remove OptionError
Nathan James [Mon, 1 Mar 2021 17:55:16 +0000 (17:55 +0000)]
[clang-tidy] Remove OptionError

The interface served a purpose, but since the ability to emit diagnostics when parsing configuration was added, its become mostly redundant. Emitting the diagnostic and removing the boilerplate is much cleaner.

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D97614

3 years ago[LegalizeTypes] Improve ExpandIntRes_XMULO codegen.
Craig Topper [Mon, 1 Mar 2021 17:45:01 +0000 (09:45 -0800)]
[LegalizeTypes] Improve ExpandIntRes_XMULO codegen.

The code previously used two BUILD_PAIRs to concatenate the two UMULO
results with 0s in the lower bits to match original VT. Then it created
an ADD and a UADDO with the original bit width. Each of those operations
need to be expanded since they have illegal types.

Since we put 0s in the lower bits before the ADD, the lower half of the
ADD result will be 0. So the lower half of the UADDO result is
solely determined by the other operand. Since the UADDO need to
be split in half, we don't really needd an operation for the lower
bits. Unfortunately, we don't see that in type legalization and end up
creating something more complicated and DAG combine or
lowering aren't always able to recover it.

This patch directly generates the narrower ADD and UADDO to avoid
needing to legalize them. Now only the MUL is done on the original
type.

Reviewed By: RKSimon

Differential Revision: https://reviews.llvm.org/D97440

3 years ago[clangd] Improve document symbols support for Objective-C categories and methods
David Goldman [Fri, 12 Feb 2021 16:52:43 +0000 (11:52 -0500)]
[clangd] Improve document symbols support for Objective-C categories and methods

- Categories will now show up as `MyClass(Category)` instead of
  `Category` and `MyCategory()` instead of `(anonymous)` in document
  symbols

- Methods will now be shown as `-selector:` or `+selector:`
  instead of `selector:` to differentiate between instance and class
  methods in document symbols

Differential Revision: https://reviews.llvm.org/D96612

3 years ago[AMDGPU] Add IntrWillReturn to recently added intrinsics
Jay Foad [Mon, 1 Mar 2021 11:41:53 +0000 (11:41 +0000)]
[AMDGPU] Add IntrWillReturn to recently added intrinsics

This adds IntrWillReturn to the gfx90a mfma intrinsics, to match all the
other mfma intrinsics, and llvm.amdgcn.live.mask, to match
llvm.amdgcn.ps.live.

Differential Revision: https://reviews.llvm.org/D97675

3 years agoRemove use of tuple for multiresult type storage
Jacques Pienaar [Mon, 1 Mar 2021 17:30:24 +0000 (09:30 -0800)]
Remove use of tuple for multiresult type storage

Move the results in line with the op instead. This results in each
operation having its own types recorded vs single tuple type, but comes
at benefit that every mutation doesn't incurs uniquing. Ran into cases
where updating result type of operation led to very large memory usage.

Differential Revision: https://reviews.llvm.org/D97652

3 years ago[lld-macho] Switch default to new Darwin backend
Jez Ng [Mon, 1 Mar 2021 17:30:10 +0000 (12:30 -0500)]
[lld-macho] Switch default to new Darwin backend

The new Darwin backend for LLD is now able to link reasonably large
real-world programs on x86_64. For instance, we have achieved
self-hosting for the X86_64 target, where all LLD tests pass when
building lld with itself on macOS. As such, we would like to make it the
default back-end.

The new port is now named `ld64.lld`, and the old port remains
accessible as `ld64.lld.darwinold`

This [annoucement email][1] has some context. (But note that, unlike
what the email says, we are no longer doing this as part of the LLVM 12
branch cut -- instead we will go into LLVM 13.)

Numerous mechanical test changes were required to make this change; in
the interest of creating something that's reviewable on Phabricator,
I've split out the boring changes into a separate diff (D95905). I plan to
merge its contents with those in this diff before landing.

(@gkm made the original draft of this diff, and he has agreed to let me
take over.)

[1]: https://lists.llvm.org/pipermail/llvm-dev/2021-January/147665.html

Reviewed By: #lld-macho, thakis

Differential Revision: https://reviews.llvm.org/D95204

3 years ago[lld-macho][nfc] Remove TODO regarding addends
Jez Ng [Mon, 1 Mar 2021 17:30:08 +0000 (12:30 -0500)]
[lld-macho][nfc] Remove TODO regarding addends

There was initially some concern around the correct handling of pcrel
section relocations with r_length != 2. But it looks like there are no such
relocations in practice -- x86_64's pcrel section relocs all have r_length == 2,
and ARM64 doesn't even have pcrel section relocs. So we can replace the TODO
with an assert.

Reviewed By: #lld-macho, thakis

Differential Revision: https://reviews.llvm.org/D97576

3 years agoFix virtual-dtor warning a different way, since a virtual dtor is not required for...
David Blaikie [Mon, 1 Mar 2021 17:15:00 +0000 (09:15 -0800)]
Fix virtual-dtor warning a different way, since a virtual dtor is not required for this use case.

3 years agoFix a warning about named return value not being moved-from.
David Blaikie [Mon, 1 Mar 2021 17:14:15 +0000 (09:14 -0800)]
Fix a warning about named return value not being moved-from.

The use of an rvalue reference here was using reference lifetime
extension needlessly - the code is simpler and more efficient without
it.

3 years ago[TTI] Consider select form of and/or i1 as having arithmetic cost
Juneyoung Lee [Wed, 24 Feb 2021 07:03:51 +0000 (16:03 +0900)]
[TTI] Consider select form of and/or i1 as having arithmetic cost

This is a patch that updates the cost of `select i1 a, b, false` to be equivalent to that of `and i1 a, b`
as well as the cost of `select i1 a, true, b` equivalent to `or i1 a, b`.

Until now, these selects were folded into and/or i1 by InstCombine, but the transformation is poison-unsafe.
This is a step towards removing the unsafe transformation. D93065 has relevant transformations linked.
These selects should be translated into the assemblies as and/or i1 do in the same manner. The cost should be equivalent.

Reviewed By: spatel

Differential Revision: https://reviews.llvm.org/D97360

3 years ago[libc++/abi] Allow running back-deployment testing against libc++abi
Louis Dionne [Wed, 8 Jul 2020 20:38:54 +0000 (16:38 -0400)]
[libc++/abi] Allow running back-deployment testing against libc++abi

Before this patch, we could only link against the back-deployment libc++abi
dylib. This patch allows linking against the just-built libc++abi, but
running against the back-deployment one -- just like we do for libc++.

Also, add XFAIL markup to flag expected errors.

Differential Revision: https://reviews.llvm.org/D91069

3 years ago[clang] SimpleMFlag helper in Options.td
Stanislav Mekhanoshin [Fri, 19 Feb 2021 18:47:28 +0000 (10:47 -0800)]
[clang] SimpleMFlag helper in Options.td

This is the new helper to create a boolean -m and -mno-
options.

Differential Revision: https://reviews.llvm.org/D97069

3 years ago[clang-cl] make -f(no-)ident a CoreOption
Nico Weber [Mon, 1 Mar 2021 16:49:21 +0000 (11:49 -0500)]
[clang-cl] make -f(no-)ident a CoreOption

On clang emits the compiler version string into debug information
by default for both dwarf and codeview. That makes compiler output
needlessly compiler-version-dependent which makes e.g. comparing
object file outputs during a bisect hard. So it's nice if there's
an easy way to turn this off.

(On ELF, this flag also controls the .comment section, but that
part is ELF-only. The debug-info bit isn't.)

Differential Revision: https://reviews.llvm.org/D97695

3 years ago[VPlan] Remove recipes from back to front.
Florian Hahn [Mon, 1 Mar 2021 16:04:37 +0000 (16:04 +0000)]
[VPlan] Remove recipes from back to front.

Update the deletion order when destroying VPBasicBlocks. This ensures
recipes that depend on earlier ones in the block are removed first.
Otherwise this may cause issues when recipes have remaining users later
in the block.

3 years ago[WebAssembly] call_indirect issues table number relocs
Andy Wingo [Fri, 12 Feb 2021 10:22:13 +0000 (11:22 +0100)]
[WebAssembly] call_indirect issues table number relocs

If the reference-types feature is enabled, call_indirect will explicitly
reference its corresponding function table via TABLE_NUMBER
relocations against a table symbol.

Also, as before, address-taken functions can also cause the function
table to be created, only with reference-types they additionally cause a
symbol table entry to be emitted.

Differential Revision: https://reviews.llvm.org/D90948

3 years ago[TableGen] Avoid repeated TreePredicateFn::getCodeToRunOnSDNode() calls in MatcherTab...
Simon Pilgrim [Mon, 1 Mar 2021 15:38:39 +0000 (15:38 +0000)]
[TableGen] Avoid repeated TreePredicateFn::getCodeToRunOnSDNode() calls in MatcherTableEmitter::EmitNodePredicatesFunction loop. NFCI.

3 years ago[PowerPC] Removing sqrtd2 and sqrtf4 from list of vectorizable function with MASSV
Masoud Ataei [Mon, 1 Mar 2021 15:42:19 +0000 (15:42 +0000)]
[PowerPC] Removing sqrtd2 and sqrtf4 from list of vectorizable function with MASSV

Under -O3 and -Ofast, the MASSV conversion prevents the sqrt call to be inlined.
Inline sqrt is faster than MASSV call on leppc.

Differential Revision: https://reviews.llvm.org/D97487

3 years ago[lldb] [test] Skip AVX lldb-server test on non-x86 architectures
Michał Górny [Thu, 25 Feb 2021 07:44:42 +0000 (08:44 +0100)]
[lldb] [test] Skip AVX lldb-server test on non-x86 architectures

Skip the AVX-related lldb-server test on non-x86 architectures, as they
do not support AVX.  While technically the test worked on Linux because
the AVX check would simply return false, other platforms do not provide
such a straightforward way of checking for AVX (especially remotely),
and the results of such check may need to be interpreted specially
for the platform in question.

Differential Revision: https://reviews.llvm.org/D97450

3 years ago[lldb] [test] Workaround symlink-related test failures
Michał Górny [Mon, 22 Feb 2021 22:39:39 +0000 (23:39 +0100)]
[lldb] [test] Workaround symlink-related test failures

Use realpath() when spawning the executable create_after_attach
to workaround a FreeBSD plugin (and possibly others) problem.
If the executable is started via a path containing a symlink, it is
added to the module list twice -- via the real and apparent path.
This in turn cases the requested breakpoint to resolve twice.

Use realpath() for main program path in lldb-vscode breakpoint tests
to workaround a similar problem.  If the passed path does not match
the realpath, lldb-vscode does not report the breakpoints as verified
and causes tests to fail.

Since the underlying problems are non-trivial to fix and the purpose
of these tests is not to reproduce symlink problems, let's apply
trivial workarounds to make them pass.

Differential Revision: https://reviews.llvm.org/D97230

3 years ago[lldb] Rename NativeRegisterContext{Watchpoint => DBReg}_x86
Michał Górny [Mon, 22 Feb 2021 19:14:31 +0000 (20:14 +0100)]
[lldb] Rename NativeRegisterContext{Watchpoint => DBReg}_x86

Differential Revision: https://reviews.llvm.org/D97210

3 years ago[lldb] Fix handling of `DW_AT_decl_file` according to D91014
Andy Yankovsky [Tue, 16 Feb 2021 14:17:53 +0000 (15:17 +0100)]
[lldb] Fix handling of `DW_AT_decl_file` according to D91014

Apply changes from https://reviews.llvm.org/D91014 to other places where DWARF entries are being processed.

Differential Revision: https://reviews.llvm.org/D96778

3 years ago[X86] Fold shuffle(not(x),undef) -> not(shuffle(x,undef))
Simon Pilgrim [Mon, 1 Mar 2021 14:47:24 +0000 (14:47 +0000)]
[X86] Fold shuffle(not(x),undef) -> not(shuffle(x,undef))

Move NOT out to expose more AND -> ANDN folds

3 years ago[AMDGPU] New intrinsic void llvm.amdgcn.s.sethalt(i32)
Jay Foad [Mon, 1 Mar 2021 09:45:55 +0000 (09:45 +0000)]
[AMDGPU] New intrinsic void llvm.amdgcn.s.sethalt(i32)

The expected use case is for frontends to insert this into
shaders that are to be run under a debugger. The shader can
then be resumed or single stepped from the point of the call
under debugger control.

Differential Revision: https://reviews.llvm.org/D97670

3 years ago[Flang][OpenMP] Add semantic checks for OpenMP clauses.
Praveen [Sat, 30 Jan 2021 16:45:09 +0000 (22:15 +0530)]
[Flang][OpenMP] Add semantic checks for OpenMP clauses.

Semantic checks for the following OpenMP 4.5 clauses.

1. 2.15.4.2 - Copyprivate clause
2. 2.15.3.4 - Firstprivate clause
3. 2.15.3.5 - Lastprivate clause

Add related test cases and resolve test cases marked as XFAIL.

Reviewed By: kiranchandramohan

Differential Revision: https://reviews.llvm.org/D91920

3 years ago[AMDGPU] Simplify SITargetLowering::isSDNodeSourceOfDivergence. NFC.
Jay Foad [Mon, 1 Mar 2021 10:20:54 +0000 (10:20 +0000)]
[AMDGPU] Simplify SITargetLowering::isSDNodeSourceOfDivergence. NFC.

Check for read-modify-write AtomicSDNodes instead of using an exhaustive
list of ISD opcodes.

Differential Revision: https://reviews.llvm.org/D97671

3 years agoGlobalISel: Verify G_CONCAT_VECTORS has at least 2 sources
Matt Arsenault [Sun, 28 Feb 2021 00:35:48 +0000 (19:35 -0500)]
GlobalISel: Verify G_CONCAT_VECTORS has at least 2 sources

3 years agoGlobalISel: Move splitToValueTypes to generic code
Matt Arsenault [Sun, 28 Feb 2021 16:12:08 +0000 (11:12 -0500)]
GlobalISel: Move splitToValueTypes to generic code

I copied the nearly identical function from AArch64 into AMDGPU, so
fix this duplication.

Mips and X86 have their own more exotic versions which should be
removed. However replacing those is better left for a separate patch
since it requires other changes to avoid regressions.

3 years agoAArch64/GlobalISel: Fix using wrong calling convention for calls
Matt Arsenault [Sun, 28 Feb 2021 16:28:14 +0000 (11:28 -0500)]
AArch64/GlobalISel: Fix using wrong calling convention for calls

This was reusing the parent function calling convention instead of the
callee. I'm not sure if there's a case where there's an observable
difference.

I previously missed this in b72a23650f573299aec30846fb844c3558921fb8

3 years ago[AArch64] NFC: Cleanup some SVE cost-model tests.
Sander de Smalen [Mon, 1 Mar 2021 11:51:52 +0000 (11:51 +0000)]
[AArch64] NFC: Cleanup some SVE cost-model tests.

Moved some of the `sve-getIntrinsicCost-<..>` into a single sve-intrinsics.ll
file, and simplified the tests a bit by bundling all the intrinsics in one
function (instead of testing one intrinsic per function). That makes it easier
to see the cost of the intrinsics.

3 years ago[mlir] Add convenience grouping for tensor type inference
Jacques Pienaar [Mon, 1 Mar 2021 13:21:07 +0000 (05:21 -0800)]
[mlir] Add convenience grouping for tensor type inference

For ops that produces tensor types and implement the shaped type component interface, the type inference interface can be used. Create a grouping of these together to make it easier to specify (it cannot be added into a list of traits, but must rather be appended/concated to one as it isn't a trait but a list of traits).

Differential Revision: https://reviews.llvm.org/D97636

3 years agoRevert "Use the default seed value for djb hash for StringMap"
serge-sans-paille [Mon, 1 Mar 2021 12:58:18 +0000 (13:58 +0100)]
Revert "Use the default seed value for djb hash for StringMap"

This reverts commit d84440ec919019ac446241db72cfd905c6ac9dfa.

It breaks (at least) lldb and lld validation

https://lab.llvm.org/buildbot/#/builders/68/builds/7837
https://lab.llvm.org/buildbot/#/builders/36/builds/5495

3 years ago[AArch64] Add combine for add(udot(0, x, y), z) -> udot(z, x, y).
David Green [Mon, 1 Mar 2021 12:53:34 +0000 (12:53 +0000)]
[AArch64] Add combine for add(udot(0, x, y), z) -> udot(z, x, y).

Given a zero input for a udot, an add can be folded in to take the place
of the input, using thte addition that the instruction naturally
performs.

Differential Revision: https://reviews.llvm.org/D97188

3 years ago[AArch64] Adjust dot produce tests. NFC
David Green [Mon, 1 Mar 2021 12:46:43 +0000 (12:46 +0000)]
[AArch64] Adjust dot produce tests. NFC

This regenerates and splits out the dotproduce tests, adding a few extra
tests for upcoming changes.