platform/upstream/llvm.git
4 years ago[DAG] SimplifyDemandedVectorElts - add INSERT_SUBVECTOR SimplifyMultipleUseDemandedBi...
Simon Pilgrim [Fri, 1 May 2020 15:08:30 +0000 (16:08 +0100)]
[DAG] SimplifyDemandedVectorElts - add INSERT_SUBVECTOR SimplifyMultipleUseDemandedBits handling

4 years ago[DAG] SimplifyDemandedVectorElts - remove INSERT_SUBVECTOR if we don't demand the...
Simon Pilgrim [Fri, 1 May 2020 14:38:20 +0000 (15:38 +0100)]
[DAG] SimplifyDemandedVectorElts - remove INSERT_SUBVECTOR if we don't demand the subvector

4 years ago[libc++] Avoid using GNU extension in test, which triggers a warning
Louis Dionne [Fri, 1 May 2020 15:04:34 +0000 (11:04 -0400)]
[libc++] Avoid using GNU extension in test, which triggers a warning

4 years ago[libc++] Make sure -Werror is enabled all the time, except in verify tests
Louis Dionne [Thu, 30 Apr 2020 22:11:07 +0000 (18:11 -0400)]
[libc++] Make sure -Werror is enabled all the time, except in verify tests

4 years ago[InstSimplify] allow insertelement-with-undef fold if poison-safe
Sanjay Patel [Fri, 1 May 2020 14:34:29 +0000 (10:34 -0400)]
[InstSimplify] allow insertelement-with-undef fold if poison-safe

The more general fold was not poison-safe, so it was removed:
rG5486e00
...but it is ok to have this transform if analysis can determine
the vector contains no poison. The test shows a simple example
of that: constant integer elements are not poison.

4 years ago[InstSimplify] update test; NFC
Sanjay Patel [Fri, 1 May 2020 14:06:02 +0000 (10:06 -0400)]
[InstSimplify] update test; NFC

Missed this test diff when committing:
rG5486e00dc3

4 years ago[Bitcode] reserve in front of push_back loops. NFCI.
Benjamin Kramer [Fri, 1 May 2020 13:39:55 +0000 (15:39 +0200)]
[Bitcode] reserve in front of push_back loops. NFCI.

4 years ago[SCCP] Get a copy of the state of CopyOf once.
Florian Hahn [Fri, 1 May 2020 13:43:15 +0000 (14:43 +0100)]
[SCCP] Get a copy of the state of CopyOf once.

This fixes potential reference invalidations, when no lattice value is
assigned for CopyOf. As the state of CopyOf won't change while in
handleCallResult, we can get a copy once and use that.

Should fix PR45749.

4 years agoRevert "Add support for #pragma float_control"
Melanie Blower [Fri, 1 May 2020 13:36:58 +0000 (06:36 -0700)]
Revert "Add support for #pragma float_control"

This reverts commit 4f1e9a17e9d28bdfd035313c96b3a5d4c91a7733.
due to fail on buildbot, sorry for the noise

4 years ago[InstSimplify] remove poison-unsafe insertelement of undef value
Sanjay Patel [Fri, 1 May 2020 13:18:33 +0000 (09:18 -0400)]
[InstSimplify] remove poison-unsafe insertelement of undef value

PR45481:
https://bugs.llvm.org/show_bug.cgi?id=45481

SDAG has an identical transform to this, so there's little
chance of any real-world impact. OTOH, that means we are
effectively sweeping the bug out of sight because poison
exists in codegen too.

4 years agoAdd support for #pragma float_control
Melanie Blower [Mon, 27 Apr 2020 14:25:59 +0000 (07:25 -0700)]
Add support for #pragma float_control

Reviewers: rjmccall, erichkeane, sepavloff

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

4 years ago[DAG] SimplifyDemandedVectorElts - add EXTRACT_SUBVECTOR SimplifyMultipleUseDemandedB...
Simon Pilgrim [Fri, 1 May 2020 12:47:55 +0000 (13:47 +0100)]
[DAG] SimplifyDemandedVectorElts - add EXTRACT_SUBVECTOR SimplifyMultipleUseDemandedBits handling

4 years ago[InstCombine] adjust tests for pow(); NFC
Sanjay Patel [Fri, 1 May 2020 12:23:34 +0000 (08:23 -0400)]
[InstCombine] adjust tests for pow(); NFC

D68231 would change this, but the existing test
doesn't cover what was probably intended (a libcall test).

4 years agoRemove unused variable. NFC.
Benjamin Kramer [Fri, 1 May 2020 12:29:58 +0000 (14:29 +0200)]
Remove unused variable. NFC.

4 years ago[IR] AttributeList::getContext has a single user, remove it.
Benjamin Kramer [Fri, 1 May 2020 12:18:29 +0000 (14:18 +0200)]
[IR] AttributeList::getContext has a single user, remove it.

4 years ago[IR] Make Attributes and AttributeLists trivially destructible and BumpPtrAllocate...
Benjamin Kramer [Fri, 1 May 2020 12:12:17 +0000 (14:12 +0200)]
[IR] Make Attributes and AttributeLists trivially destructible and BumpPtrAllocate them

4 years ago[ms] llvm-lib gives a more useful error if no inputs and no output path are provided
Eric Astor [Fri, 1 May 2020 11:42:54 +0000 (07:42 -0400)]
[ms] llvm-lib gives a more useful error if no inputs and no output path are provided

Summary:
If no inputs and no output path are provided, llvm-lib should produce a useful error.

Before this, it would fail by reading from an unitialized StringRef.

