platform/upstream/llvm.git
3 years ago[LiveDebugValues] Add `#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)` to suppress...
Fangrui Song [Sat, 19 Sep 2020 00:23:46 +0000 (17:23 -0700)]
[LiveDebugValues] Add `#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)` to suppress -Wunused-function

3 years ago[NFC][LSan] Add REQUIRES: linux
Vitaly Buka [Sat, 19 Sep 2020 00:22:35 +0000 (17:22 -0700)]
[NFC][LSan] Add REQUIRES: linux

Additional registers scaning is only implemented for x86 linux.

3 years ago[AArch64][GlobalISel] Add tests for pre-existing selection support for <4 x s16>...
Amara Emerson [Fri, 18 Sep 2020 23:46:02 +0000 (16:46 -0700)]
[AArch64][GlobalISel] Add tests for pre-existing selection support for <4 x s16> arithmetic/bitwise ops.

3 years ago[AArch64][GlobalISel] Legalize arithmetic ops for <4 x s16>
Amara Emerson [Fri, 18 Sep 2020 23:45:12 +0000 (16:45 -0700)]
[AArch64][GlobalISel] Legalize arithmetic ops for <4 x s16>

3 years ago[NFC][StackSafety] Replace auto with type
Vitaly Buka [Sat, 19 Sep 2020 00:08:21 +0000 (17:08 -0700)]
[NFC][StackSafety] Replace auto with type

Fixes static analyzer is warning.

3 years ago[NFC][Asan] Fix test broken by RegAllocFast
Vitaly Buka [Fri, 18 Sep 2020 23:46:20 +0000 (16:46 -0700)]
[NFC][Asan] Fix test broken by RegAllocFast

The test worked only because by coincidence register with pointer was
clobbered.
After D52010 value is still preserved.

3 years ago[SCEV] Fix an unused variable in -DLLVM_ENABLE_ASSERTIONS=off build
Fangrui Song [Fri, 18 Sep 2020 23:16:14 +0000 (16:16 -0700)]
[SCEV] Fix an unused variable in -DLLVM_ENABLE_ASSERTIONS=off build

3 years ago[GlobalISel] Add lowering support for G_ABS and use for AArch64.
Amara Emerson [Fri, 18 Sep 2020 22:13:12 +0000 (15:13 -0700)]
[GlobalISel] Add lowering support for G_ABS and use for AArch64.

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

3 years ago[PowerPC] Implement Move to VSR Mask builtins in LLVM/Clang
Amy Kwan [Fri, 18 Sep 2020 22:38:08 +0000 (17:38 -0500)]
[PowerPC] Implement Move to VSR Mask builtins in LLVM/Clang

This patch implements the vec_gen[b|h|w|d|q]m function prototypes in altivec.h
in order to utilize the move to VSR with mask instructions introduced in Power10.

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

3 years ago[lld][WebAssembly] Fix -Wunused-variable after D87663
Fangrui Song [Fri, 18 Sep 2020 23:10:39 +0000 (16:10 -0700)]
[lld][WebAssembly] Fix -Wunused-variable after D87663

3 years ago[NFC][sanitizer] Don't use ::testing::internal
Vitaly Buka [Fri, 18 Sep 2020 22:24:46 +0000 (15:24 -0700)]
[NFC][sanitizer] Don't use ::testing::internal

3 years ago[clang] Remove profile available check for fsplit-machine-functions.
Snehasish Kumar [Fri, 18 Sep 2020 21:08:21 +0000 (14:08 -0700)]
[clang] Remove profile available check for fsplit-machine-functions.

Enforcing a profile available check in the driver does not work with
incremental LTO builds where the LTO backend invocation does not include
the profile flags. At this point the profiles have already been consumed
and the IR contains profile metadata. Instead we always pass through the
-fsplit-machine-functions flag on user request. The pass itself contains
a check to return early if no profile information is available.

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

3 years ago[clang][module] Improve incomplete-umbrella warning
Zixu Wang [Tue, 16 Jun 2020 23:39:50 +0000 (16:39 -0700)]
[clang][module] Improve incomplete-umbrella warning

Change the warning message for -Wincomplete-umbrella to report the location of the umbrella header;

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

3 years ago[instcombine][x86] Converted pdep/pext with shifted mask to simple arithmetic
Philip Reames [Fri, 18 Sep 2020 21:53:29 +0000 (14:53 -0700)]
[instcombine][x86] Converted pdep/pext with shifted mask to simple arithmetic

If the mask of a pdep or pext instruction is a shift masked (i.e. one contiguous block of ones) we need at most one and and one shift to represent the operation without the intrinsic. One all platforms I know of, this is faster than the pdep/pext.

The cost modelling for multiple contiguous blocks might be worth exploring in a follow up, but it's not relevant for my current use case. It would almost certainly be a win on AMDs where these are really really slow though.

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

3 years ago[test][InstrProf] Fix always_inline.ll under NPM
Arthur Eubanks [Fri, 18 Sep 2020 18:26:58 +0000 (11:26 -0700)]
[test][InstrProf] Fix always_inline.ll under NPM

