lldb.git
2 years ago[libc] Fix warnings on release build.
Paula Toth [Thu, 7 May 2020 18:55:29 +0000 (11:55 -0700)]
[libc] Fix warnings on release build.

Summary:
These warnings were present when building llvm-libc in release mode.

```
workspace/llvm-project/libc/utils/benchmarks/LibcMemoryBenchmarkTest.cpp:50:34: warning: 'None' is deprecated: Use Align() or Align(1) instead [-Wdeprecated-declarations]
  Conf.AddressAlignment = Align::None();

workspace/llvm-project/libc/utils/testutils/FDReaderUnix.cpp:19:7: warning: unused variable 'err' [-Wunused-variable]
  int err = ::pipe(pipefd);
```

For test-utils it seems in general we should use `report_fatal_error` instead of asserts as these are turned off when building in release mode.
https://llvm.org/docs/CodingStandards.html#assert-liberally

Reviewers: abrachet, sivachandra

Reviewed By: abrachet, sivachandra

Subscribers: tschuett, libc-commits

Tags: #libc-project

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

2 years ago[lldb/Test] Fix typo in find-and-replace.
Jonas Devlieghere [Thu, 7 May 2020 18:53:57 +0000 (11:53 -0700)]
[lldb/Test] Fix typo in find-and-replace.

2 years ago[clang-format] [PR45791] BeforeLambdaBody is confused by comment inside lambda
mydeveloperday [Thu, 7 May 2020 18:53:56 +0000 (19:53 +0100)]
[clang-format] [PR45791] BeforeLambdaBody is confused by comment inside lambda

Summary:
https://bugs.llvm.org/show_bug.cgi?id=45791

Lambda with line comment is incorrectly formatted

```
auto k = []() // comment
{ return; };
````

```
auto k = []() // comment { return; };
```

Reviewed By: Wawha

Subscribers: cfe-commits

Tags: #clang, #clang-format

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

2 years ago[clang-format] ensure dump_format_style.py works with Python3 correctly
mydeveloperday [Thu, 7 May 2020 18:52:12 +0000 (19:52 +0100)]
[clang-format] ensure dump_format_style.py works with Python3 correctly

Summary:
Python2 has been removed from cygwin, this means anyone running the dump_format_style.py in a cygwin shell could pick up python3 instead

In Python3 all strings are unicode as the file is opened in binary mode we need to encode the contents string or we'll face the following error

```
Traceback (most recent call last):
  File "./dump_format_style.py", line 228, in <module>
    output.write(contents)
