platform/upstream/llvm.git
3 years ago[lldb] [Process/NetBSD] Correct DS/ES/FS/GS register sizes
Michał Górny [Mon, 9 Nov 2020 14:47:37 +0000 (15:47 +0100)]
[lldb] [Process/NetBSD] Correct DS/ES/FS/GS register sizes

Fix DS/ES/FS/GS register sizes in getter/setter for NetBSD.  Apparently
only CS and SS registers are specified as 64/32-bit in LLDB, while
the others are specified as 16-bit.

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

3 years ago[OpenMPIRBuilder] Implement CreateCanonicalLoop.
Michael Kruse [Mon, 9 Nov 2020 20:13:17 +0000 (14:13 -0600)]
[OpenMPIRBuilder] Implement CreateCanonicalLoop.

CreateCanonicalLoop generates a standardized control flow structure for OpenMP canonical for loops. The structure can be consumed by loop-associated directives such as worksharing-loop, distribute, simd etc. as well as loop transformations such as tile and unroll.

This is a first design without considering all complexities yet. The control-flow emits more basic block than strictly necessary, but these will be optimized by CFGSimplify anyway, provide a nice separation of concerns and might later be useful with more complex scenarios. I successfully implemented a basic tile construct using this API, which is not part of this patch.

The fundamental building block is the CreateCanonicalLoop that only takes the loop trip count and operates on the logical iteration spaces only. An overloaded CreateCanonicalLoop for using LB, UB, Increment is provided as well, but at least for C++, Clang will need to implement a loop counter to logical induction variable mapping anyway, since iterator overload resolution cannot be done in LLVMFrontend.

As there currently is no user for CreateCanonicalLoop, it is only called from unittests. Similarly, CanonicalLoopInfo::eraseFromParent() is used in my file implementation and might be generally useful for implementing loop-associated constructs, but is not used in this patch itself.

The following non-exhaustive list describes not yet covered items:
 * collapse clause (including non-rectangular and non-perfectly nested); idea is to provide a OpenMPIRBuilder::collapseLoopNest method consuming multiple nested loops and returning a new CanonicalLoopInfo that can be used for loop-associated directives.
 * simarly: ordered clause for DOACROSS loops
 * branch weights
 * Cancellation point (?)
 * AllocaIP
 * break statement (if needed at all)
 * Exceptions (if not completely handled in the front-end)
  * Using it in Clang; this requires implementing at least one loop-associated construct.
 * ...

Reviewed By: jdoerfert

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

3 years ago[mlir][std] Add ExpandOps pass.
Alexander Belyaev [Mon, 9 Nov 2020 15:47:02 +0000 (16:47 +0100)]
[mlir][std] Add ExpandOps pass.

The pass combines patterns of ExpandAtomic, ExpandMemRefReshape,
StdExpandDivs passes. The pass is meant to legalize STD for conversion to LLVM.

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

3 years ago[NewPM] Add unique-internal-linkage-names to PassRegistry.def
Arthur Eubanks [Mon, 9 Nov 2020 20:54:13 +0000 (12:54 -0800)]
[NewPM] Add unique-internal-linkage-names to PassRegistry.def

Pass was already ported, just not properly hooked up.

3 years ago[test] Completely pin PR37334-break-crit-edges-require-dt.ll to legacy PM
Arthur Eubanks [Mon, 9 Nov 2020 20:47:57 +0000 (12:47 -0800)]
[test] Completely pin PR37334-break-crit-edges-require-dt.ll to legacy PM