NPM's inliner does not clean up dead functions.

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

3 years agoTemporarily Revert "[clangd] Add Random Forest runtime for code completion."
Eric Christopher [Fri, 18 Sep 2020 21:47:43 +0000 (14:47 -0700)]
Temporarily Revert "[clangd] Add Random Forest runtime for code completion."
as a header doesn't appear to have made it into the commit.

This reverts commit 9b6765e784b39c88cb8cdb85ab083e6c95a997ed and followup

3 years ago[spirv] Move device info from resource limit into target env
Lei Zhang [Fri, 18 Sep 2020 21:39:53 +0000 (17:39 -0400)]
[spirv] Move device info from resource limit into target env

Vendor/device information are not resource limits. Moving to
target environment directly for better organization.

Reviewed By: mravishankar

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

3 years ago[COFF] Move per-global .drective emission from AsmPrinter to TLOFCOFF
Reid Kleckner [Fri, 18 Sep 2020 20:43:13 +0000 (13:43 -0700)]
[COFF] Move per-global .drective emission from AsmPrinter to TLOFCOFF

This changes the order of output sections and the output assembly, but
is otherwise NFC.

It simplifies the TLOF interface by removing two COFF-only methods.

3 years ago[llvm-cov] Allow commas in filenames passed to `-object` flag
Vedant Kumar [Fri, 18 Sep 2020 20:43:49 +0000 (13:43 -0700)]
[llvm-cov] Allow commas in filenames passed to `-object` flag

Currently, -object takes a comma separated list of objects as an
argument, which prevents it working with path names that contain a
comma. Drop comma-separated support, which requires to set pass the
-object flag multiple times to set multiple objects.

Patch by Andrew Gallagher!

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

3 years ago[msan][asan] Add runtime flag intercept_strcmp
Vitaly Buka [Fri, 18 Sep 2020 10:00:50 +0000 (03:00 -0700)]
[msan][asan] Add runtime flag intercept_strcmp

Can be used to disable interceptor to workaround issues of
non-instrumented code.

Reviewed By: morehouse, eugenis

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

3 years ago[OpenMP] Initial Support for OpenMP Webpage Documentation
Joseph Huber [Wed, 16 Sep 2020 21:15:56 +0000 (17:15 -0400)]
[OpenMP] Initial Support for OpenMP Webpage Documentation

Summary:
Adding support for generated html documentation for OpenMP. Changing
Cmake files to build the documentation and adding the base templates for
future documentation to be added.

Reviewers: jdoerfert

Subscribers: aaron.ballman arphaman guansong mgorny openmp-commits sstefan1 yaxunl

Tags: #OpenMP

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

3 years agoCompletionModelCodegen: Remove unused import
Nico Weber [Fri, 18 Sep 2020 20:24:54 +0000 (16:24 -0400)]
CompletionModelCodegen: Remove unused import

The unused import is 3.4+, so it also breaks py2.7 compat.
But this is easy to fix :)

3 years agoclang: Make changes in 7c8bb409f31e py2.7-compatible
Nico Weber [Fri, 18 Sep 2020 20:15:24 +0000 (16:15 -0400)]
clang: Make changes in 7c8bb409f31e py2.7-compatible

3 years ago[InstSimplify] add tests for constant folding fmin/fmax with undef op; NFC
Sanjay Patel [Fri, 18 Sep 2020 14:36:24 +0000 (10:36 -0400)]
[InstSimplify] add tests for constant folding fmin/fmax with undef op; NFC

3 years ago[gn build] add file i forgot to add in 929d91a55616
Nico Weber [Fri, 18 Sep 2020 20:01:00 +0000 (16:01 -0400)]
[gn build] add file i forgot to add in 929d91a55616

3 years ago[gn build] (manually) port 9b6765e784b3 more
Nico Weber [Fri, 18 Sep 2020 19:56:15 +0000 (15:56 -0400)]
[gn build] (manually) port 9b6765e784b3 more

3 years agoTemporarily Revert "[SLP] Allow reordering of vectorization trees with reused instruc...
Eric Christopher [Fri, 18 Sep 2020 19:33:12 +0000 (12:33 -0700)]
Temporarily Revert "[SLP] Allow reordering of vectorization trees with reused instructions."
as it's infinite looping on occasion.

This reverts commit 455ca0ebb69210046928fedffe292420a30f89ad.

3 years ago[clang-format] Recognize "hxx" as a C++ header in clang-format-diff.py
Miklos Vajna [Fri, 18 Sep 2020 19:42:38 +0000 (21:42 +0200)]
[clang-format] Recognize "hxx" as a C++ header in clang-format-diff.py

And shift "proto" to the next line to avoid a too long line.

Reviewed By: MyDeveloperDay

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

3 years ago[gn build] Do not sync filenames containing variable references
Nico Weber [Fri, 18 Sep 2020 19:34:21 +0000 (15:34 -0400)]
[gn build] Do not sync filenames containing variable references