Reviewed By: vvereschaka

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

4 years ago[mlir][spirv] Handle debug information during (de)serialization.
Denis Khalikov [Fri, 1 May 2020 09:51:22 +0000 (12:51 +0300)]
[mlir][spirv] Handle debug information during (de)serialization.

Summary:
This is an initial version, currently supports OpString and OpLine
for autogenerated operations during (de)serialization.

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

4 years agoFix indentation. NFC.
Jay Foad [Fri, 1 May 2020 10:37:59 +0000 (11:37 +0100)]
Fix indentation. NFC.

4 years ago[Gnu toolchain] Move GCC multilib/multiarch paths support from Linux to Gnu
Samuel Thibault [Fri, 1 May 2020 10:36:23 +0000 (12:36 +0200)]
[Gnu toolchain] Move GCC multilib/multiarch paths support from Linux to Gnu
Add missing files

Summary: The current code for GNU/Linux is actually completely generic, and can be moved to Gnu, so it can benefit GNU/Hurd and GNU/kFreeBSD

Reviewers: kristina, sammccall, lebedev.ri, MaskRay, arsenm, phosek

Reviewed By: MaskRay, phosek

Subscribers: wdng, ormris, emaste, arichardson, krytarowski, cfe-commits

Tags: #clang

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

4 years ago[X86] Improving folding of concat_vectors of subvectors from the same broadcast
Simon Pilgrim [Fri, 1 May 2020 10:22:57 +0000 (11:22 +0100)]
[X86] Improving folding of concat_vectors of subvectors from the same broadcast

Handle concat_vectors(extract_subvector(broadcast(x)), extract_subvector(broadcast(x))) -> broadcast(x)

To expose this we also need collectConcatOps to recognise the insert_subvector(x, extract_subvector(x, lo), hi) subvector splat pattern

4 years ago[Gnu toolchain] Move GCC multilib/multiarch paths support from Linux to Gnu
Samuel Thibault [Fri, 1 May 2020 10:11:21 +0000 (12:11 +0200)]
[Gnu toolchain] Move GCC multilib/multiarch paths support from Linux to Gnu

Summary: The current code for GNU/Linux is actually completely generic, and can be moved to Gnu, so it can benefit GNU/Hurd and GNU/kFreeBSD

Reviewers: kristina, sammccall, lebedev.ri, MaskRay, arsenm, phosek

Reviewed By: MaskRay, phosek

Subscribers: wdng, ormris, emaste, arichardson, krytarowski, cfe-commits

Tags: #clang

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

4 years ago[docs][llvm-cxxfilt] Document --no-strip-underscore option
James Henderson [Thu, 30 Apr 2020 09:56:40 +0000 (10:56 +0100)]
[docs][llvm-cxxfilt] Document --no-strip-underscore option

This option was added several months ago in commit e84468c1.

Reviewed by: MaskRay, erik.pilkington, steven_wu

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

4 years ago[AMDGPU] Remove unnecessary s_waitcnt between VMEM loads
Jay Foad [Thu, 30 Apr 2020 09:51:09 +0000 (10:51 +0100)]
[AMDGPU] Remove unnecessary s_waitcnt between VMEM loads

VMEM loads of the same type (sampler vs no sampler) are guaranteed to
write their result registers in order, so there is no need for an
s_waitcnt even if they write to overlapping vgprs.

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

4 years ago[X86] Update type actions for ISD::TRUNCATE with avx512f to be Legal when possible...
Craig Topper [Fri, 1 May 2020 06:23:37 +0000 (23:23 -0700)]
[X86] Update type actions for ISD::TRUNCATE with avx512f to be Legal when possible. NFCI

The Custom handler wasn't doing anything for these cases anyway.

4 years ago[mlir] Add sine operation to Standard dialect.
MaheshRavishankar [Fri, 1 May 2020 04:39:21 +0000 (21:39 -0700)]
[mlir] Add sine operation to Standard dialect.

Also add lowering of sine operation to SPIR-V dialect.

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

4 years ago[mlir][OpBuilder] Remove the vtable from OpBuilder in favor of using the listener...
River Riddle [Fri, 1 May 2020 04:28:36 +0000 (21:28 -0700)]
[mlir][OpBuilder] Remove the vtable from OpBuilder in favor of using the listener pattern

The current OpBuilder has a set of virtual functions required by the fact that the PatternRewriter inherits from it for convenience. The PatternRewriter is required to know about IR mutations for correctness. This revision changes the relationship to be explicit by having users register a listener with the builder instead of using inheritance/vtables. This still requires that users properly transfer the listener when creating new builders, but has several benefits:

* More than one builder can be created during pattern rewrites(assuming that the listener is properly forwarded)
* OpBuilder no longer requires a vtable, and thus does not incur the cost when a listener isn't present.

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

4 years ago[mlir][StandardToSPIRV] Add support for lowering integer casting.
Hanhan Wang [Fri, 1 May 2020 02:29:05 +0000 (19:29 -0700)]
[mlir][StandardToSPIRV] Add support for lowering integer casting.

Summary:
Maps ZeroExtendIOp and TruncateIOp to spirv::UConvertOp and spirv::SConvertOp.

Depends On D78974

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

4 years ago[mlir][StandardToSPIRV] Emulate bitwidths not supported for load op.
Hanhan Wang [Fri, 1 May 2020 02:27:08 +0000 (19:27 -0700)]
[mlir][StandardToSPIRV] Emulate bitwidths not supported for load op.

