platform/upstream/llvm.git
2 years ago[VE] MUL,SUB,OR,XOR v256i32|64 isel
Simon Moll [Tue, 14 Dec 2021 12:23:34 +0000 (13:23 +0100)]
[VE] MUL,SUB,OR,XOR v256i32|64 isel

v256i32|i64 isel patterns and tests.

Reviewed By: kaz7

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

2 years ago[bazel] Port debuginfod rules
Benjamin Kramer [Tue, 14 Dec 2021 12:12:39 +0000 (13:12 +0100)]
[bazel] Port debuginfod rules

Needed after 34491ca7291c

2 years ago[AArch64] Add a tablegen pattern for UZP1.
Alexandros Lamprineas [Tue, 14 Dec 2021 11:28:22 +0000 (11:28 +0000)]
[AArch64] Add a tablegen pattern for UZP1.

Converts concat_vectors(V64 (trunc V128), V64 (trunc V128)), which
would otherwise be lowered as xtn followed by xtn2, to uzp1.

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

2 years ago[libc++][NFC] Remove goto from std::string
Nikolas Klauser [Tue, 14 Dec 2021 00:20:53 +0000 (01:20 +0100)]
[libc++][NFC] Remove goto from std::string

Remove `goto` from `std::string`

Reviewed By: Quuxplusone, ldionne, #libc, nilayvaish

Spies: nilayvaish, libcxx-commits

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

2 years ago[AArch64][SVE] Fix handling of stack protection with SVE
John Brawn [Tue, 14 Dec 2021 11:11:41 +0000 (11:11 +0000)]
[AArch64][SVE] Fix handling of stack protection with SVE

Fix a couple of things that were causing stack protection to not work
correctly in functions that have scalable vectors on the stack:
 * Use TypeSize when determining if accesses to a variable are
   considered out-of-bounds so that the behaviour is correct for
   scalable vectors.
 * When stack protection is enabled move the stack protector location
   to the top of the SVE locals, so that any overflow in them (or the
   other locals which are below that) will be detected.

Fixes: https://github.com/llvm/llvm-project/issues/51137

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

2 years ago[CodeGen] Add std:: qualifier
Nikita Popov [Tue, 14 Dec 2021 11:17:55 +0000 (12:17 +0100)]
[CodeGen] Add std:: qualifier

Hopefully addresses the buildbot failures.

2 years ago[CodeGen] Require use of Address::invalid() for invalid address (NFC)
Nikita Popov [Mon, 13 Dec 2021 13:23:21 +0000 (14:23 +0100)]
[CodeGen] Require use of Address::invalid() for invalid address (NFC)

This no longer allows creating an invalid Address through the regular
constructor. There were only two places that did this (AggValueSlot
and EHCleanupScope) which did this by converting a potential nullptr
into an Address. I've fixed both of these by directly storing an
Address instead.

This is intended as a bit of preliminary cleanup for D103465.

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

2 years ago[X86] Use bundle for CALL_RVMARKER expansion.
Florian Hahn [Tue, 14 Dec 2021 10:53:22 +0000 (10:53 +0000)]
[X86] Use bundle for CALL_RVMARKER expansion.

This patch updates expandCALL_RVMARKER to wrap the call, marker and
objc runtime call in an instruction bundle. This ensures later passes,
like machine block placement, cannot break them up.

On AArch64, the instruction sequence is already wrapped in a bundle.
Keeping the whole instruction sequence together is highly desirable for
performance and outweighs potential other benefits from breaking the
sequence up.

Reviewed By: ahatanak

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

2 years ago[clang][deps] Remove hard-coded resource directory from tests
Jan Svoboda [Mon, 13 Dec 2021 12:22:08 +0000 (13:22 +0100)]
[clang][deps] Remove hard-coded resource directory from tests

Dependency scanner test for resource directory deduction doesn't account for LLVM builds with custom `CLANG_RESOURCE_DIR`.

This patch ensures we don't hardcode the default behavior into the test and take into account the actual value. This is done by running `%clang -print-resource-dir` and using that as the expected value in test assertions.
New comment also clarifies this is different from running that command as part of the dependency scan.

Reviewed By: mgorny

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

2 years ago[mlir] Split std.rank into tensor.rank and memref.rank.
Alexander Belyaev [Tue, 14 Dec 2021 08:35:14 +0000 (09:35 +0100)]
[mlir] Split std.rank into tensor.rank and memref.rank.

Move `std.rank` similarly to how `std.dim` was moved to TensorOps and MemRefOps.

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

2 years ago[mlir] Implement `DataLayoutTypeInterface` for `LLVMArrayType`
Markus Böck [Tue, 14 Dec 2021 07:52:02 +0000 (08:52 +0100)]
[mlir] Implement `DataLayoutTypeInterface` for `LLVMArrayType`

Implementation of the interface allows querying the size and alignments of an LLVMArrayType as well as query the size and alignment of a struct containing an LLVMArrayType.
The implementation should yield the same results as llvm::DataLayout, including support for over aligned element types.
There is no customization point for adjusting an arrays alignment; it is simply taken from the element type.

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

2 years ago[OpenMP][libomp] Fix compile errors with new KMP_HW_SUBSET changes
Jonathan Peyton [Tue, 14 Dec 2021 07:32:22 +0000 (08:32 +0100)]
[OpenMP][libomp] Fix compile errors with new KMP_HW_SUBSET changes

Add missing guards around x86-specific code.

Reviewed By: kaz7

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

2 years ago[llvm] Use llvm::reverse (NFC)
Kazu Hirata [Tue, 14 Dec 2021 05:54:51 +0000 (21:54 -0800)]
[llvm] Use llvm::reverse (NFC)

2 years ago[RISCV] Add rs2 encoding to the FPUnaryOp_r and FPUnaryOp_r_frm template arguments.
Craig Topper [Tue, 14 Dec 2021 05:38:40 +0000 (21:38 -0800)]
[RISCV] Add rs2 encoding to the FPUnaryOp_r and FPUnaryOp_r_frm template arguments.

Instead of having unary instruction include a 'let' in their class
body, add rs2val as a template parameter. Then we can use a let
in FPUnaryOp_r and FPUnaryOp_r_frm. This reduces the overall
verbosity of the FP files.

Reviewed By: achieveartificialintelligence

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