3 years agoPre-commit test for CSEing masked loads/stores
Krzysztof Parzyszek [Fri, 18 Sep 2020 19:28:11 +0000 (14:28 -0500)]
Pre-commit test for CSEing masked loads/stores

3 years ago[gn build] (manually) port 9b6765e784b3
Nico Weber [Fri, 18 Sep 2020 19:26:52 +0000 (15:26 -0400)]
[gn build] (manually) port 9b6765e784b3

3 years agoclangd: Make ompletionModelCodegen.py tpy2.7 compatible
Nico Weber [Fri, 18 Sep 2020 19:25:53 +0000 (15:25 -0400)]
clangd:  Make ompletionModelCodegen.py tpy2.7 compatible

LLVM still supports Python 2.7, so unbreak bots that still run that.
In a separate commit so that this is easy to revert once we drop
support :)

3 years agoFirst pass on MLIR python context lifetime management.
Stella Laurenzo [Fri, 18 Sep 2020 07:21:09 +0000 (00:21 -0700)]
First pass on MLIR python context lifetime management.

* Per thread https://llvm.discourse.group/t/revisiting-ownership-and-lifetime-in-the-python-bindings/1769
* Reworks contexts so it is always possible to get back to a py::object that holds the reference count for an arbitrary MlirContext.
* Retrofits some of the base classes to automatically take a reference to the context, elimintating keep_alives.
* More needs to be done, as discussed, when moving on to the operations/blocks/regions.

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

3 years agoscudo: Add an API for disabling memory initialization per-thread.
Peter Collingbourne [Thu, 10 Sep 2020 02:15:26 +0000 (19:15 -0700)]
scudo: Add an API for disabling memory initialization per-thread.

Here "memory initialization" refers to zero- or pattern-init on
non-MTE hardware, or (where possible to avoid) memory tagging on MTE
hardware. With shared TSD the per-thread memory initialization state
is stored in bit 0 of the TLS slot, similar to PointerIntPair in LLVM.

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

3 years ago[X86][AVX] lowerBuildVectorAsBroadcast - improve BROADCASTM lowering on non-VLX targets
Simon Pilgrim [Fri, 18 Sep 2020 18:51:45 +0000 (19:51 +0100)]
[X86][AVX] lowerBuildVectorAsBroadcast - improve BROADCASTM lowering on non-VLX targets

Broadcast to a ZMM type then extract the low subvector.

3 years ago[test][TSan] Fix tests under NPM
Arthur Eubanks [Fri, 18 Sep 2020 18:32:58 +0000 (11:32 -0700)]
[test][TSan] Fix tests under NPM

Under NPM, the TSan passes are split into a module and function pass. A
couple tests were testing for inserted module constructors, which is
only part of the module pass.

3 years ago[InstCombine][SVE] Skip scalable type for InstCombiner::getFlippedStrictnessPredicate...
Huihui Zhang [Fri, 18 Sep 2020 18:26:28 +0000 (11:26 -0700)]
[InstCombine][SVE] Skip scalable type for InstCombiner::getFlippedStrictnessPredicateAndConstant.

We cannot iterate on scalable vector, the number of elements is unknown at compile-time.

Reviewed By: efriedma

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

3 years agoLinewrap & remove some dead typedefs from previous commit
David Blaikie [Fri, 18 Sep 2020 18:22:37 +0000 (11:22 -0700)]
Linewrap & remove some dead typedefs from previous commit

Cleanup for 51a505340dfdfdfd9ab32c7267a74db3cdeefa56

3 years agoDebugInfo: Simplify line table parsing to take all the units together, rather than...
David Blaikie [Fri, 18 Sep 2020 18:17:56 +0000 (11:17 -0700)]
DebugInfo: Simplify line table parsing to take all the units together, rather than CUs and TUs separately

3 years agoPR47468: Fix findPHICopyInsertPoint, so that copies aren't incorrectly inserted after...
James Y Knight [Thu, 17 Sep 2020 22:10:19 +0000 (18:10 -0400)]
PR47468: Fix findPHICopyInsertPoint, so that copies aren't incorrectly inserted after an INLINEASM_BR.

findPHICopyInsertPoint special cases placement in a block with a
callbr or invoke in it. In that case, we must ensure that the copy is
placed before the INLINEASM_BR or call instruction, if the register is
defined prior to that instruction, because it may jump out of the
block.

Previously, the code placed it immediately after the last def _or
use_. This is wrong, if the use is the instruction which may jump.  We
could correctly place it immediately after the last def (ignoring
uses), but that is non-optimal for register pressure.

Instead, place the copy after the last def, or before the
call/inlineasm_br, whichever is later.

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

3 years ago[X86][AVX] Add missing non AVX512VL broadcastm test coverage
Simon Pilgrim [Fri, 18 Sep 2020 18:11:09 +0000 (19:11 +0100)]
[X86][AVX] Add missing non AVX512VL broadcastm test coverage