This tests legacy PM specific code (https://bugs.llvm.org/show_bug.cgi?id=37334).
This is failing under the new PM because -loop-sink is a function pass,
not a loop pass, and doesn't run -loop-simplify.

3 years agoTooling: Remove dead code for ToolingInvocation::mapVirtualFile
Duncan P. N. Exon Smith [Thu, 5 Nov 2020 22:12:17 +0000 (17:12 -0500)]
Tooling: Remove dead code for ToolingInvocation::mapVirtualFile

Follows through on c4cb3b10dc8c50e46c9fb1b7ae95e3c3c94975d3's FIXME
dating back to 2015. Anyone using this should migrate to
InMemoryFileSystem and/or ClangTool::mapVirtualFile.

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

3 years ago[test][NewPM] Pin -flattencfg test to legacy PM
Arthur Eubanks [Mon, 9 Nov 2020 20:39:51 +0000 (12:39 -0800)]
[test][NewPM] Pin -flattencfg test to legacy PM

It is not used in the optimization pipeline and can be ported later.

3 years ago[BasicAA] Add test for decomposition limit (NFC)
Nikita Popov [Mon, 9 Nov 2020 19:42:57 +0000 (20:42 +0100)]
[BasicAA] Add test for decomposition limit (NFC)

Test behavior before/at/after the GEP decomposition limit.

3 years ago[test][NewPM] Fix LoopLoadElim tests under NPM
Arthur Eubanks [Mon, 9 Nov 2020 20:19:03 +0000 (12:19 -0800)]
[test][NewPM] Fix LoopLoadElim tests under NPM

3 years ago[llvm] Check the debug info line table for basic block sections.
Snehasish Kumar [Sat, 7 Nov 2020 00:24:25 +0000 (16:24 -0800)]
[llvm] Check the debug info line table for basic block sections.

Extend the existing basic block sections debug info test to check for the correctness of the generated line table.

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

3 years ago[clangd] NFC: Fix a typo in Tracer name
Kirill Bobyrev [Mon, 9 Nov 2020 20:18:35 +0000 (21:18 +0100)]
[clangd] NFC: Fix a typo in Tracer name

3 years ago[FastISel][test] %llc_dwarf -mtriple -> llc -mtriple
Fangrui Song [Mon, 9 Nov 2020 20:10:44 +0000 (12:10 -0800)]
[FastISel][test] %llc_dwarf -mtriple -> llc -mtriple

if config.target_triple contains 'windows-msvc', %llc_dwarf has a -mtriple:

    llc.exe: for the --mtriple option: may only occur zero or one times!

3 years ago[MLIR] Fix GCC build failure
Rahul Joshi [Mon, 9 Nov 2020 19:57:52 +0000 (11:57 -0800)]
[MLIR] Fix GCC build failure

3 years agoRevert "Check if debug line sequences are starting after the first code segment"
António Afonso [Mon, 9 Nov 2020 19:45:35 +0000 (11:45 -0800)]
Revert "Check if debug line sequences are starting after the first code segment"

This reverts commit 265a38fbc547adc0e2b71a98dac4d0a60b0dd63c.

3 years agoFix use of directly-nested traverse() matchers
Stephen Kelly [Mon, 9 Nov 2020 18:59:30 +0000 (18:59 +0000)]
Fix use of directly-nested traverse() matchers

3 years agoFix trailing whitespace
Stephen Kelly [Mon, 9 Nov 2020 18:59:00 +0000 (18:59 +0000)]
Fix trailing whitespace

My editor keeps on changing this and I keep having to revert it.

3 years agoChange algorithms to return iterators
Stephen Kelly [Fri, 6 Nov 2020 16:05:16 +0000 (16:05 +0000)]
Change algorithms to return iterators

Make it possible to inspect the matched node, possibly to ignore it.

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

3 years ago[MLIR] Change FuncOp assembly syntax to print visibility inline instead of in attrib...
Rahul Joshi [Mon, 9 Nov 2020 16:23:55 +0000 (08:23 -0800)]
[MLIR] Change FuncOp assembly syntax to print visibility inline instead of in attrib dict.

- Change syntax for FuncOp to be `func <visibility>? @name` instead of printing the
  visibility in the attribute dictionary.
- Since printFunctionLikeOp() and parseFunctionLikeOp() are also used by other
  operations, make the "inline visibility" an opt-in feature.
- Updated unit test to use and check the new syntax.

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

3 years ago[ms] [llvm-ml] Support MASM's relational operators (EQ, LT, etc.)
Eric Astor [Mon, 9 Nov 2020 18:22:37 +0000 (13:22 -0500)]
[ms] [llvm-ml] Support MASM's relational operators (EQ, LT, etc.)

Support the named relational operators (EQ, LT, etc.).

Reviewed By: thakis

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

3 years ago[MLIR] Support `global_memref` and `get_global_memref` in standard -> LLVM conversion.
Rahul Joshi [Mon, 9 Nov 2020 17:01:39 +0000 (09:01 -0800)]
[MLIR] Support `global_memref` and `get_global_memref` in standard -> LLVM conversion.

- Convert `global_memref` to LLVM::GlobalOp.
- Convert `get_global_memref` to a memref descriptor with a pointer to the first element
  of the global stashed in it.
- Extend unit test and a mlir-cpu-runner test to validate the generated LLVM IR.

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

3 years ago[SelectionDAG] Enable CTPOP optimization fine tuning
David Zarzycki [Wed, 28 Oct 2020 11:18:09 +0000 (07:18 -0400)]
[SelectionDAG] Enable CTPOP optimization fine tuning

Add a TLI hook to allow SelectionDAG to fine tune the conversion of CTPOP to a chain of "x & (x - 1)" when CTPOP isn't legal.

A subsequent patch will attempt to fine tune the X86 code gen.

Reviewed By: spatel

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

3 years ago[clangd][remote] Check an index file correctly
Aleksandr Platonov [Mon, 9 Nov 2020 18:39:01 +0000 (21:39 +0300)]
[clangd][remote] Check an index file correctly

There is not reason to check `std::make_unique<...>(..)` return value,
but `clangd::clang::loadIndex()` returns `nullptr` if an index file could not be loaded (e.g. incorrect version).

Reviewed By: kadircet

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

3 years ago[FastISel][test] Add ELF triple after D90877
Fangrui Song [Mon, 9 Nov 2020 18:26:02 +0000 (10:26 -0800)]
[FastISel][test] Add ELF triple after D90877

MachO has different symbol naming and thus on a MachO platform this test has a
different behavior without a triple.

3 years ago[llvm][AArch64] Allow TB(N)Z to drop signext for sign bit tests.
Francesco Petrogalli [Mon, 9 Nov 2020 18:18:28 +0000 (18:18 +0000)]
[llvm][AArch64] Allow TB(N)Z to drop signext for sign bit tests.

For example if the sign extension is only used in for TBZ, and the value is used elsewhere with a zero extension, this can eliminate a sign extension.

Reviewed By: samparker

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

3 years ago[flang] Avoid calling the linker when "-c" option is used
Peter Steinfeld [Mon, 9 Nov 2020 15:42:12 +0000 (07:42 -0800)]
[flang] Avoid calling the linker when "-c" option is used

The title says it all.

3 years ago[ms] [llvm-ml] Support REPEAT/FOR/WHILE macro-like directives
Eric Astor [Mon, 9 Nov 2020 16:49:41 +0000 (11:49 -0500)]
[ms] [llvm-ml] Support REPEAT/FOR/WHILE macro-like directives

Support MASM's REPEAT, FOR, FORC, and WHILE macro-like directives.

Also adds support for macro argument substitution inside quoted strings, and additional testing for macro directives.

Reviewed By: thakis

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

3 years ago[libunwind] Delete unused codeOffsetAtStackDecrement/registersInOtherRegisters/sameVa...
Fangrui Song [Mon, 9 Nov 2020 18:19:12 +0000 (10:19 -0800)]
[libunwind] Delete unused codeOffsetAtStackDecrement/registersInOtherRegisters/sameValueUsed

ld64 uses them to create compact unwind from DWARF call frame information.
When the code was ported to libunwind, the variables were not deleted.

Reviewed By: #libunwind, compnerd

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

3 years ago[ARM] Remove MI variable aliasing. NFC
David Green [Mon, 9 Nov 2020 18:18:43 +0000 (18:18 +0000)]
[ARM] Remove MI variable aliasing. NFC

This was accidentally using the same name for two different variables in
the same line. Whilst it seems to work for some compilers, others have
trouble and it is probably not a fantastic idea.

3 years ago[RISCV] Make ctlz/cttz cheap to speculatively execute so CodeGenPrepare won't insert...
Craig Topper [Mon, 9 Nov 2020 18:05:51 +0000 (10:05 -0800)]
[RISCV] Make ctlz/cttz cheap to speculatively execute so CodeGenPrepare won't insert a zero check.

Add additional isel patterns for ctzw/clzw instructions.

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

3 years ago[RISCV] Add isel patterns for using PACK for zext.h and zext.w.
Craig Topper [Mon, 9 Nov 2020 18:01:55 +0000 (10:01 -0800)]
[RISCV] Add isel patterns for using PACK for zext.h and zext.w.

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

3 years ago[RISCV] Make SIGN_EXTEND_INREG from i8/i16 legal when Zbb extension is enabled.
Craig Topper [Mon, 9 Nov 2020 17:57:38 +0000 (09:57 -0800)]
[RISCV] Make SIGN_EXTEND_INREG from i8/i16 legal when Zbb extension is enabled.

This produces better code for sign extend to i64 on RV32 target.

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

3 years ago[ELF] Special case static_assert for _WIN32
Fangrui Song [Mon, 9 Nov 2020 18:08:44 +0000 (10:08 -0800)]
[ELF] Special case static_assert for _WIN32

I don't have a Windows machine. Hope someone can test why its InputSection is
still larger.

3 years ago[RISCV] Add isel patterns to match sbset/sbclr/sbinv/sbext even if the shift amount...
Craig Topper [Mon, 9 Nov 2020 17:45:22 +0000 (09:45 -0800)]
[RISCV] Add isel patterns to match sbset/sbclr/sbinv/sbext even if the shift amount isn't masked.

This uses the shiftop PatFrags to handle the masked shift amount
and unmasked shift amount cases. That also checks XLen as part
of the masked amount check so we don't need separate RV32 and RV64
patterns.

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

3 years ago[ELF] Make InputSection smaller
Fangrui Song [Mon, 9 Nov 2020 17:55:09 +0000 (09:55 -0800)]
[ELF] Make InputSection smaller

On LP64/Windows platforms, this decreases sizeof(InputSection) from 208 (larger
on Windows) to 184.

For a large executable (7.6GiB, inputSections.size()=5105122,
make<InputSection> called 4835760 times), this decreases cgroup
memory.max_usage_in_bytes by 0.6%

Reviewed By: grimar

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

3 years ago[X86] vector-narrow-binop.ll - remove unused check-prefixes
Simon Pilgrim [Mon, 9 Nov 2020 17:50:03 +0000 (17:50 +0000)]
[X86] vector-narrow-binop.ll - remove unused check-prefixes

3 years ago[HardwareLoops] Remove unused check-prefixes
Simon Pilgrim [Mon, 9 Nov 2020 17:46:49 +0000 (17:46 +0000)]
[HardwareLoops] Remove unused check-prefixes

Just use default CHECK

3 years ago[FastISel] Reduce spills around mem-intrinsic calls
Paul Robinson [Thu, 5 Nov 2020 21:09:10 +0000 (13:09 -0800)]
[FastISel] Reduce spills around mem-intrinsic calls

FastISel generates instructions to materialize "local values" at the
top of a block, in the hope that these values could be reused within
the block.  To reduce spills and restores, FastISel treats calls as
sub-block boundaries, flushing the "local value map" at each call.

This patch treats the mem* intrinsics as if they were calls, because
at O0 generally they are calls.  Eliminating these spills/restores is
actually better for debugging (especially a "continue at this line"
command), code size, stack frame size, and maybe even performance.

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

3 years ago[MLIR] Flag no-terminator error on the last operation of non-empty blocks
Rahul Joshi [Sat, 7 Nov 2020 00:24:35 +0000 (16:24 -0800)]
[MLIR] Flag no-terminator error on the last operation of non-empty blocks

- When a block is not empty and does not end with a terminator, flag the error on the
  last operation of the block instead of the start of the block.

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

3 years ago-fbasic-block-sections=list=: Suppress output if failed to open the file
Fangrui Song [Mon, 9 Nov 2020 17:26:37 +0000 (09:26 -0800)]
-fbasic-block-sections=list=: Suppress output if failed to open the file

Reviewed By: tmsriram

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

3 years ago[X86][GlobalISel] Remove some unused check-prefixes
Simon Pilgrim [Mon, 9 Nov 2020 17:21:11 +0000 (17:21 +0000)]
[X86][GlobalISel] Remove some unused check-prefixes

3 years ago[FunctionImport] Remove unused check-prefixes
Simon Pilgrim [Mon, 9 Nov 2020 16:19:10 +0000 (16:19 +0000)]
[FunctionImport] Remove unused check-prefixes

3 years ago[DeadStoreElimination] Remove unused check-prefixes
Simon Pilgrim [Mon, 9 Nov 2020 16:08:07 +0000 (16:08 +0000)]
[DeadStoreElimination] Remove unused check-prefixes

Just use default CHECK

3 years agoRevert "Ignores functions that have a range starting outside of a code section"
António Afonso [Mon, 9 Nov 2020 17:07:48 +0000 (09:07 -0800)]
Revert "Ignores functions that have a range starting outside of a code section"

This reverts commit df30bc0168d236e5575d815030d6fe4cd8626f34.

3 years ago[mlir][Linalg] Add support for bufferization of SubTensorOp and SubTensorInsertOp
Nicolas Vasilache [Mon, 9 Nov 2020 11:57:42 +0000 (11:57 +0000)]
[mlir][Linalg] Add support for bufferization of SubTensorOp and SubTensorInsertOp

This revision adds support for bufferization by using a mix of `tensor_load`, `subview`, `linalg.copy` and `tensor_to_memref`.

3 years ago[lldb] Avoid confusing reproducer crashes when initialization failed
Jonas Devlieghere [Mon, 9 Nov 2020 16:47:08 +0000 (08:47 -0800)]
[lldb] Avoid confusing reproducer crashes when initialization failed

During active replay, the ::Initialize call is replayed like any other
SB API call and the return value is ignored. Since we can't intercept
this, we terminate here before the uninitialized debugger inevitably
crashes.

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

3 years ago[clang] Fix ForStmt mustprogress handling
Atmn Patel [Mon, 9 Nov 2020 13:19:44 +0000 (08:19 -0500)]
[clang] Fix ForStmt mustprogress handling

D86841 had an error where for statements with no conditional were
required to make progress. This is not true, this patch removes that
line, and adds regression tests.

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

3 years ago[NFC] Use [MC]Register
Mircea Trofin [Wed, 4 Nov 2020 21:28:13 +0000 (13:28 -0800)]
[NFC] Use [MC]Register

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

3 years ago[XCOFF] Enable explicit sections on AIX
jasonliu [Mon, 9 Nov 2020 15:12:46 +0000 (15:12 +0000)]
[XCOFF] Enable explicit sections on AIX

Implement mechanism to allow explicit sections to be generated on AIX.

Reviewed By: DiggerLin

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

3 years agoIgnores functions that have a range starting outside of a code section
António Afonso [Mon, 9 Nov 2020 02:17:10 +0000 (18:17 -0800)]
Ignores functions that have a range starting outside of a code section

This is a similar patch to https://reviews.llvm.org/D87172. Greg said we should also do it for functions.

Reviewed By: clayborg, labath

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

3 years agoCheck if debug line sequences are starting after the first code segment
António Afonso [Sun, 18 Oct 2020 17:33:25 +0000 (10:33 -0700)]
Check if debug line sequences are starting after the first code segment

I found a few cases where entries in the debug_line for a specific line of code have invalid entries (the address is outside of a code section or no section at all) and also valid entries. When this happens lldb might not set the breakpoint because the first line entry it will find in the line table might be the invalid one and since it's range is "invalid" no location is resolved. To get around this I changed the way we parse the line sequences to ignore those starting at an address under the first code segment.
Greg suggested to implement it this way so we don't need to check all sections for every line sequence.

Reviewed By: clayborg

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

3 years ago[AMDGPU] Omit buffer resource with flat scratch.
Stanislav Mekhanoshin [Fri, 6 Nov 2020 21:00:10 +0000 (13:00 -0800)]
[AMDGPU] Omit buffer resource with flat scratch.

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

3 years ago[TableGen] Add the !filter bang operator.
Paul C. Anagnostopoulos [Thu, 5 Nov 2020 17:49:21 +0000 (12:49 -0500)]
[TableGen] Add the !filter bang operator.

Add a test. Update the Programmer's Reference.

Use it in some TableGen files.

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

3 years ago[SelectionDAG] NFC: Hoist is legal check
David Zarzycki [Mon, 9 Nov 2020 15:53:37 +0000 (10:53 -0500)]
[SelectionDAG] NFC: Hoist is legal check

This was requested during the code review of D89952.

3 years ago[AMDGPU] Add amdgpu_gfx calling convention
Sebastian Neubauer [Wed, 16 Sep 2020 12:38:54 +0000 (14:38 +0200)]
[AMDGPU] Add amdgpu_gfx calling convention

Add a calling convention called amdgpu_gfx for real function calls
within graphics shaders. For the moment, this uses the same calling
convention as other calls in amdgpu, with registers excluded for return
address, stack pointer and stack buffer descriptor.

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

3 years ago[NFC] Remove string parameter of annotation attribute from AST childs.
Tyker [Mon, 9 Nov 2020 14:06:14 +0000 (15:06 +0100)]
[NFC] Remove string parameter of annotation attribute from AST childs.
this simplifies using annotation attributes when using clang as library

3 years ago[testing] Add exhaustive ULT/UGT vector CTPOP to AArch64 and PPC
David Zarzycki [Mon, 9 Nov 2020 15:23:08 +0000 (10:23 -0500)]
[testing] Add exhaustive ULT/UGT vector CTPOP to AArch64 and PPC

This to help review the impact of https://reviews.llvm.org/D89952 which
allows targets to fine tune what SelectionDAG does when vector CTPOP is
not legal.

3 years ago[ARM][MachineOutliner] Emit more CFI instructions
Momchil Velikov [Mon, 9 Nov 2020 11:48:32 +0000 (11:48 +0000)]
[ARM][MachineOutliner] Emit more CFI instructions

This patch make the outliner emit CFI instructions in a few more
places:

  * after LR is restored, but before the return in an outlined
  function

  * around save/restore of LR to/from a register at calls to outlined
  functions

  * around save/restore of LR to/from the stack at calls to outlined
  functions

The latter two only when the function does NOT spill LR. If the
function spills LR, then outliner generated saves/restores around
calls are not considered interesting for unwinding the frame.

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

3 years ago[X86] Remove some unused check-prefixes
Simon Pilgrim [Mon, 9 Nov 2020 15:01:30 +0000 (15:01 +0000)]
[X86] Remove some unused check-prefixes

3 years ago[X86] Replace X32 check-prefix with X86 and remove unused X64 common prefix
Simon Pilgrim [Mon, 9 Nov 2020 14:45:48 +0000 (14:45 +0000)]
[X86] Replace X32 check-prefix with X86 and remove unused X64 common prefix

We try to use X32 for gnux32 triple tests

3 years ago[ARM][LowOverheadLoops] Merge a VCMP and the new VPST into a VPT
Sam Tebbs [Fri, 30 Oct 2020 13:30:58 +0000 (13:30 +0000)]
[ARM][LowOverheadLoops] Merge a VCMP and the new VPST into a VPT

There were cases where a VCMP and a VPST were merged even if the VCMP
didn't have the same defs of its operands as the VPST. This is fixed by
adding RDA checks for the defs. This however gave rise to cases where
the new VPST created would precede the un-merged VCMP and so would fail
a predicate mask assertion since the VCMP wasn't predicated. This was
solved by converting the VCMP to a VPT instead of inserting the new
VPST.

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

3 years ago[mlir] Fix bug in use of rewiter for AtomicRMWOp.
Tres Popp [Mon, 9 Nov 2020 14:55:08 +0000 (15:55 +0100)]
[mlir] Fix bug in use of rewiter for AtomicRMWOp.

The legalization did not forward the listener which prevents dynamic
legalization and prevents rollbacks. This handled that and then changed
the associated pass to support all other std ops to support partial
conversion.

Previously, this lowering was failing, but due to the
initial bug, the op's modifications were not reverted, and thus the
pattern matching succeeded.

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

3 years ago[LoopFlatten] FlattenInfo bookkeeping. NFC.
Sjoerd Meijer [Mon, 9 Nov 2020 14:33:52 +0000 (14:33 +0000)]
[LoopFlatten] FlattenInfo bookkeeping. NFC.

Introduce struct FlattenInfo to group some of the bookkeeping. Besides this
being a bit of a clean-up, it is a prep step for next additions (D90640). I
could take things a bit further, but thought this was a good first step also
not to make this change too large.

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

3 years ago[gn build] Port 9ca6fc4e095
LLVM GN Syncbot [Mon, 9 Nov 2020 14:31:09 +0000 (14:31 +0000)]
[gn build] Port 9ca6fc4e095

3 years ago[clang-format] avoid introducing multiline comments
Krasimir Georgiev [Mon, 9 Nov 2020 14:26:02 +0000 (15:26 +0100)]
[clang-format] avoid introducing multiline comments

In C++ with -Werror=comment, multiline comments are not allowed.
clang-format could accidentally introduce multiline comments when reflowing.
This adapts clang-format to not introduce multiline comments by not allowing a
break after `\`. Note that this does not apply to comment lines that already are
multiline comments, such as comments in macros.

Reviewed By: sammccall

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

3 years agoAdd a new altera kernel name restriction check to clang-tidy.
Frank Derry Wanye [Mon, 9 Nov 2020 14:20:35 +0000 (09:20 -0500)]
Add a new altera kernel name restriction check to clang-tidy.

The altera kernel name restriction check finds kernel files and include
directives whose filename is "kernel.cl", "Verilog.cl", or "VHDL.cl".
Such kernel file names cause the Altera Offline Compiler to generate
intermediate design files that have the same names as certain internal
files, which leads to a compilation error.

As per the "Guidelines for Naming the Kernel" section in the "Intel FPGA
SDK for OpenCL Pro Edition: Programming Guide."

This reverts the reversion from 43a38a65233039b5e71797a644d41a890f8d7f2b.

3 years ago[mlir] Add initial Python bindings for DenseInt/FPElementsAttr
Alex Zinenko [Fri, 6 Nov 2020 10:59:22 +0000 (11:59 +0100)]
[mlir] Add initial Python bindings for DenseInt/FPElementsAttr

Enumerating elements in these classes is necessary to enable custom
operand accessors for variadic operands.

Depends On D90919

Reviewed By: stellaraccident

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

3 years ago[VPlan] Print result value for loads in VPWidenMemoryInst (NFC).
Florian Hahn [Mon, 9 Nov 2020 13:52:54 +0000 (13:52 +0000)]
[VPlan] Print result value for loads in VPWidenMemoryInst (NFC).

For loads, print the result value.

3 years ago[VPlan] Add isStore helper to VPWidenMemoryInstructionRecipe (NFC).
Florian Hahn [Mon, 9 Nov 2020 13:50:58 +0000 (13:50 +0000)]
[VPlan] Add isStore helper to VPWidenMemoryInstructionRecipe (NFC).

Move logic to check if the recipe is a store to a helper for easier
reuse.

3 years ago[mlir] Expose operation attributes to Python bindings
Alex Zinenko [Fri, 6 Nov 2020 10:25:41 +0000 (11:25 +0100)]
[mlir] Expose operation attributes to Python bindings

Operations in a MLIR have a dictionary of attributes attached. Expose
those to Python bindings through a pseudo-container that can be indexed
either by attribute name, producing a PyAttribute, or by a contiguous
index for enumeration purposes, producing a PyNamedAttribute.

Depends On D90917

Reviewed By: stellaraccident

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

3 years ago[llvm-mca] Add branch forms of ALU instructions to Cortex-A57 test
Evgeny Leviant [Mon, 9 Nov 2020 13:53:50 +0000 (16:53 +0300)]
[llvm-mca] Add branch forms of ALU instructions to Cortex-A57 test

3 years ago[AMDGPU] Remove unused DisableDecoder machinery. NFC.
Jay Foad [Mon, 9 Nov 2020 13:51:40 +0000 (13:51 +0000)]
[AMDGPU] Remove unused DisableDecoder machinery. NFC.

This has been unused since D24738.

3 years ago[VPlan] Use VPValue def for VPWidenCall.
Florian Hahn [Mon, 9 Nov 2020 13:29:41 +0000 (13:29 +0000)]
[VPlan] Use VPValue def for VPWidenCall.

This patch turns VPWidenCall into a VPValue and uses it
during VPlan construction and codegeneration instead of the plain IR
reference where possible.

Reviewed By: dmgreen

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

3 years ago[clang-tidy] Remove bad assert after 3b9b90a1
Nathan James [Mon, 9 Nov 2020 13:21:55 +0000 (13:21 +0000)]
[clang-tidy] Remove bad assert after 3b9b90a1

Forgot to remove it on push, just there to help debugging

3 years ago[AMDGPU][MC] Added tests for checking error position
Dmitry Preobrazhensky [Mon, 9 Nov 2020 12:46:27 +0000 (15:46 +0300)]
[AMDGPU][MC] Added tests for checking error position

See bug 47519: https://bugs.llvm.org/show_bug.cgi?id=47519

Reviewers: arsenm, rampitec

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

3 years ago[ARM] Remove kill flags between VCMP and insertion point
David Green [Mon, 9 Nov 2020 13:17:53 +0000 (13:17 +0000)]
[ARM] Remove kill flags between VCMP and insertion point

When we fold a VCMP into a VPST instruction any kill flags between the
old VCMP position and the new insertion point need to be removed, in
order to keep the verifier happy.

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

3 years ago[ARM][AArch64] Adding Neoverse V1 CPU support
Lucas Prates [Wed, 28 Oct 2020 11:07:17 +0000 (11:07 +0000)]
[ARM][AArch64] Adding Neoverse V1 CPU support

Add support for the Neoverse V1 CPU to the ARM and AArch64 backends.

This is based on patches from Mark Murray and Victor Campos.

Reviewed By: dmgreen

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

3 years ago[InterleavedAccess] Remove unused check-prefixes
Simon Pilgrim [Mon, 9 Nov 2020 13:12:10 +0000 (13:12 +0000)]
[InterleavedAccess] Remove unused check-prefixes

Just use default CHECK

3 years ago[ConstProp] Remove unused check-prefixes
Simon Pilgrim [Mon, 9 Nov 2020 13:08:56 +0000 (13:08 +0000)]
[ConstProp] Remove unused check-prefixes

Just use default CHECK and remove duplicate RUN

3 years ago[CodeGenPrepare] Remove unused check-prefixes
Simon Pilgrim [Mon, 9 Nov 2020 13:01:48 +0000 (13:01 +0000)]
[CodeGenPrepare] Remove unused check-prefixes

3 years ago[llvm][AArch64] Simplify (and (sign_extend..) #bitmask).
Francesco Petrogalli [Mon, 9 Nov 2020 11:37:25 +0000 (11:37 +0000)]
[llvm][AArch64] Simplify (and (sign_extend..) #bitmask).

Fold

    VT = (and (sign_extend NarrowVT to VT) #bitmask)

into

    VT = (zero_extend NarrowVT)

With this combine, the test replaces a sign extended load + an
unsigned extention with a zero extended load to render one of the
operands of the last multiplication.

  BEFORE                       |  AFTER
    f_i16_i32:                 |    f_i16_i32:
         .fnstart              |           .fnstart
         ldrsh   r0, [r0]      |           ldrh    r1, [r1]
         ldrsh   r1, [r1]      |           ldrsh   r0, [r0]
         smulbb  r0, r1, r0    |           smulbb  r0, r0, r1
         uxth    r1, r1        |           mul     r0, r0, r1
         mul     r0, r0, r1    |           bx      lr
         bx      lr            |

Reviewed By: resistor

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

3 years ago[VPlan] Add printOperands helper to VPUser (NFC).
Florian Hahn [Mon, 9 Nov 2020 12:10:03 +0000 (12:10 +0000)]
[VPlan] Add printOperands helper to VPUser (NFC).

Factor out the code for printing operands of a VPUser so it can be
re-used when printing other recipes.

3 years ago[lld] Provide a hook to customize undefined symbols error handling
serge-sans-paille [Mon, 19 Oct 2020 11:21:23 +0000 (13:21 +0200)]
[lld] Provide a hook to customize undefined symbols error handling

This is a follow up to https://reviews.llvm.org/D87758, implementing the missing
symbol part, as done by binutils.

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

3 years ago[LoopVectorize] Remove unused check-prefixes
Simon Pilgrim [Mon, 9 Nov 2020 12:14:09 +0000 (12:14 +0000)]
[LoopVectorize] Remove unused check-prefixes

3 years ago[LoopVectorize][AMDGPU] Regenerate packed-math test checks
Simon Pilgrim [Mon, 9 Nov 2020 12:12:48 +0000 (12:12 +0000)]
[LoopVectorize][AMDGPU] Regenerate packed-math test checks

3 years ago[MemCpyOpt] Remove unused check-prefixes
Simon Pilgrim [Mon, 9 Nov 2020 11:38:39 +0000 (11:38 +0000)]
[MemCpyOpt] Remove unused check-prefixes

Just use default CHECK

3 years ago[NewGVN] Remove unused check-prefixes
Simon Pilgrim [Mon, 9 Nov 2020 11:29:29 +0000 (11:29 +0000)]
[NewGVN] Remove unused check-prefixes

3 years ago[clangd] Handle duplicate enum constants in PopulateSwitch tweak
Nathan James [Mon, 9 Nov 2020 12:14:51 +0000 (12:14 +0000)]
[clangd] Handle duplicate enum constants in PopulateSwitch tweak

If an enum has different names for the same constant, make sure only the first one declared gets added into the switch. Failing to do so results in a compiler error as 2 case labels can't represent the same value.

```
lang=c
enum Numbers{
One,
Un = One,
Two,
Deux = Two,
Three,
Trois = Three
};

// Old behaviour
switch (<Number>) {
  case One:
  case Un:
  case Two:
  case Duex:
  case Three:
  case Trois: break;
}

// New behaviour
switch (<Number>) {
  case One:
  case Two:
  case Three: break;
}
```

Reviewed By: sammccall

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

3 years ago[LLDB][test] - Update one more test after the yaml2obj change.
Georgii Rymar [Mon, 9 Nov 2020 11:55:16 +0000 (14:55 +0300)]
[LLDB][test] - Update one more test after the yaml2obj change.

I've missed this one.

3 years ago[InstCombine] Fix constant-folding of overflowing arithmetic ops on vectors
LemonBoy [Mon, 9 Nov 2020 11:39:34 +0000 (14:39 +0300)]
[InstCombine] Fix constant-folding of overflowing arithmetic ops on vectors

Feeding vector values to `InstCombiner::OptimizeOverflowCheck` produces a scalar boolean flag if it proves the overflow check can be eliminated.
This causes `InstCombiner::CreateOverflowTuple` to crash as it correctly expects a vector of i1 values instead.

Reviewed By: lebedev.ri

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

3 years agoReland "Precommit LTO pipeline test"
Sanne Wouda [Tue, 3 Nov 2020 19:34:27 +0000 (19:34 +0000)]
Reland "Precommit LTO pipeline test"

Target Pass Configuration does not always run, so we can't check for it.

3 years ago[SLPVectorizer][X86] Remove unused check-prefixes
Simon Pilgrim [Mon, 9 Nov 2020 10:56:46 +0000 (10:56 +0000)]
[SLPVectorizer][X86] Remove unused check-prefixes

3 years ago[lldb] [Host/freebsd] Set Arg0 for 'platform process list -v'
Michał Górny [Sun, 8 Nov 2020 09:44:54 +0000 (10:44 +0100)]
[lldb] [Host/freebsd] Set Arg0 for 'platform process list -v'

Same fix as in NetBSD (a6712889f5f1702dfa535718abe400d1a83174c5).

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

3 years agoRevert "[lldb] [Host/freebsd] Set Arg0 for 'platform process list -v'"
Michał Górny [Mon, 9 Nov 2020 11:08:19 +0000 (12:08 +0100)]
Revert "[lldb] [Host/freebsd] Set Arg0 for 'platform process list -v'"

Accidentally referenced the wrong diff.

This reverts commit fce8e758892f0b650762513680adc06cea53d6e3.

3 years ago[lldb][test] - Update test cases after yaml2obj change.
Georgii Rymar [Mon, 9 Nov 2020 10:52:58 +0000 (13:52 +0300)]
[lldb][test] - Update test cases after yaml2obj change.

The format of program header descriptions was changed by D90458.

3 years ago[SimplifyCFG] Remove unused check-prefixes
Simon Pilgrim [Mon, 9 Nov 2020 10:36:46 +0000 (10:36 +0000)]
[SimplifyCFG] Remove unused check-prefixes

3 years ago[Scalarizer] Remove unused check-prefixes
Simon Pilgrim [Mon, 9 Nov 2020 10:27:52 +0000 (10:27 +0000)]
[Scalarizer] Remove unused check-prefixes

3 years ago[llvm] [Support] Fix segv if argv0 is null in getMainExecutable()
Michał Górny [Sat, 7 Nov 2020 21:03:29 +0000 (22:03 +0100)]
[llvm] [Support] Fix segv if argv0 is null in getMainExecutable()

When LLDB Python bindings are used and stack backtraces are enabled
for logging, getMainExecutable() is called with argv0 being null.
This caused the fallback function getprogpath() (used on FreeBSD, NetBSD
and Linux) to segfault.  Make it handle null executable name gracefully.

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

3 years ago[lldb] [Host/freebsd] Set Arg0 for 'platform process list -v'
Michał Górny [Sun, 8 Nov 2020 09:44:54 +0000 (10:44 +0100)]
[lldb] [Host/freebsd] Set Arg0 for 'platform process list -v'

Same fix as in NetBSD (a6712889f5f1702dfa535718abe400d1a83174c5).

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

3 years ago[lldb] [test] Extend watchpoint test to wait for thread to start
Michał Górny [Sun, 8 Nov 2020 13:08:54 +0000 (14:08 +0100)]
[lldb] [test] Extend watchpoint test to wait for thread to start

TestWatchpointMultipleThreads currently accounts for two scenarios:
setting the watchpoint before a new thread starts (presumably, verifying
that it will be propagated to the new thread) and setting it after
the thread starts (presumably, verifying that a new watchpoint is set
on all threads).  However, the latter test currently assumes that
the thread will be reported to the debugger before the breakpoint is
hit.  This is not the case on FreeBSD and NetBSD.

On NetBSD, new threads do not inherit debug registers from their parent
threads.  Instead, LLDB copies them manually after the new thread is
reported.  Since the thread is actually reported after the second
breakpoint location, both tests effectively check the same behavior
(i.e. watchpoint being set before the new thread is reported).

On FreeBSD, new threads inherit debug registers and we seem to hit
an interesting race condition.  While the thread is reported after
the breakpoint is hit, the kernel seems to construct it and copy
the debug register before that happens.  As a result, setting
the watchpoint at the second breakpoint location modifies the debug
registers of the first thread after they have been copied to the second
thread but before the debugger is aware of it.  Therefore,
the watchpoint is not propagated to the second thread and the test
fails.

Extend the test to cover all three possible scenarios: setting
watchpoint before the thread is lanched, after it is launched but before
it is guaranteed to have started and after it has actually started.  Add
a second barrier to account for the last case.  This should ensure that
the second assumption (i.e. that the watchpoint is set on all currently
known threads) is actually tested on FreeBSD and NetBSD.

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

3 years ago[lldb] [Process/FreeBSDRemote] Handle exec() from inferior
Michał Górny [Fri, 6 Nov 2020 14:32:43 +0000 (15:32 +0100)]
[lldb] [Process/FreeBSDRemote] Handle exec() from inferior

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