2 years ago[RISCV] Support named opcodes in .insn directive.
Nelson Chu [Tue, 14 Dec 2021 04:59:02 +0000 (20:59 -0800)]
[RISCV] Support named opcodes in .insn directive.

This patch is one of the TODO of commit, 283879793dc787225992496587581ec77b6b0610

We build the GenericTable for these opcodes, and also extend class RISCVOpcode, to store the names of opcodes.  Then we call the parseInsnDirectiveOpcode to parse the opcode filed in .insn directive.  We only allow users to write the recognized opcode names, or just write the immediate values in the 7 bits range.

Documentation: https://sourceware.org/binutils/docs-2.37/as/RISC_002dV_002dFormats.html

Reviewed By: craig.topper

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

2 years agoReland [ELF] Split scanRelocations into scanRelocations/postScanRelocations
Fangrui Song [Tue, 14 Dec 2021 04:11:24 +0000 (20:11 -0800)]
Reland [ELF] Split scanRelocations into scanRelocations/postScanRelocations

(Fixed an issue about GOT on a copy relocated alias.)

The idea is to make scanRelocations mark some actions are needed (GOT/PLT/etc)
and postpone the real work to postScanRelocations. It gives some flexibility:

* Make it feasible to support .plt.got (PR32938): we need to know whether GLOB_DAT and JUMP_SLOT are both needed.
* Make non-preemptible IFUNC handling slightly cleaner: avoid setting/clearing sym.gotInIgot
* -z nocopyrel: report all copy relocation places for one symbol
* Make GOT deduplication feasible
* Make parallel relocation scanning feasible (if we can avoid all stateful operations and make Symbol attributes atomic), but parallelism may not be the appealing choice

Since this patch moves a large chunk of code out of ELFT templates. My x86-64
executable is actually a few hundred bytes smaller.

For ppc32-ifunc-nonpreemptible-pic.s: I remove absolute relocation references to non-preemptible ifunc
because absolute relocation references are incorrect in -fpie mode.

Reviewed By: peter.smith, ikudrin

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

2 years ago[ELF] Improve test for copy relocations on aliases
Fangrui Song [Tue, 14 Dec 2021 04:04:24 +0000 (20:04 -0800)]
[ELF] Improve test for copy relocations on aliases

2 years ago[LegalizeVectorOps] code refactor for LegalizeOp; NFC
Chen Zheng [Mon, 13 Dec 2021 15:00:06 +0000 (15:00 +0000)]
[LegalizeVectorOps] code refactor for LegalizeOp; NFC

Reviewed By: craig.topper

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

2 years agoRevert "[ELF] Split scanRelocations into scanRelocations/postScanRelocations"
Fangrui Song [Tue, 14 Dec 2021 03:29:53 +0000 (19:29 -0800)]
Revert "[ELF] Split scanRelocations into scanRelocations/postScanRelocations"

This reverts commit fc33861d48a95aa4682ce3b6e44732e5c8bbd092.

`replaceWithDefined` should copy needsGot, otherwise an alias for a copy
relocated symbol may not have GOT entry if its needsGot was originally true.

2 years agoDWARFVerifier: Verbosely dump DIEs in verifier reports
David Blaikie [Tue, 14 Dec 2021 03:00:38 +0000 (19:00 -0800)]
DWARFVerifier: Verbosely dump DIEs in verifier reports

Seems helpful when you're dealing with invalid/problematic DWARF. Some
diagnostic messages are probably redundant with the verbose dumping and
could be simplified with this.

2 years agoRevert "[InstrProf] Attach debug info to counters"
Ellis Hoag [Tue, 14 Dec 2021 02:08:57 +0000 (18:08 -0800)]
Revert "[InstrProf] Attach debug info to counters"

This reverts commit 800bf8ed29fbcaa9436540e83bc119ec92e7d40f.

The `Instrumentation/InstrProfiling/debug-info-correlate.ll` test was
failing because I forgot the `llc` commands are architecture specific.
I'll follow up with a fix.

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

2 years ago[InstrProf] Attach debug info to counters
Ellis Hoag [Tue, 14 Dec 2021 00:47:47 +0000 (16:47 -0800)]
[InstrProf] Attach debug info to counters

Add the llvm flag `-debug-info-correlate` to attach debug info to instrumentation counters so we can correlate raw profile data to their functions. Raw profiles are dumped as `.proflite` files. The next diff enables `llvm-profdata` to consume `.proflite` and debug info files to produce a normal `.profdata` profile.

Part of the "lightweight instrumentation" work: https://groups.google.com/g/llvm-dev/c/r03Z6JoN7d4

Reviewed By: kyulee

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

2 years ago[benchmark] Pull latest; disable -Werror
Mircea Trofin [Tue, 14 Dec 2021 00:02:02 +0000 (16:02 -0800)]
[benchmark] Pull latest; disable -Werror

Pulled the latest (b000672), which adds an option to disable -Werror,
which caused issues previously (see for instance
https://reviews.llvm.org/D112012)

Applied https://github.com/google/benchmark/pull/1305 to unblock, as
this issue is causing downstream buildbot failures.

The only change is in llvm/CMakeLists.txt, where we set
BENCHMARK_ENABLE_WERROR to have the same value as LLVM_ENABLE_WERROR.

This patch also introduces a convenience script to pull benchmark from
upstream.

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

2 years ago[lldb] Use LLDB_VERSION_STRING instead of CLANG_VERSION_STRING
Jonas Devlieghere [Tue, 14 Dec 2021 00:58:29 +0000 (16:58 -0800)]
[lldb] Use LLDB_VERSION_STRING instead of CLANG_VERSION_STRING

2 years ago[AMDGPU][NFC] Add documentation for location description DWARF extension
Tony Tye [Sat, 11 Dec 2021 23:43:54 +0000 (23:43 +0000)]
[AMDGPU][NFC] Add documentation for location description DWARF extension

Add documentation for the DWARF extension to allow location descriptions
on the DWARF expression stack. This is part of the "DWARF Extensions For
Heterogeneous Debugging" used by the AMD GPU target.

Reviewed By: scott.linder

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

2 years ago[instcombine] Canonicalize constant index type to i64 for extractelement/insertelement
Philip Reames [Tue, 14 Dec 2021 00:29:19 +0000 (16:29 -0800)]
[instcombine] Canonicalize constant index type to i64 for extractelement/insertelement

The basic idea to this is that a) having a single canonical type makes CSE easier, and b) many of our transforms are inconsistent about which types we end up with based on visit order.