Summary:
The current implementation in SPIRVTypeConverter just unconditionally turns
everything into 32-bit if it doesn't meet the requirements of extensions or
capabilities. In this case, we can load a 32-bit value and then do bit
extraction to get the value.

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

4 years ago[tests] Revert unhelpful change from d73eed42d1dc
Hubert Tong [Fri, 1 May 2020 02:18:54 +0000 (22:18 -0400)]
[tests] Revert unhelpful change from d73eed42d1dc

4 years ago[tests] Speculative fix for buildbot breakage from c5f7c039efe7
Hubert Tong [Fri, 1 May 2020 02:04:02 +0000 (22:04 -0400)]
[tests] Speculative fix for buildbot breakage from c5f7c039efe7

4 years agoHandle cases for subregisters.
Suyog Sarda [Wed, 31 Jul 2019 06:17:38 +0000 (11:47 +0530)]
Handle cases for subregisters.

While restoring latency, check if any of the registers of
source instruction is a subregister of the successor instructions
apart from being same register.

4 years ago[lit] Don't crash for --time-tests in aborted test run
Julian Lettner [Fri, 1 May 2020 01:15:50 +0000 (18:15 -0700)]
[lit] Don't crash for --time-tests in aborted test run

Properly print the test times histogram even for aborted (user
interrupt, [Ctrl+C]) test runs.

4 years ago[clang] Add vendor identity for Hygon Dhyana processor to cpuid.h
Craig Topper [Fri, 1 May 2020 01:04:25 +0000 (18:04 -0700)]
[clang] Add vendor identity for Hygon Dhyana processor to cpuid.h

The vendor id is used to determine whether the processor
supports hardware CRC32 in the Scudo code. The previous
discussion about the patch is in [1], and more information
about Hygon Dhyana processor is in[2].

[1]: https://reviews.llvm.org/D62368
[2]: https://git.kernel.org/torvalds/c/c9661c1e80b609cd038db7c908e061f0535804ef

Patch by fanjinke (Jinke Fan)

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

4 years ago[lit] Add EXCLUDED test result category
Julian Lettner [Mon, 13 Apr 2020 20:01:46 +0000 (13:01 -0700)]
[lit] Add EXCLUDED test result category

Track and print the number of tests that were discovered but not
executed due to test selection options:
  * --filter (regex filter)
  * --max-tests (limits number of tests)
  * sharding feature

With this change all discovered tests are accounted for: every
discovered test is included in one of the counts printed in the summary.

Reviewed By: jdenny

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

4 years ago[MC][Target][XCOFF] Consolidate MCAsmInfo XCOFF defaults; NFC
Hubert Tong [Fri, 1 May 2020 00:44:04 +0000 (20:44 -0400)]
[MC][Target][XCOFF] Consolidate MCAsmInfo XCOFF defaults; NFC

The setting of `MCAsmInfo` properties for XCOFF got split between
`MCAsmInfoXCOFF` and `PPCXCOFFMCAsmInfo`. Except for the properties that
are dependent on the target information being passed via the
constructor, the properties being set in `PPCXCOFFMCAsmInfo` had no
fundamental reason for being treated as specific for XCOFF on PowerPC.
Indeed, the property that might be considered more specific to PowerPC,
`NeedsFunctionDescriptors`, was set in `MCAsmInfoXCOFF`.

XCOFF being specific to PowerPC anyway, this patch consolidates the
setting of the properties into `MCAsmInfoXCOFF` except for the cases
that are dependent on the information provided via the
`PPCXCOFFMCAsmInfo` constructor.

This patch also reorders the assignments to the fields to match the
declaration order in `MCAsmInfo`.

4 years ago[XCOFF] Clean-up enum use in BinaryFormat/XCOFF.h; NFC
Hubert Tong [Fri, 1 May 2020 00:40:53 +0000 (20:40 -0400)]
[XCOFF] Clean-up enum use in BinaryFormat/XCOFF.h; NFC

Summary:
This patch splits mostly unrelated size constants into separate
constexpr variables, sets explicit underlying types for the enumerations
to match the fields they are used for, and improves various comments.

This patch also replaces `<cname>` headers with `<name.h>` headers to
match the usage of the declared names as global namespace members in the
file.

Reviewers: jasonliu, DiggerLin, daltenty, sfertile

Reviewed By: jasonliu, sfertile

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

4 years ago[X86] Add x, t and g modifiers for inline asm
Craig Topper [Fri, 1 May 2020 00:25:37 +0000 (17:25 -0700)]
[X86] Add x, t and g modifiers for inline asm

This patch adds the x, t and g modifiers for inline asm from GCC. These will print a vector register as xmm*, ymm* or zmm* respectively.

I also fixed register names with modifiers with inteldialect so they are no longer printed with a leading %.

Patch by Amanieu d'Antras

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

4 years ago[NFC] Add include cstdint for SIZE_MAX.
Andrew Browne [Fri, 1 May 2020 00:24:05 +0000 (17:24 -0700)]
[NFC] Add include cstdint for SIZE_MAX.

4 years agoRevert "Revert "[ADT] Fix SmallVector unused template instantiation on 32-bit systems.""
Andrew Browne [Fri, 1 May 2020 00:17:23 +0000 (17:17 -0700)]
Revert "Revert "[ADT] Fix SmallVector unused template instantiation on 32-bit systems.""

This reverts commit ac2635e457d53b80b0a6f73a5041767197643aae.

Revert was too hasty, build was already broken.

4 years ago[X86] Don't return true from isTruncateFree for vectors
Craig Topper [Thu, 30 Apr 2020 23:25:29 +0000 (16:25 -0700)]
[X86] Don't return true from isTruncateFree for vectors