3 years agoCodeGen: Move split block utility to MachineBasicBlock
Matt Arsenault [Fri, 11 Sep 2020 15:42:44 +0000 (11:42 -0400)]
CodeGen: Move split block utility to MachineBasicBlock

AMDGPU needs this in several places, so consolidate them here.

3 years agoRegAllocFast: Rewrite and improve
Matt Arsenault [Mon, 14 Sep 2020 16:48:12 +0000 (12:48 -0400)]
RegAllocFast: Rewrite and improve

This rewrites big parts of the fast register allocator. The basic
strategy of doing block-local allocation hasn't changed but I tweaked
several details:

Track register state on register units instead of physical
registers. This simplifies and speeds up handling of register aliases.
Process basic blocks in reverse order: Definitions are known to end
register livetimes when walking backwards (contrary when walking
forward then uses may or may not be a kill so we need heuristics).

Check register mask operands (calls) instead of conservatively
assuming everything is clobbered.  Enhance heuristics to detect
killing uses: In case of a small number of defs/uses check if they are
all in the same basic block and if so the last one is a killing use.
Enhance heuristic for copy-coalescing through hinting: We check the
first k defs of a register for COPYs rather than relying on there just
being a single definition.  When testing this on the full llvm
test-suite including SPEC externals I measured:

average 5.1% reduction in code size for X86, 4.9% reduction in code on
aarch64. (ranging between 0% and 20% depending on the test) 0.5%
faster compiletime (some analysis suggests the pass is slightly slower
than before, but we more than make up for it because later passes are
faster with the reduced instruction count)

Also adds a few testcases that were broken without this patch, in
particular bug 47278.

Patch mostly by Matthias Braun

3 years agoReapply "RegAllocFast: Record internal state based on register units"
Matt Arsenault [Tue, 15 Sep 2020 13:16:14 +0000 (09:16 -0400)]
Reapply "RegAllocFast: Record internal state based on register units"

The regressions this caused should be fixed when
https://reviews.llvm.org/D52010 is applied.

This reverts commit a21387c65470417c58021f8d3194a4510bb64f46.

3 years ago[CodeGen] emit CG profile for COFF object file
Zequan Wu [Thu, 17 Sep 2020 02:05:51 +0000 (19:05 -0700)]
[CodeGen] emit CG profile for COFF object file