I'm restricting this to constants as for non-constants, we'd have to decide whether the simplicity was worth extra instructions. For constants, there are no extra instructions.

We chose the canonical type as i64 arbitrarily.  We might consider changing this to something else in the future if we have cause.

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

2 years ago[MemorySSA] Document details regarding MemorySSA's precision.
Alina Sbirlea [Fri, 12 Nov 2021 01:14:14 +0000 (17:14 -0800)]
[MemorySSA] Document details regarding MemorySSA's precision.

2 years ago[NewGVN] Use PredicateInfo info when previously used for the same ssa.copy intrinsic
Alina Sbirlea [Fri, 1 Oct 2021 05:22:17 +0000 (22:22 -0700)]
[NewGVN] Use PredicateInfo info when previously used for the same ssa.copy intrinsic

Symbolic execution using PredicateInfo is only done for the ssa.copy
intrinsic. It's using two potential sources for building the expression:
1. the Value of the instruction for which the instruction is a copy of, and
2. the Value from the contraint in PredicateInfo
It's possible to get into an infinite loop when choosing between these
two, as described in PR31613.

This patch proposes performing swapping of the two values (i.e. choosing
the second one for the expression), if that same second value was chosen
before; this breaks the cycle.

In the testcases provided, where there is a contradiction between the
value from symbolic execution and assume instruction, NewGVN reduces the
assume to assume(false).

Resolves PR31613.

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

2 years ago[LegalizeVectorOps] fix a typo
Chen Zheng [Mon, 13 Dec 2021 14:45:52 +0000 (14:45 +0000)]
[LegalizeVectorOps] fix a typo

Reviewed By: craig.topper

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

2 years ago[NFC][Clang][OpenMP] Use switch-case statement to process clauses of atomic directive
Shilei Tian [Mon, 13 Dec 2021 22:00:22 +0000 (17:00 -0500)]
[NFC][Clang][OpenMP] Use switch-case statement to process clauses of atomic directive

This patch makes the process of clauses of atomic directive more clear
and preparation for the support for `atomic compare capture`.

Reviewed By: jdoerfert

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

2 years ago[libc++] Make ThrowingIterator constexpr
Nikolas Klauser [Sun, 12 Dec 2021 10:25:20 +0000 (11:25 +0100)]
[libc++] Make ThrowingIterator constexpr

Make ThrowingIterator constexpr

Reviewed By: Quuxplusone, ldionne, #libc

Spies: libcxx-commits

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

2 years agoReapply: Autogen more vectorizer tests in advance of D115387.
Philip Reames [Mon, 13 Dec 2021 23:20:25 +0000 (15:20 -0800)]
Reapply: Autogen more vectorizer tests in advance of D115387.

Drop changes to consecutive-ptr-uniforms.ll since that test checks boths IR output and debug messages.  I'd missed this in the original commit, and Florian pointed it out in post-commit review.

Original commit message:

These are the ones my first round of scripting couldn't handle that required a bit of manual messaging.  This should be the last batch in llvm-check.

This reverts commit bbba86764ae8f9365a1a3908c50eb54698b2b203.

2 years ago[gn build] Port fff876c20e83
LLVM GN Syncbot [Mon, 13 Dec 2021 23:30:23 +0000 (23:30 +0000)]
[gn build] Port fff876c20e83

2 years agoRevert "[ASan] Shared optimized callbacks implementation."
Arthur Eubanks [Mon, 13 Dec 2021 23:25:44 +0000 (15:25 -0800)]
Revert "[ASan] Shared optimized callbacks implementation."

This reverts commit ebc31d2e7297d4002c72e5c7b9761c9559428ffc.

Causes test failures on Windows, see comments on D114558.

2 years agoRevert "[ASan] Added NO_EXEC_STACK_DIRECTIVE to assembly callback file."
Arthur Eubanks [Mon, 13 Dec 2021 23:24:46 +0000 (15:24 -0800)]
Revert "[ASan] Added NO_EXEC_STACK_DIRECTIVE to assembly callback file."

This reverts commit e31a5e0ba540fcebf115d2fcde2be8a250c485c1.

Reverting dependent change D114558.

2 years ago[Symbolizer][Debuginfo] Add debuginfod client to llvm-symbolizer.
Noah Shutty [Mon, 13 Dec 2021 22:35:27 +0000 (22:35 +0000)]
[Symbolizer][Debuginfo] Add debuginfod client to llvm-symbolizer.

Adds a fallback to use the debuginfod client library (386655) in `findDebugBinary`.
Fixed a cast of Erorr::success() to Expected<> in debuginfod library.
Added Debuginfod to Symbolize deps in gn.
Updates compiler-rt/lib/sanitizer_common/symbolizer/scripts/build_symbolizer.sh to include Debuginfod library to fix sanitizer-x86_64-linux breakage.

Reviewed By: jhenderson, vitalybuka

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

2 years ago[libc++] Fix the noexceptness of __decay_copy.
Arthur O'Dwyer [Mon, 13 Dec 2021 19:50:37 +0000 (14:50 -0500)]
[libc++] Fix the noexceptness of __decay_copy.

When `a` was an array type, `__decay_copy(a)` was incorrectly marking itself
noexcept(false), because it is false that `int[10]` is nothrow convertible to `int[10]`
(in fact it is not convertible at all).

We have no tests explicitly for `__decay_copy`, but the new ranges::begin
and ranges::end tests fail before this patch.

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

2 years ago[mlir][Vector] Patterns flattening vector transfers to 1D
Benoit Jacob [Mon, 13 Dec 2021 20:00:28 +0000 (20:00 +0000)]
[mlir][Vector] Patterns flattening vector transfers to 1D

This is the second part of https://reviews.llvm.org/D114993 after slicing
into 2 independent commits.

This is needed at the moment to get good codegen from 2d vector.transfer
ops that aim to compile to SIMD load/store instructions but that can
only do so if the whole 2d transfer shape is handled in one piece, in
particular taking advantage of the memref being contiguous rowmajor.

For instance, if the target architecture has 128bit SIMD then we would
expect that contiguous row-major transfers of <4x4xi8> map to one SIMD
load/store instruction each.

The current generic lowering of multi-dimensional vector.transfer ops
can't achieve that because it peels dimensions one by one, so a transfer
of <4x4xi8> becomes 4 transfers of <4xi8>.

The new patterns here are only enabled for now by
 -test-vector-transfer-flatten-patterns.