Also fix some cost tables for vXi1 types to match the costs entries for the types they will be promoted to.

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

4 years agoRevert "[ADT] Fix SmallVector unused template instantiation on 32-bit systems."
Andrew Browne [Thu, 30 Apr 2020 23:40:48 +0000 (16:40 -0700)]
Revert "[ADT] Fix SmallVector unused template instantiation on 32-bit systems."

This reverts commit 25e2e92297e21bb4e0acab1b6bb5b2fdd5dc49ad.

Buildbot failure.

4 years ago[ADT] Fix SmallVector unused template instantiation on 32-bit systems.
Andrew Browne [Thu, 30 Apr 2020 22:15:35 +0000 (15:15 -0700)]
[ADT] Fix SmallVector unused template instantiation on 32-bit systems.

Summary:
This was introduced in dda3c19a3618dce94 aka D77621.

The unused template instantiation causes a warning on 32 bit systems
about truncating a uint64_t to 32-bit size_t.

Reviewed By: dblaikie, smeenai

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

4 years agoAdd header guards for header files that should not be included on the PS4 platform.
Douglas Yung [Thu, 30 Apr 2020 23:17:34 +0000 (16:17 -0700)]
Add header guards for header files that should not be included on the PS4 platform.

Reviewers: craig.topper

Reviewed By: craig.topper

Subscribers: cfe-commits

Tags: #clang

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

4 years ago[libcxx][libcxxabi][libunwind] Use libgcc on Android
Shoaib Meenai [Fri, 24 Apr 2020 04:19:11 +0000 (21:19 -0700)]
[libcxx][libcxxabi][libunwind] Use libgcc on Android

Android doesn't have a libgcc_s and uses libgcc instead, so adjust the
build accordingly. This matches compiler-rt's build setup. libc++abi and
libunwind were already checking for libgcc but in a different context.
This change makes them search only for libgcc on Android now, but the
code to link against libgcc if it were present was already there.

Reviewed By: #libc, #libc_abi, #libunwind, rprichard, srhines

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

4 years ago[FIX][libc++][Regex] Using regex_constants match_prev_avail | match_not_bol | match_n...
Diogo Sampaio [Thu, 30 Apr 2020 22:34:01 +0000 (23:34 +0100)]
[FIX][libc++][Regex] Using regex_constants match_prev_avail | match_not_bol | match_not_bow

Summary:
pr42199
When using regex_constants::match_prev_avail, it is defined that
--first is valid, and match_not_bol and match_not_bow should be
ignored. At the moment these flags are not ignored. This fixis that.

Reviewers: ldionne, miyuki, EricWF, mclow.lists, #libc

Reviewed By: ldionne, miyuki, #libc

Subscribers: broadwaylamb, dexonsmith, libcxx-commits

Tags: #libc

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

4 years ago[gn build] Port cfea3dc1021
LLVM GN Syncbot [Thu, 30 Apr 2020 22:15:14 +0000 (22:15 +0000)]
[gn build] Port cfea3dc1021

4 years ago[mlir][nvvm][rocdl] refactor NVVM and ROCDL dialect. NFC.
Wen-Heng (Jack) Chung [Thu, 30 Apr 2020 22:05:28 +0000 (00:05 +0200)]
[mlir][nvvm][rocdl] refactor NVVM and ROCDL dialect. NFC.

- Extract common logic between -convert-gpu-to-nvvm and -convert-gpu-to-rocdl.
- Cope with the fact that alloca operates on different addrspaces between NVVM
  and ROCDL.
- Modernize unit tests for ROCDL dialect.

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

4 years ago[ms] Fix repeated executions of the no-inputs llvm-lib test
Eric Astor [Thu, 30 Apr 2020 22:08:07 +0000 (18:08 -0400)]
[ms] Fix repeated executions of the no-inputs llvm-lib test

`rm` the file, THEN run the command that shouldn't create it, THEN confirm that it doesn't exist

4 years ago[AbstractCallSite] Look though constant cast expression when checking for callee use
Sergey Dmitriev [Thu, 30 Apr 2020 21:08:35 +0000 (14:08 -0700)]
[AbstractCallSite] Look though constant cast expression when checking for callee use

Summary: That makes AbstractCallSite::isCallee(const Use *) behavior consistent with AbstractCallSite constructor.

Reviewers: jdoerfert

Reviewed By: jdoerfert

Subscribers: mgorny, llvm-commits

Tags: #llvm

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

4 years ago[mlir][EDSC] Make use of InsertGuard
Nicolas Vasilache [Thu, 30 Apr 2020 21:44:40 +0000 (17:44 -0400)]
[mlir][EDSC] Make use of InsertGuard

Summary:
This revision cleans up a layer of complexity in ScopedContext and uses InsertGuard instead of previously manual bookkeeping.
The method `getBuilder` is renamed to `getBuilderRef` and spurious copies of OpBuilder are tracked.

This results in some canonicalizations not happening anymore in the Linalg matmul to vector test. This test is retired because relying on DRRs for this has been shaky at best. The solution will be better support to write fused passes in C++ with more idiomatic pattern composition and application.

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

4 years ago[scudo] Zero- and pattern-initialization of memory.
Evgenii Stepanov [Wed, 29 Apr 2020 21:39:23 +0000 (14:39 -0700)]
[scudo] Zero- and pattern-initialization of memory.

Summary:
Implement pattern initialization of memory (excluding the secondary
allocator because it already has predictable memory contents).
Expose both zero and pattern initialization through the C API.

Reviewers: pcc, cryptoad

Subscribers: #sanitizers, llvm-commits

