platform/upstream/llvm.git
4 years ago[pstl] Do not install the __config_site.in file
Louis Dionne [Wed, 8 Jul 2020 18:51:30 +0000 (14:51 -0400)]
[pstl] Do not install the __config_site.in file

The generated version of the file is already installed -- we shouldn't
install the pre-generation version of the file.

4 years ago[DAGCombiner] clean up in mergeConsecutiveStores(); NFC
Sanjay Patel [Wed, 8 Jul 2020 18:47:21 +0000 (14:47 -0400)]
[DAGCombiner] clean up in mergeConsecutiveStores(); NFC

4 years ago[DAGCombiner] fix code comment and improve readability; NFC
Sanjay Patel [Wed, 8 Jul 2020 17:02:18 +0000 (13:02 -0400)]
[DAGCombiner] fix code comment and improve readability; NFC

4 years ago[ELF] Enforce double-dash form for --warn-backrefs-exclude
Fangrui Song [Wed, 8 Jul 2020 18:43:48 +0000 (11:43 -0700)]
[ELF] Enforce double-dash form for --warn-backrefs-exclude

This is an LLD-specific option. We have enforced double-dash forms for
other options (reduce collision with short options) but missed this one.

4 years ago[pstl] Fix a few errors when running PSTL tests through the libc++ test suite
Louis Dionne [Wed, 8 Jul 2020 18:38:59 +0000 (14:38 -0400)]
[pstl] Fix a few errors when running PSTL tests through the libc++ test suite

4 years agoSILoadStoreOptimizer: add support for GFX10 image instructions
Jay Foad [Thu, 11 Jun 2020 16:42:30 +0000 (17:42 +0100)]
SILoadStoreOptimizer: add support for GFX10 image instructions

GFX10 image instructions use one or more address operands starting at
vaddr0, instead of a single vaddr operand, to allow for NSA forms.

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

4 years ago[AMDGPU] Fix and simplify AMDGPULegalizerInfo::legalizeUDIV_UREM32Impl
Jay Foad [Mon, 22 Jun 2020 16:17:17 +0000 (17:17 +0100)]
[AMDGPU] Fix and simplify AMDGPULegalizerInfo::legalizeUDIV_UREM32Impl

Use the algorithm from AMDGPUCodeGenPrepare::expandDivRem32.

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

4 years ago[AMDGPU] Fix and simplify AMDGPUTargetLowering::LowerUDIVREM
Jay Foad [Mon, 22 Jun 2020 16:11:58 +0000 (17:11 +0100)]
[AMDGPU] Fix and simplify AMDGPUTargetLowering::LowerUDIVREM

Use the algorithm from AMDGPUCodeGenPrepare::expandDivRem32.

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

4 years ago[AMDGPU] Fix and simplify AMDGPUCodeGenPrepare::expandDivRem32
Jay Foad [Mon, 22 Jun 2020 14:27:37 +0000 (15:27 +0100)]
[AMDGPU] Fix and simplify AMDGPUCodeGenPrepare::expandDivRem32