Reviewed By: nicolasvasilache

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

2 years ago[clang][amdgpu] - Choose when to promote VarDecl to address space 4.
Ethan Stewart [Mon, 13 Dec 2021 22:30:54 +0000 (16:30 -0600)]
[clang][amdgpu] - Choose when to promote VarDecl to address space 4.

There are instances where clang codegen creates stores to
address space 4 in ctors, which causes a crash in llc.
This store was being optimized out at opt levels > 0.

For example:

pragma omp declare target
static  const double log_smallx = log2(smallx);
pragma omp end declare target

This patch ensures that any global const that does not
have constant initialization stays in address space 1.

Note - a second patch is in the works where all global
constants are placed in address space 1 during
codegen and then the opt pass InferAdressSpaces
will promote to address space 4 where necessary.

Reviewed By: JonChesterfield

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

2 years ago[MIPS] Allow i1 values for 'r' constraint in inline-asm
Simon Atanasyan [Mon, 13 Dec 2021 16:16:39 +0000 (19:16 +0300)]
[MIPS] Allow i1 values for 'r' constraint in inline-asm

The bug was reported in the issue #52638.

2 years ago[lld] Replace Symbolize.h with DIContext.h in lld's COFF lib
Noah Shutty [Mon, 13 Dec 2021 22:16:41 +0000 (22:16 +0000)]
[lld] Replace Symbolize.h with DIContext.h in lld's COFF lib

lld only needs DIContext.h which it gets through Symbolize.h -> SymbolizableModule.h -> DIContext.h. This replaces it with a direct include of DIContext.h to avoid any confusion and pulling in unnecessary headers.

Reviewed By: phosek

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

2 years ago[z/OS] Implement prologue and epilogue generation for z/OS target.
Neumann Hon [Mon, 13 Dec 2021 21:17:16 +0000 (16:17 -0500)]
[z/OS] Implement prologue and epilogue generation for z/OS target.

This patch adds support for prologue and epilogue generation for
the z/OS target under the XPLINK64 ABI for functions with a stack
size of less than 1048576 bytes (huge stack frames).

Reviewed by: uweigand, Kai

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

2 years ago[clang] [unitttests] Fix linking Basic test to LLVMTestingSupport
Michał Górny [Sat, 11 Dec 2021 17:12:24 +0000 (18:12 +0100)]
[clang] [unitttests] Fix linking Basic test to LLVMTestingSupport

Link BasicTests via explicit target_link_libraries() rather than
clang_target_link_libraries() in order to fix linking when building
clang against libclang-cpp.  The latter requires all listed libraries
to be part of libclang-cpp and omits them if libclang-cpp is used.
However, LLVMTestingSupport is not part of libclang-cpp, so omitting it
causes undefined symbols.  Link to the library explicitly to follow suit
with the 7 other unittest programs.

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

2 years ago[mlir][Vector] Patterns flattening vector transfers to 1D
Benoit Jacob [Mon, 13 Dec 2021 20:00:28 +0000 (20:00 +0000)]
[mlir][Vector] Patterns flattening vector transfers to 1D

This is the first part of https://reviews.llvm.org/D114993 which has been
split into small independent commits.

This is needed at the moment to get good codegen from 2d vector.transfer
ops that aim to compile to SIMD load/store instructions but that can
only do so if the whole 2d transfer shape is handled in one piece, in
particular taking advantage of the memref being contiguous rowmajor.

For instance, if the target architecture has 128bit SIMD then we would
expect that contiguous row-major transfers of <4x4xi8> map to one SIMD
load/store instruction each.

The current generic lowering of multi-dimensional vector.transfer ops
can't achieve that because it peels dimensions one by one, so a transfer
of <4x4xi8> becomes 4 transfers of <4xi8>.

The new patterns here are only enabled for now by
 -test-vector-transfer-flatten-patterns.

Reviewed By: nicolasvasilache

2 years agoRe-apply [NFC] Generalize a couple of passes so they can operate on any FunctionLike op.
Stella Laurenzo [Mon, 13 Dec 2021 21:08:54 +0000 (13:08 -0800)]
Re-apply [NFC] Generalize a couple of passes so they can operate on any FunctionLike op.

* Generalizes passes linalg-detensorize, linalg-fold-unit-extent-dims, convert-elementwise-to-linalg.
* I feel that more work could be done in the future (i.e. make FunctionLike into a proper OpInterface and extend actions in dialect conversion to be trait based), and this patch would be a good record of why that is useful.
* Note for downstreams:
  * Since these passes are now generic, they do not automatically nest with pass managers set up for implicit nesting.
  * The Detensorize pass must run on a FunctionLike, and this requires explicit nesting.
* Addressed missed comments from the original and per-suggestion removed the assert on FunctionLike in ElementwiseToLinalg and DropUnitDims.cpp, which also is what was causing the integration test to fail.

This reverts commit aa8815e42e646a98663af4cf036dbb913ad047a7.

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

2 years agoRevert "[LTO] Add a function `LTOCodeGenerator::getMergedModule`"
Shilei Tian [Mon, 13 Dec 2021 21:31:22 +0000 (16:31 -0500)]
Revert "[LTO] Add a function `LTOCodeGenerator::getMergedModule`"

This reverts commit 61051e42c2d5b30ad440b2b275397fc0aa478434.

2 years agoRevert "[NFC][Clang][OpenMP] Use switch-case statement to process clauses of atomic...
Shilei Tian [Mon, 13 Dec 2021 21:30:56 +0000 (16:30 -0500)]
Revert "[NFC][Clang][OpenMP] Use switch-case statement to process clauses of atomic directive"

This reverts commit 5c23acbc023fbb9fdc6c56f4d2212ecb0432874e.

2 years agoSimplify AddSphinxTarget.cmake by just including `GNUInstallDirs`
John Ericson [Sun, 12 Dec 2021 17:07:13 +0000 (17:07 +0000)]
Simplify AddSphinxTarget.cmake by just including `GNUInstallDirs`

See the discussion in D30906 for how it must be robust to downstream
projects that might not use `GNUInstallDirs`.

I think an easier approach is just to include `GNUInstallDirs` so that
we can always rely on it. Looking at its definition in
https://gitlab.kitware.com/cmake/cmake/-/blob/master/Modules/GNUInstallDirs.cmake
it appears safe to include multiple times.