Tags: #sanitizers

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

4 years ago[mlir] [VectorOps] Included i1 support for vector.print
aartbik [Thu, 30 Apr 2020 19:47:38 +0000 (12:47 -0700)]
[mlir] [VectorOps] Included i1 support for vector.print

Summary:
Added boolean support to vector.print.
Useful for upcoming "mask" tests.

Reviewers: ftynse, nicolasvasilache, andydavis1

Reviewed By: andydavis1

Subscribers: mehdi_amini, rriddle, jpienaar, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, liufengdb, Joonsoo, grosul1, frgossen, Kayjukh, llvm-commits

Tags: #llvm

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

4 years ago[lldb] Remove lldb/lldb subdirectory
Jonas Devlieghere [Thu, 30 Apr 2020 21:54:04 +0000 (14:54 -0700)]
[lldb] Remove lldb/lldb subdirectory

A patch command with the wrong -p value (strip prefix) created the
nested lldb folder.

4 years agoFix clang test after D76886
Nikita Popov [Thu, 30 Apr 2020 21:40:54 +0000 (23:40 +0200)]
Fix clang test after D76886

4 years agoHandle indirect calls in preallocated verification
Arthur Eubanks [Thu, 30 Apr 2020 20:48:43 +0000 (13:48 -0700)]
Handle indirect calls in preallocated verification

Summary: getCalledFunction() returns null for indirect function invocations.

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[clang-format] Add the missing default argument.
Michael Liao [Thu, 30 Apr 2020 21:34:49 +0000 (17:34 -0400)]
[clang-format] Add the missing default argument.

4 years ago[WebAssembly] Fix test failure after 0a6c4d8d2eb
Sam Clegg [Thu, 30 Apr 2020 21:20:04 +0000 (14:20 -0700)]
[WebAssembly] Fix test failure after 0a6c4d8d2eb

Reverting part of https://reviews.llvm.org/D79137 which caused an
failure in an ObjectYAML test.

4 years ago[LoopVersioning] Update setAliasChecks to take ArrayRef argument (NFC).
Florian Hahn [Thu, 30 Apr 2020 19:15:30 +0000 (20:15 +0100)]
[LoopVersioning] Update setAliasChecks to take ArrayRef argument (NFC).

This cleanup was suggested as part of D78458.

4 years ago[InlineFunction] Disable emission of alignment assumptions by default
Nikita Popov [Wed, 25 Mar 2020 22:35:19 +0000 (23:35 +0100)]
[InlineFunction] Disable emission of alignment assumptions by default

In D74183 clang started emitting alignment for sret parameters
unconditionally. This caused a 1.5% compile-time regression on
tramp3d-v4. The reason is that we now generate many instance of IR like

    %ptrint = ptrtoint %class.GuardLayers* %guards_m to i64
    %maskedptr = and i64 %ptrint, 3
    %maskcond = icmp eq i64 %maskedptr, 0
    tail call void @llvm.assume(i1 %maskcond)

to preserve the alignment information during inlining. Based on IR
analysis, these assumptions also regress optimization. The attached
phase ordering test case illustrates two issues: One are instruction
count based optimization heuristics, which are affected by the four
additional instructions of the assumption. The other is blocking of
SROA due to ptrtoint casts (PR45763).

We already encountered the same problem in Rust, where we (unlike
Clang) generally prefer to emit alignment information absolutely
everywhere it is available. We were only able to do this after
hardcoding -preserve-alignment-assumptions-during-inlining=false,
because we were seeing significant optimization and compile-time
regressions otherwise.

This patch disables -preserve-alignment-assumptions-during-inlining
by default, because we should not be punishing people for adding
more alignment annotations.

Once the assume bundle work shakes out and we can represent (and use)
alignment assumptions using assume bundles, it should be possible to
re-enable this with reduced overhead.

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

4 years ago[IRBuilder][NFC] Dereference MaybeAlign that's known non-None.
Eli Friedman [Thu, 30 Apr 2020 21:08:37 +0000 (14:08 -0700)]
[IRBuilder][NFC] Dereference MaybeAlign that's known non-None.

4 years ago[lit] Push computation of workers into run_tests
Julian Lettner [Thu, 30 Apr 2020 20:47:09 +0000 (13:47 -0700)]
[lit] Push computation of workers into run_tests

This also avoids assigning to the option object.

4 years ago[clang-format] [PR45626] SpacesInAngles does not insert or preserve leading space...
mydeveloperday [Thu, 30 Apr 2020 20:42:27 +0000 (21:42 +0100)]
[clang-format] [PR45626] SpacesInAngles does not insert or preserve leading space before :: operator

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

Ensure space between < and ::

(void)static_cast<::std::uint32_t >(1);

Reviewers: krasimir, mitchell-stellar

Reviewed By: krasimir

Subscribers: cfe-commits

Tags: #clang, #clang-format

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

4 years ago[lldb/API] Move SBCommandInterpreterRunOption in its own header. (NFC)
Jonas Devlieghere [Thu, 30 Apr 2020 20:28:42 +0000 (13:28 -0700)]
[lldb/API] Move SBCommandInterpreterRunOption in its own header. (NFC)

Currently, `SBCommandInterpreterRunOptions` is defined in
`SBCommandInterpreter.h`. Given that the options are always passed by
reference, a forward declaration is sufficient.

That's not the case for `SBCommandInterpreterRunResults`, which we need
for a new overload for `RunCommandInterpreter` and that returns this new
class by value. We can't include `SBCommandInterpreter.h` because
`SBCommandInterpreter::GetDebugger()` returns SBDebugger by value and
therefore needs a full definition.