Fix the division/remainder algorithm by adding a second quotient
refinement step, which is required in some cases like
0xFFFFFFFFu / 0x11111111u (https://bugs.llvm.org/show_bug.cgi?id=46212).

Also document, rewrite and simplify it by ensuring that we always have a
lower bound on inv(y), which simplifies the UNR step and the quotient
refinement steps.

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

4 years ago[SVE] Remove calls to VectorType::getNumElements from Scalar
Christopher Tetreault [Wed, 8 Jul 2020 18:00:57 +0000 (11:00 -0700)]
[SVE] Remove calls to VectorType::getNumElements from Scalar

Reviewers: efriedma, fhahn, reames, kmclaughlin, sdesmalen

Reviewed By: sdesmalen

Subscribers: tschuett, hiraditya, rkruppe, psnobl, dantrushin, llvm-commits

Tags: #llvm

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

4 years ago[libc++] Reimplement platform detection features without running on the test host
Louis Dionne [Wed, 8 Jul 2020 18:04:45 +0000 (14:04 -0400)]
[libc++] Reimplement platform detection features without running on the test host

It's sufficient to sniff the platform we're running on using the compiler
macros -- we don't need to run any code.

4 years ago[test] Add REQUIRES: x86-registered-target to tools/obj2yaml/COFF/bss.s
Fangrui Song [Wed, 8 Jul 2020 17:53:30 +0000 (10:53 -0700)]
[test] Add REQUIRES: x86-registered-target to tools/obj2yaml/COFF/bss.s

4 years ago[Support] Define llvm::parallel::strategy for -DLLVM_ENABLE_THREADS=off builds after...
Fangrui Song [Wed, 8 Jul 2020 17:50:53 +0000 (10:50 -0700)]
[Support] Define llvm::parallel::strategy for -DLLVM_ENABLE_THREADS=off builds after D76885

4 years agoRemove the unnecessary `is_nothrow_swappable` condition in `swap`.
Michael Park [Wed, 8 Jul 2020 17:46:02 +0000 (10:46 -0700)]
Remove the unnecessary `is_nothrow_swappable` condition in `swap`.

Thanks to @lewissbaker who pointed out the unnecessary condition in
https://reviews.llvm.org/D81954#inline-756872. Since this codepath does not
make use of `swap` anyway (that codepath is a different branch), we can safely
remove this condition and produce better codegen when all types are nothrow
movable but are potentially-throwing swappable.

See codegen in https://gcc.godbolt.org/z/uDFZjz

Reviewed By: ldionne, #libc

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

4 years ago[X86] Enabled a bunch of 64-bit Interlocked* functions intrinsics on 32-bit Windows...
Craig Topper [Wed, 8 Jul 2020 17:39:56 +0000 (10:39 -0700)]
[X86] Enabled a bunch of 64-bit Interlocked* functions intrinsics on 32-bit Windows to match recent MSVC

This enables _InterlockedAnd64/_InterlockedOr64/_InterlockedXor64/_InterlockedDecrement64/_InterlockedIncrement64/_InterlockedExchange64/_InterlockedExchangeAdd64/_InterlockedExchangeSub64 on 32-bit Windows

The backend already knows how to expand these to a loop using cmpxchg8b on 32-bit targets.

Fixes PR46595

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

4 years agohwasan: Don't pass the tagged-globals target-feature to non-aarch64 backends.
Craig Topper [Wed, 8 Jul 2020 17:17:44 +0000 (10:17 -0700)]
hwasan: Don't pass the tagged-globals target-feature to non-aarch64 backends.

The other backends don't know what this feature is and print a
message to stderr.

I recently tried to rework some target feature stuff in X86 and
this unknown feature tripped an assert I added.

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

4 years ago[ELF] Rename canRelax to toExecRelax. NFC
Fangrui Song [Wed, 8 Jul 2020 17:27:31 +0000 (10:27 -0700)]
[ELF] Rename canRelax to toExecRelax. NFC

In the absence of TLS relaxation (rewrite of code sequences),
there is still an applicable optimization:

[gd]: General Dynamic: resolve DTPMOD to 1 and/or resolve DTPOFF statically

All the other relaxations are only performed when transiting to
executable (`!config->shared`).
Since [gd] is handled differently, we can fold `!config->shared` into canRelax
and simplify its use sites. Rename the variable to reflect to new semantics.

Reviewed By: grimar, psmith

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

4 years ago[test] Run llvm/test/**/*.yaml & don't run llvm/test/**/*.cxx (not exist)
Fangrui Song [Wed, 8 Jul 2020 17:22:49 +0000 (10:22 -0700)]
[test] Run llvm/test/**/*.yaml & don't run llvm/test/**/*.cxx (not exist)

This patch extends D58439 (`llvm/test/{yaml2obj,obj2yaml}/**/*.yaml`) and runs all
`llvm/test/**/*.yaml`

Many directories have configured `.yaml` (see the deleted lit.local.cfg
files). Yet still some don't configure .yaml and have caused stale tests:

8c5825befb7bbb2e76f7eccedc6d3bf26e9b2a6a test/llvm-readobj
bdc3134e237737dd46b51cd1ecd41ecbbe9f921a test/ExecutionEngine

Just hoist .yaml to `llvm/test/lit.cfg.py`. Also delete .cxx which is
not used.  The number of tests running on my machine increases from 38304 to 38309.
The list of new tests:

```
ExecutionEngine/RuntimeDyld/X86/ELF_x86-64_none.yaml
Object/archive-error-tmp.txt
tools/llvm-ar/coff-weak.yaml
tools/llvm-readobj/ELF/verneed-flags.yaml
tools/obj2yaml/COFF/bss.s
```

Reviewed By: grimar, jhenderson, rupprecht

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

4 years ago[ELF] Add -z dead-reloc-in-nonalloc=<section_glob>=<value>
Fangrui Song [Wed, 8 Jul 2020 17:10:43 +0000 (10:10 -0700)]
[ELF] Add -z dead-reloc-in-nonalloc=<section_glob>=<value>

... to customize the tombstone value we use for an absolute relocation
referencing a discarded symbol. This can be used as a workaround when
some debug processing tool has trouble with current -1 tombstone value
(https://bugs.chromium.org/p/chromium/issues/detail?id=1102223#c11 )

For example, to get the current built-in rules (not considering the .debug_line special case for ICF):

```
-z dead-reloc-in-nonalloc='.debug_*=0xffffffffffffffff'
-z dead-reloc-in-nonalloc=.debug_loc=0xfffffffffffffffe
-z dead-reloc-in-nonalloc=.debug_ranges=0xfffffffffffffffe
```

To get GNU ld (as of binutils 2.35)'s behavior:

```
-z dead-reloc-in-nonalloc='*=0'
-z dead-reloc-in-nonalloc=.debug_ranges=1
```

This option has other use cases. For example, if we want to check
whether a non-SHF_ALLOC section has dead relocations.
With this patch, we can run a regular LLD and run another with a special
-z dead-reloc-in-nonalloc=, then compare their output.

Reviewed By: thakis

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

4 years ago[flang] Fix a crash when cosubscript list is empty
Pete Steinfeld [Wed, 8 Jul 2020 17:05:04 +0000 (10:05 -0700)]
[flang] Fix a crash when cosubscript list is empty

Summary:
When there are errors in the evaluation of every cosubscript expression in a
coindexed object, the compiler would crash.  I fixed this by just checking to
see if there were errors in the evaluation of the cosubscripts before
constructing the `DataRef` for the coindexed object.

Reviewers: klausler, tskeith, DavidTruby

Subscribers: llvm-commits

Tags: #llvm

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

4 years ago[CUDA][HIP] Let lambda be host device by default
Yaxun (Sam) Liu [Fri, 17 Apr 2020 03:51:40 +0000 (23:51 -0400)]
[CUDA][HIP] Let lambda be host device by default

This patch let lambda be host device by default and adds diagnostics for
capturing host variable by reference in device lambda.

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

4 years ago[RecordLayout] Fix ItaniumRecordLayoutBuilder so that is grabs the correct bases...
shafik [Wed, 8 Jul 2020 17:02:13 +0000 (10:02 -0700)]
[RecordLayout] Fix ItaniumRecordLayoutBuilder so that is grabs the correct bases class offsets from the external source

Currently the ItaniumRecordLayoutBuilder when laying out base classes has the virtual
and non-virtual bases mixed up when pulling the base class layouts from the external source.

This came up in an LLDB bug where on arm64 because of differences in how it deals with
tail padding would layout the bases differently without the correct layout from the
external source (LLDB). This would result in some fields being off by 4 bytes.

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

4 years ago[libc++][NFC] Remove outdated TODO item
Louis Dionne [Wed, 8 Jul 2020 17:04:17 +0000 (13:04 -0400)]
[libc++][NFC] Remove outdated TODO item

4 years ago[DAGCombiner] fix function-name formatting; NFC
Sanjay Patel [Wed, 8 Jul 2020 15:57:45 +0000 (11:57 -0400)]
[DAGCombiner] fix function-name formatting; NFC

4 years ago[DAGCombiner] add enum for store source value; NFC
Sanjay Patel [Wed, 8 Jul 2020 15:48:41 +0000 (11:48 -0400)]
[DAGCombiner] add enum for store source value; NFC

This removes existing code duplication and allows us to
assert that we are handling the expected cases.

We have a list of outstanding bugs that could benefit by
handling truncated source values, so that's a possible
addition going forward.

4 years ago[X86][SSE] Pull out PACK(SHUFFLE(),SHUFFLE()) folds into its own function. NFC.
Simon Pilgrim [Wed, 8 Jul 2020 16:07:41 +0000 (17:07 +0100)]
[X86][SSE] Pull out PACK(SHUFFLE(),SHUFFLE()) folds into its own function. NFC.

Future patches will extend this so declutter combineVectorPack before we start.

4 years ago[X86] Fix copy+paste typo in combineVectorPack assert message. NFC.
Simon Pilgrim [Wed, 8 Jul 2020 15:54:47 +0000 (16:54 +0100)]
[X86] Fix copy+paste typo in combineVectorPack assert message. NFC.

4 years ago[NewPM] Add PredicateInfoPrinterPass to PassRegistry.def
Arthur Eubanks [Wed, 8 Jul 2020 16:27:57 +0000 (09:27 -0700)]
[NewPM] Add PredicateInfoPrinterPass to PassRegistry.def

Fixes tests under NPM in Transforms/Util/PredicateInfo.

4 years ago[SampleFDO] Enable sample-profile-top-down-load and sample-profile-merge-inlinee
Wei Mi [Tue, 30 Jun 2020 21:32:46 +0000 (14:32 -0700)]
[SampleFDO] Enable sample-profile-top-down-load and sample-profile-merge-inlinee
by default.

sample-profile-top-down-load is an internal option which can enable top-down
order of inlining and profile annotation in sample profile load pass. It was
found to be beneficial for better profile annotation.

Recently we found it could also solve some build time issue. Suppose function
A has many callsites in function B. In the last release binary where sample
profile was collected, the outline copy of A is large because there are many
other functions inlined into A. However although all the callsites calling A
in B are inlined, but every inlined body is small (A was inlined into B
before other functions are inlined into A), there is no build time issue in
last release.

In an optimized build using the sample profile collected from last release,
without top-down inlining, we saw a case that A got very large because of
inlining, and then multiple callsites of A got inlined into B, and that led
to a huge B which caused significant build time issue besides profile
annotation issue.

To solve that problem, the patch enables the flag
sample-profile-top-down-load by default. sample-profile-top-down-load can
have better performance when it is enabled together with
sample-profile-merge-inlinee so in this patch we also enable
sample-profile-merge-inlinee by default.

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

4 years ago[SystemZ] Allow specifying integer registers as part of the address calculation
Ulrich Weigand [Wed, 8 Jul 2020 16:17:03 +0000 (18:17 +0200)]
[SystemZ] Allow specifying integer registers as part of the address calculation

Revision e1de2773a534957305d7a559c6d88c4b5ac354e2 provided support for
accepting integer registers in inline asm i.e.

__asm("lhi %r0, 5") -> lhi %r0, 5
__asm("lhi 0, 5") -> lhi 0,5

This patch aims to extend this support to instructions which compute
addresses as well. (i.e instructions of type BDMem and BD[X|R|V|L]Mem)

Author: anirudhp

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

4 years agoDomTree: remove explicit use of DomTreeNodeBase::iterator
Nicolai Hähnle [Thu, 2 Jul 2020 18:36:30 +0000 (20:36 +0200)]
DomTree: remove explicit use of DomTreeNodeBase::iterator

Summary:
Almost all uses of these iterators, including implicit ones, really
only need the const variant (as it should be). The only exception is
in NewGVN, which changes the order of dominator tree child nodes.

Change-Id: I4b5bd71e32d71b0c67b03d4927d93fe9413726d4

Reviewers: arsenm, RKSimon, mehdi_amini, courbet, rriddle, aartbik

Subscribers: wdng, Prazek, hiraditya, kuhar, rogfer01, rriddle, jpienaar, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, aartbik, liufengdb, stephenneuendorffer, Joonsoo, grosul1, vkmr, Kayjukh, jurahul, msifontes, cfe-commits, llvm-commits

Tags: #clang, #mlir, #llvm

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

4 years agoRevert "Double check that passes correctly set their Modified status"
serge-sans-paille [Wed, 8 Jul 2020 16:13:59 +0000 (18:13 +0200)]
Revert "Double check that passes correctly set their Modified status"

This reverts commit 37afd99c768b29c7df7c5f2eb645362fb61f9915.

4 years ago[matrix] Add some more Verifier negative tests. NFC.
Sjoerd Meijer [Wed, 8 Jul 2020 16:04:23 +0000 (17:04 +0100)]
[matrix] Add some more Verifier negative tests. NFC.

4 years ago[libc++] Mark some tests as unsupported on GCC 5
Louis Dionne [Wed, 8 Jul 2020 15:09:03 +0000 (11:09 -0400)]
[libc++] Mark some tests as unsupported on GCC 5

There used to be a workaround where we'd pretend that GCC 5 didn't support
C++14 because it doesn't implement it properly. Since that workaround has
been removed (in 1eb211ada17a), we need to mark a few individual tests as
failing with GCC 5.

4 years ago[NewPM][opt] Translate "-O#" to NPM's "default<O#>"
Arthur Eubanks [Wed, 8 Jul 2020 15:56:27 +0000 (08:56 -0700)]
[NewPM][opt] Translate "-O#" to NPM's "default<O#>"

 Fixes 52 check-llvm tests under NPM.

Reviewed By: hans

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

4 years ago[clang] Fix a crash when passing a C structure of incompatible type to a function...
Aleksandr Platonov [Wed, 8 Jul 2020 15:46:30 +0000 (16:46 +0100)]
[clang] Fix a crash when passing a C structure of incompatible type to a function with a reference parameter.

__builtin_va_*() and __builtin_ms_va_*() are declared as functions with a
parameter of reference type.

This patch fixes a crash when using these functions in C where an argument
of structure type is incompatible with the parameter type.

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

Reviewed By: riccibruno

Patch by: Aleksandr Platonov <platonov.aleksandr@huawei.com>

4 years ago[libc] Fix typographical error in math_utils.h.
Chris Gyurgyik [Wed, 8 Jul 2020 15:56:21 +0000 (11:56 -0400)]
[libc] Fix typographical error in math_utils.h.

4 years ago[NewPM][opt] Share -disable-loop-unrolling between pass managers
Arthur Eubanks [Wed, 8 Jul 2020 15:50:22 +0000 (08:50 -0700)]
[NewPM][opt] Share -disable-loop-unrolling between pass managers

There's no reason to introduce a new option for the NPM.
The various PGO options are shared in this manner.

Reviewed By: echristo

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

4 years ago[MIR] Speedup parsing of function with large number of basic blocks
Evgeny Leviant [Wed, 8 Jul 2020 15:50:00 +0000 (18:50 +0300)]
[MIR] Speedup parsing of function with large number of basic blocks

Patch eliminates string length calculation when lexing a token. Speedup can be up to
1000x.

Differential revision: https://reviews.llvm.org/D83389

4 years ago[Preallocated] Add @llvm.call.preallocated.teardown
Arthur Eubanks [Wed, 8 Jul 2020 15:48:44 +0000 (08:48 -0700)]
[Preallocated] Add @llvm.call.preallocated.teardown

This cleans up the stack allocated by a @llvm.call.preallocated.setup.
Should either call the teardown or the preallocated call to clean up the
stack. Calling both is UB.

Add LangRef.

Add verifier check that the token argument is a @llvm.call.preallocated.setup.

Reviewed By: efriedma

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

4 years agopartial revert on RTBuilder.h to avoid warnings.
Eric Schweitz [Wed, 8 Jul 2020 15:47:13 +0000 (08:47 -0700)]
partial revert on RTBuilder.h to avoid warnings.

4 years ago[lldb] Modernize/clean up ValueObject::GetChildMemberWithName
Pavel Labath [Wed, 8 Jul 2020 15:33:58 +0000 (17:33 +0200)]
[lldb] Modernize/clean up ValueObject::GetChildMemberWithName

4 years ago[SelectionDAG] Fix incorrect offset when expanding CONCAT_VECTORS.
Paul Walker [Wed, 8 Jul 2020 15:12:22 +0000 (15:12 +0000)]
[SelectionDAG] Fix incorrect offset when expanding CONCAT_VECTORS.

ExpandVectorBuildThroughStack is also used for CONCAT_VECTORS.
However, when calculating the offsets for each of the operands we
incorrectly use the element size rather than actual size and thus
the stores overlap.

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

4 years ago[clang][NFC] Also test for serialization in test/AST/ast-dump-APValue-*
Bruno Ricci [Wed, 8 Jul 2020 15:36:48 +0000 (16:36 +0100)]
[clang][NFC] Also test for serialization in test/AST/ast-dump-APValue-*

This does not actually exercise the serialization of APValue, but it
will at least prevent a regression in the future. NFC.

4 years agoDouble check that passes correctly set their Modified status
serge-sans-paille [Thu, 28 May 2020 10:40:17 +0000 (12:40 +0200)]
Double check that passes correctly set their Modified status

The approach is simple: if a pass reports that it's not modifying a
Function/Module, compute a loose hash of that Function/Module and compare it
with the original one. If we report no change but there's a hash change, then we
have an error.

This approach misses a lot of change but it's not super intrusive and can
detect most of the simple mistakes.

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

4 years ago[clangd] Improve serialization error messages. NFC
Sam McCall [Wed, 8 Jul 2020 15:30:24 +0000 (17:30 +0200)]
[clangd] Improve serialization error messages. NFC

4 years ago[OpenMPIRBuilder][Fix] Move llvm::omp::types to OpenMPIRBuilder.
sstefan1 [Sun, 5 Jul 2020 13:24:36 +0000 (15:24 +0200)]
[OpenMPIRBuilder][Fix] Move llvm::omp::types to OpenMPIRBuilder.

Summary:
D82193 exposed a problem with global type definitions in
`OMPConstants.h`. This causes a race when running in thinLTO mode.
Types now live inside of OpenMPIRBuilder to prevent this from happening.

Reviewers: jdoerfert

Subscribers: yaxunl, hiraditya, guansong, dexonsmith, aaron.ballman, cfe-commits, llvm-commits

Tags: #clang, #llvm

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

4 years agoSLP: honor requested max vector size merging PHIs
Stanislav Mekhanoshin [Fri, 19 Jun 2020 18:48:37 +0000 (11:48 -0700)]
SLP: honor requested max vector size merging PHIs

At the moment this place does not check maximum size set
by TTI and just creates a maximum possible vectors.

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

4 years ago[clangd] Enable reading config from files behind a flag
Sam McCall [Mon, 6 Jul 2020 15:23:08 +0000 (17:23 +0200)]
[clangd] Enable reading config from files behind a flag

Reviewers: kadircet, hokein

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits

Tags: #clang

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

4 years ago[flang] Upstreaming intrinsic call lowering.
Eric Schweitz [Tue, 7 Jul 2020 22:39:09 +0000 (15:39 -0700)]
[flang] Upstreaming intrinsic call lowering.

This module implements the lowering of Fortran intrinsics to the
corresponding calls in support libraries (the Fortran runtime, math
libraries, etc.)

This revision is a tad larger because there are a large number of Fortran
intrinsics and this adds lowering for a fair number of them.

Differential revision: https://reviews.llvm.org/D83355

4 years ago[flang] Support for image selectors
Pete Steinfeld [Tue, 7 Jul 2020 19:15:39 +0000 (12:15 -0700)]
[flang] Support for image selectors

Summary:
This change implements support for image selectors and image selector
specifications as described in section 9.6.

In check-coarray[.h,cpp] I changed the `Leave()` function for
`parser::ImageSelectorSpec` to take a `parser::ImageSelector`, which
contains a list of image selector specifications.  This allows us to
detect when the same specification is used more than once.  I also added
code to analyze the expressions for the image selector specifications to
expression.cpp and a test for all of the conditions to check at
compile-time.

Note that we do not check at compile-time to see if the value of the
cosubscripts are within the specified cobounds.  We also do not check anything
related to selecting a valid team.  We also do not check that the denotation of
the `stat-variable` is not dependent on the evaluation of an entity in the
same statement.

Reviewers: klausler, tskeith, DavidTruby

Subscribers: llvm-commits

Tags: #llvm, #flang

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

4 years ago[CodeGen] Don't combine extract + concat vectors with non-legal types
Ties Stuij [Wed, 8 Jul 2020 12:12:30 +0000 (13:12 +0100)]
[CodeGen] Don't combine extract + concat vectors with non-legal types

Summary:
The following combine currently breaks in the DAGCombiner:

```
extract_vector_elt (concat_vectors v4i16:a, v4i16:b), x
   -> extract_vector_elt a, x
```

This happens because after we have combined these nodes we have inserted nodes
that use individual instances of the vector element type. In the above example
i16. However this isn't a legal type on all backends, and when the combining pass calls
the legalizer it breaks as it expects types to already be legal. The type legalizer has
already been run, and running it again would make a mess of the nodes.

In the example code at least, the generated code is still efficient after the change.

Reviewers: miyuki, arsenm, dmgreen, lebedev.ri

Reviewed By: miyuki, lebedev.ri

Subscribers: lebedev.ri, wdng, hiraditya, steven.zhang, llvm-commits

Tags: #llvm

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

4 years agoFix crash on overloaded postfix unary operators due to invalid sloc
Eduardo Caldas [Wed, 24 Jun 2020 15:11:31 +0000 (15:11 +0000)]
Fix crash on overloaded postfix unary operators due to invalid sloc

Subscribers: cfe-commits

Tags: #clang

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

4 years ago[NVPTX]Add a test for debug info for packed bitfields, NFC.
Alexey Bataev [Wed, 8 Jul 2020 13:09:57 +0000 (09:09 -0400)]
[NVPTX]Add a test for debug info for packed bitfields, NFC.

4 years ago[mlir] Add ViewLikeOpInterface to std.memref_cast.
Alexander Belyaev [Wed, 8 Jul 2020 11:44:36 +0000 (13:44 +0200)]
[mlir] Add ViewLikeOpInterface to std.memref_cast.

Summery:  It's needed for correct work of BufferPlacement.

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

4 years ago[flang] Fix setting mxcsr on MSVC
Isuru Fernando [Wed, 8 Jul 2020 12:19:01 +0000 (07:19 -0500)]
[flang] Fix setting mxcsr on MSVC

Reviewers: sscalpone, jdoerfert, #flang, DavidTruby, jeanPerier

Reviewed By: jeanPerier

Subscribers: richard.barton.arm, jeanPerier, ro, llvm-commits

Tags: #llvm, #flang

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

4 years ago[x86] improve codegen for non-splat bit-masked vector compare and select (PR46531)
Sanjay Patel [Wed, 8 Jul 2020 12:20:49 +0000 (08:20 -0400)]
[x86] improve codegen for non-splat bit-masked vector compare and select (PR46531)

vselect ((X & Pow2C) == 0), LHS, RHS --> vselect ((shl X, C') < 0), RHS, LHS

Follow-up to D83073 - the non-splat mask cases where we actually see an
improvement are quite limited from what I can tell. AVX1 needs multiply
and blend capabilities and AVX2 needs vector shift and blend capabilities.
The intersection of those 2 constraints is only vectors with 32-bit or
64-bit elements.

XOP is/was better.

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

4 years ago[lldb/Core] Update comment to make it more explicit (NFC)
Med Ismail Bennani [Wed, 8 Jul 2020 12:01:54 +0000 (14:01 +0200)]
[lldb/Core] Update comment to make it more explicit (NFC)

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
4 years agoclang: Don't show a trailing space with --version when not built from the repo
Sylvestre Ledru [Wed, 8 Jul 2020 11:33:34 +0000 (13:33 +0200)]
clang: Don't show a trailing space with --version when not built from the repo

Reported here:
https://bugs.llvm.org/show_bug.cgi?id=38998#c15

Reviewers: hans

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

4 years ago[lldb/Utility] Simplify Scalar float accessors
Pavel Labath [Wed, 8 Jul 2020 11:54:33 +0000 (13:54 +0200)]
[lldb/Utility] Simplify Scalar float accessors

Make use of APFloat conversion methods to avoid needing to switch based
on the stored value type.

4 years ago[AST][RecoveryExpr] Fix the value category for recovery expr.
Haojian Wu [Wed, 8 Jul 2020 11:53:47 +0000 (13:53 +0200)]
[AST][RecoveryExpr] Fix the value category for recovery expr.

RecoveryExpr was always lvalue, but it is wrong if we use it to model
broken function calls, function call expression has more compliated rules:

- a call to a function whose return type is an lvalue reference yields an lvalue;
- a call to a function whose return type is an rvalue reference yields an xvalue;
- a call to a function whose return type is nonreference type yields a prvalue;

This patch makes the recovery-expr align with the function call if it is
modeled a broken call.

Differential revision: https://reviews.llvm.org/D83201

4 years ago[lldb/API] Overwrite variables with SBLaunchInfo::SetEnvironment(append=true)
Pavel Labath [Mon, 6 Jul 2020 14:44:37 +0000 (16:44 +0200)]
[lldb/API] Overwrite variables with SBLaunchInfo::SetEnvironment(append=true)

Summary:
This function was documented to overwrite entries with D76111, which was
adding a couple of similar functions. However, this function (unlike the
functions added in that patch) was/is not actually overwriting variables
-- any pre-existing variables would get ignored.

This behavior does not seem to be intentional. In fact, before the refactor in
D41359, this function could introduce duplicate entries, which could
have very surprising effects both inside lldb and on other applications
(some applications would take the first value, some the second one; in
lldb, attempting to unset a variable could make the second variable
become active, etc.).

Overwriting seems to be the most reasonable behavior here, so change the
code to match documentation.

Reviewers: clayborg, wallace, jingham

Subscribers: lldb-commits

Tags: #lldb

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

4 years ago[cmake] Use CMAKE_GENERATOR to determine if Ninja is used
Michael Forney [Wed, 8 Jul 2020 10:42:39 +0000 (12:42 +0200)]
[cmake] Use CMAKE_GENERATOR to determine if Ninja is used

The name of the make program does not necessarily match "ninja",
especially if an alternative implementation like samurai is used.

Using CMAKE_GENERATOR is a more robust detection method, and is
already used elsewhere in this file.

Differential revision: https://reviews.llvm.org/D77091

4 years ago[X86][AVX] SimplifyDemandedVectorEltsForTargetShuffle - ensure mask is same size...
Simon Pilgrim [Wed, 8 Jul 2020 10:47:43 +0000 (11:47 +0100)]
[X86][AVX] SimplifyDemandedVectorEltsForTargetShuffle - ensure mask is same size as constant size

Fixes test regression reported on D81791

4 years agoAdd missing REQUIRES: x86-registered-target
Alex Richardson [Wed, 8 Jul 2020 10:38:13 +0000 (11:38 +0100)]
Add missing REQUIRES: x86-registered-target

This should fix build bot failures after a80afc032859ebe65af283f76b38a0f5921b683f

4 years ago[lldb][NFC] Fix indentation in expect_expr
Raphael Isemann [Wed, 8 Jul 2020 10:32:07 +0000 (12:32 +0200)]
[lldb][NFC] Fix indentation in expect_expr

4 years ago[GlobalISel][InlineAsm] Fix matching input constraints to mem operand
Petar Avramovic [Wed, 8 Jul 2020 10:32:17 +0000 (12:32 +0200)]
[GlobalISel][InlineAsm] Fix matching input constraints to mem operand

Mark matching input constraint to mem operand as not supported.

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

4 years ago[X86][AVX] Add SimplifyDemandedVectorEltsForTargetShuffle test for v32i8->v16i8 PSHUFB
Simon Pilgrim [Wed, 8 Jul 2020 10:26:16 +0000 (11:26 +0100)]
[X86][AVX] Add SimplifyDemandedVectorEltsForTargetShuffle test for v32i8->v16i8 PSHUFB

On SKX targets we end up loading a v16i8 PSHUFB mask from a v32i8 constant and scaling incorrectly indexes the demanded elts mask - we're missing a check that the constant pool is the same size as the loaded mask.

Test case from D81791 post-commit review.

4 years ago[Support] Fix signed/unsigned comparison warning
Oliver Stannard [Wed, 8 Jul 2020 10:24:03 +0000 (11:24 +0100)]
[Support] Fix signed/unsigned comparison warning

4 years ago[UpdateTestChecks] Add UTC_ARGS support for update_{llc,cc}_test_checks.py
Alex Richardson [Wed, 8 Jul 2020 09:59:50 +0000 (10:59 +0100)]
[UpdateTestChecks] Add UTC_ARGS support for update_{llc,cc}_test_checks.py

https://reviews.llvm.org/D69701 added support for on-the-fly argument
changes for update scripts. I recently wanted to keep some manual check
lines in a test generated by update_cc_test_checks.py in our CHERI fork, so
this commit adds support for UTC_ARGS in update_cc_test_checks.py. And since
I was refactoring the code to be in common.py, I also added it for
update_llc_test_checks.py.

Reviewed By: jdoerfert, MaskRay
Differential Revision: https://reviews.llvm.org/D78478

4 years ago[UpdateTestChecks] Move more update_test_checks.py logic to common.py
Alex Richardson [Tue, 7 Jul 2020 15:38:28 +0000 (16:38 +0100)]
[UpdateTestChecks] Move more update_test_checks.py logic to common.py

I intend to reuse this to add UTC_ARGS support for update_llc_test_checks.py
and update_cc_test_checks.py in D78478.

Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D78618

4 years ago[SVE] Custom ISel for fixed length extract/insert_subvector.
Paul Walker [Wed, 8 Jul 2020 09:10:16 +0000 (09:10 +0000)]
[SVE] Custom ISel for fixed length extract/insert_subvector.

We use extact_subvector and insert_subvector to "cast" between
fixed length and scalable vectors.  This patch adds custom c++
based ISel for the following cases:

  fixed_vector = ISD::EXTRACT_SUBVECTOR scalable_vector, 0
  scalable_vector = ISD::INSERT_SUBVECTOR undef(scalable_vector), fixed_vector, 0

Which result in either EXTRACT_SUBREG/INSERT_SUBREG for NEON sized
vectors or COPY_TO_REGCLASS otherwise.

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

4 years ago[lldb] Skip TestIOHandlerResizeNoEditline on Windows
Raphael Isemann [Wed, 8 Jul 2020 09:45:30 +0000 (11:45 +0200)]
[lldb] Skip TestIOHandlerResizeNoEditline on Windows

It seems opening the empty file and trying use that file object as an input
stream doesn't work on Windows. Skipping it for now.

4 years ago[MLIR][SPIRVToLLVM] Implementation of spv.BitFieldSExtract and spv.BitFieldUExtract...
George Mitenkov [Wed, 8 Jul 2020 08:33:27 +0000 (11:33 +0300)]
[MLIR][SPIRVToLLVM] Implementation of spv.BitFieldSExtract and spv.BitFieldUExtract patterns

This patch adds conversion patterns for `spv.BitFieldSExtract` and `spv.BitFieldUExtract`.
As in the patch for `spv.BitFieldInsert`, `offset` and `count` have to be broadcasted in
vector case and casted to match the type of the base.

Reviewed By: antiagainst

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

4 years ago[DWARF] Add cuttoff guarding quadratic validThroughout behaviour
Jeremy Morse [Wed, 8 Jul 2020 09:01:14 +0000 (10:01 +0100)]
[DWARF] Add cuttoff guarding quadratic validThroughout behaviour

Occasionally we see absolutely massive basic blocks, typically in global
constructors that are vulnerable to heavy inlining. When these blocks are
dense with DBG_VALUE instructions, we can hit near quadratic complexity in
DwarfDebug's validThroughout function. The problem is caused by:

  * validThroughout having to step through all instructions in the block to
    examine their lexical scope,
  * and a high proportion of instructions in that block being DBG_VALUEs
    for a unique variable fragment,

Leading to us stepping through every instruction in the block, for (nearly)
each instruction in the block.

By adding this guard, we force variables in large blocks to use a location
list rather than a single-location expression, as shown in the added test.
This shouldn't change the meaning of the output DWARF at all: instead we
use a less efficient DWARF encoding to avoid a poor-performance code path.

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

4 years ago[NFCI][llvm-reduce] Cleanup Delta passes to use Oracle abstraction
Roman Lebedev [Wed, 8 Jul 2020 09:05:15 +0000 (12:05 +0300)]
[NFCI][llvm-reduce] Cleanup Delta passes to use Oracle abstraction

Summary:
I think, this results in much more understandable/readable flow.
At least the original logic was perhaps the most hard thing for me to grasp when taking an initial look on the delta passes.

Reviewers: nickdesaulniers, dblaikie, diegotf, george.burgess.iv

Reviewed By: nickdesaulniers

Subscribers: llvm-commits

Tags: #llvm

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

4 years agoFix MSVC "not all control paths return a value" warnings. NFC.
Simon Pilgrim [Wed, 8 Jul 2020 09:18:20 +0000 (10:18 +0100)]
Fix MSVC "not all control paths return a value" warnings. NFC.

4 years ago[X86][AVX] Remove redundant EXTRACT_VECTOR_ELT(VBROADCAST(SCALAR())) fold
Simon Pilgrim [Tue, 7 Jul 2020 19:30:16 +0000 (20:30 +0100)]
[X86][AVX] Remove redundant EXTRACT_VECTOR_ELT(VBROADCAST(SCALAR())) fold

Noticed while looking for similar cases to rG931ec74f7a29 - SimplifyDemandedVectorElts and shuffle combining both should handle this now.

4 years ago[DebugInfo/DWARF] - Test invalid CFI opcodes properly and refine related `CFIProgram...
Georgii Rymar [Tue, 30 Jun 2020 12:02:28 +0000 (15:02 +0300)]
[DebugInfo/DWARF] - Test invalid CFI opcodes properly and refine related `CFIProgram::parse` code.

There are following issues with `CFIProgram::parse` code:

1) Invalid CFI opcodes were never tested. And currently a test would fail
when the `LLVM_ENABLE_ABI_BREAKING_CHECKS` is enabled. It happens because
the `DataExtractor::Cursor C` remains unchecked when the
"Invalid extended CFI opcode" error is reported:

```
.eh_frame section at offset 0x1128 address 0x0:
Program aborted due to an unhandled Error:
Error value was Success. (Note: Success values must still be checked prior to being destroyed).
```

2) It is impossible to reach the "Invalid primary CFI opcode" error with the current code.
There are 3 possible primary opcode values and all of them are handled. Hence this error
should be replaced with llvm_unreachable.

3) Errors currently reported are upper-case.

This patch refines the code in the `CFIProgram::parse` method to fix all issues mentioned
and adds unit tests for all possible invalid extended CFI opcodes.

Differential revision: https://reviews.llvm.org/D82868

4 years ago[llvm-readobj] - Refine error reporting in MipsGOTParser<ELFT> helper.
Georgii Rymar [Tue, 7 Jul 2020 15:13:26 +0000 (18:13 +0300)]
[llvm-readobj] - Refine error reporting in MipsGOTParser<ELFT> helper.

This is a follow-up for D83225. This does the following:
1) Adds missing tests for existent errors.
2) Stops using `unwrapOrError` to propagate errors to caller.
   (I am trying to get rid of all `unwrapOrErr` calls in the llvm-readelf code).
3) Improves error messages reported slightly.

Differential revision: https://reviews.llvm.org/D83314

4 years ago[CodeGen] Fix wrong use of getVectorNumElements() in DAGTypeLegalizer::SplitVecRes_Ex...
David Sherwood [Fri, 3 Jul 2020 12:32:02 +0000 (13:32 +0100)]
[CodeGen] Fix wrong use of getVectorNumElements() in DAGTypeLegalizer::SplitVecRes_ExtendOp

In DAGTypeLegalizer::SplitVecRes_ExtendOp I have replaced an invalid
call to getVectorNumElements() with a call to getVectorMinNumElements(),
since the code path works for both fixed and scalable vectors.

This fixes up a warning in the following test:

  sve-sext-zext.ll

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

4 years ago[CodeGen] Fix wrong use of getVectorNumElements in PromoteIntRes_EXTRACT_SUBVECTOR
David Sherwood [Fri, 3 Jul 2020 12:21:27 +0000 (13:21 +0100)]
[CodeGen] Fix wrong use of getVectorNumElements in PromoteIntRes_EXTRACT_SUBVECTOR

Calling getVectorNumElements() is not safe for scalable vectors and we
should normally use getVectorElementCount() instead. However, for the
code changed in this patch I decided to simply move the instantiation of
the variable 'OutNumElems' lower down to the place where only fixed-width
vectors are used, and hence it is safe to call getVectorNumElements().

Fixes up one warning in this test:

  sve-sext-zext.ll

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

4 years ago[analyzer] Silence gcc -Wparentheses warning [NFC]
Mikael Holmen [Wed, 8 Jul 2020 08:14:53 +0000 (10:14 +0200)]
[analyzer] Silence gcc -Wparentheses warning [NFC]

4 years ago[CodeGen] Fix warnings in sve-ld1-addressing-mode-reg-imm.ll
David Sherwood [Thu, 2 Jul 2020 11:24:45 +0000 (12:24 +0100)]
[CodeGen] Fix warnings in sve-ld1-addressing-mode-reg-imm.ll

For the GetElementPtr case in function
  AddressingModeMatcher::matchOperationAddr
I've changed the code to use the TypeSize class instead of relying
upon the implicit conversion to a uint64_t. As part of this we now
check for scalable types and if we encounter one just bail out for
now as the subsequent optimisations doesn't currently support them.

This changes fixes up all warnings in the following tests:

  llvm/test/CodeGen/AArch64/sve-ld1-addressing-mode-reg-imm.ll
  llvm/test/CodeGen/AArch64/sve-st1-addressing-mode-reg-imm.ll

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

4 years ago[MLIR][SPIRVToLLVM] Miscellaneous ops conversion: select, fmul and undef
George Mitenkov [Tue, 7 Jul 2020 10:35:45 +0000 (13:35 +0300)]
[MLIR][SPIRVToLLVM] Miscellaneous ops conversion: select, fmul and undef

This patch introduces 3 new direct conversions for SPIR-V ops:
- `spv.Select`
- `spv.Undef`
- `spv.FMul` that was skipped in the patch with arithmetic ops

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

4 years ago[WebAssembly] Generate unreachable after __stack_chk_fail
Heejin Ahn [Wed, 8 Jul 2020 07:59:21 +0000 (00:59 -0700)]
[WebAssembly] Generate unreachable after __stack_chk_fail

`__stack_chk_fail` does not return, but `unreachable` was not generated
following `call __stack_chk_fail`. This had a possibility to generate an
invalid binary for functions with a return type, because
`__stack_chk_fail`'s return type is void and `call __stack_chk_fail` can
be the last instruction in the function whose return type is non-void.
Generating `unreachable` after it makes sure CFGStackify's
`fixEndsAtEndOfFunction` handles it correctly.

Reviewed By: tlively

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

4 years ago[DSE,MSSA] Eliminate stores by terminators (free,lifetime.end).
Florian Hahn [Wed, 8 Jul 2020 07:42:55 +0000 (08:42 +0100)]
[DSE,MSSA] Eliminate stores by terminators (free,lifetime.end).

This patch adds support for eliminating stores by free & lifetime.end
calls. We can remove stores that are not read before calling a memory
terminator and we can eliminate all stores after a memory terminator
until we see a new lifetime.start. The second case seems to not really
trigger much in practice though.

Reviewers: dmgreen, rnk, efriedma, bryant, asbirlea, Tyker

Reviewed By: asbirlea

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

4 years ago[gn build] Port 20e271a98de
LLVM GN Syncbot [Wed, 8 Jul 2020 07:52:15 +0000 (07:52 +0000)]
[gn build] Port 20e271a98de

4 years ago[analyzer] Warning for default constructed unique_ptr dereference
Nithin Vadukkumchery Rajendrakumar [Fri, 26 Jun 2020 00:31:20 +0000 (02:31 +0200)]
[analyzer] Warning for default constructed unique_ptr dereference

Summary: Add support for warning incase of default constructed unique pointer dereferences

Reviewed By: NoQ, Szelethus, vsavchenko, xazax.hun

Tags: #clang

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

4 years agoUpgrade TypePromotionTransaction to be able to report changes in CodeGenPrepare
serge-sans-paille [Tue, 23 Jun 2020 13:44:29 +0000 (15:44 +0200)]
Upgrade TypePromotionTransaction to be able to report changes in CodeGenPrepare

optimizeMemoryInst was reporting no change while still modifying the IR.
Inspect the status of TypePromotionTransaction to get a better status.

Related to https://reviews.llvm.org/D80916

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

4 years agoRename `xla_lhlo.terminator` into `return` in SCF parallel loop test (NFC)
Mehdi Amini [Wed, 8 Jul 2020 04:04:54 +0000 (04:04 +0000)]
Rename `xla_lhlo.terminator` into `return` in SCF parallel loop test (NFC)

It seems that these were inserted here inadvertently instead of using
standard `return`.

4 years agoRevert "[X86] Add back the assert in getImpliedFeatures that I removed in ef4cc70f3ed...
Nico Weber [Wed, 8 Jul 2020 02:56:08 +0000 (22:56 -0400)]
Revert "[X86] Add back the assert in getImpliedFeatures that I removed in ef4cc70f3ed2a91e0a48c6448c517c3ba34c2846"

This reverts commit 91f70675cc6e5c872e0059c11d797b8726eeac67.
It seems to break most (all?) hwasan tests.

4 years ago[openmp][NFC] Remove duplicate clause defaultmap for target parallel do
clementval [Wed, 8 Jul 2020 02:38:13 +0000 (22:38 -0400)]
[openmp][NFC] Remove duplicate clause defaultmap for target parallel do

4 years ago[gn build] Port baca8f977ed
Nico Weber [Wed, 8 Jul 2020 02:29:19 +0000 (22:29 -0400)]
[gn build] Port baca8f977ed

4 years ago[LLDB] Disable flaky lldb-vscode tests on arm
Muhammad Omair Javaid [Wed, 8 Jul 2020 02:02:16 +0000 (07:02 +0500)]
[LLDB] Disable flaky lldb-vscode tests on arm

Summary:
These two tests are flaky on lldb Arm buildbot as well. They are already
being skipped for aarch64. I am going to mark them skipped for Arm.

Tags: #lldb

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

4 years agoRecommit "[X86] Merge the FEATURE_64BIT and FEATURE_EM64T bits in X86TargetParser...
Craig Topper [Wed, 8 Jul 2020 02:01:22 +0000 (19:01 -0700)]
Recommit "[X86] Merge the FEATURE_64BIT and FEATURE_EM64T bits in X86TargetParser.def."

These represent the same thing but 64BIT only showed up from
getHostCPUFeatures providing a list of featuers to clang. While
EM64T showed up from getting the features for a named CPU.

EM64T didn't have a string specifically so it would not be passed
up to clang when getting features for a named CPU. While 64bit
needed a name since that's how it is index.

Merge them by filtering 64bit out before sending features to clang
for named CPUs.

4 years ago[RISCV] optimize addition with a pair of (addi imm)
Ben Shi [Wed, 8 Jul 2020 01:54:22 +0000 (18:54 -0700)]
[RISCV] optimize addition with a pair of (addi imm)

For an addition with an immediate in specific ranges, a pair of
addi-addi can be generated instead of the ordinary lui-addi-add serial.

Reviewed By: MaskRay, luismarques

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

4 years ago[RISCV] Optimize multiplication by constant
Ben Shi [Wed, 8 Jul 2020 01:48:46 +0000 (18:48 -0700)]
[RISCV] Optimize multiplication by constant

... to shift/add or shift/sub.

Do not enable it on riscv32 with the M extension where decomposeMulByConstant
may not be an optimization.

Reviewed By: luismarques, MaskRay

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

4 years ago[mlir][spirv] Add MatrixTimesMatrix operation
HazemAbdelhafez [Wed, 8 Jul 2020 01:32:39 +0000 (21:32 -0400)]
[mlir][spirv] Add MatrixTimesMatrix operation

Add MatrixTimesMatrix operation to SPIRV Dialect and add NoSideEffect trait
to Matrix ops.

Reviewed By: antiagainst

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

4 years agoPR45521: Preserve the value kind when performing a standard conversion
Richard Smith [Wed, 8 Jul 2020 01:25:57 +0000 (18:25 -0700)]
PR45521: Preserve the value kind when performing a standard conversion
sequence on a glvalue expression.

If the sequence is supposed to perform an lvalue-to-rvalue conversion,
then one will be specified as the first conversion in the sequence.
Otherwise, one should not be invented.