platform/upstream/llvm.git
3 years agoUse CXX_SOURCES and point to the right source file.
Jim Ingham [Thu, 21 Jan 2021 02:38:07 +0000 (18:38 -0800)]
Use CXX_SOURCES and point to the right source file.

Copy paste error, but the test still built on macOS.  Weird.
It failed on debian linux with an error about -fno-limit-debug-info
not being a supported flag???  Not sure how this goof would cause
that error, but let's see if it did...

3 years ago[MSan] Move origins for overlapped memory transfer
Jianzhou Zhao [Wed, 13 Jan 2021 01:37:16 +0000 (01:37 +0000)]
[MSan] Move origins for overlapped memory transfer

Reviewed-by: eugenis
Differential Revision: https://reviews.llvm.org/D94572

3 years agoFix a bug with setting breakpoints on C++11 inline initialization statements.
Jim Ingham [Thu, 21 Jan 2021 01:58:34 +0000 (17:58 -0800)]
Fix a bug with setting breakpoints on C++11 inline initialization statements.

If they occurred before the constructor that used them, we would refuse to
set the breakpoint because we thought they were crossing function boundaries.

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

3 years ago[lld-macho] Add dependency on ObjCARC to fix shared build
Jez Ng [Thu, 21 Jan 2021 01:41:24 +0000 (20:41 -0500)]
[lld-macho] Add dependency on ObjCARC to fix shared build