I forgot to add emission of CG profile for COFF object file, when adding the support (https://reviews.llvm.org/D81775)

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

3 years ago[test][HWAsan] Fix kernel-inline.ll under NPM
Arthur Eubanks [Fri, 18 Sep 2020 17:55:28 +0000 (10:55 -0700)]
[test][HWAsan] Fix kernel-inline.ll under NPM

3 years agoDebugInfo: Tidy up initializing multi-section contributions in DWARFContext
David Blaikie [Fri, 18 Sep 2020 17:54:02 +0000 (10:54 -0700)]
DebugInfo: Tidy up initializing multi-section contributions in DWARFContext

3 years ago[Sema] Handle objc_super special lookup when checking builtin compatibility
Raul Tambre [Fri, 18 Sep 2020 17:07:05 +0000 (20:07 +0300)]
[Sema] Handle objc_super special lookup when checking builtin compatibility

objc_super is special and needs LookupPredefedObjCSuperType() called before performing builtin type comparisons.
This fixes an error when compiling macOS headers. A test is added.

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

3 years ago[ASan][NewPM] Fix byref-args.ll under NPM
Arthur Eubanks [Fri, 18 Sep 2020 17:50:17 +0000 (10:50 -0700)]
[ASan][NewPM] Fix byref-args.ll under NPM

3 years ago[flang] Rework preprocessing of stringification
peter klausler [Thu, 17 Sep 2020 19:19:42 +0000 (12:19 -0700)]
[flang] Rework preprocessing of stringification

Hew more closely to the C17 standard; perform macro replacement
of arguments to function-like macros unless they're being stringified
or pasted.  Test with a model "assert" macro idiom that exposed
the problem.

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

3 years agoAMDGPU: Don't sometimes allow instructions before lowered si_end_cf
Matt Arsenault [Thu, 10 Sep 2020 19:49:09 +0000 (15:49 -0400)]
AMDGPU: Don't sometimes allow instructions before lowered si_end_cf

Since 6524a7a2b9ca072bd7f7b4355d1230e70c679d2f, this would sometimes
not emit the or to exec at the beginning of the block, where it really
has to be. If there is an instruction that defines one of the source
operands, split the block and turn the si_end_cf into a terminator.

This avoids regressions when regalloc fast is switched to inserting
reloads at the beginning of the block, instead of spills at the end of
the block.

In a future change, this should always split the block.

3 years ago[AArch64][GlobalISel] Make <8 x s8> of G_BUILD_VECTOR legal.
Amara Emerson [Fri, 18 Sep 2020 17:23:35 +0000 (10:23 -0700)]
[AArch64][GlobalISel] Make <8 x s8> of G_BUILD_VECTOR legal.

3 years ago[clangd] Add Random Forest runtime for code completion.
Utkarsh Saxena [Tue, 14 Jul 2020 21:12:45 +0000 (23:12 +0200)]
[clangd] Add Random Forest runtime for code completion.

Summary:
[WIP]
- Proposes a json format for representing Random Forest model.
- Proposes a way to test the generated runtime using a test model.

TODO:
- Add generated source code snippet for easier review.
- Fix unused label warning.
- Figure out required using declarations for CATEGORICAL columns from Features.json.
- Necessary Google3 internal modifications for blaze before landing.
- Add documentation for format of the model.
- Document more.

Subscribers: mgorny, ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits

Tags: #clang

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

3 years ago[mlir][shape] Extend shape.cstr_require with a message.
Sean Silva [Fri, 18 Sep 2020 01:16:41 +0000 (18:16 -0700)]
[mlir][shape] Extend shape.cstr_require with a message.

I realized when using this that one can't get very good error messages
without an additional message attribute.

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

3 years ago[clang-format] NFC ensure the clang-format tests remain clang-formatted
mydeveloperday [Fri, 18 Sep 2020 17:16:02 +0000 (18:16 +0100)]
[clang-format] NFC ensure the clang-format tests remain clang-formatted

3 years ago[clang-format] Add a option for the position of Java static import
mydeveloperday [Fri, 18 Sep 2020 17:11:33 +0000 (18:11 +0100)]
[clang-format] Add a option for the position of Java static import

 Some Java style guides and IDEs group Java static imports after
 non-static imports. This patch allows clang-format to control
 the location of static imports.

Patch by: @bc-lee

Reviewed By: MyDeveloperDay, JakeMerdichAMD

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

3 years ago[libomptarget] Disable build of amdgpu plugin as it doesn't build with rocm.
JonChesterfield [Fri, 18 Sep 2020 17:10:27 +0000 (18:10 +0100)]
[libomptarget] Disable build of amdgpu plugin as it doesn't build with rocm.

3 years ago[NFC][ScheduleDAG] Remove unused EntrySU SUnit
Francis Visoiu Mistrih [Thu, 17 Sep 2020 22:41:01 +0000 (15:41 -0700)]
[NFC][ScheduleDAG] Remove unused EntrySU SUnit

EntrySU doesn't seem to be used at all when building the ScheduleDAG.

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

3 years agoUse one more byte to silence a warning from Vistual C++
Jianzhou Zhao [Fri, 18 Sep 2020 16:41:18 +0000 (16:41 +0000)]
Use one more byte to silence a warning from Vistual C++

3 years agoExtending Baremetal toolchain's support for the rtlib option.
Jon Roelofs [Fri, 18 Sep 2020 15:47:37 +0000 (08:47 -0700)]
Extending Baremetal toolchain's support for the rtlib option.

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

Patch by Manuel Carrasco!

3 years ago[MLIR][ODS] Add constBuilderCall for TypeArrayAttr
Andy Ly [Fri, 18 Sep 2020 15:18:12 +0000 (15:18 +0000)]
[MLIR][ODS] Add constBuilderCall for TypeArrayAttr

constBuilderCall was not defined for TypeArrayAttr, resulting in tblgen not emitting the correct code when TypeArrayAttr is used with a default valued attribute.

Reviewed By: antiagainst

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

3 years ago[X86][AVX] lowerBuildVectorAsBroadcast - improve i64 BROADCASTM lowering on 32-bit...
Simon Pilgrim [Fri, 18 Sep 2020 15:35:39 +0000 (16:35 +0100)]
[X86][AVX] lowerBuildVectorAsBroadcast - improve i64 BROADCASTM lowering on 32-bit targets

We already handle the the cases where we have a 'zero extended splat' build vector (a, 0, 0, 0, a, 0, 0, 0, ...) but were missing the case where the 'a' scalar was zero-extended as well - such as i64 -> vXi64 splat cases on 32-bit targets.

3 years ago[DFSan] Add strpbrk wrapper.
Matt Morehouse [Fri, 18 Sep 2020 15:47:31 +0000 (08:47 -0700)]
[DFSan] Add strpbrk wrapper.

Reviewed By: vitalybuka

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

3 years ago[MLIR][SPIRV] Create new ctx for deserialization in roundtrips.
ergawy [Fri, 18 Sep 2020 15:47:37 +0000 (11:47 -0400)]
[MLIR][SPIRV] Create new ctx for deserialization in roundtrips.

Roundtripping SPIR-V modules used the same MLIRContext object for both
ways of the trip. This resulted in deserialization using a context
object already containing Types constructed during serialization.
This commit rectifies that by creating a new MLIRContext during
deserialization.

Reviewed By: mravishankar, antiagainst

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

3 years ago[mlir][openacc] Add missing operands for acc.data operation
Valentin Clement [Fri, 18 Sep 2020 15:52:02 +0000 (11:52 -0400)]
[mlir][openacc] Add missing operands for acc.data operation

Add missing operands to represent copyin with readonly modifier, copyout with zero modifier
and create with zero modifier.

Reviewed By: ftynse

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

3 years ago[mlir][openacc] Support Index and AnyInteger in loop op
Valentin Clement [Fri, 18 Sep 2020 15:37:34 +0000 (11:37 -0400)]
[mlir][openacc] Support Index and AnyInteger in loop op

Following patch D87712, this patch switch AnyInteger for operands gangNum, gangStatic,
workerNum, vectoreLength and tileOperands to Index and AnyInteger.

Reviewed By: ftynse

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

3 years ago[X86][AVX] Add missing i686 broadcastm test coverage
Simon Pilgrim [Fri, 18 Sep 2020 15:10:09 +0000 (16:10 +0100)]
[X86][AVX] Add missing i686 broadcastm test coverage

3 years ago[DAG] BuildVectorSDNode::getSplatValue - pull out repeated getNumOperands() calls...
Simon Pilgrim [Fri, 18 Sep 2020 14:11:13 +0000 (15:11 +0100)]
[DAG] BuildVectorSDNode::getSplatValue - pull out repeated getNumOperands() calls. NFCI.

3 years ago[AIX] Enable large code model when building with clang
David Tenty [Thu, 30 Jul 2020 12:31:54 +0000 (08:31 -0400)]
[AIX] Enable large code model when building with clang

3 years ago[clangd] Add option for disabling AddUsing tweak on some namespaces.
Adam Czachorowski [Tue, 15 Sep 2020 17:47:50 +0000 (19:47 +0200)]
[clangd] Add option for disabling AddUsing tweak on some namespaces.

For style guides forbid "using" declarations for namespaces like "std".
With this new config option, AddUsing can be selectively disabled on
those.

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

3 years ago[mlir][StandardToSPIRV] Handle vector of i1 case for lowering zexti to SPIR-V.
Hanhan Wang [Fri, 18 Sep 2020 14:07:10 +0000 (07:07 -0700)]
[mlir][StandardToSPIRV] Handle vector of i1 case for lowering zexti to SPIR-V.

Reviewed By: mravishankar

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

3 years ago[InstSimplify] fix fmin/fmax miscompile for partial undef vectors (PR47567)
Sanjay Patel [Fri, 18 Sep 2020 13:53:06 +0000 (09:53 -0400)]
[InstSimplify] fix fmin/fmax miscompile for partial undef vectors (PR47567)

It would also be correct to return the variable operand in these cases,
but eliminating a variable use is probably better for optimization.

3 years agoIR: Move denormal mode parsing from MachineFunction to Function
Matt Arsenault [Thu, 17 Sep 2020 21:50:42 +0000 (17:50 -0400)]
IR: Move denormal mode parsing from MachineFunction to Function

This was just inspecting the IR to begin with, and is useful to check
in some places in the IR.

3 years agoemacs: Add nofree and willreturn to list of attributes
Matt Arsenault [Fri, 18 Sep 2020 13:28:57 +0000 (09:28 -0400)]
emacs: Add nofree and willreturn to list of attributes

3 years agoRevert "[amdgpu] Lower SGPR-to-VGPR copy in the final phase of ISel."
Matt Arsenault [Thu, 17 Sep 2020 16:07:59 +0000 (12:07 -0400)]
Revert "[amdgpu] Lower SGPR-to-VGPR copy in the final phase of ISel."

This reverts commit c3492a1aa1b98c8d81b0969d52cea7681f0624c2.

I think this is the wrong strategy and wrong place to do this
transform anyway. Also reverts follow up commit
7d593d0d6905b55ca1124fca5e4d1ebb17203138.

3 years ago[SLP] Allow reordering of vectorization trees with reused instructions.
Alexey Bataev [Thu, 17 Sep 2020 15:24:00 +0000 (11:24 -0400)]
[SLP] Allow reordering of vectorization trees with reused instructions.

If some leaves have the same instructions to be vectorized, we may
incorrectly evaluate the best order for the root node (it is built for the
vector of instructions without repeated instructions and, thus, has less
elements than the root node). In this case we just can not try to reorder
the tree + we may calculate the wrong number of nodes that requre the
same reordering.
For example, if the root node is \<a+b, a+c, a+d, f+e\>, then the leaves
are \<a, a, a, f\> and \<b, c, d, e\>. When we try to vectorize the first
leaf, it will be shrink to \<a, b\>. If instructions in this leaf should
be reordered, the best order will be \<1, 0\>. We need to extend this
order for the root node. For the root node this order should look like
\<3, 0, 1, 2\>. This patch allows extension of the orders of the nodes
with the reused instructions.

Reviewed By: RKSimon

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

3 years ago[AMDGPU] Set DS alignment requirements to be more strict
Mirko Brkusanin [Fri, 18 Sep 2020 13:19:54 +0000 (15:19 +0200)]
[AMDGPU] Set DS alignment requirements to be more strict

Alignment requirements for ds_read/write_b96/b128 for gfx9 and onward are
now the same as for other GCN subtargets. This way we can avoid any
unintentional use of these instructions on systems that do not support dword
alignment and instead require natural alignment.
This also makes 'SH_MEM_CONFIG.alignment_mode == STRICT' the default.

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

3 years ago[InstSimplify] add another test for NaN propagation; NFC
Sanjay Patel [Thu, 17 Sep 2020 21:20:17 +0000 (17:20 -0400)]
[InstSimplify] add another test for NaN propagation; NFC

3 years ago[libunwind] Support for leaf function unwinding.
Daniel Kiss [Wed, 16 Sep 2020 21:03:19 +0000 (23:03 +0200)]
[libunwind] Support for leaf function unwinding.

Unwinding leaf function is useful in cases when the backtrace finds a
leaf function for example when it caused a signal.
This patch also add the support for the DW_CFA_undefined because it marks
the end of the frames.

Ryan Prichard provided code for the tests.

Reviewed By: #libunwind, mstorsjo

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

Reland with limit the test to the x86_64-linux target.

3 years ago[DWARFYAML] Make the include_directories, file_names and opcodes fields of the line...
Xing GUO [Fri, 18 Sep 2020 12:20:58 +0000 (20:20 +0800)]
[DWARFYAML] Make the include_directories, file_names and opcodes fields of the line table optional.

This patch makes the include_directories, file_names and opcodes fields
of the line table optional. This helps us simplify some tests.

Reviewed By: jhenderson

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

3 years ago[DWARFYAML][test] Use 'CHECK-NEXT:' to make checkers stricter. NFC.
Xing GUO [Fri, 18 Sep 2020 12:18:48 +0000 (20:18 +0800)]
[DWARFYAML][test] Use 'CHECK-NEXT:' to make checkers stricter. NFC.

This patch makes checkers stricter so that we are able to avoid
some potential problems earlier.

Reviewed By: jhenderson, MaskRay

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

3 years ago[UpdateCCTestChecks] Include generated functions if asked
David Greene [Mon, 13 Jan 2020 18:16:35 +0000 (12:16 -0600)]
[UpdateCCTestChecks] Include generated functions if asked

Add the --include-generated-funcs option to update_cc_test_checks.py so that any
functions created by the compiler that don't exist in the source will also be
checked.

We need to maintain the output order of generated function checks so that
CHECK-LABEL works properly.  To do so, maintain a list of functions output for
each prefix in the order they are output.  Use this list to output checks for
generated functions in the proper order.

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

3 years ago[Test] Missing range check removal opportunity
Max Kazantsev [Fri, 18 Sep 2020 10:38:08 +0000 (17:38 +0700)]
[Test] Missing range check removal opportunity

3 years ago[Polly] Update map passed to SCEVParameterReweriter.
Florian Hahn [Fri, 18 Sep 2020 10:40:45 +0000 (11:40 +0100)]
[Polly] Update map passed to SCEVParameterReweriter.

The type of the map the SCEVParameterRewriter takes has been changed in
4635f6050b10.

Update the single use in polly to use SCEV* as type of the values.

3 years ago[mlir][Linalg] Evolve named ops to use assembly form and support linalg on tensors.
Nicolas Vasilache [Fri, 18 Sep 2020 10:13:25 +0000 (06:13 -0400)]
[mlir][Linalg] Evolve named ops to use assembly form and support linalg on tensors.

This revision allows representing a reduction at the level of linalg on tensors for named ops. When a structured op has a reduction and returns tensor(s), new conventions are added and documented.

As an illustration, the syntax for a `linalg.matmul` writing into a buffer is:

```
  linalg.matmul ins(%a, %b : memref<?x?xf32>, tensor<?x?xf32>)
               outs(%c : memref<?x?xf32>)
```

, whereas the syntax for a `linalg.matmul` returning a new tensor is:

```
  %d = linalg.matmul ins(%a, %b : tensor<?x?xf32>, memref<?x?xf32>)
                    init(%c : memref<?x?xf32>)
                      -> tensor<?x?xf32>
```

Other parts of linalg will be extended accordingly to allow mixed buffer/tensor semantics in the presence of reductions.

3 years agoRecommit "[DSE] Switch to MemorySSA-backed DSE by default."
Florian Hahn [Fri, 18 Sep 2020 07:54:09 +0000 (08:54 +0100)]
Recommit "[DSE] Switch to MemorySSA-backed DSE by default."

This switches to using DSE + MemorySSA by default again, after
fixing the issues reported after the first commit.

Notable fixes fc8200633122a0017c2bc258.

This reverts commit 3a59628f3cc26eb085acfc9cbdc97243ef71a6c5.

3 years agoRevert "[libunwind] Support for leaf function unwinding."
Daniel Kiss [Fri, 18 Sep 2020 09:37:54 +0000 (11:37 +0200)]
Revert "[libunwind] Support for leaf function unwinding."

This reverts commit 23bef7ee9923b1262326981960397e8cd95d6923.

3 years ago[SCEV] Generalize SCEVParameterRewriter to accept SCEV expression as target.
Florian Hahn [Fri, 18 Sep 2020 08:50:01 +0000 (09:50 +0100)]
[SCEV] Generalize SCEVParameterRewriter to accept SCEV expression as target.

This patch extends SCEVParameterRewriter to support rewriting unknown
epxressions to arbitrary SCEV expressions. It will be used by further
patches.

Reviewed By: reames

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

3 years ago[TableGen][GlobalISel] Fix handling of zero_reg
Gabriel Hjort Ã…kerlund [Fri, 18 Sep 2020 08:08:32 +0000 (10:08 +0200)]
[TableGen][GlobalISel] Fix handling of zero_reg

When generating matching tables for GlobalISel, TableGen would output
"::zero_reg" whenever encountering the zero_reg, which in turn would
result in compilation error. This patch fixes that by instead outputting
NoRegister (== 0), which is the same result that TableGen produces when
generating matching tables for ISelDAG.

Reviewed By: arsenm

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

3 years agoAArch64: make sure jump table entries can reach entire image
Tim Northover [Tue, 8 Sep 2020 10:08:25 +0000 (11:08 +0100)]
AArch64: make sure jump table entries can reach entire image

This turns all jump table entries into deltas within the target
function because in the small memory model all code & static data must
be in a 4GB block somewhere in memory.

When the entries were a delta between the table location and a basic
block, the 32-bit signed entries are not enough to guarantee
reachability.

https://reviews.llvm.org/D87286

3 years ago[NFC][gotsan] Fix 'format' error
Vitaly Buka [Fri, 18 Sep 2020 08:17:54 +0000 (01:17 -0700)]
[NFC][gotsan] Fix 'format' error

3 years ago[NFC][sanitizer] Disable a test on Windows
Vitaly Buka [Fri, 18 Sep 2020 08:09:16 +0000 (01:09 -0700)]
[NFC][sanitizer] Disable a test on Windows

3 years ago[sanitizer] Add facility to print the full StackDepot
Teresa Johnson [Wed, 16 Sep 2020 20:47:16 +0000 (13:47 -0700)]
[sanitizer] Add facility to print the full StackDepot

Split out of D87120 (memory profiler). Added unit testing of the new
printing facility.

Reviewed By: vitalybuka

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

3 years agoRevert "[InstCombine] Canonicalize SPF_ABS to abs intrinc"
Nikita Popov [Fri, 18 Sep 2020 07:27:56 +0000 (09:27 +0200)]
Revert "[InstCombine] Canonicalize SPF_ABS to abs intrinc"

This reverts commit 05d4c4ebc2fb006b8a2bd05b24c6aba10dd2eef8.

mstorsjo reports a miscompile after this change in
https://reviews.llvm.org/D87188#2281093. Reverting until I can
investigate this.

3 years ago[NFC][fuzzer] Simplify StrcmpTest.cpp
Vitaly Buka [Fri, 18 Sep 2020 07:17:18 +0000 (00:17 -0700)]
[NFC][fuzzer] Simplify StrcmpTest.cpp

The test started to consistently fail after unrelated
2ffaa9a1732c6f2af514603d25f0e8c238b3dd06.

Even before the patch it was possible to fail the test,
e.g. -seed=1660180256 on my workstation.

Also this checks do not look related to strcmp.

3 years ago[AArch64] Add tests for zext pattern match with AssertZext/AssertSext operand, NFC
Andrew Wei [Fri, 18 Sep 2020 06:59:51 +0000 (14:59 +0800)]
[AArch64] Add tests for zext pattern match with AssertZext/AssertSext operand, NFC

3 years ago[FPEnv] Use typed accessors in FPOptions
Serge Pavlov [Wed, 16 Sep 2020 16:27:46 +0000 (23:27 +0700)]
[FPEnv] Use typed accessors in FPOptions

Previously methods `FPOptions::get*` returned unsigned value even if the
corresponding property was represented by specific enumeration type. With
this change such methods return actual type of the property. It also
allows printing value of a property as text rather than integer code.

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

3 years agoRevert "This is a test commit"
Artur Bialas [Fri, 18 Sep 2020 06:43:53 +0000 (08:43 +0200)]
Revert "This is a test commit"

This reverts commit 9d54b166c2e59f29e476a6566951b6809fc8808e.

3 years agoThis is a test commit
Artur Bialas [Fri, 18 Sep 2020 06:43:18 +0000 (08:43 +0200)]
This is a test commit

3 years ago[X86] Add some demanded bits test cases for PDEP with constant mask
Craig Topper [Fri, 18 Sep 2020 05:37:29 +0000 (22:37 -0700)]
[X86] Add some demanded bits test cases for PDEP with constant mask

The number of ones in the mask for the PDEP determines how many
bits of the other operand are used. If the mask is constant we
can use this to build a mask for SimplifyDemandedBits. This can
be used to replace the extends in the test with anyextend.