I am trying this out because we will face the same problem many times
over if we use `GNUInstallDirs` more widely, as proposed in D99484 and
its parent revisions, since we do not know what downstream projects do
and rather not break them.

Reviewed By: phosek

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

2 years ago[MachineOutliner] Don't outline functions starting with PATCHABLE_FUNCTION_ENTER...
Fangrui Song [Mon, 13 Dec 2021 21:24:29 +0000 (13:24 -0800)]
[MachineOutliner] Don't outline functions starting with PATCHABLE_FUNCTION_ENTER/FENTRL_CALL

MachineOutliner may outline a "patchable-function-entry" function whose body has
a TargetOpcode::PATCHABLE_FUNCTION_ENTER MachineInstr. This is incorrect because
the special code sequence must stay unchanged to be used at run-time.
Avoid outlining PATCHABLE_FUNCTION_ENTER. While here, avoid outlining FENTRY_CALL too
(which doesn't reproduce currently) to allow phase ordering flexibility.

Fixes #52635

Reviewed By: paquette

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

2 years agoAdd support for a "load binary" LC_NOTE in mach-o corefiles
Jason Molenda [Mon, 13 Dec 2021 21:20:05 +0000 (13:20 -0800)]
Add support for a "load binary" LC_NOTE in mach-o corefiles

Add lldb support for a Mach-O "load binary" LC_NOTE which provides
a UUID, load address/slide, and possibly a name of a binary that
should be loaded when examining the core.

struct load_binary
{
    uint32_t version;        // currently 1
    uuid_t   uuid;           // all zeroes if uuid not specified
    uint64_t load_address;   // virtual address where the macho is loaded, UINT64_MAX if unavail
    uint64_t slide;          // slide to be applied to file address to get load address, 0 if unavail
    char     name_cstring[]; // must be nul-byte terminated c-string, '\0' alone if name unavail
} __attribute__((packed));

Differential Revision: https://reviews.llvm.org/D115494
rdar://85069250

2 years ago[NFC][Clang][OpenMP] Use switch-case statement to process clauses of atomic directive
Shilei Tian [Mon, 13 Dec 2021 21:20:01 +0000 (16:20 -0500)]
[NFC][Clang][OpenMP] Use switch-case statement to process clauses of atomic directive

This patch makes the process of clauses of atomic directive more clear
and preparation for the support for `atomic compare capture`.

Reviewed By: jdoerfert

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

2 years agoadd missing textual header
Adrian Prantl [Mon, 13 Dec 2021 21:19:15 +0000 (13:19 -0800)]
add missing textual header

2 years ago[LTO] Add a function `LTOCodeGenerator::getMergedModule`
Shilei Tian [Mon, 13 Dec 2021 21:18:56 +0000 (16:18 -0500)]
[LTO] Add a function `LTOCodeGenerator::getMergedModule`

One of the uses of `LTOCodeGenerator` is to take it as a middle+back end. Sometimes
it is very helpful to access, especially get information from the optimized module.
If the information can be changed in optimization, it cannot be get before the
module is added to `LTOCodeGenerator`. This patch adds a function
`LTOCodeGenerator::getMergedModule` to access the `MergedModule`.

Reviewed By: steven_wu

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

2 years ago[mlir][ExecutionEngine] Fix native dependencies for AsmParser and Printer
Nicolas Vasilache [Mon, 13 Dec 2021 21:01:42 +0000 (21:01 +0000)]
[mlir][ExecutionEngine] Fix native dependencies for AsmParser and Printer

This is a post-commit fix for https://reviews.llvm.org/D114338 which was landed as
https://reviews.llvm.org/rG050cc1cd6e6882eadba6e5ea7b588ca0b8aa1b12

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

2 years ago[Const Rationale] various typo fixes, and update it to present tense.
Chris Lattner [Mon, 13 Dec 2021 20:49:25 +0000 (12:49 -0800)]
[Const Rationale] various typo fixes, and update it to present tense.

2 years ago[mlir][sparse] python driven test for SDDMM
Aart Bik [Thu, 9 Dec 2021 23:47:21 +0000 (15:47 -0800)]
[mlir][sparse] python driven test for SDDMM

explores various sparsity combinations of
the SDMM kernel and verifies that the computed
result is the same for all cases

Reviewed By: bixia

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

2 years agoRevert "Autogen more vectorizer tests in advance of D115387."
Philip Reames [Mon, 13 Dec 2021 20:44:50 +0000 (12:44 -0800)]
Revert "Autogen more vectorizer tests in advance of D115387."

This reverts commit bbfaf0b170b6070e08f1dc22419dfedc75b9a0fe.

Post commit review noted a case where my manual update lost intentional check lines.  Given I've abandoned the motivating patch, I'm just reverting the autogen prep.

2 years agoRevert "[NFC] Generalize a couple of passes so they can operate on any FunctionLike...
Mehdi Amini [Mon, 13 Dec 2021 20:41:25 +0000 (20:41 +0000)]
Revert "[NFC] Generalize a couple of passes so they can operate on any FunctionLike op."

This reverts commit 34696e6542894ac63dbfb899b0181c539c223ef1.

A test is crashing on the mlir-nvidia bot.

2 years ago[gn build] Remove unnecessary lld dependency on DebugInfo/Symbolize.
Noah Shutty [Mon, 13 Dec 2021 20:07:05 +0000 (20:07 +0000)]
[gn build] Remove unnecessary lld dependency on DebugInfo/Symbolize.

The gn script for lld's COFF lib adds an unnecessary dependency on llvm/lib/DebugInfo/Symbolize. There is no such dependency in lld/COFF/CMakeLists.txt. This can be safely removed.

Reviewed By: phosek, thakis

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

2 years ago[NFC][asan] XFAIL a test on THUMB
Vitaly Buka [Mon, 13 Dec 2021 20:05:50 +0000 (12:05 -0800)]
[NFC][asan] XFAIL a test on THUMB

Followup to D114934

2 years agoSupport sparse tensor output.
Bixia Zheng [Fri, 10 Dec 2021 23:26:27 +0000 (15:26 -0800)]
Support sparse tensor output.

Add convertFromMLIRSparseTensor to the supporting C shared library to convert
SparseTensorStorage to COO-flavor format.

Add Python routine sparse_tensor_to_coo_tensor to convert sparse tensor storage
pointer to numpy values for COO-flavor format tensor.

Add a Python test for sparse tensor output.

Reviewed By: aartbik

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

2 years ago[lldb] Clarify StructuredDataImpl ownership
Pavel Labath [Thu, 25 Nov 2021 13:01:41 +0000 (14:01 +0100)]
[lldb] Clarify StructuredDataImpl ownership

StructuredDataImpl ownership semantics is unclear at best. Various
structures were holding a non-owning pointer to it, with a comment that
the object is owned somewhere else. From what I was able to gather that
"somewhere else" was the SBStructuredData object, but I am not sure that
all created object eventually made its way there. (It wouldn't matter
even if they did, as we are leaking most of our SBStructuredData
objects.)

Since StructuredDataImpl is just a collection of two (shared) pointers,
there's really no point in elaborate lifetime management, so this patch
replaces all StructuredDataImpl pointers with actual objects or
unique_ptrs to it. This makes it much easier to resolve SBStructuredData
leaks in a follow-up patch.

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

2 years ago[NFC] Generalize a couple of passes so they can operate on any FunctionLike op.
Stella Laurenzo [Mon, 13 Dec 2021 05:19:39 +0000 (21:19 -0800)]
[NFC] Generalize a couple of passes so they can operate on any FunctionLike op.

* Generalizes passes linalg-detensorize, linalg-fold-unit-extent-dims, convert-elementwise-to-linalg.
* I feel that more work could be done in the future (i.e. make FunctionLike into a proper OpInterface and extend actions in dialect conversion to be trait based), and this patch would be a good record of why that is useful.
* Note for downstreams:
  * Since these passes are now generic, they do not automatically nest with pass managers set up for that.
  * If running them over nested functions, you must nest explicitly. Upstream has adopted this style but *-opt still has some uses of implicit pipelines via args. See tests for argument changes needed.

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

2 years agodisable test on older compilers
Adrian Prantl [Mon, 13 Dec 2021 19:58:59 +0000 (11:58 -0800)]
disable test on older compilers

2 years ago[mlir][linalg] Stage application of pad tensor op vectoriztaion.
gysit [Mon, 13 Dec 2021 19:49:16 +0000 (19:49 +0000)]
[mlir][linalg] Stage application of pad tensor op vectoriztaion.

Adapt the LinalgStrategyVectorizationPattern pass to apply the vectorization patterns in two stages. The change ensures the generic pad tensor op vectorization pattern does not run too early. Additionally, the revision adds the transfer op canonicalization patterns to the set of applied patterns, since they are needed to enable efficient vectorization for rank-reduced convolutions.

Reviewed By: nicolasvasilache

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

2 years ago[libc++] Change workaround for init_priority((100)) outside of system headers
Louis Dionne [Wed, 8 Dec 2021 13:26:27 +0000 (08:26 -0500)]
[libc++] Change workaround for init_priority((100)) outside of system headers

We had previously been using a different workaround for pretending that
we were inside a system header, however it had some undesirable effects
on dependency parsing for build systems, as explained in [1].

This patch changes the workaround to use `#pragma GCC system_header`,
which shouldn't suffer from the same issue. Unfortunately, it is a lot
more verbose. The issue is that `#pragma GCC system_header` is ignored
when we are inside a source file, so we have to create a header just for
the sake of using it. IMO this seems like an artificial restriction
without much benefit, but investigating that is a different story.
For now, this should at least solve build system problems at the
cost of some readability.

[1]: https://reviews.llvm.org/D95972#3178968

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

2 years ago[mlir] Update comments that mention `linalg.collapse/expand` shape.
Alexander Belyaev [Mon, 13 Dec 2021 19:34:42 +0000 (20:34 +0100)]
[mlir] Update comments that mention `linalg.collapse/expand` shape.

2 years ago[libc][NFC] Remove dependecies on entrypoints from loader tests.
Siva Chandra Reddy [Sat, 11 Dec 2021 08:42:57 +0000 (08:42 +0000)]
[libc][NFC] Remove dependecies on entrypoints from loader tests.

A small collection of utils called osutils has been added. These utils
are now used in loader tests instead of the equivalent entrypoints.
The loader can now be built and tested without depending on any entrypoint.
In a follow up change, the relevent entrypoints will be updated to use the
newly added osutils.

Reviewed By: lntue, michaelrj

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

2 years ago[SimplifyLibCalls] propagate tail flags on CallInsts
Nick Desaulniers [Mon, 13 Dec 2021 19:18:20 +0000 (11:18 -0800)]
[SimplifyLibCalls] propagate tail flags on CallInsts

I noticed we weren't propagating tail flags on calls when
FortifiedLibCallSimplifier.optimizeCall() was replacing calls to runtime
checked calls to the non-checked routines (when safe to do so). Make
sure to check this before replacing the original calls!

Also, avoid any libcall transforms when notail/musttail is present.

PR46734
Fixes: https://github.com/llvm/llvm-project/issues/46079

Reviewed By: jdoerfert

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

2 years ago[libc] Bazel overlay for libc
Guillaume Chatelet [Mon, 13 Dec 2021 19:13:52 +0000 (19:13 +0000)]
[libc] Bazel overlay for libc

This patch provides a draft overlay to support compilation of llvm libc with Bazel.

Tested on linux x86-64 with
```
cd git/llvm-project/utils/bazel
bazelisk-linux-amd64 build --sandbox_base=/dev/shm --config=generic_clang @llvm-project//libc:all
```

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

2 years agoRevert "[CMake] Update internal libc++ configuration"
Petr Hosek [Mon, 13 Dec 2021 19:13:02 +0000 (11:13 -0800)]
Revert "[CMake] Update internal libc++ configuration"

This reverts commit e286fefa8caaddea521685a8de1879acca82c67c since
the issue affecting the sanitizer-ppc64le-linux builder is resolved.

2 years agoCheck subrange liveness at rematerialization
Stanislav Mekhanoshin [Tue, 7 Dec 2021 21:10:54 +0000 (13:10 -0800)]
Check subrange liveness at rematerialization

LiveRangeEdit::allUsesAvailableAt checks that VNI at use is the same
as at the original use slot. However, the VNI can be the same while
a specific subrange needed for use can be dead at the new index.

This patch adds subrange liveness check if there is a subreg use.

Fixes: SWDEV-312810

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

2 years ago[CMake] Update internal libc++ configuration
Petr Hosek [Mon, 13 Dec 2021 19:03:07 +0000 (11:03 -0800)]
[CMake] Update internal libc++ configuration

This is an attempt to address 458ead66dc378ee5b9cbeb453a9cb7c3de768b2e
by better matching the previous configuration.

2 years ago[lldb/plugin] Fix heap-use-after-free in ScriptedProcess::ReadMemory
Med Ismail Bennani [Mon, 13 Dec 2021 18:41:39 +0000 (10:41 -0800)]
[lldb/plugin] Fix heap-use-after-free in ScriptedProcess::ReadMemory

This commit should fix a heap-use-after-free bug that was caught by the
sanitizer bot.

The issue is that we were reading memory from a second target into a
`SBData` object in Python, that was passed to lldb's internal
`ScriptedProcess::DoReadMemory` C++ method.

The ScriptedPythonInterface then extracts the underlying `DataExtractor`
from the `SBData` object, and is used to read the memory with the
appropriate address size and byte order.

Unfortunately, it seems that even though the DataExtractor object was
still valid, it pointed to invalid, possibly garbage-collected memory
from Python.

To mitigate this, the patch uses `SBData::SetDataWithOwnership` to copy
the pointed buffer to lldb's heap memory which prevents the
use-after-free error.

rdar://84511405

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

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2 years ago[lldb/API] Add SetDataWithOwnership method to SBData
Med Ismail Bennani [Mon, 13 Dec 2021 18:34:49 +0000 (10:34 -0800)]
[lldb/API] Add SetDataWithOwnership method to SBData

This patch introduces a new method to SBData: SetDataWithOwnership.

Instead of referencing the pointer to the data, this method copies the
data buffer into lldb's heap memory.

This can prevent having the underlying DataExtractor object point to
freed/garbage-collected memory.

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

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2 years agoAutogen more vectorizer tests in advance of D115387.
Philip Reames [Mon, 13 Dec 2021 19:03:13 +0000 (11:03 -0800)]
Autogen more vectorizer tests in advance of D115387.

These are the ones my first round of scripting couldn't handle that required a bit of manual messaging.  This should be the last batch in llvm-check.

2 years ago[SLP]Improve/fix reodering for gather nodes with extractelements/undefs.
Alexey Bataev [Wed, 8 Dec 2021 16:50:39 +0000 (08:50 -0800)]
[SLP]Improve/fix reodering for gather nodes with extractelements/undefs.

If the gather node is a mix of undefvalues and exractelement
instructions, need to take the ordering for such nodes into account too.
It allows to reorder some (sub)trees and remove some extra shuffles,
improving overall vectorization.
Also, outlined common functionality into a separate function.

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

2 years ago[MCA][X86] Add AVX512 subvector broadcast instruction test coverage
Simon Pilgrim [Mon, 13 Dec 2021 18:39:31 +0000 (18:39 +0000)]
[MCA][X86] Add AVX512 subvector broadcast instruction test coverage

2 years agoAutogen a bunch of instcombine and vectorizer tests
Philip Reames [Mon, 13 Dec 2021 18:07:28 +0000 (10:07 -0800)]
Autogen a bunch of instcombine and vectorizer tests

Done in advance of D115387.  These are all the ones which my local script could handle, there's a couple more which need manual updates.

2 years ago[libc] add basic strtold implementation
Michael Jones [Wed, 10 Nov 2021 23:58:42 +0000 (15:58 -0800)]
[libc] add basic strtold implementation

Due to the differences between the types of long double, this function
is effectively three functions in one. This patch adds basic support for
the types of long double, although it's just using the fast path and the
fallback for the moment. I still need to implement a version of
Eisel-Lemire for performance, but the existing algorithms should be
correct.

Reviewed By: sivachandra, lntue

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

2 years ago[NFC][regalloc] Move ExtraRegInfo and related to LiveRangeStageManager
Mircea Trofin [Wed, 1 Dec 2021 00:30:16 +0000 (16:30 -0800)]
[NFC][regalloc] Move ExtraRegInfo and related to LiveRangeStageManager

This would allow sharing the LiveRangeStageManager between different
RegAllocEvictionAdvisors. One scenario is for ML training, where we want
to capture what the default advisor would do, for bootstrapping (speeds
up training).

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

2 years ago[ThinLTO] Fix nondeterministic exit on error.
Mircea Trofin [Sat, 11 Dec 2021 04:59:24 +0000 (20:59 -0800)]
[ThinLTO] Fix nondeterministic exit on error.

In the multi-threaded case, if a thread hits an error, we mimick
LLVMContext's behavior of reporting the error and exit-ing. However,
this doesn't cleanly join the other threads, so depending on how fast
the process exits, other threads may report 'terminate called without an
active exception'.

To avoid this non-determinsim, and without introducing a more complicated
design, we just report the error, but not exit early. We do track whether
we hit errors and exit(1) after joining.

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

2 years ago[MCA][X86] Add AVX512 movddup/movshdup/movsldup instruction test coverage
Simon Pilgrim [Mon, 13 Dec 2021 18:01:19 +0000 (18:01 +0000)]
[MCA][X86] Add AVX512 movddup/movshdup/movsldup instruction test coverage

As noted on D115547

2 years ago[VP] [NFC] Fix vp_store signature and vp_gather examples
Fraser Cormack [Mon, 13 Dec 2021 17:52:47 +0000 (17:52 +0000)]
[VP] [NFC] Fix vp_store signature and vp_gather examples

Reviewed By: frasercrmck, simoll

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

2 years ago[ELF] Split scanRelocations into scanRelocations/postScanRelocations
Fangrui Song [Mon, 13 Dec 2021 17:56:51 +0000 (09:56 -0800)]
[ELF] Split scanRelocations into scanRelocations/postScanRelocations

The idea is to make scanRelocations mark some actions are needed (GOT/PLT/etc)
and postpone the real work to postScanRelocations. It gives some flexibility:

* Make it feasible to support .plt.got (PR32938): we need to know whether GLOB_DAT and JUMP_SLOT are both needed.
* Make non-preemptible IFUNC handling slightly cleaner: avoid setting/clearing sym.gotInIgot
* -z nocopyrel: report all copy relocation places for one symbol
* Make parallel relocation scanning possible (if we can avoid all stateful operations and make Symbol attributes atomic), but parallelism may not be the appealing choice
* Make GOT deduplication feasible

Since this patch moves a large chunk of code out of ELFT templates. My x86-64
executable is actually a few hundred bytes smaller.

For ppc32-ifunc-nonpreemptible-pic.s: I remove absolute relocation references to non-preemptible ifunc
because absolute relocation references are incorrect in -fpie mode.

Reviewed By: peter.smith, ikudrin

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

2 years ago[MCA][X86] Add AVX512 broadcast instruction test coverage
Simon Pilgrim [Mon, 13 Dec 2021 17:39:31 +0000 (17:39 +0000)]
[MCA][X86] Add AVX512 broadcast instruction test coverage

As noted on D115547

2 years ago[llvm] [Debuginfod] Disable CURL by default.
Noah Shutty [Mon, 13 Dec 2021 17:39:01 +0000 (17:39 +0000)]
[llvm] [Debuginfod] Disable CURL by default.

Sets LLVM_ENABLE_CURL to OFF by default to avoid accidental inclusion of libcurl in builds which do not override the default.

Reviewed By: thakis

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

2 years ago[LoopIdiom] Let LIR fold memset pointer / stride SCEV regarding loop guards
eopXD [Thu, 9 Dec 2021 16:15:43 +0000 (08:15 -0800)]
[LoopIdiom] Let LIR fold memset pointer / stride SCEV regarding loop guards

Expression guraded in loop entry can be folded prior to comparison. This patch
proceeds D107353 and makes LIR able to deal with nested for-loop.

Reviewed By: qianzhen, bmahjour

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

2 years agoQuote some more destination paths with variables
John Ericson [Sat, 11 Dec 2021 01:54:42 +0000 (01:54 +0000)]
Quote some more destination paths with variables

Just defensive CMake-ing. I pulled this from D115544 and D99484 which
are blocked on some lldb CI failures I don't yet understand. Hoping to land
something smaller in the meantime.

Reviewed By: #libc, ldionne

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

2 years agoAdd missing textual header to module map
Adrian Prantl [Mon, 13 Dec 2021 17:21:21 +0000 (09:21 -0800)]
Add missing textual header to module map

2 years agoAdd missing textual header to module map
Adrian Prantl [Mon, 13 Dec 2021 17:19:12 +0000 (09:19 -0800)]
Add missing textual header to module map

2 years ago[WebAssembly] Lower global syms representing tables with .tabletype
Paulo Matos [Mon, 13 Dec 2021 16:45:51 +0000 (17:45 +0100)]
[WebAssembly] Lower global syms representing tables with .tabletype

This patch implements a fix to recognize global symbols that represent
WebAssembly appropriately and generate the necessary .tabletype
directives.

Reviewed By: sbc100

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

2 years ago[RISCV] Don't use VLMAX for start value splat in reduction lowering.
Craig Topper [Mon, 13 Dec 2021 17:02:53 +0000 (09:02 -0800)]
[RISCV] Don't use VLMAX for start value splat in reduction lowering.

The reduction instructions only reads the first element. The
execution time for a splat may take longer with a larger VL.
We should use the smallest VL we can.

Reviewed By: frasercrmck, HsiangKai

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

2 years ago[DAGCombine][X86][ARM] EXTRACT_SUBVECTOR(VECTOR_SHUFFLE(?,?,Mask)) -> VECTOR_SHUFFLE...
Roman Lebedev [Mon, 13 Dec 2021 17:00:10 +0000 (20:00 +0300)]
[DAGCombine][X86][ARM] EXTRACT_SUBVECTOR(VECTOR_SHUFFLE(?,?,Mask)) -> VECTOR_SHUFFLE(EXTRACT_SUBVECTOR(?, ?), EXTRACT_SUBVECTOR(?, ?), Mask')

In most test changes this allows us to drop some broadcasts/shuffles.

Reviewed By: RKSimon

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

2 years agoFix build failure of HIPUtility.cpp on Windows
Yaxun (Sam) Liu [Mon, 13 Dec 2021 16:49:22 +0000 (11:49 -0500)]
Fix build failure of HIPUtility.cpp on Windows

2 years ago[ASan] Replace IR based callbacks with shared assembly code callbacks.
Kirill Stoimenov [Mon, 13 Dec 2021 16:10:58 +0000 (16:10 +0000)]
[ASan] Replace IR based callbacks with shared assembly code callbacks.

This change moves optimized callbacks from each .o file to compiler-rt.

Reviewed By: vitalybuka, morehouse

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

2 years agoFix warning about unused variable in HIPAMD.cpp
Yaxun (Sam) Liu [Mon, 13 Dec 2021 16:25:24 +0000 (11:25 -0500)]
Fix warning about unused variable in HIPAMD.cpp

2 years ago[Flang][Unit Test] Move the declaration of kindMap to the class
Kiran Chandramohan [Mon, 13 Dec 2021 16:11:32 +0000 (16:11 +0000)]
[Flang][Unit Test] Move the declaration of kindMap to the class

kindMap variable is declared in the Setup function but passed as
a reference to the firBuilder class. The firBuilder is declared in
the class and hence its lifetime exceeds that of kindMap. This can
lead to undefined behaviour. Move the kindMap variable into the class
to avoid this.

This is part of the upstreaming effort from the fir-dev branch in [1].
[1] https://github.com/flang-compiler/f18-llvm-project

Reviewed By: awarzynski

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

2 years ago[SystemZ][z/OS] Fix handling of dirs with filesystem tests
Muiez Ahmed [Mon, 13 Dec 2021 16:00:56 +0000 (11:00 -0500)]
[SystemZ][z/OS] Fix handling of dirs with filesystem tests

The aim of this patch is to fix the post processing that is happening on the temporary test directories upon scope exit. In particular, ~scoped_test_env aims to chmod and remove the temporary directories; however,

bad symlinks are followed and we get "No such file or directory". FIX: use find as alternative to chmod and avoid -follow option.
Attempting to remove read-only files on z/OS prompts a message asking for confirmation. FIX: use the -f option to delete read-only files immediately without asking for confirmation.
Some libcxx tests such as libcxx/test/std/input.output/filesystems/cl ass.directory_entry/directory_entry.cons/path.pass.cpp set the dir permissions to none. In turn, recursively doing chmod (-R) does not set the file permissions needed to be able to remove the dir on z/OS only. FIX: use find as alternative to chmod -R, which does not run into this issue on z/OS.

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

2 years ago[gn build] Port 78b0f3701d44
LLVM GN Syncbot [Mon, 13 Dec 2021 15:53:45 +0000 (15:53 +0000)]
[gn build] Port 78b0f3701d44