This patch moves the definition of `SBCommandInterpreterRunOptions` into
a new header. In a later patch,  `SBCommandInterpreterRunResults` will
be defined in there as well, solving the aforementioned problem.

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

4 years ago[OPENMP50]Basic support for uses_allocators clause.
Alexey Bataev [Tue, 21 Apr 2020 17:21:00 +0000 (13:21 -0400)]
[OPENMP50]Basic support for uses_allocators clause.

Summary: Added parsing/sema/serialization supoprt for uses_allocators clause.

Reviewers: jdoerfert

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

Tags: #clang

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

4 years ago[lldb/CommandInterpreter] Move everything into CommandInterpreterRunOptions
Jonas Devlieghere [Thu, 30 Apr 2020 20:17:48 +0000 (13:17 -0700)]
[lldb/CommandInterpreter] Move everything into CommandInterpreterRunOptions

This implements Greg's suggestion from D78825 to include "auto handle
events" and "spawn thread" in CommandInterpreterRunOptions. This change
is in preparation for adding a new overload for RunCommandInterpreter
that takes only SBCommandInterpreterRunOptions and returns
SBCommandInterpreterRunResults.

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

4 years ago[lldb/CMake] Use INSTALL_RPATH for tools and BUILD_RPATH for unittests.
Jonas Devlieghere [Thu, 30 Apr 2020 18:43:03 +0000 (11:43 -0700)]
[lldb/CMake] Use INSTALL_RPATH for tools and BUILD_RPATH for unittests.

It seems like only the unittests are building with
BUILD_WITH_INSTALL_RPATH set to OFF. Of course when I did my last change
I only ran check-lldb-unit. Not sure why this difference exists, why
would you even install the unittest?

For the LLDB framework we do need different build and install RPATHs.
Currently that logic lives downstream. I plan to upstream that in the
near future. For now I'm just trying to make it possible to run the
test.

4 years ago[clang] Disable check for system sanitizer blacklists files if -fno-sanitizer-blackli...
Sylvain Audi [Thu, 30 Apr 2020 18:52:43 +0000 (14:52 -0400)]
[clang] Disable check for system sanitizer blacklists files if -fno-sanitizer-blacklist was specified

This is to avoid checking for the validity of a file that is not used.
This also contains a minor fix for the test, as the cfi sanitizer requires -flto and -fvisibility= arguments.

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

4 years ago[libc++] Use Lit utilities instead of old libcxx utilities for str/bytes conversions
Louis Dionne [Thu, 30 Apr 2020 19:48:27 +0000 (15:48 -0400)]
[libc++] Use Lit utilities instead of old libcxx utilities for str/bytes conversions

The libcxx.util utilities don't work properly, and we should remove them
when we get rid of compiler.py. In particular, libcxx.util.to_string
appears to be completely broken.

4 years ago[VFDatabase] Testsuite for scalar functions are vector functions with VF =1
Masoud Ataei [Thu, 30 Apr 2020 19:47:21 +0000 (15:47 -0400)]
[VFDatabase] Testsuite for scalar functions are vector functions with VF =1

Fixing test suite of the committed PR: https://reviews.llvm.org/D78054.
I am proposing to remove the PowerPC target triple in the test suite.

Reviewed by: @jsji, @fpetrogalli

Tags: LLVM

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

4 years ago[WebAssmebly] Add support for defined wasm globals in MC and lld
Sam Clegg [Wed, 29 Apr 2020 20:26:27 +0000 (13:26 -0700)]
[WebAssmebly] Add support for defined wasm globals in MC and lld

This change add support for defined wasm globals in the .s format,
the MC layer, and wasm-ld

Currently there is no support custom initialization and all wasm
globals are initialized to zero.

Fixes: PR45742

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

4 years ago[libc++] Make sure platform detection works in both Python 2 and 3
Louis Dionne [Thu, 30 Apr 2020 19:30:39 +0000 (15:30 -0400)]
[libc++] Make sure platform detection works in both Python 2 and 3

19123a3e0873 was too naive -- we really want to handle both Python 2 and
Python 3, not only Python 3.

4 years ago[ms] Add new option to llvm-lib: /llvmlibempty
Eric Astor [Thu, 30 Apr 2020 19:29:52 +0000 (15:29 -0400)]
[ms] Add new option to llvm-lib: /llvmlibempty

Summary:
Add a new option (/llvmlibempty). If passed and llvm-lib does not give an error, it will create a valid output archive even if empty.

By default, llvm-lib mimicks lib.exe: if given no input files, it doesn't create its output file at all. This is incompatible with some build systems, so we add a command-line option to toggle this compatibility behavior.

Reviewed By: thakis

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

4 years ago[test] Fix ELF/linkerscript/input-archive.s w/ @ in path
Thomas Preud'homme [Wed, 29 Apr 2020 16:27:17 +0000 (17:27 +0100)]
[test] Fix ELF/linkerscript/input-archive.s w/ @ in path

Lld test ELF/linkerscript/input-archive.s fails when path contain a @
because is not accepted in unquoted token in linker scripts which leads
to the path being broken in 2 around the @. This commit quotes the path
used in the linker script created by this and similar testcases allowing
the test to pass even in the presence of an @ sign in the path.

Reviewed By: MaskRay

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

4 years ago[mlir][AffineStructures] Explicitly initialize variables to avoid use of uninitialize...
River Riddle [Thu, 30 Apr 2020 19:08:53 +0000 (12:08 -0700)]
[mlir][AffineStructures] Explicitly initialize variables to avoid use of uninitialized variable