3 years ago[Clang][OpenMP] Use `clang_cc1` test for `declare_target_device_only_compilation...
Shilei Tian [Thu, 21 Jan 2021 01:34:03 +0000 (20:34 -0500)]
[Clang][OpenMP] Use `clang_cc1` test for `declare_target_device_only_compilation.cpp`

Use `clang_cc1` test for `declare_target_device_only_compilation.cpp`

Reviewed By: echristo

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

3 years ago[DAGCombiner] Precommit test case for D95086
Guozhi Wei [Thu, 21 Jan 2021 01:15:47 +0000 (17:15 -0800)]
[DAGCombiner] Precommit test case for D95086

This is the test case for D95086 with worse result.

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

3 years ago[mlir][OpFormatGen] Fix incorrect kind used for RegionsDirective
River Riddle [Thu, 21 Jan 2021 00:47:00 +0000 (16:47 -0800)]
[mlir][OpFormatGen] Fix incorrect kind used for RegionsDirective

I attempted to write a test case for this, but the situations in which the kind is used for RegionDirective and ResultsDirective have zero overlap; meaning that there isn't a situation in which sharing the kind creates a conflict.

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

3 years ago[mlir] Make MLIRContext::getOrLoadDialect(StringRef, TypeID, ...) public
mfehr [Thu, 21 Jan 2021 00:29:51 +0000 (00:29 +0000)]
[mlir] Make MLIRContext::getOrLoadDialect(StringRef, TypeID, ...) public

Having this function in a public scope is helpful to register dialects that are
defined at runtime, and thus that need a runtime-defined TypeID.

Also, a similar function in DialectRegistry, insert(TypeID, StringRef, ...), has
a public scope.

Reviewed By: mehdi_amini

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

3 years ago[mlir] Add a new builtin `unrealized_conversion_cast` operation
River Riddle [Thu, 21 Jan 2021 00:17:26 +0000 (16:17 -0800)]
[mlir] Add a new builtin `unrealized_conversion_cast` operation

An `unrealized_conversion_cast` operation represents an unrealized conversion
from one set of types to another, that is used to enable the inter-mixing of
different type systems. This operation should not be attributed any special
representational or execution semantics, and is generally only intended to be
used to satisfy the temporary intermixing of type systems during the conversion
of one type system to another.

This operation was discussed in the following RFC(and ODM):

https://llvm.discourse.group/t/open-meeting-1-14-dialect-conversion-and-type-conversion-the-question-of-cast-operations/

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

3 years ago[mlir] Add an interface for Cast-Like operations
River Riddle [Thu, 21 Jan 2021 00:17:13 +0000 (16:17 -0800)]
[mlir] Add an interface for Cast-Like operations

A cast-like operation is one that converts from a set of input types to a set of output types. The arity of the inputs may be from 0-N, whereas the arity of the outputs may be anything from 1-N. Cast-like operations are removable in cases where they produce a "no-op", i.e when the input types and output types match 1-1.

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

3 years ago[NFC] Minor cleanup for ValueHandle code.
Varun Gandhi [Thu, 7 Jan 2021 16:50:31 +0000 (08:50 -0800)]
[NFC] Minor cleanup for ValueHandle code.

Based on feedback in https://reviews.llvm.org/D93433.

Reviewed By: dblaikie

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

3 years ago[libc][NFC][obvious] fix the names of MPFR tests
Michael Jones [Wed, 20 Jan 2021 23:42:01 +0000 (23:42 +0000)]
[libc][NFC][obvious] fix the names of MPFR tests

I missed the MPFR tests in my previous commit. They have now been fixed
to not fail the prefix check in the test macro.

3 years ago[libc][NFC] add "LlvmLibc" as a prefix to all test names
Michael Jones [Fri, 15 Jan 2021 21:54:23 +0000 (21:54 +0000)]
[libc][NFC] add "LlvmLibc" as a prefix to all test names

Summary:
Having a consistent prefix makes selecting all of the llvm libc tests
easier on any platform that is also using the gtest framework.
This also modifies the TEST and TEST_F macros to enforce this change
moving forward.

Reviewers: sivachandra

Subscribers:

3 years ago[BuildLibcalls, Attrs] Support more variants of C++'s new, add attributes for C+...
Dávid Bolvanský [Wed, 20 Jan 2021 23:12:28 +0000 (00:12 +0100)]
[BuildLibcalls, Attrs] Support more variants of C++'s new, add attributes for C++'s delete

Reviewed By: jdoerfert

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

3 years ago[RISCV] Add another isel pattern for slliu.w.
Craig Topper [Wed, 20 Jan 2021 22:52:03 +0000 (14:52 -0800)]
[RISCV] Add another isel pattern for slliu.w.

Previously we only matched (and (shl X, C1), 0xffffffff << C1)
which matches the InstCombine canonicalization order. But its
possible to see (shl (and X, 0xffffffff), C1) if the pattern
is introduced in SelectionDAG. For example, through expansion of
a GEP.

3 years ago[RISCV] Add addu.w and slliu.w test that uses getelementptr with zero extended indices.
Craig Topper [Wed, 20 Jan 2021 22:32:20 +0000 (14:32 -0800)]
[RISCV] Add addu.w and slliu.w test that uses getelementptr with zero extended indices.

This is closer to the kind of code that these intrinsics are
targeted at. Note we fail to match slliu.w here because our pattern
looks for (and (shl X, C1), 0xffffffff << C1) rather than
(shl (and X, 0xffffffff), C1). I'll fix this in a follow up
commit.

3 years agoRevert "[mlir][Affine] Add support for multi-store producer fusion"
Diego Caballero [Wed, 20 Jan 2021 22:36:37 +0000 (00:36 +0200)]
Revert "[mlir][Affine] Add support for multi-store producer fusion"

This reverts commit 7dd198852b4db52ae22242dfeda4eccda83aa8b2.

ASAN issue.

3 years ago[mlir][sparse] add asserts on reading in tensor data
Aart Bik [Wed, 20 Jan 2021 18:37:22 +0000 (10:37 -0800)]
[mlir][sparse] add asserts on reading in tensor data

Rationale:
Since I made the argument that metadata helps with extra
verification checks, I better actually do that ;-)

Reviewed By: penpornk

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

3 years agoD94954: Fixes Snapdragon Kryo CPU core detection
Ryan Houdek [Wed, 20 Jan 2021 22:23:43 +0000 (22:23 +0000)]
D94954: Fixes Snapdragon Kryo CPU core detection

All of these families were claiming to be a73 based, which was causing
-mcpu/mtune=native to never use the newer features available to these
cores.

Goes through each and bumps the individual cores to their respective Big
counterparts. Since this code path doesn't support big.little detection,
there was already a precedent set with the Qualcomm line to choose the
big cores only.

Adds a comment on each line for the product's name that the part number
refers to. Confirmed on-device and through Linux header naming
convections.

Additionally newer SoCs mix CPU implementer parts from multiple
implementers. Both 0x41 (ARM) and 0x51 (Qualcomm) in the Snapdragon case

This was causing a desync in information where the scan at the start to
find the implementer would mismatch the part scan later on.
Now scan for both implementer and part at the start so these stay in
sync.

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

3 years agoMakefile.rules: Avoid redundant .d generation (make restart) and inline archive rule...
Fangrui Song [Wed, 20 Jan 2021 22:22:33 +0000 (14:22 -0800)]
Makefile.rules: Avoid redundant .d generation (make restart) and inline archive rule to the only test

Take an example when `CXX_SOURCES` is main.cpp.

main.d is an included file. make will rebuild main.d, re-executes itself [1] to read
in the new main.d file, then rebuild main.o, finally link main.o into a.out.
main.cpp is parsed twice in this process.

This patch merges .d generation into .o generation [2], writes explicit rules
for .c/.m and deletes suffix rules for %.m and %.o. Since a target can be
satisfied by either of .c/.cpp/.m/.mm, we use multiple pattern rules. The
rule with the prerequisite (with VPATH considered) satisfied is used [3].

Since suffix rules are disabled, the implicit rule for archive member targets is
no long available [4]. Rewrite, simplify the archive rule and inline it into the
only test `test/API/functionalities/archives/Makefile`.

[1]: https://www.gnu.org/software/make/manual/html_node/Remaking-Makefiles.html
[2]: http://make.mad-scientist.net/papers/advanced-auto-dependency-generation/
[3]: https://www.gnu.org/software/make/manual/html_node/Pattern-Match.html
[4]: https://www.gnu.org/software/make/manual/html_node/Archive-Update.html

ObjC/ObjCXX tests only run on macOS. I don't have testing environment.  Hope
someone can do it for me.

Reviewed By: JDevlieghere

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

3 years ago[mlir] NFC - Fix unused variable in non-debug mode
Nicolas Vasilache [Wed, 20 Jan 2021 22:19:59 +0000 (22:19 +0000)]
[mlir] NFC - Fix unused variable in non-debug mode

3 years ago[NFC][AMDGPU] Document target ID syntax for code object V2 to V3
Tony Tye [Wed, 20 Jan 2021 03:38:55 +0000 (03:38 +0000)]
[NFC][AMDGPU] Document target ID syntax for code object V2 to V3

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

3 years ago[hip] Fix `<complex>` compilation on Windows with VS2019.
Michael Liao [Wed, 20 Jan 2021 19:55:06 +0000 (14:55 -0500)]
[hip] Fix `<complex>` compilation on Windows with VS2019.

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

3 years agoReland "[NPM][Inliner] Factor ImportedFunctionStats in the InlineAdvisor"
Mircea Trofin [Wed, 20 Jan 2021 19:25:43 +0000 (11:25 -0800)]
Reland "[NPM][Inliner] Factor ImportedFunctionStats in the InlineAdvisor"

This reverts commit d97f776be5f8cd3cd446fe73827cd355f6bab4e1.

The original problem was due to build failures in shared lib builds. D95079
moved ImportedFunctionsInliningStatistics under Analysis, unblocking
this.

3 years ago[mlir:async] Fix data races in AsyncRuntime
Eugene Zhulenev [Wed, 20 Jan 2021 13:17:12 +0000 (05:17 -0800)]
[mlir:async] Fix data races in AsyncRuntime

Resumed coroutine potentially can deallocate the token/value/group and destroy the mutex before the std::unique_ptr destructor.

Reviewed By: mehdi_amini

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

3 years ago[gn build] Port 95ce32c7878d
LLVM GN Syncbot [Wed, 20 Jan 2021 21:18:20 +0000 (21:18 +0000)]
[gn build] Port 95ce32c7878d

3 years ago[NFC] Move ImportedFunctionsInliningStatistics to Analysis
Mircea Trofin [Wed, 20 Jan 2021 20:39:55 +0000 (12:39 -0800)]
[NFC] Move ImportedFunctionsInliningStatistics to Analysis

This is related to D94982. We want to call these APIs from the Analysis
component, so we can't leave them under Transforms.

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

3 years ago[flang] Fix creation of deferred shape arrays by POINTER statement
Peter Steinfeld [Wed, 20 Jan 2021 20:34:08 +0000 (12:34 -0800)]
[flang] Fix creation of deferred shape arrays by POINTER statement

It's possible to  declare deferred shape array using the POINTER
statement, for example:

  POINTER :: var(:)

When analyzing POINTER declarations, we were not capturing the array
specification information, if present.  I fixed this by changing the
"Post" function for "parser::PointerDecl" to check to see if the
declaration contained a "DeferredShapeSpecList".  In such cases, I
analyzed the shape and used to information to declare an "ObjectEntity"
that contains the shape information rather than an "UnknownEntity".

I also added a couple of small tests that fail to compile without these
changes.

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

3 years ago[OpenMP][NVPTX] Added forward declaration to pave the way for building deviceRTLs...
Shilei Tian [Wed, 20 Jan 2021 20:55:52 +0000 (15:55 -0500)]
[OpenMP][NVPTX] Added forward declaration to pave the way for building deviceRTLs with OpenMP

Once we switch to build deviceRTLs with OpenMP, primitives and CUDA
intrinsics cannot be used directly anymore because `__device__` is not recognized
by OpenMP compiler. To avoid involving all CUDA internal headers we had in `clang`,
we forward declared these functions. Eventually they will be transformed into
right LLVM instrinsics.

Reviewed By: JonChesterfield

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

3 years ago[CodeView] Emit function types in -gline-tables-only.
Amy Huang [Tue, 12 Jan 2021 00:37:29 +0000 (16:37 -0800)]
[CodeView] Emit function types in -gline-tables-only.

This change adds function types to further differentiate between
FUNC_IDs in -gline-tables-only.

Size increase of object files in clang are
Before: 917990 kb
After:  999312 kb

Bug: https://bugs.llvm.org/show_bug.cgi?id=48432

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

3 years ago[flang] Infrastructure improvements in utility routines
peter klausler [Wed, 20 Jan 2021 01:14:41 +0000 (17:14 -0800)]
[flang] Infrastructure improvements in utility routines

* IsArrayElement() needs another option to control whether it
  should ignore trailing component references.
* Add IsObjectPointer().
* Add const Scope& variants of IsFunction() and IsProcedure().
* Make TypeAndShape::Characterize() work with procedure bindings.
* Handle CHARACTER length in MeasureSizeInBytes().
* Fine-tune FindExternallyVisibleObject()'s handling of dummy arguments
  to conform with Fortran 2018: only INTENT(IN) and dummy pointers
  in pure functions signify; update two tests accordingly.

Also: resolve some stylistic inconsistencies and add a missing
"const" in the expression traversal template framework.

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

3 years ago[mlir][Linalg] NFC - Fully compose map and operands when creating AffineMin in tiling.
Nicolas Vasilache [Wed, 20 Jan 2021 20:29:34 +0000 (20:29 +0000)]
[mlir][Linalg] NFC - Fully compose map and operands when creating AffineMin in tiling.

This may simplify the composition of patterns but is otherwise NFC.

3 years ago[mlir] Add ComplexDialect to SCF->GPU pass.
Alexander Belyaev [Wed, 20 Jan 2021 20:11:49 +0000 (21:11 +0100)]
[mlir] Add ComplexDialect to SCF->GPU pass.

3 years ago[mlir] Fix SubTensorInsertOp semantics
Nicolas Vasilache [Wed, 20 Jan 2021 19:54:02 +0000 (19:54 +0000)]
[mlir] Fix SubTensorInsertOp semantics

Like SubView, SubTensor/SubTensorInsertOp are allowed to have rank-reducing/expanding semantics. In the case of SubTensorInsertOp , the rank of offsets/sizes/strides should be the rank of the destination tensor.

Also, add a builder flavor for SubTensorOp to return a rank-reduced tensor.

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

3 years ago[PredicateInfo] Handle logical and/or
Nikita Popov [Wed, 20 Jan 2021 19:52:23 +0000 (20:52 +0100)]
[PredicateInfo] Handle logical and/or

Teach PredicateInfo to handle logical and/or the same way as
bitwise and/or. This allows handling logical and/or inside IPSCCP
and NewGVN.

3 years ago[lldb/Commands] Align process launch --plugin with process attach (NFC)
Med Ismail Bennani [Wed, 20 Jan 2021 19:29:13 +0000 (20:29 +0100)]
[lldb/Commands] Align process launch --plugin with process attach (NFC)

Following `7169d3a315f4cdc19c4ab6b8f20c6f91b46ba9b8`, this patch updates
the short option for the plugin command option to (`-p` to `-P`) to
align with the `process attach` command options.

The long option remains the same since there are already the same for both
commands.

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
3 years ago[PredicateInfo][SCCP][NewGVN] Add tests for logical and/or (NFC)
Nikita Popov [Mon, 11 Jan 2021 19:17:10 +0000 (20:17 +0100)]
[PredicateInfo][SCCP][NewGVN] Add tests for logical and/or (NFC)

Duplicate some existing and/or tests using logical form.

3 years agoReland "[PDB] Defer relocating .debug$S until commit time and parallelize it"
Reid Kleckner [Wed, 20 Jan 2021 19:46:05 +0000 (11:46 -0800)]
Reland "[PDB] Defer relocating .debug$S until commit time and parallelize it"

This reverts commit 5b7aef6eb4b2930971029b984cb2360f7682e5a5 and relands
6529d7c5a45b1b9588e512013b02f891d71bc134.

The ASan error was debugged and determined to be the fault of an invalid
object file input in our test suite, which was fixed by my last change.
LLD's project policy is that it assumes input objects are valid, so I
have added a comment about this assumption to the relocation bounds
check.

3 years ago[mlir][Linalg] NFC - Expose getSmallestBoundingIndex as an utility function
Nicolas Vasilache [Wed, 20 Jan 2021 19:24:49 +0000 (19:24 +0000)]
[mlir][Linalg] NFC - Expose getSmallestBoundingIndex as an utility function

3 years ago[libomptarget][devicertl][nfc] Simplify target_atomic abstraction
Jon Chesterfield [Wed, 20 Jan 2021 19:50:50 +0000 (19:50 +0000)]
[libomptarget][devicertl][nfc] Simplify target_atomic abstraction

[libomptarget][devicertl][nfc] Simplify target_atomic abstraction

Atomic functions were implemented as a shim around cuda's atomics, with
amdgcn implementing those symbols as a shim around gcc style intrinsics.

This patch folds target_atomic.h into target_impl.h and folds amdgcn.

Further work is likely to be useful here, either changing to openmp's atomic
interface or instantiating the templates on the few used types in order to
move them into a cuda/c++ implementation file. This change is mostly to
group the remaining uses of the cuda api under nvptx' target_impl abstraction.

Reviewed By: jdoerfert

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

3 years agoRevert "[lldb] Re-enable TestPlatformProcessConnect on macos"
Pavel Labath [Wed, 20 Jan 2021 19:49:03 +0000 (20:49 +0100)]
Revert "[lldb] Re-enable TestPlatformProcessConnect on macos"

This reverts commit 079e664661770a78e30c0d27a12d50047f1b1ea8. It needs
more work.

3 years ago[COFF] Fix relocation offsets in pdb-file-statics test input
Reid Kleckner [Wed, 20 Jan 2021 19:16:01 +0000 (11:16 -0800)]
[COFF] Fix relocation offsets in pdb-file-statics test input

The relocation offsets were incorrect. I fixed them with llvm-readobj
-codeview -codeview-subsection-bytes, which has a helpful printout of
the relocations that apply to a given symbol record with their offsets.
With this, I was able to update the relocation offsets in the yaml to
fix the line table and the S_DEFRANGE_REGISTER records.

There is still some remaining inconsistency in yaml2obj and obj2yaml
when round tripping MSVC objects, but that isn't a blocker for relanding
D94267.

3 years ago[libomptarget][devicertl][nfc] Remove some cuda intrinsics, simplify
Jon Chesterfield [Wed, 20 Jan 2021 19:45:05 +0000 (19:45 +0000)]
[libomptarget][devicertl][nfc] Remove some cuda intrinsics, simplify

[libomptarget][devicertl][nfc] Remove some cuda intrinsics, simplify

Replace __popc, __ffs with clang intrinsics. Move kmpc_impl_min to only file
that uses it and replace template with explictly typed.

Reviewed By: jdoerfert

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

3 years ago[PredicateInfo] Generalize processing of conditions
Nikita Popov [Mon, 11 Jan 2021 21:18:12 +0000 (22:18 +0100)]
[PredicateInfo] Generalize processing of conditions

Branch/assume conditions in PredicateInfo are currently handled in
a rather ad-hoc manner, with some arbitrary limitations. For example,
an `and` of two `icmp`s will be handled, but an `and` of an `icmp`
and some other condition will not. That also includes the case where
more than two conditions and and'ed together.

This patch makes the handling more general by looking through and/ors
up to a limit and considering all kinds of conditions (though operands
will only be taken for cmps of course).

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

3 years ago[flang][driver] Refactor one unit-test case to use fixtures (nfc)
Andrzej Warzynski [Wed, 20 Jan 2021 18:27:04 +0000 (18:27 +0000)]
[flang][driver] Refactor one unit-test case to use fixtures (nfc)

Move the unit test from InputOutputTest.cpp to FrontendActionTest.cpp
and re-implement it in terms of the FrontendActionTest fixture. This is
just a small code clean-up and a continuation of:
  * https://reviews.llvm.org/D93544

Moving forward, we should try be implementing all unit-test cases for
Flang's frontend actions in terms of FrontendActionTest.

Reviewed By: sameeranjoshi

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

3 years ago[EXTINT][OMP] Fix _ExtInt type checking in device code
Erich Keane [Wed, 20 Jan 2021 19:33:22 +0000 (11:33 -0800)]
[EXTINT][OMP] Fix _ExtInt type checking in device code

_ExtInt gets stuck in the device-type-checking for __int128 if it is
between 65 and 128 bits inclusive.  Anything larger or smaller was
permitted despite this, so this is simply enabling 65-128 bit _ExtInts.
_ExtInt is supported on all our current ABIs, but we stil use the
hasExtIntType in the target info to differentiate here so that it can be
disabled.

3 years ago[WebAssembly] Prototype new f64x2 conversions
Thomas Lively [Wed, 20 Jan 2021 19:28:06 +0000 (11:28 -0800)]
[WebAssembly] Prototype new f64x2 conversions

As proposed in https://github.com/WebAssembly/simd/pull/383.

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

3 years ago[mlir][Linalg] NFC - getAssumedNonShapedOperands now returns OperandRange
Nicolas Vasilache [Wed, 20 Jan 2021 19:02:08 +0000 (19:02 +0000)]
[mlir][Linalg] NFC - getAssumedNonShapedOperands now returns OperandRange

Also adds a isInput interface method.

3 years ago[NFC][AMDGPU] Split AMDGPUSubtarget.h to R600 and GCN subtargets
dfukalov [Wed, 20 Jan 2021 12:48:02 +0000 (15:48 +0300)]
[NFC][AMDGPU] Split AMDGPUSubtarget.h to R600 and GCN subtargets

... to reduce headers dependency.

Reviewed By: rampitec, arsenm

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

3 years ago[lld-macho] Run ObjCContractPass during LTO
Jez Ng [Tue, 12 Jan 2021 19:41:56 +0000 (14:41 -0500)]
[lld-macho] Run ObjCContractPass during LTO

Run the ObjCARCContractPass during LTO. The legacy LTO backend (under
LTO/ThinLTOCodeGenerator.cpp) already does this; this diff just adds that
behavior to the new LTO backend. Without that pass, the objc.clang.arc.use
intrinsic will get passed to the instruction selector, which doesn't know how to
handle it.

In order to test both the new and old pass managers, I've also added support for
the `--[no-]lto-legacy-pass-manager` flags.

P.S. Not sure if the ordering of the pass within the pipeline matters...

Reviewed By: fhahn

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

3 years ago[lld-macho][easy] Create group for LLD-specific CLI flags
Jez Ng [Tue, 12 Jan 2021 19:55:38 +0000 (14:55 -0500)]
[lld-macho][easy] Create group for LLD-specific CLI flags

Reviewed By: #lld-macho, compnerd

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

3 years agoRevert "[NPM][Inliner] Factor ImportedFunctionStats in the InlineAdvisor"
Mircea Trofin [Wed, 20 Jan 2021 19:19:16 +0000 (11:19 -0800)]
Revert "[NPM][Inliner] Factor ImportedFunctionStats in the InlineAdvisor"

This reverts commit e8aec763a57e211420dfceb2a8dc6b88574924f3.

3 years ago[flang] Fix ASSOCIATE statement name resolution
peter klausler [Wed, 20 Jan 2021 01:09:55 +0000 (17:09 -0800)]
[flang] Fix ASSOCIATE statement name resolution

F18 Clause 19.4p9 says:

  The associate names of an ASSOCIATE construct have the scope of the
  block.

Clause 11.3.1p1 says the ASSOCIATE statement is not itself in the block:

  R1102 associate-construct is:  associate-stmt block end-associate-stmt

Associate statement associations are currently fully processed from left
to right, incorrectly interposing associating entities earlier in the
list on same-named entities in the host scope.

    1  program p
    2    logical :: a = .false.
    3    real :: b = 9.73
    4    associate (b => a, a => b)
    5      print*, a, b
    6    end associate
    7    print*, a, b
    8  end

Associating names 'a' and 'b' at line 4 in this code are now both
aliased to logical host entity 'a' at line 2.  This happens because the
reference to 'b' in the second association incorrectly resolves 'b' to
the entity in line 4 (already associated to 'a' at line 2), rather than
the 'b' at line 3.  With bridge code to process these associations,
f18 output is:

 F F
 F 9.73

It should be:

 9.73 F
 F 9.73

To fix this, names in right-hand side selector variables/expressions
must all be resolved before any left-hand side entities are resolved.
This is done by maintaining a stack of lists of associations, rather
than a stack of associations.  Each ASSOCIATE statement's list of
assocations is then visited once for right-hand side processing, and
once for left-hand side processing.

Note that other construct associations do not have this problem.
SELECT RANK and SELECT TYPE each have a single assocation, not a list.
Constraint C1113 prohibits the right-hand side of a CHANGE TEAM
association from referencing any left-hand side entity.

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

3 years ago[NPM][Inliner] Factor ImportedFunctionStats in the InlineAdvisor
Mircea Trofin [Tue, 19 Jan 2021 18:05:25 +0000 (10:05 -0800)]
[NPM][Inliner] Factor ImportedFunctionStats in the InlineAdvisor

When using 2 InlinePass instances in the same CGSCC - one for other
mandatory inlinings, the other for the heuristic-driven ones - the order
in which the ImportedFunctionStats would be output-ed would depend on
the destruction order of the inline passes, which is not deterministic.

This patch moves the ImportedFunctionStats responsibility to the
InlineAdvisor to address this problem.

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

3 years agoRevert "[DAGCombiner] Enable SimplifyDemandedBits vector support for TRUNCATE"
Hans Wennborg [Wed, 20 Jan 2021 19:03:02 +0000 (20:03 +0100)]
Revert "[DAGCombiner] Enable SimplifyDemandedBits vector support for TRUNCATE"

It caused "Vector shift amounts must be in the same as their first arg"
asserts in Chromium builds. See the code review for repro instructions.

> Add DemandedElts support inside the TRUNCATE analysis.
>
> Differential Revision: https://reviews.llvm.org/D56387

This reverts commit cad4275d697c601761e0819863f487def73c67f8.

3 years agoRevert "[clang] Change builtin object size when subobject is invalid"
George Burgess IV [Wed, 20 Jan 2021 18:56:21 +0000 (10:56 -0800)]
Revert "[clang] Change builtin object size when subobject is invalid"

This reverts commit 275f30df8ad6de75e1f29e4b33eaeb67686caf0d.

As noted on the code review (https://reviews.llvm.org/D92892), this
change causes us to reject valid code in a few cases. Reverting so we
have more time to figure out what the right fix{es are, is} here.

3 years ago[COFF] Use range for on relocations, NFC
Reid Kleckner [Wed, 20 Jan 2021 19:00:58 +0000 (11:00 -0800)]
[COFF] Use range for on relocations, NFC

3 years ago[BuildLibcalls] Mark some libcalls with inaccessiblememonly and inaccessiblemem_or_ar...
Dávid Bolvanský [Wed, 20 Jan 2021 18:45:13 +0000 (19:45 +0100)]
[BuildLibcalls] Mark some libcalls with inaccessiblememonly and inaccessiblemem_or_argmemonly

Reviewed By: jdoerfert

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

3 years ago[RISCV] Remove unnecessary APInt copy. NFC
Craig Topper [Wed, 20 Jan 2021 18:32:03 +0000 (10:32 -0800)]
[RISCV] Remove unnecessary APInt copy. NFC

getAPIntValue returns a const APInt& so keep it as a reference.

3 years ago[X86][AVX] Handle vperm2x128 shuffling of a subvector splat.
Simon Pilgrim [Wed, 20 Jan 2021 18:15:39 +0000 (18:15 +0000)]
[X86][AVX] Handle vperm2x128 shuffling of a subvector splat.

We already handle "vperm2x128 (ins ?, X, C1), (ins ?, X, C1), 0x31" for shuffling of the upper subvectors, but we weren't dealing with the case when we were splatting the upper subvector from a single source.

3 years ago[AArch64] Fix -Wunused-but-set-variable in GCC -DLLVM_ENABLE_ASSERTIONS=off build
Fangrui Song [Wed, 20 Jan 2021 18:14:10 +0000 (10:14 -0800)]
[AArch64] Fix -Wunused-but-set-variable in GCC -DLLVM_ENABLE_ASSERTIONS=off build

3 years ago[MLIR][Standard] Add log1p operation to std
Frederik Gossen [Wed, 20 Jan 2021 17:52:55 +0000 (18:52 +0100)]
[MLIR][Standard] Add log1p operation to std

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

3 years ago[PowerPC][Power10] Exploit splat instruction xxsplti32dx in Power10
Albion Fung [Wed, 20 Jan 2021 17:55:03 +0000 (12:55 -0500)]
[PowerPC][Power10] Exploit splat instruction xxsplti32dx in Power10

Exploits the instruction xxsplti32dx.

It can be used to materialize any 64 bit scalar/vector splat by using two instances, one for the upper 32 bits and the other for the lower 32 bits. It should not materialize the cases which can be materialized by using the instruction xxspltidp.

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

3 years ago[lldb/Commands] Refactor ProcessLaunchCommandOptions to use TableGen (NFC)
Med Ismail Bennani [Wed, 20 Jan 2021 17:33:00 +0000 (18:33 +0100)]
[lldb/Commands] Refactor ProcessLaunchCommandOptions to use TableGen (NFC)

This patch refactors the current implementation of
`ProcessLaunchCommandOptions` to be generated by TableGen.

The patch also renames the class to `CommandOptionsProcessLaunch` to
align better with the rest of the codebase style and moves it to
separate files.

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

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
3 years ago[mlir] fix the rocm runtime wrapper to account for cuda / rocm api differences
Tobias Gysi [Wed, 20 Jan 2021 17:35:51 +0000 (18:35 +0100)]
[mlir] fix the rocm runtime wrapper to account for cuda / rocm api differences

The patch adapts the rocm runtime wrapper due to subtle differences between the cuda and the rocm/hip runtime api.

Reviewed By: csigg

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

3 years agoAvoid unused variable warning in opt mode
Jacques Pienaar [Wed, 20 Jan 2021 17:45:22 +0000 (09:45 -0800)]
Avoid unused variable warning in opt mode

3 years ago[RISCV] Add way to mark CompressPats that should only be used for compressing.
Craig Topper [Wed, 20 Jan 2021 17:19:57 +0000 (09:19 -0800)]
[RISCV] Add way to mark CompressPats that should only be used for compressing.

There can be muliple patterns that map to the same compressed
instruction. Reversing those leads to multiple ways to uncompress
an instruction, but its not easily controllable which one will
be chosen by the tablegen backend.

This patch adds a flag to mark patterns that should only be used
for compressing. This allows us to leave one canonical pattern
for uncompressing.

The obvious benefit of this is getting c.mv to uncompress to
the addi patern that is aliased to the mv pseudoinstruction. For
the add/and/or/xor/li patterns it just removes some unreachable
code from the generated code.

Reviewed By: frasercrmck

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

3 years ago[mlir][Affine] Add support for multi-store producer fusion
Diego Caballero [Wed, 20 Jan 2021 01:24:57 +0000 (03:24 +0200)]
[mlir][Affine] Add support for multi-store producer fusion

This patch adds support for producer-consumer fusion scenarios with
multiple producer stores to the AffineLoopFusion pass. The patch
introduces some changes to the producer-consumer algorithm, including:

* For a given consumer loop, producer-consumer fusion iterates over its
producer candidates until a fixed point is reached.

* Producer candidates are gathered beforehand for each iteration of the
consumer loop and visited in reverse program order (not strictly guaranteed)
to maximize the number of loops fused per iteration.

In general, these changes were needed to simplify the multi-store producer
support and remove some of the workarounds that were introduced in the past
to support more fusion cases under the single-store producer limitation.

This patch also preserves the existing functionality of AffineLoopFusion with
one minor change in behavior. Producer-consumer fusion didn't fuse scenarios
with escaping memrefs and multiple outgoing edges (from a single store).
Multi-store producer scenarios will usually (always?) have multiple outgoing
edges so we couldn't fuse any with escaping memrefs, which would greatly limit
the applicability of this new feature. Therefore, the patch enables fusion for
these scenarios. Please, see modified tests for specific details.

Reviewed By: andydavis1, bondhugula

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

3 years ago[OpenMP][NVPTX] Replaced CUDA builtin vars with LLVM intrinsics
Shilei Tian [Wed, 20 Jan 2021 17:01:51 +0000 (12:01 -0500)]
[OpenMP][NVPTX] Replaced CUDA builtin vars with LLVM intrinsics

Replaced CUDA builtin vars with LLVM intrinsics such that we don't need
definitions of those intrinsics.

Reviewed By: JonChesterfield

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

3 years ago[AMDGPU] pin lit test divergent-unswitch.ll to the old pass manager
Sameer Sahasrabuddhe [Wed, 20 Jan 2021 16:32:09 +0000 (22:02 +0530)]
[AMDGPU] pin lit test divergent-unswitch.ll to the old pass manager

The loop-unswitch transform should not be performed on a loop whose
condition is divergent. For this to happen correctly, divergence
analysis must be available. The existing divergence analysis has not
been ported to the new pass manager yet. As a result, loop unswitching
on the new pass manager is currently unsafe on targets that care about
divergence.

This test is temporarily disabled to unblock work on the new pass
manager. The issue is now tracked in bug 48819.

Reviewed By: foad

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

3 years ago[SLP] reduce reduction code for checking vectorizable ops; NFC
Sanjay Patel [Wed, 20 Jan 2021 13:32:47 +0000 (08:32 -0500)]
[SLP] reduce reduction code for checking vectorizable ops; NFC

This is another step towards removing `OperationData` and
fixing FMF matching/propagation bugs when forming reductions.

3 years ago[SLP] refactor more reduction functions; NFC
Sanjay Patel [Wed, 20 Jan 2021 13:11:30 +0000 (08:11 -0500)]
[SLP] refactor more reduction functions; NFC

We were able to remove almost all of the state from
OperationData, so these don't make sense as members
of that class - just pass the RecurKind in as a param.

More streamlining is possible, but I'm trying to avoid
logic/typo bugs while fixing this. Eventually, we should
not need the `OperationData` class.

3 years ago[SLP] move reduction createOp functions; NFC
Sanjay Patel [Tue, 19 Jan 2021 19:13:59 +0000 (14:13 -0500)]
[SLP] move reduction createOp functions; NFC

We were able to remove almost all of the state from
OperationData, so these don't make sense as members
of that class - just pass the RecurKind in as a param.

3 years ago[docs] Fix overly specific link to uploading patches on Phabricator
Louis Dionne [Mon, 18 Jan 2021 20:08:55 +0000 (15:08 -0500)]
[docs] Fix overly specific link to uploading patches on Phabricator

The documentation for contributing to LLVM currently links to the section
explaining how to submit a Phabricator review using the web interface.
I believe it would be better to link to the general page for using
Phabricator instead, which explains how to sign up with Phabricator,
and also how to submit patches using either the web interface or the
command-line.

I think this is worth changing because what currently *appears* to be our
preferred way of submitting a patch (through the web interface) isn't
actually what we prefer. Indeed, patches submitted from the command-line
have more meta-data available (such as which repository the patch targets),
and also can't suffer from missing context.

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

3 years agoLoop peeling: check that latch is conditional branch
Joseph Tremoulet [Wed, 20 Jan 2021 16:01:09 +0000 (11:01 -0500)]
Loop peeling: check that latch is conditional branch

Loop peeling assumes that the loop's latch is a conditional branch.  Add
a check to canPeel that explicitly checks for this, and testcases that
otherwise fail an assertion when trying to peel a loop whose back-edge
is a switch case or the non-unwind edge of an invoke.

Reviewed By: skatkov, fhahn

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

3 years agoImplement dynamic mapAnyOf in terms of ASTNodeKinds
Stephen Kelly [Sun, 17 Jan 2021 16:29:49 +0000 (16:29 +0000)]
Implement dynamic mapAnyOf in terms of ASTNodeKinds

This reduces template bloat, but more importantly, makes it possible to
construct one from clang-query without template types.

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

3 years ago[libomptarget][devicertl] Wrap source in declare target pragmas
Jon Chesterfield [Wed, 20 Jan 2021 15:50:41 +0000 (15:50 +0000)]
[libomptarget][devicertl] Wrap source in declare target pragmas

[libomptarget][devicertl] Wrap source in declare target pragmas

Factored out of D93135 / D94745. C++ and cuda ignore unknown pragmas
so this is a NFC for the current implementation language. Removes noise
from patches for building deviceRTL as openmp.

Reviewed By: tianshilei1992

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

3 years ago[libc++] Split re.alg tests into locale-dependent and independent tests
Alex Richardson [Wed, 20 Jan 2021 15:43:57 +0000 (15:43 +0000)]
[libc++] Split re.alg tests into locale-dependent and independent tests

Currently all these tests are XFAILED on Linux even though the problem
only seems to be with the few checks that look at collation. To retain
test coverage this splits the locale-dependent tests into a separate
.pass.cpp that is XFAILed as before.
This commit also XFAILs the locale-dependent tests on FreeBSD since the
[=M=] and [.ch.] behaviour for cs_CZ also doesn't seem to match the
behaviour that is expected by these tests.

Reviewed By: #libc, ldionne

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

3 years agoMake it possible to store a ASTNodeKind in VariantValue
Stephen Kelly [Sun, 17 Jan 2021 16:24:01 +0000 (16:24 +0000)]
Make it possible to store a ASTNodeKind in VariantValue

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

3 years ago[DAGCombiner] Enable SimplifyDemandedBits vector support for TRUNCATE
Simon Pilgrim [Wed, 20 Jan 2021 15:39:30 +0000 (15:39 +0000)]
[DAGCombiner] Enable SimplifyDemandedBits vector support for TRUNCATE

Add DemandedElts support inside the TRUNCATE analysis.

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

3 years agoRevert "Following up on PR48517, fix handling of template arguments that refer"
Hans Wennborg [Wed, 20 Jan 2021 14:25:33 +0000 (15:25 +0100)]
Revert "Following up on PR48517, fix handling of template arguments that refer"

Combined with 'da98651 - Revert "DR2064:
decltype(E) is only a dependent', this change (5a391d3) caused verifier
errors when building Chromium. See https://crbug.com/1168494#c1 for a
reproducer.

Additionally it reverts changes that were dependent on this one, see
below.

> Following up on PR48517, fix handling of template arguments that refer
> to dependent declarations.
>
> Treat an id-expression that names a local variable in a templated
> function as being instantiation-dependent.
>
> This addresses a language defect whereby a reference to a dependent
> declaration can be formed without any construct being value-dependent.
> Fixing that through value-dependence turns out to be problematic, so
> instead this patch takes the approach (proposed on the core reflector)
> of allowing the use of pointers or references to (but not values of)
> dependent declarations inside value-dependent expressions, and instead
> treating template arguments as dependent if they evaluate to a constant
> involving such dependent declarations.
>
> This ends up affecting a bunch of OpenMP tests, due to OpenMP
> imprecisely handling instantiation-dependent constructs, bailing out
> early instead of processing dependent constructs to the extent possible
> when handling the template.
>
> Previously committed as 8c1f2d15b826591cdf6bd6b468b8a7d23377b29e, and
> reverted because a dependency commit was reverted.

This reverts commit 5a391d38ac6c561ba908334d427f26124ed9132e.

It also restores clang/test/SemaCXX/coroutines.cpp to its state before
da986511fb9da1a46a0ca4dba2e49e2426036303.

Revert "[c++20] P1907R1: Support for generalized non-type template arguments of scalar type."

> Previously committed as 9e08e51a20d0d2b1c5724bb17e969d036fced4cd, and
> reverted because a dependency commit was reverted. This incorporates the
> following follow-on commits that were also reverted:
>
7e84aa1b81e72d44bcc58ffe1731bfc7abb73ce0 by Simon Pilgrim
ed13d8c66781b50ff007cb089c5905f9bb9e8af2 by me
95c7b6cadbc9a3d4376ef44edbeb3c8bb5b8d7fc by Sam McCall
430d5d8429473c2b10b109991d7577a3cea41140 by Dave Zarzycki

This reverts commit 4b574008aef5a7235c1f894ab065fe300d26e786.

Revert "[msabi] Mangle a template argument referring to array-to-pointer decay"

> [msabi] Mangle a template argument referring to array-to-pointer decay
> applied to an array the same as the array itself.
>
> This follows MS ABI, and corrects a regression from the implementation
> of generalized non-type template parameters, where we "forgot" how to
> mangle this case.

This reverts commit 18e093faf726d15f210ab4917142beec51848258.

3 years agoRevert "[TableGen] Improve algorithm for inheriting class template args and fields"
Paul C. Anagnostopoulos [Wed, 20 Jan 2021 14:44:54 +0000 (09:44 -0500)]
Revert "[TableGen] Improve algorithm for inheriting class template args and fields"

This reverts commit c056f824340ff0189f3ef7870b83e3730de401d1.

That commit causes build failures.

3 years ago[X86][AVX] Fold extract_subvector(VSRLI/VSHLI(x,32)) -> VSRLI/VSHLI(extract_subvector...
Simon Pilgrim [Wed, 20 Jan 2021 14:19:18 +0000 (14:19 +0000)]
[X86][AVX] Fold extract_subvector(VSRLI/VSHLI(x,32)) -> VSRLI/VSHLI(extract_subvector(x),32)

As discussed on D56387, if we're shifting to extract the upper/lower half of a vXi64 vector then we're actually better off performing this at the subvector level as its very likely to fold into something.

combineConcatVectorOps can perform this in reverse if necessary.

3 years ago[TableGen] Improve algorithm for inheriting class template args and fields
Paul C. Anagnostopoulos [Fri, 8 Jan 2021 14:44:27 +0000 (09:44 -0500)]
[TableGen] Improve algorithm for inheriting class template args and fields

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

3 years ago[AArch64] Add support for the GNU ILP32 ABI
Amanieu d'Antras [Wed, 20 Jan 2021 13:30:47 +0000 (13:30 +0000)]
[AArch64] Add support for the GNU ILP32 ABI

Add the aarch64[_be]-*-gnu_ilp32 targets to support the GNU ILP32 ABI for AArch64.

The needed codegen changes were mostly already implemented in D61259, which added support for the watchOS ILP32 ABI. The main changes are:
- Wiring up the new target to enable ILP32 codegen and MC.
- ILP32 va_list support.
- ILP32 TLSDESC relocation support.

There was existing MC support for ELF ILP32 relocations from D25159 which could be enabled by passing "-target-abi ilp32" to llvm-mc. This was changed to check for "gnu_ilp32" in the target triple instead. This shouldn't cause any issues since the existing support was slightly broken: it was generating ELF64 objects instead of the ELF32 object files expected by the GNU ILP32 toolchain.

This target has been tested by running the full rustc testsuite on a big-endian ILP32 system based on the GCC ILP32 toolchain.

Reviewed By: kristof.beyls

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

3 years ago[SCEV] Add a test with wrong exit counts. (NFC)
Mindong Chen [Wed, 20 Jan 2021 12:26:16 +0000 (20:26 +0800)]
[SCEV] Add a test with wrong exit counts. (NFC)

This patch pre-commits a test case with wrong exit count
analysis for D92367.

Reviewed by: mkazantsev

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

3 years ago[PM] Avoid duplicates in the Used/Preserved/Required sets
Bjorn Pettersson [Mon, 11 Jan 2021 12:08:38 +0000 (13:08 +0100)]
[PM] Avoid duplicates in the Used/Preserved/Required sets

The pass analysis uses "sets" implemented using a SmallVector type
to keep track of Used, Preserved, Required and RequiredTransitive
passes. When having nested analyses we could end up with duplicates
in those sets, as there was no checks to see if a pass already
existed in the "set" before pushing to the vectors. This idea with
this patch is to avoid such duplicates by avoiding pushing elements
that already is contained when adding elements to those sets.

To align with the above PMDataManager::collectRequiredAndUsedAnalyses
is changed to skip adding both the Required and RequiredTransitive
passes to its result vectors (since RequiredTransitive always is
a subset of Required we ended up with duplicates when traversing
both sets).

Main goal with this is to avoid spending time verifying the same
analysis mulitple times in PMDataManager::verifyPreservedAnalysis
when iterating over the Preserved "set". It is assumed that removing
duplicates from a "set" shouldn't have any other negative impact
(I have not seen any problems so far). If this ends up causing
problems one could do some uniqueness filtering of the vector being
traversed in verifyPreservedAnalysis instead.

Reviewed By: foad

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

3 years ago[clangd] Extend find-refs to include overrides.
Haojian Wu [Fri, 8 Jan 2021 10:56:30 +0000 (11:56 +0100)]
[clangd] Extend find-refs to include overrides.

find-references on `virtual void meth^od() = 0` will include override references.

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

3 years agoFix cuda-runner tests.
Christian Sigg [Wed, 20 Jan 2021 12:11:03 +0000 (13:11 +0100)]
Fix cuda-runner tests.

3 years ago[AArch64] Add missing "flagm" feature to the .arch_extension directive.
Mark Murray [Tue, 19 Jan 2021 09:58:43 +0000 (09:58 +0000)]
[AArch64] Add missing "flagm" feature to the .arch_extension directive.

Depends on D94970

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

3 years ago[AArch64] Add missing "pauth" feature to the .arch_extension directive.
Mark Murray [Mon, 18 Jan 2021 17:23:47 +0000 (17:23 +0000)]
[AArch64] Add missing "pauth" feature to the .arch_extension directive.

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

3 years ago[clangd] Fix division by zero when computing scores
Kadir Cetinkaya [Fri, 15 Jan 2021 10:12:11 +0000 (11:12 +0100)]
[clangd] Fix division by zero when computing scores

NameMatch could be a float close to zero, in such cases we were
dividing by zero and moreover propogating a "NaN" to clients, which is invalid
per JSON.

This fixes the issue by only using Quality scores whenever the NameMatch is low,
as we do in CodeCompletion ranking.

Fixes https://github.com/clangd/clangd/issues/648.

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

3 years ago[llvm-symbolizer][doc] Reorder --relativenames in options list
James Henderson [Tue, 12 Jan 2021 10:11:49 +0000 (10:11 +0000)]
[llvm-symbolizer][doc] Reorder --relativenames in options list

This puts it in alphabetical order, matching the rest of the list.

Reviewed by: MaskRay, saugustine

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

3 years ago[LV] Add test cases with multiple exits which require versioning.
Florian Hahn [Wed, 20 Jan 2021 11:43:59 +0000 (11:43 +0000)]
[LV] Add test cases with multiple exits which require versioning.

This adds some test coverage for
caafdf07bbccbe89219539e2b56043c2a98358f1, which relaxed an assertion
to only require a unique exit block.

3 years ago[LLD][ELF] Correct test temporary file paths
Jeremy Morse [Wed, 20 Jan 2021 11:43:27 +0000 (11:43 +0000)]
[LLD][ELF] Correct test temporary file paths

In 8031785f4a7ebd the temporary object being built was moved to %t/main.o,
but not all run lines were updated to reflect this. Observe the failure
on this buildbot:

  http://lab.llvm.org:8011/#/builders/5/builds/3646/steps/9/logs/stdio

It might pass locally for some people due to a stale %t.o hanging around
the build directory.

3 years agoAdded check if there are regions that do not implement the RegionBranchOpInterface.
Julian Gross [Wed, 13 Jan 2021 10:13:41 +0000 (11:13 +0100)]
Added check if there are regions that do not implement the RegionBranchOpInterface.

Add a check if regions do not implement the RegionBranchOpInterface. This is not
allowed in the current deallocation steps. Furthermore, we handle edge-cases,
where a single region is attached and the parent operation has no results.

This fixes: https://bugs.llvm.org/show_bug.cgi?id=48575

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

3 years ago[mlir] Link mlir_runner_utils statically into cuda/rocm-runtime-wrappers.
Christian Sigg [Mon, 11 Jan 2021 12:04:09 +0000 (13:04 +0100)]
[mlir] Link mlir_runner_utils statically into cuda/rocm-runtime-wrappers.

The runtime-wrappers depend on LLVMSupport, pulling in static initialization code (e.g. command line arguments). Dynamically loading multiple such libraries results in ODR violoations.

So far this has not been an issue, but in D94421, I would like to load both the async-runtime and the cuda-runtime-wrappers as part of a cuda-runner integration test. When doing this, code that asserts that an option category is only registered once fails (note that I've only experienced this in Google's bazel where the async-runtime depends on LLVMSupport, but a similar issue would happen in cmake if more than one runtime-wrapper starts to depend on LLVMSupport).

The underlying issue is that we have a mix of static and dynamic linking. If all dependencies were loaded as shared objects (i.e. if LLVMSupport was linked dynamically to the runtime wrappers), each dependency would only get loaded once. However, linking dependencies dynamically would require special attention to paths (one could dynamically load the dependencies first given explicit paths). The simpler approach seems to be to link all dependencies statically into a single shared object.

This change basically applies the same logic that we have in the c_runner_utils: we have a shared object target that can be loaded dynamically, and we have a static library target that can be linked to other runtime-wrapper shared object targets.

Reviewed By: herhut

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

3 years ago[PostRASched] Regenerate Whole Test with update_llc_test_checks.py
Arun R [Wed, 20 Jan 2021 11:00:15 +0000 (16:30 +0530)]
[PostRASched] Regenerate Whole Test with update_llc_test_checks.py

Reviewed by xbolva00

Reviewers: llvm-commits, MatzeB, craig.topper, kparzysz, efriedma, pengfei, wxiao3, xbolva00

Subscribers: llvm-commits, xbolva00

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

3 years ago[Coroutine] Remain alignment information when merging frame variables
Chuanqi Xu [Wed, 20 Jan 2021 10:54:46 +0000 (18:54 +0800)]
[Coroutine] Remain alignment information when merging frame variables

Summary: This is to address bug48712.
The solution in this patch is that when we want to merge two variable a
into the storage frame of variable b only if the alignment of a is
multiple of b.
There may be other strategies. But now I think they are hard to handle
and benefit little. Or we can implement them in the future.

Test-plan: check-llvm

Reviewers: jmorse, lxfind, junparser

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

3 years ago[AMDGPU][GlobalISel] Avoid selecting S_PACK with constants
Mirko Brkusanin [Wed, 20 Jan 2021 10:38:05 +0000 (11:38 +0100)]
[AMDGPU][GlobalISel] Avoid selecting S_PACK with constants

If constants are hidden behind G_ANYEXT we can treat them same way as G_SEXT.
For that purpose we extend getConstantVRegValWithLookThrough with option
to handle G_ANYEXT same way as G_SEXT.

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