TypeError: a bytes-like object is required, not 'str'
```

Reviewed By: krasimir

Subscribers: cfe-commits

Tags: #clang, #clang-format

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

2 years ago[clang-format] [PR45126] Help text is missing all available formats
mydeveloperday [Thu, 7 May 2020 18:50:21 +0000 (19:50 +0100)]
[clang-format] [PR45126] Help text is missing all available formats

Summary:
https://bugs.llvm.org/show_bug.cgi?id=45126

GNU and Microsoft styles are built in supported styles but are not displayed in the help text

Reviewed By: sammccall

Subscribers: cfe-commits

Tags: #clang, #clang-format

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

2 years ago [flang]Add examples in documentation/BijectiveInternalNameUniquing.md
sameeran joshi [Tue, 5 May 2020 20:11:58 +0000 (01:41 +0530)]
[flang]Add examples in documentation/BijectiveInternalNameUniquing.md

    Summary:
    I thought it would be simpler to understand on how the unique names would
    look like when an example is present. So I added some examples.

    I found 2 such places to add examples
    -Common blocks
    -Module scope global data

    Reviewers: schweitz, kiranchandramohan, sscalpone, jeanPerier, jdoerfert, DavidTruby

    Reviewed By: schweitz, jeanPerier

    Subscribers: llvm-commits, flang-commits

    Tags: #flang, #llvm

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

2 years agoAdd a function to detect whether an Xcode SDK supports Swift
Adrian Prantl [Thu, 7 May 2020 01:02:44 +0000 (18:02 -0700)]
Add a function to detect whether an Xcode SDK supports Swift

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

2 years ago[lldb/Test] Add @skipIfReproducer to tests using lldb::FileSP.
Jonas Devlieghere [Thu, 7 May 2020 18:15:58 +0000 (11:15 -0700)]
[lldb/Test] Add @skipIfReproducer to tests using lldb::FileSP.

lldb::FileSP is a typedef for std::shared_ptr<lldb_private::File> and
the reproducers cannot instrument a lldb_private constructor.

2 years agoAdd an XcodeSDK::GetSDKTypeForTriple function
Adrian Prantl [Thu, 7 May 2020 17:53:50 +0000 (10:53 -0700)]
Add an XcodeSDK::GetSDKTypeForTriple function

This is something used in swift-lldb, but of general usefulness.

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

<rdar://problem/62684906>

2 years ago[YAMLVFSWriter][Test][NFC] Add couple tests
Jan Korous [Wed, 6 May 2020 19:15:49 +0000 (12:15 -0700)]
[YAMLVFSWriter][Test][NFC] Add couple tests

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

2 years ago[mlir] Remove unnecessary DEPENDS for MLIRMlirOptMain
Lei Zhang [Thu, 7 May 2020 13:47:27 +0000 (09:47 -0400)]
[mlir] Remove unnecessary DEPENDS for MLIRMlirOptMain

https://github.com/llvm/llvm-project/commit/c296d2dc53d5c11c
fixes the dependency issue by turning LINK_LIBS to PUBLIC.
These explicit DEPENDS are not needed anymore.

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

2 years ago[YAMLVFSWriter] Fix directory handling
Jan Korous [Wed, 6 May 2020 06:45:49 +0000 (23:45 -0700)]
[YAMLVFSWriter] Fix directory handling

For empty directories (except the first one) we've been adding a file
with the same name as the directory to the result VFS mapping.

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

2 years ago[mlir][vulkan-runner] Remove duplicated/uncessary link libraries
Lei Zhang [Thu, 7 May 2020 14:31:19 +0000 (10:31 -0400)]
[mlir][vulkan-runner] Remove duplicated/uncessary link libraries

vulkan-runtime-wrappers does not need MLIRSPIRVSerialization,
which is used by the ConvertGpuLaunchFuncToVulkanLaunchFunc pass
under the hood.

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

2 years ago[libc++] Fix ostream for complex numbers with fixed field width
Antonio Sanchez [Thu, 7 May 2020 17:49:12 +0000 (13:49 -0400)]
[libc++] Fix ostream for complex numbers with fixed field width

The ostream operator<< is currently broken for std::complex with
specified field widths.

This patch a partial revert of c3478eff7a65 (reviewed as D71214),
restoring the correct behavior.

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

2 years agoReuse existing functionality in XcodeSDK::SDKSupportsModules (NFC)
Adrian Prantl [Thu, 7 May 2020 00:20:15 +0000 (17:20 -0700)]
Reuse existing functionality in XcodeSDK::SDKSupportsModules (NFC)

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

2 years ago[YAMLVFSWriter][Tests] Fix YAMLVFSWriterTest
Jan Korous [Wed, 6 May 2020 05:03:37 +0000 (22:03 -0700)]
[YAMLVFSWriter][Tests] Fix YAMLVFSWriterTest

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

2 years ago[libc++] NFC: Port type_info tests to C++03
Louis Dionne [Thu, 7 May 2020 17:41:45 +0000 (13:41 -0400)]
[libc++] NFC: Port type_info tests to C++03

2 years ago[dsymutil] Avoid relocating DW_AT_call_pc twice
Vedant Kumar [Thu, 7 May 2020 01:06:40 +0000 (18:06 -0700)]
[dsymutil] Avoid relocating DW_AT_call_pc twice

Summary:
Avoid relocating DW_AT_call_pc, e.g. when a call PC is equal to the
function's low_pc as is the case in the test:

```
__Z5func1v:
0000000100007f94        b       __Z5func2v
```

rdar://62952440

Reviewers: friss, JDevlieghere

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

2 years ago[libc++] chrono: check _POSIX_TIMERS before using clock_gettime
Mara Sophie Grosch [Thu, 7 May 2020 16:10:33 +0000 (12:10 -0400)]
[libc++] chrono: check _POSIX_TIMERS before using clock_gettime

clock_gettime is documented to be available when _POSIX_TIMERS is
defined. Add a check for this.

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

2 years ago[lldb/Reproducers] Make DoConnectRemote connect to the replay server.
Jonas Devlieghere [Thu, 7 May 2020 17:02:08 +0000 (10:02 -0700)]
[lldb/Reproducers] Make DoConnectRemote connect to the replay server.

All entry points into ProcessGDBRemote that connect to the debug server
should connect to the replay server instead during reproducer replay.
This patch adds the necessary logic for ConnectRemote, which is
accessible from the SB API. This fixes active replay for
TestRecognizeBreakpoint.py as described in D78588.

2 years ago[ModuloSchedule] Fix epilogue peeling with illegal phi.
Thomas Raoux [Thu, 7 May 2020 15:30:00 +0000 (08:30 -0700)]
[ModuloSchedule] Fix epilogue peeling with illegal phi.

When peeling out the epilogue we need to ignore illegal phis coming from stages
greater than the producer stage. Otherwise we end up with circular phi
dependencies.

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

2 years ago[libc++][test] Adjust move_iterator tests to allow C++20
Casey Carter [Thu, 7 May 2020 16:58:13 +0000 (09:58 -0700)]
[libc++][test] Adjust move_iterator tests to allow C++20

These tests fail due to a couple of changes to `move_iterator` for C++20:

* `move_iterator<I>::operator++(int)` returns `void` in C++20 if `I` doesn't model `forward_iterator`.

* `move_iterator<I>::reference` is calculated in C++20, so `I` must actually have an `operator*() const`.

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

2 years ago[libc++] Add tests for _LIBCPP_HAS_MERGED_TYPEINFO_NAMES_DEFAULT
Louis Dionne [Mon, 27 Apr 2020 18:46:52 +0000 (14:46 -0400)]
[libc++] Add tests for _LIBCPP_HAS_MERGED_TYPEINFO_NAMES_DEFAULT

The issue on Apple platforms was fixed in 2464d8135e2a, but this commit
adds some tests to make sure we don't regress.

See https://llvm.org/PR45549.

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

2 years ago[mlir] Drop forward-declaration of loop::TerminatorOp.
Alex Zinenko [Thu, 7 May 2020 16:27:40 +0000 (18:27 +0200)]
[mlir] Drop forward-declaration of loop::TerminatorOp.

This Op has been deleted in favor of loop::YieldOp, but the forward
declaration remain in the header.

2 years agoAdd a test for "clang --version".
Nico Weber [Thu, 7 May 2020 16:14:51 +0000 (12:14 -0400)]
Add a test for "clang --version".

2 years agotab completion for register read/write
Gongyu Deng [Thu, 7 May 2020 16:12:39 +0000 (18:12 +0200)]
tab completion for register read/write

Summary:
1. Created a new common completion for the registers of the current context;
2. Apply this new common completion to the commands register read/write;
3. Unit test.

Reviewers: teemperor, JDevlieghere

Reviewed By: teemperor

Tags: #lldb

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

2 years ago[libcxx] Add deduction guides for shared_ptr and weak_ptr
Logan Smith [Thu, 7 May 2020 16:07:01 +0000 (12:07 -0400)]
[libcxx] Add deduction guides for shared_ptr and weak_ptr

This patch adds deduction guides to <memory> to allow deducing
construction of shared_ptrs from unique_ptrs, and from weak_ptrs
and vice versa, as specified by C++17.

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

2 years ago[libcxx] Qualify make_pair in searcher implementations to prevent ADL
Logan Smith [Thu, 7 May 2020 15:54:25 +0000 (11:54 -0400)]
[libcxx] Qualify make_pair in searcher implementations to prevent ADL

This patch adds `_VSTD::` to some calls to `make_pair` inside the
implementations of searchers, to prevent things exploding if there is
a make_pair in an associated namespace of a user-defined type.
https://godbolt.org/z/xAFG98

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

2 years ago[lldb][NFC] Also initialize language_flags in ValueObject::Dereference
Raphael Isemann [Thu, 7 May 2020 15:33:45 +0000 (17:33 +0200)]
[lldb][NFC] Also initialize language_flags in ValueObject::Dereference

We currently rely on the TypeSystem implementation to initialize this value
with 0 in the GetChildCompilerTypeAtIndex call below. Let's just initialize
this variable like the rest.

2 years ago[SVE] Fix incorrect usage of getNumElements() in InstCombineCalls
Christopher Tetreault [Thu, 7 May 2020 15:34:55 +0000 (08:34 -0700)]
[SVE] Fix incorrect usage of getNumElements() in InstCombineCalls

Summary:
Remove incorrect usage of getNumElements() from visitCallInst(). The
number of elements was being used to construct a DemandedElts bitfield.
This operation does not make sense for scalable vectors. Cast to
FixedVectorType

Identified by test case Clang :: CodeGen/aarch64-sve-intrinsics/acle_sve_mla.c

Reviewers: rengolin, efriedma, sdesmalen, c-rhodes, david-arm

Reviewed By: david-arm

Subscribers: tschuett, kristof.beyls, hiraditya, rkruppe, psnobl, llvm-commits

Tags: #llvm

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

2 years ago[cmake] Add headers in include/llvm/Remarks subdirectory
Simon Pilgrim [Thu, 7 May 2020 15:43:11 +0000 (16:43 +0100)]
[cmake] Add headers in include/llvm/Remarks subdirectory

Appeases visual studio

2 years ago[MSan] Pass MSan command line options under new pass manager
Arthur Eubanks [Tue, 5 May 2020 20:33:13 +0000 (13:33 -0700)]
[MSan] Pass MSan command line options under new pass manager

Summary:
Properly forward TrackOrigins and Recover user options to the MSan pass under the new pass manager.
This makes the number of check-msan failures when ENABLE_EXPERIMENTAL_NEW_PASS_MANAGER is TRUE go from 52 to 2.

Based on https://reviews.llvm.org/D77249.

Reviewers: nemanjai, vitalybuka, leonardchan

Subscribers: cfe-commits

Tags: #clang

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

2 years ago[SveEmitter] Add builtins for SVE2 svtbx (extended table lookup)
Sander de Smalen [Tue, 5 May 2020 15:31:56 +0000 (16:31 +0100)]
[SveEmitter] Add builtins for SVE2 svtbx (extended table lookup)

This patch adds builtins for:
- svtbx

2 years ago[SveEmitter] Add builtins for SVE2 Optional extensions (AES, SHA3, SM4, BITPERM)
Sander de Smalen [Tue, 5 May 2020 15:26:30 +0000 (16:26 +0100)]
[SveEmitter] Add builtins for SVE2 Optional extensions (AES, SHA3, SM4, BITPERM)

This patch adds various builtins under their corresponding feature macros:

Defined under __ARM_FEATURE_SVE2_AES:
- svaesd
- svaese
- svaesimc
- svaesmc
- svpmullb_pair
- svpmullt_pair

Defined under __ARM_FEATURE_SVE2_SHA3:
- svrax1

Defined under __ARM_FEATURE_SVE2_SM4:
- svsm4e
- svsm4ekey

Defined under __ARM_FEATURE_SVE2_BITPERM:
- svbdep
- svbext
- svbgrp

2 years ago[SveEmitter] Add builtins for SVE2 Character match instructions
Sander de Smalen [Tue, 5 May 2020 15:22:22 +0000 (16:22 +0100)]
[SveEmitter] Add builtins for SVE2 Character match instructions

This patch adds builtins for:
- svmatch
- svnmatch

2 years ago[SveEmitter] Add builtins for SVE2 Vector histogram count instructions
Sander de Smalen [Tue, 5 May 2020 15:21:46 +0000 (16:21 +0100)]
[SveEmitter] Add builtins for SVE2 Vector histogram count instructions

This patch adds builtins for:
- svhistcnt
- svhistseg

2 years ago[SveEmitter] Add builtins for SVE2 Floating-point integer binary logarithm instructions
Sander de Smalen [Tue, 5 May 2020 15:19:24 +0000 (16:19 +0100)]
[SveEmitter] Add builtins for SVE2 Floating-point integer binary logarithm instructions

This patch adds builtins for:
- svlogb

2 years ago[SveEmitter] Add builtins for SVE2 Floating-point widening multiply-accumulate
Sander de Smalen [Tue, 5 May 2020 15:07:09 +0000 (16:07 +0100)]
[SveEmitter] Add builtins for SVE2 Floating-point widening multiply-accumulate

This patch adds builtins for:
- svmlalb, svmlalb_lane
- svmlalt, svmlalt_lane
- svmlslb, svmlslb_lane
- svmlslt, svmlslt_lane

2 years ago[SveEmitter] Add builtins for SVE2 Complex integer dot product
Sander de Smalen [Tue, 5 May 2020 15:04:00 +0000 (16:04 +0100)]
[SveEmitter] Add builtins for SVE2 Complex integer dot product

This patch adds builtins for:
- svcdot, svcdot_lane

2 years ago[SveEmitter] Add builtins for SVE2 Widening complex integer arithmetic
Sander de Smalen [Tue, 5 May 2020 14:26:59 +0000 (15:26 +0100)]
[SveEmitter] Add builtins for SVE2 Widening complex integer arithmetic

This patch adds builtins for:
- svaddlbt
- svqdmlalbt
- svqdmlslbt
- svsublbt
- svsubltb

2 years ago[SveEmitter] Add builtins for SVE2 Narrowing DSP operations
Sander de Smalen [Tue, 5 May 2020 14:13:35 +0000 (15:13 +0100)]
[SveEmitter] Add builtins for SVE2 Narrowing DSP operations

This patch adds builtins for:
- svaddhnb
- svaddhnt
- svqrshrnb
- svqrshrnt
- svqrshrunb
- svqrshrunt
- svqshrnb
- svqshrnt
- svqshrunb
- svqshrunt
- svqxtnb
- svqxtnt
- svqxtunb
- svqxtunt
- svraddhnb
- svraddhnt
- svrshrnb
- svrshrnt
- svrsubhnb
- svrsubhnt
- svshrnb
- svshrnt
- svsubhnb
- svsubhnt

2 years ago[SveEmitter] Add builtins for SVE2 Widening DSP operations
Sander de Smalen [Tue, 5 May 2020 14:10:48 +0000 (15:10 +0100)]
[SveEmitter] Add builtins for SVE2 Widening DSP operations

This patch adds builtins for:
- svabalb
- svabalt
- svabdlb
- svabdlt
- svaddlb
- svaddlt
- svaddwb
- svaddwt
- svmlalb, svmlalb_lane
- svmlalt, svmlalt_lane
- svmlslb, svmlslb_lane
- svmlslt, svmlslt_lane
- svmullb, svmullb_lane
- svmullt, svmullt_lane
- svqdmlalb, svqdmlalb_lane
- svqdmlalt, svqdmlalt_lane
- svqdmlslb, svqdmlslb_lane
- svqdmlslt, svqdmlslt_lane
- svqdmullb, svqdmullb_lane
- svqdmullt, svqdmullt_lane
- svshllb
- svshllt
- svsublb
- svsublt
- svsubwb
- svsubwt

2 years ago[SveEmitter] Add builtins for SVE2 Uniform complex integer arithmetic
Sander de Smalen [Tue, 5 May 2020 14:09:47 +0000 (15:09 +0100)]
[SveEmitter] Add builtins for SVE2 Uniform complex integer arithmetic

This patch adds builtins for:
- svcadd
- svqcadd
- svcmla
- svcmla_lane
- svqrdcmlah
- svqrdcmlah_lane

2 years agoRevert "Let clang print registered targets for --version"
Yaxun (Sam) Liu [Thu, 7 May 2020 14:59:43 +0000 (10:59 -0400)]
Revert "Let clang print registered targets for --version"

This reverts commit 66041187c9028f730c41597fe5ea6a63fda1ccad.

Will reland it under --print-target.

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

2 years ago[flang] Fix to IsDescriptor
Tim Keith [Thu, 7 May 2020 14:50:39 +0000 (07:50 -0700)]
[flang] Fix to IsDescriptor

IsDescriptor was returning false for a component whose shape depended
on a length parameter. Change it to return true for any array with
non-constant bounds.

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

2 years agoRevert "[SLP] add another bailout for load-combine patterns"
Hans Wennborg [Thu, 7 May 2020 14:26:36 +0000 (16:26 +0200)]
Revert "[SLP] add another bailout for load-combine patterns"

It caused asserts building Chromium, see discussion on
https://reviews.llvm.org/D78997

This reverts commit 86dfbc676ebe4f46f9cff629f0fe21fa65bd0f97.

2 years ago[VectorCombine] add tests for insert into arbitrary constant; NFC
Sanjay Patel [Thu, 7 May 2020 14:12:47 +0000 (10:12 -0400)]
[VectorCombine] add tests for insert into arbitrary constant; NFC

Goes with D79452.

2 years ago[SveEmitter] Add builtins for SVE2 Multiplication by indexed elements
Sander de Smalen [Tue, 5 May 2020 14:08:10 +0000 (15:08 +0100)]
[SveEmitter] Add builtins for SVE2 Multiplication by indexed elements

This patch adds builtins for:
- svmla_lane
- svmls_lane
- svmul_lane

2 years ago[SveEmitter] Add builtins for SVE2 Large integer arithmetic
Sander de Smalen [Tue, 5 May 2020 14:00:57 +0000 (15:00 +0100)]
[SveEmitter] Add builtins for SVE2 Large integer arithmetic

This patch adds builtins for:
- svadclb
- svadclt
- svsbclb
- svsbclt

2 years ago[SveEmitter] Add builtins for SVE2 Bitwise ternary logical instructions
Sander de Smalen [Tue, 5 May 2020 13:59:15 +0000 (14:59 +0100)]
[SveEmitter] Add builtins for SVE2 Bitwise ternary logical instructions

This patch adds builtins for:
- svbcax
- svbsl
- svbsl1n
- svbsl2n
- sveor3
- svnbsl
- svxar

2 years ago[SveEmitter] Add builtins for SVE2 widening pairwise arithmetic
Sander de Smalen [Tue, 5 May 2020 13:58:01 +0000 (14:58 +0100)]
[SveEmitter] Add builtins for SVE2 widening pairwise arithmetic

This patch adds builtins for:
- svadalp

2 years ago[SveEmitter] Add builtins for SVE2 Non-widening pairwise arithmetic
Sander de Smalen [Tue, 5 May 2020 13:57:18 +0000 (14:57 +0100)]
[SveEmitter] Add builtins for SVE2 Non-widening pairwise arithmetic

This patch adds builtins for:
- svaddp
- svmaxnmp
- svmaxp
- svminnmp
- svminp

2 years ago[OPENMP]Consider 'omp_null_allocator' as a predefined allocator.
Alexey Bataev [Thu, 30 Apr 2020 17:32:22 +0000 (13:32 -0400)]
[OPENMP]Consider 'omp_null_allocator' as a predefined allocator.

Summary:
omp.h header file defines omp_null_allocator as a predefined allocator,
need to consider it also as a predefined allocator.

Reviewers: jdoerfert

Subscribers: jholewinski, yaxunl, guansong, cfe-commits, caomhin

Tags: #clang

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

2 years ago[X86] Add AVX512VL concat-cast tests.
Simon Pilgrim [Thu, 7 May 2020 14:08:17 +0000 (15:08 +0100)]
[X86] Add AVX512VL concat-cast tests.

2 years ago[mlir][spirv] Serialize all operands together if possible
Lei Zhang [Tue, 5 May 2020 20:43:00 +0000 (16:43 -0400)]
[mlir][spirv] Serialize all operands together if possible

SPIR-V ops can mix operands and attributes in the definition. These
operands and attributes are serialized in the exact order of the definition
to match SPIR-V binary format requirements. It can cause excessive
generated code bloat because we are emitting code to handle each
operand/attribute separately. So here we probe first to check whether all
the operands are ahead of attributes. Then we can serialize all operands
together.

This removes ~1000 lines of code from the generated inc file.

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

2 years ago[mlir][spirv] Remove template functions for getting op's opcode
Lei Zhang [Tue, 5 May 2020 20:41:58 +0000 (16:41 -0400)]
[mlir][spirv] Remove template functions for getting op's opcode

These template functions are used in the serializer, where we can
actually directly query the opcode from the op's definition and
use that in the auto-generated serialization logic.

This removes a set of templates accounting for 319 lines from
the auto-generated inc file.

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

2 years ago[LV] Fix typo in variable name. NFC.
Sjoerd Meijer [Thu, 7 May 2020 12:12:46 +0000 (13:12 +0100)]
[LV] Fix typo in variable name. NFC.

2 years ago[SveEmitter] Add builtins for SVE2 uniform DSP operations
Sander de Smalen [Tue, 5 May 2020 13:53:07 +0000 (14:53 +0100)]
[SveEmitter] Add builtins for SVE2 uniform DSP operations

This patch adds builtins for:
- svqdmulh, svqdmulh_lane
- svqrdmlah, svqrdmlah_lane
- svqrdmlsh, svqrdmlsh_lane
- svqrdmulh, svqrdmulh_lane

2 years ago[SveEmitter] Add more SVE2 builtins for shift operations
Sander de Smalen [Tue, 5 May 2020 13:20:26 +0000 (14:20 +0100)]
[SveEmitter] Add more SVE2 builtins for shift operations

This patch adds builtins for:
- svqshlu
- svrshr
- svrsra
- svsli
- svsra
- svsri

2 years ago[SveEmitter] Add builtins for SVE2 saturating shift left and addition
Sander de Smalen [Tue, 5 May 2020 13:13:43 +0000 (14:13 +0100)]
[SveEmitter] Add builtins for SVE2 saturating shift left and addition

This patch adds builtins for:
- svqrshl
- svqshl
- svsqadd
- svuqadd

2 years ago[SveEmitter] Add builtins for SVE2 uniform DSP operations
Sander de Smalen [Tue, 5 May 2020 12:50:50 +0000 (13:50 +0100)]
[SveEmitter] Add builtins for SVE2 uniform DSP operations

This patch adds builtins for:
- svqadd, svhadd, svrhadd
- svqsub, svhsub, svqusbr, svhsubr
- svqabs
- svqneg
- svrecpe
- svrsqrte

2 years ago[SveEmitter] Add builtins for svqdecp and svqincp
Sander de Smalen [Tue, 5 May 2020 12:46:45 +0000 (13:46 +0100)]
[SveEmitter] Add builtins for svqdecp and svqincp

This patch adds builtins for saturating increment/decrement by svcntp,
in scalar and vector forms.

2 years ago[SveEmitter] Add builtins for svinsr
Sander de Smalen [Wed, 6 May 2020 12:55:50 +0000 (13:55 +0100)]
[SveEmitter] Add builtins for svinsr

2 years ago[X86][AVX] combineSignExtendInReg - promote mask arithmetic before v4i64 canonicalization
Simon Pilgrim [Thu, 7 May 2020 11:28:31 +0000 (12:28 +0100)]
[X86][AVX] combineSignExtendInReg - promote mask arithmetic before v4i64 canonicalization

We rely on the combine

(sext_in_reg (v4i64 a/sext (v4i32 x)), v4i1) -> (v4i64 sext (v4i32 sext_in_reg (v4i32 x, ExtraVT)))

to avoid complex v4i64 ashr codegen, but doing so prevents v4i64 comparison mask promotion, so ensure we attempt to promote before canonicalizing the (hopefully now redundant sext_in_reg).

Helps with the poor codegen in PR45808.

2 years ago[NFC][AArch64] Add test
Sam Parker [Thu, 7 May 2020 12:13:58 +0000 (13:13 +0100)]
[NFC][AArch64] Add test

Add cost model test for cast operations.

2 years ago[profile] Don't crash when forking in several threads
Calixte Denizet [Mon, 20 Apr 2020 08:50:30 +0000 (10:50 +0200)]
[profile] Don't crash when forking in several threads

Summary:
When forking in several threads, the counters were written out in using the same global static variables (see GCDAProfiling.c): that leads to crashes.
So when there is a fork, the counters are resetted in the child process and they will be dumped at exit using the interprocess file locking.
When there is an exec, the counters are written out and in case of failures they're resetted.

Reviewers: jfb, vsk, marco-c, serge-sans-paille

Reviewed By: marco-c, serge-sans-paille

Subscribers: llvm-commits, serge-sans-paille, dmajor, cfe-commits, hiraditya, dexonsmith, #sanitizers, marco-c, sylvestre.ledru

Tags: #sanitizers, #clang, #llvm

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

2 years agoRevert "[cmake] Allow std::filesystem tests in CrossWinToARMLinux.cmake"
Sergej Jaskiewicz [Thu, 7 May 2020 12:01:39 +0000 (15:01 +0300)]
Revert "[cmake] Allow std::filesystem tests in CrossWinToARMLinux.cmake"

This reverts commit 67175d8dc53b580bad439f85fda12623fa6993fa.

https://reviews.llvm.org/D78200 has been reverted, so our bot is red.
Make it green by turning off std::filesystem.

2 years ago[MLIR] Make ParallelLoopFusion pass scan through all nested regions.
Alexander Belyaev [Thu, 7 May 2020 08:53:06 +0000 (10:53 +0200)]
[MLIR] Make ParallelLoopFusion pass scan through all nested regions.

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

2 years ago[ARM][MVE] Add support for incrementing gathers
Anna Welker [Thu, 7 May 2020 11:29:15 +0000 (12:29 +0100)]
[ARM][MVE] Add support for incrementing gathers

Enables the MVEGatherScatterLowering pass to build
pre-incrementing gathers. Incrementing writeback gathers
are built when it is possible to replace the loop increment
instruction.

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

2 years ago[SveEmitter] Add builtins for svasrd (zeroing/undef predication)
Sander de Smalen [Tue, 5 May 2020 12:44:57 +0000 (13:44 +0100)]
[SveEmitter] Add builtins for svasrd (zeroing/undef predication)

This patch adds builtins for arithmetic shift right (round towards zero)
instructions for zeroing (_z) and undef (_x) predication.

2 years ago[SveEmitter] Add builtins for address calculations.
Sander de Smalen [Tue, 5 May 2020 12:43:10 +0000 (13:43 +0100)]
[SveEmitter] Add builtins for address calculations.

This patch adds builtins for:
- svadrb, svadrh, svadrw, svadrd

2 years ago[SveEmitter] Add builtins for svcntp
Sander de Smalen [Wed, 6 May 2020 12:59:17 +0000 (13:59 +0100)]
[SveEmitter] Add builtins for svcntp

2 years ago[SveEmitter] Add builtins for FFR manipulation
Sander de Smalen [Thu, 7 May 2020 10:12:59 +0000 (11:12 +0100)]
[SveEmitter] Add builtins for FFR manipulation

This patch adds builtins for:
- svrdffr, svrdffr_z
- svsetffr
- svwrffr

2 years ago[SveEmitter] Add builtins for svqadd, svqsub and svdot
Sander de Smalen [Tue, 5 May 2020 12:41:05 +0000 (13:41 +0100)]
[SveEmitter] Add builtins for svqadd, svqsub and svdot

This patch adds builtins for saturating add/sub instructions:
- svqadd, svqadd_n
- svqsub, svqsub_n

and builtins for dot product instructions:
- svdot, svdot_lane

2 years ago[VE] Minimum MC layer for VE (2/4)
Kazushi (Jam) Marukawa [Thu, 7 May 2020 11:20:12 +0000 (13:20 +0200)]
[VE] Minimum MC layer for VE (2/4)

Remove unnecessary EncoderMethod and DecoderMethod which cause errors in
supporting MC layer.

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

2 years ago[VE] Implements minimum MC layer for VE (1/4)
Kazushi (Jam) Marukawa [Thu, 7 May 2020 11:10:02 +0000 (13:10 +0200)]
[VE] Implements minimum MC layer for VE (1/4)

Summary:
Correct instruction bitfield addresses to generate machine code correctly.  Also
add some variables to represent all instructions correctly and change default
values to use registers by default.

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

2 years ago[Clang][Sema] Capturing section type conflicts between #pragma clang section and...
Lucas Prates [Tue, 21 Apr 2020 16:25:18 +0000 (17:25 +0100)]
[Clang][Sema] Capturing section type conflicts between #pragma clang section and section attributes

Summary:
Conflicting types for the same section name defined in clang section
pragmas and GNU-style section attributes were not properly captured by
Clang's Sema. The lack of diagnostics was caused by the fact the section
specification coming from attributes was handled by Sema as implicit,
even though explicitly defined by the user.

This patch enables the diagnostics for section type conflicts between
those specifications by making sure sections defined in section
attributes are correctly handled as explicit.

Reviewers: hans, rnk, javed.absar

Reviewed By: rnk

Subscribers: cfe-commits

Tags: #clang

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

2 years ago[Clang][Sema] Capturing section type conflicts on #pragma clang section
Lucas Prates [Thu, 16 Apr 2020 12:55:18 +0000 (13:55 +0100)]
[Clang][Sema] Capturing section type conflicts on #pragma clang section

Summary:
Section names used in clang section pragmas were not validated against
previously defined sections, causing section type conflicts to be
ignored by Sema.

This patch enables Clang to capture these section type conflicts by
using the existing Sema's UnifySection method to validate section names
from clang section pragmas.

Reviewers: hans, rnk, javed.absar

Reviewed By: rnk

Subscribers: cfe-commits

Tags: #clang

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

2 years ago[SveEmitter] Add builtins for SVE2 Polynomial arithmetic
Sander de Smalen [Thu, 7 May 2020 10:22:39 +0000 (11:22 +0100)]
[SveEmitter] Add builtins for SVE2 Polynomial arithmetic

This patch adds builtins for:
- sveorbt
- sveortb
- svpmul
- svpmullb, svpmullb_pair
- svpmullt, svpmullt_pair

The svpmullb and svpmullt builtins are expressed using the svpmullb_pair
and svpmullt_pair LLVM IR intrinsics, respectively.

Reviewers: SjoerdMeijer, efriedma, rengolin

Reviewed By: efriedma

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

2 years agoRecommit "[LV] Induction Variable does not remain scalar under tail-folding."
Sjoerd Meijer [Thu, 7 May 2020 10:10:15 +0000 (11:10 +0100)]
Recommit "[LV] Induction Variable does not remain scalar under tail-folding."

With 3 llvm regr tests fixed/updated that I had missed.

2 years ago[clangd] Fix AddUsing tweak for out-of-line functions.
Adam Czachorowski [Thu, 7 May 2020 10:47:29 +0000 (12:47 +0200)]
[clangd] Fix AddUsing tweak for out-of-line functions.

Summary:
We used getEnclosingNamespaceContext(), which calls getParent() rather
than getLexicalParent(), so we would end up adding the "using" line in
places that do not affect the cursor location, or just return an error
when declaration was in another file.

Patch by Adam Czachorowski!

Reviewers: hokein

Reviewed By: hokein

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

Tags: #clang

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

2 years ago[CodeGen][SVE] Lowering of shift operations with scalable types
Kerry McLaughlin [Thu, 7 May 2020 10:06:26 +0000 (11:06 +0100)]
[CodeGen][SVE] Lowering of shift operations with scalable types

Summary:
Adds AArch64ISD nodes for:
 - SHL_PRED (logical shift left)
 - SHR_PRED (logical shift right)
 - SRA_PRED (arithmetic shift right)

Existing patterns for unpredicated left shift by immediate
have also been moved into the appropriate multiclasses
in SVEInstrFormats.td.

Reviewers: sdesmalen, efriedma, ctetreau, huihuiz, rengolin

Reviewed By: efriedma

Subscribers: huihuiz, tschuett, kristof.beyls, hiraditya, rkruppe, psnobl, cfe-commits, llvm-commits

Tags: #llvm

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

2 years ago[mlir] Add a test exercising partial constant folding of affine min/max
Alex Zinenko [Thu, 7 May 2020 10:39:12 +0000 (12:39 +0200)]
[mlir] Add a test exercising partial constant folding of affine min/max

This functionality was introduced in a87db48e6fdaf8ce9e7cc479945892b934dd9404
but only only tested indirectly though Linalg tests. Add direct tests.

2 years ago[mlir] Add a test for OperationFolder
Alex Zinenko [Thu, 7 May 2020 10:39:07 +0000 (12:39 +0200)]
[mlir] Add a test for OperationFolder

Adds a test exercising the rewriting pattern in the test dialect that calls
OperationFolder.create.

2 years ago[mlir] Support partial folding of affine.min/max
Alex Zinenko [Thu, 7 May 2020 10:29:12 +0000 (12:29 +0200)]
[mlir] Support partial folding of affine.min/max

Originally, these operations were folded only if all expressions in their
affine maps could be folded to a constant expression that can be then subject
to numeric min/max computation. This introduces a more advanced version that
partially folds the affine map by lifting individual constant expression in it
even if some of the expressions remain variable. The folding can update the
operation in place to use a simpler map. Note that this is not as powerful as
canonicalization, in particular this does not remove dimensions or symbols that
became useless. This allows for better composition of Linalg tiling and
promotion transformation, where the latter can handle some canonical forms of
affine.min that the folding can now produce.

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

2 years ago[clangd] Preserve line information while build PreamblePatch
Kadir Cetinkaya [Thu, 23 Apr 2020 15:44:51 +0000 (17:44 +0200)]
[clangd] Preserve line information while build PreamblePatch

Summary: Depends on D78740.

Reviewers: sammccall

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

Tags: #clang

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

2 years ago[gn build] Port e3ffe7269b6
LLVM GN Syncbot [Thu, 7 May 2020 10:11:03 +0000 (10:11 +0000)]
[gn build] Port e3ffe7269b6

2 years ago[AMDGPU] Re-auto-generate test checks
Jay Foad [Thu, 7 May 2020 09:45:15 +0000 (10:45 +0100)]
[AMDGPU] Re-auto-generate test checks

2 years ago[AMDGPU] Cluster shader exports
Carl Ritson [Thu, 7 May 2020 10:05:38 +0000 (19:05 +0900)]
[AMDGPU] Cluster shader exports

Summary:
Add DAG scheduling mutation to cluster export instructions.
This avoids unnecessary waitcnts being added when computation
ends up interspersed with exports.

Reviewers: foad, arsenm, rampitec, nhaehnle

Reviewed By: foad

Subscribers: kzhuravl, jvesely, wdng, mgorny, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits

Tags: #llvm

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

2 years ago[AMDGPU] Precommit test for D79481. NFC
Carl Ritson [Thu, 7 May 2020 09:47:33 +0000 (18:47 +0900)]
[AMDGPU] Precommit test for D79481. NFC

Test shows unnecessary s_waitcnt between shader exports.

2 years ago[mlir][rocdl] Fix typo. NFC.
Wen-Heng (Jack) Chung [Thu, 7 May 2020 09:54:18 +0000 (11:54 +0200)]
[mlir][rocdl] Fix typo. NFC.

ROCLD -> ROCDL.

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

2 years ago[mlir] VectorToLLVM: propagate up from replaceTransferOp
Alex Zinenko [Thu, 7 May 2020 09:51:11 +0000 (11:51 +0200)]
[mlir] VectorToLLVM: propagate up from replaceTransferOp

In the Vector to LLVM conversion, the `replaceTransferOp` function calls
into a type converter that may fail and suppresses the status. Change
the function to return the failure status instead, Since it is called
from a pattern, the failure can be readily propagated to the rest of
infrastructure.

2 years ago[mlir][vector] set alignment when lowering transfer_read and transfer_write.
Wen-Heng (Jack) Chung [Thu, 7 May 2020 09:39:15 +0000 (11:39 +0200)]
[mlir][vector] set alignment when lowering transfer_read and transfer_write.

When emitting masked load / store, set alignment from data layout.

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

2 years ago[SVE][CodeGen] Fix legalisation for scalable types
Kerry McLaughlin [Thu, 7 May 2020 09:01:31 +0000 (10:01 +0100)]
[SVE][CodeGen] Fix legalisation for scalable types

Summary:
This patch handles illegal scalable types when lowering IR operations,
addressing several places where the value of isScalableVector() is
ignored.

For types such as <vscale x 8 x i32>, this means splitting the
operations. In this example, we would split it into two
operations of type <vscale x 4 x i32> for the low and high halves.

In cases such as <vscale x 2 x i32>, the elements in the vector
will be promoted. In this case they will be promoted to
i64 (with a vector of type <vscale x 2 x i64>)

Reviewers: sdesmalen, efriedma, huntergr

Reviewed By: efriedma

Subscribers: david-arm, tschuett, hiraditya, rkruppe, psnobl, cfe-commits, llvm-commits

Tags: #llvm

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

2 years agoSplitIndirectBrCriticalEdges: Fix Branch Probability update
Yevgeny Rouban [Thu, 7 May 2020 05:10:48 +0000 (12:10 +0700)]
SplitIndirectBrCriticalEdges: Fix Branch Probability update

Splitting critical edges for indirect branches
the SplitIndirectBrCriticalEdges() function may break branch
probabilities if target basic block happens to have unset
a probability for any of its successors. That is because in
such cases the getEdgeProbability(Target) function returns
probability 1/NumOfSuccessors and it is called after Target
was split (thus Target has a single successor). As the result
the correspondent successor of the split block gets
probability 100% but 1/NumOfSuccessors is expected (or better
be left unset).

Reviewers: yamauchi
Differential Revision: https://reviews.llvm.org/D78806

2 years agoRevert "[LV] Induction Variable does not remain scalar under tail-folding."
Sjoerd Meijer [Thu, 7 May 2020 08:29:56 +0000 (09:29 +0100)]
Revert "[LV] Induction Variable does not remain scalar under tail-folding."

This reverts commit 617aa64c84146468b384453375d1d34f97eb57db.

while I investigate buildbot failures.

2 years ago[LV] Induction Variable does not remain scalar under tail-folding.
Sjoerd Meijer [Thu, 7 May 2020 08:03:59 +0000 (09:03 +0100)]
[LV] Induction Variable does not remain scalar under tail-folding.

If tail-folding of the scalar remainder loop is applied, the primary induction
variable is splat to a vector and used by the masked load/store vector
instructions, thus the IV does not remain scalar. Because we now mark
that the IV does not remain scalar for these cases, we don't emit the vector IV
if it is not used. Thus, the vectoriser produces less dead code.

Thanks to Ayal Zaks for the direction how to fix this.

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

2 years ago[NFC][ARM] Add tail predication test
Sam Parker [Wed, 6 May 2020 14:04:02 +0000 (15:04 +0100)]
[NFC][ARM] Add tail predication test

2 years ago[clang-tidy] Exclude function calls in std namespace for bugprone-argument-comment.
Haojian Wu [Wed, 6 May 2020 15:06:14 +0000 (17:06 +0200)]
[clang-tidy] Exclude function calls in std namespace for bugprone-argument-comment.

Reviewers: gribozavr2

Subscribers: xazax.hun, cfe-commits

Tags: #clang

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

2 years ago[SVE] Fix getAlignmentInfo for scalable vectors
David Sherwood [Tue, 5 May 2020 15:47:31 +0000 (16:47 +0100)]
[SVE] Fix getAlignmentInfo for scalable vectors

When calculating the natural alignment for scalable vectors it
is acceptable to calculate an allocation size based on the minimum
number of elements in the vector.

This code path is exercised by an existing test:

  CodeGen/AArch64/sve-intrinsics-int-arith.ll

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