4 years ago[OPENMP]Allow cancellation constructs in target parallel regions.
Alexey Bataev [Mon, 27 Apr 2020 15:37:35 +0000 (11:37 -0400)]
[OPENMP]Allow cancellation constructs in target parallel regions.

Summary:
omp cancellation point parallel and omp cancel parallel directives are
allowed in target paralle regions.

Reviewers: jdoerfert

Subscribers: yaxunl, guansong, caomhin, cfe-commits

Tags: #clang

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

4 years ago[libc] Add definitions of double_t and float_t to math.h.
Siva Chandra Reddy [Mon, 27 Apr 2020 20:35:21 +0000 (13:35 -0700)]
[libc] Add definitions of double_t and float_t to math.h.

This change does not handle any extensions. Only the C standard
variations are handled.

Reviewers: abrachet

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

4 years ago[libc][NFC] Rename cpp::function to cpp::Function.
Siva Chandra Reddy [Thu, 30 Apr 2020 18:08:20 +0000 (11:08 -0700)]
[libc][NFC] Rename cpp::function to cpp::Function.

Summary: Just to be consistent with other names in cpp.

Reviewers: abrachet

Subscribers: tschuett, libc-commits

Tags: #libc-project

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

4 years ago[flang] Add the header file for the conversion of FIR(MLIR) to LLVM-IR dialect
Eric Schweitz [Thu, 30 Apr 2020 15:16:08 +0000 (08:16 -0700)]
[flang] Add the header file for the conversion of FIR(MLIR) to LLVM-IR dialect

Summary:
This is the interface to the conversion pass that converts the FIR dialect (and standard dialects) of MLIR to the LLVM-IR dialect. The implementation of this bridge will be forthcoming in subsequent diffs.

The purpose of the code gen bridge is to take the IR, which will be expressed as a mix of higher-level Fortran constructs as expressed in the FIR dialect and the MLIR standard dialect, and convert the representation into the LLVM-IR dialect. At that point, the LLVM-IR dialect can be converted into LLVM IR (proper) by a standard MLIR pass.

Reviewers: jeanPerier, vjayathirtha-nv, sscalpone, jdoerfert, DavidTruby, kiranchandramohan

Reviewed By: sscalpone, kiranchandramohan

Tags: #llvm, #flang

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

4 years ago[OPENMP50]Support 'task' modifier in reduction clauses.
Alexey Bataev [Wed, 22 Apr 2020 12:14:39 +0000 (08:14 -0400)]
[OPENMP50]Support 'task' modifier in reduction clauses.

Summary:
Added basic support for 'task' modifier in the reduction clauses in
non-simd parallel and worksharing constructs.

Reviewers: jdoerfert

Subscribers: yaxunl, guansong, cfe-commits, caomhin

Tags: #clang

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

4 years ago[lldb] Also set owning module for template specializations
Raphael Isemann [Thu, 30 Apr 2020 18:38:51 +0000 (20:38 +0200)]
[lldb] Also set owning module for template specializations

Summary:
This was originally commented out as it broke the data-formatter-stl/libcxx/
tests. However this was fixed by commit ef423a3ba57045f80b0fcafce72121449a8b54d4
(Add Objective-C property accessors loaded from Clang module DWARF to lookup)
which sets the HasExternalVisibleStorage flag for the template specializations.

Reviewers: aprantl

Reviewed By: aprantl

Subscribers: abidh, JDevlieghere

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

4 years ago[X86][CostModel] Bump the cost of vpermw/vpermt2b/vperm2w
Craig Topper [Thu, 30 Apr 2020 17:52:35 +0000 (10:52 -0700)]
[X86][CostModel] Bump the cost of vpermw/vpermt2b/vperm2w

vpermw is 2 uops. vpermt2b/vpermt2w are two shuffle uops and a port 015 uop. Weirdly vpermb is a single uop.

This patch bumps the cost to 2 for these operations. Maybe should go to 3 for the vpermt2*, but I've started conservative.

I've also removed a few entries that were now the same as earlier subtargets or that I didn't think we really did. Like I don't think we extend v32i8 to v32i16, shuffle, and then truncate.

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

4 years ago[flang] Add the proposal document and rationale for the internal naming module that...
Eric Schweitz [Wed, 29 Apr 2020 14:08:17 +0000 (07:08 -0700)]
[flang] Add the proposal document and rationale for the internal naming module that was previously added.

Summary:
This document describes how uniquing of internal names is done. This
name uniquing is done to support the constraints and invariants of the FIR
dialect of MLIR.

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

Reviewed By: jeanPerier, sscalpone, kiranchandramohan

Subscribers: tskeith, kiranchandramohan, rriddle, llvm-commits

Tags: #llvm, #flang

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

4 years ago[libc++] Don't over-quote arguments to DSL tests
Louis Dionne [Thu, 30 Apr 2020 17:46:30 +0000 (13:46 -0400)]
[libc++] Don't over-quote arguments to DSL tests

On Windows, quoting with single-quotes is both unnecessary and incorrect.
If the arguments are properly handled by Lit (which they are), quoting
should not be necessary.

4 years ago[X86][SSE] Canonicalize UNARYSHUFFLE(XOR(X,-1) -> XOR(UNARYSHUFFLE(X),-1)
Simon Pilgrim [Thu, 30 Apr 2020 17:45:30 +0000 (18:45 +0100)]
[X86][SSE] Canonicalize UNARYSHUFFLE(XOR(X,-1) -> XOR(UNARYSHUFFLE(X),-1)

This pushes the NOT pattern up the DAG to help expose it for further combines (AND->ANDN in particular).

The PSHUFD/MOVDDUP 'splat' cases are the only ones I've seen in the wild so far, we can further generalize if/when we need to.

4 years ago[clangd] Render doc-comment code spans with `backticks` in plaintext mode
Sam McCall [Wed, 29 Apr 2020 23:25:18 +0000 (01:25 +0200)]
[clangd] Render doc-comment code spans with `backticks` in plaintext mode

Reviewers: kadircet

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

Tags: #clang

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

4 years ago[libc++] Make sure we create the working directory for running config check commands
Louis Dionne [Thu, 30 Apr 2020 18:09:39 +0000 (14:09 -0400)]
[libc++] Make sure we create the working directory for running config check commands

The internal Lit shell requires the current working directory to exist.
This didn't show up locally because the directories were already created
by previous runs of the tests.

4 years ago[mlir][OpInterfaceGen] Emit the utility Trait decl as a class and not using directive
River Riddle [Thu, 30 Apr 2020 17:56:33 +0000 (10:56 -0700)]
[mlir][OpInterfaceGen] Emit the utility Trait decl as a class and not using directive

This fixes the build on MSVC where it is unable to handle template-template using directives properly.

4 years ago[lldb/CMake] Set the PYTHON_RPATH for the unit tests
Jonas Devlieghere [Thu, 30 Apr 2020 18:04:51 +0000 (11:04 -0700)]
[lldb/CMake] Set the PYTHON_RPATH for the unit tests

The API and Python script interpreter unit tests also link against
Python and therefore need to set the RPATH when applicable.

4 years ago[AMDGPU] Update DWARF proposal encodings
Scott Linder [Thu, 30 Apr 2020 18:00:09 +0000 (14:00 -0400)]
[AMDGPU] Update DWARF proposal encodings

Update the tentative encodings to avoid a conflict with a GNU extension.

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

4 years ago[clangd] Move inserted include from detail -> documentation.
Sam McCall [Wed, 29 Apr 2020 18:10:50 +0000 (20:10 +0200)]
[clangd] Move inserted include from detail -> documentation.

Summary: Many clients try to display all the detail inline, with poor results.

See https://github.com/clangd/clangd/issues/284

Reviewers: hokein

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

Tags: #clang

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

4 years ago[lldb/CMake] Don't make PYTHON_RPATH a required variable.
Jonas Devlieghere [Thu, 30 Apr 2020 17:54:03 +0000 (10:54 -0700)]
[lldb/CMake] Don't make PYTHON_RPATH a required variable.

4 years ago[debuginfo-tests] Update Python variable in lit.site.cfg.py
Jonas Devlieghere [Thu, 30 Apr 2020 17:51:40 +0000 (10:51 -0700)]
[debuginfo-tests] Update Python variable in lit.site.cfg.py

4 years ago[mlir][Linalg] Add support to lower named ops to loops.
Nicolas Vasilache [Thu, 30 Apr 2020 13:44:55 +0000 (09:44 -0400)]
[mlir][Linalg] Add support to lower named ops to loops.

This revision adds support to allow named ops to lower to loops.
Linalg.batch_matmul successfully lowers to loops and to LLVM.

In the process, this test also activates linalg to affine loops.
However padded convolutions to not lower to affine.load atm so this revision overrides the type of underlying load / store operation.

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

4 years ago[lldb] fix RPATH when linking against Python3.framework
Jonas Devlieghere [Thu, 30 Apr 2020 17:34:03 +0000 (10:34 -0700)]
[lldb] fix RPATH when linking against Python3.framework

The install name for the Python 3 framework in Xcode is relative to
the framework's location and not the dylib itself.

  @rpath/Python3.framework/Versions/3.x/Python3

This means that we need to compute the path to the Python3.framework
and use that as the RPATH instead of the usual dylib's directory.

4 years ago[lldb] Re-add deleted RUN line in module-ownership.mm
Raphael Isemann [Thu, 30 Apr 2020 17:28:23 +0000 (19:28 +0200)]
[lldb] Re-add deleted RUN line in module-ownership.mm

This was deleted in 681466f5e6412350a0b066791450e72325c2c074 by accident.

4 years ago[libc++] Use the internal Lit shell parser to run config tests
Louis Dionne [Thu, 30 Apr 2020 16:18:37 +0000 (12:18 -0400)]
[libc++] Use the internal Lit shell parser to run config tests

This makes the config tests portable across platforms.

4 years ago[Bitcode] Make attribute test more robust (NFC)
Nikita Popov [Thu, 30 Apr 2020 16:49:01 +0000 (18:49 +0200)]
[Bitcode] Make attribute test more robust (NFC)

The ID of the { nobuiltin } attribute set increases every time
a new test is added to this file. Store it in a variable instead.

4 years ago[clangd] Render code complete documentation as plaintext/markdown.
Sam McCall [Thu, 30 Apr 2020 08:49:32 +0000 (10:49 +0200)]
[clangd] Render code complete documentation as plaintext/markdown.

Summary:
Structure is parsed from the raw comment using the existing heuristics used
for hover.

Reviewers: kadircet

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

Tags: #clang

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

4 years ago[libc++] Do not allow customizing the arch in the trunk and back-deployment scripts
Louis Dionne [Thu, 30 Apr 2020 16:55:01 +0000 (12:55 -0400)]
[libc++] Do not allow customizing the arch in the trunk and back-deployment scripts

We should eventually be able to pass an arbitrary target triple, however
for the time being, just being able to pass 64/32 is not really that
useful.