platform/upstream/llvm.git
4 years ago[lldb] Move non-DWARF code: DWARFUnit -> SymbolFileDWARF
Jan Kratochvil [Fri, 31 Jan 2020 14:16:31 +0000 (15:16 +0100)]
[lldb] Move non-DWARF code: DWARFUnit -> SymbolFileDWARF

This patchset is removing non-DWARF code from DWARFUnit for better
future merge with LLVM DWARF as discussed with @labath.

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

4 years agoAMDGPU/GlobalISel: Select global MUBUF atomicrmw
Matt Arsenault [Fri, 24 Jan 2020 16:55:46 +0000 (11:55 -0500)]
AMDGPU/GlobalISel: Select global MUBUF atomicrmw

4 years ago[clangd][Hover] Handle uninstantiated default args
Kadir Cetinkaya [Thu, 30 Jan 2020 17:42:01 +0000 (18:42 +0100)]
[clangd][Hover] Handle uninstantiated default args

Summary:
Default args might exist but be unparsed or uninstantiated.
getDefaultArg asserts on those. This patch makes sure we don't crash in such
scenarios.

Reviewers: sammccall, ilya-biryukov

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

Tags: #clang

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

4 years agoReapply "AMDGPU: Cleanup and fix SMRD offset handling"
Matt Arsenault [Thu, 30 Jan 2020 23:41:10 +0000 (18:41 -0500)]
Reapply "AMDGPU: Cleanup and fix SMRD offset handling"

This reverts commit 6a4acb9d809aaadb9304a7a2f3382d958a6c2adf.

4 years ago[Concepts] Correctly form initial parameter mapping for parameter packs, support...
Saar Raz [Fri, 31 Jan 2020 13:55:06 +0000 (15:55 +0200)]
[Concepts] Correctly form initial parameter mapping for parameter packs, support substitution into SubstNonTypeTemplateParmExpr

We previously would not correctly for the initial parameter mapping for variadic template parameters in Concepts.
Testing this lead to the discovery that with the normalization process we would need to substitute into already-substituted-into
template arguments, which means we need to add NonTypeTemplateParmExpr support to TemplateInstantiator.
We do that by substituting into the replacement and the type separately, and then re-checking the expression against the NTTP
with the new type, in order to form any new required implicit casts (for cases where the type of the NTTP was dependent).

4 years ago[compiler-rt] Fix build on NetBSD 9.99.44
Kamil Rytarowski [Fri, 31 Jan 2020 13:54:30 +0000 (14:54 +0100)]
[compiler-rt] Fix build on NetBSD 9.99.44

Fix build on >= 9.99.44 after the removal of urio(4).
Add compat code for the device as NetBSD-9.0 is supported.

4 years agoAMDGPU/GlobalISel: Make use of MachineIRBuilder helper functions. NFC.
Jay Foad [Fri, 31 Jan 2020 13:52:33 +0000 (13:52 +0000)]
AMDGPU/GlobalISel: Make use of MachineIRBuilder helper functions. NFC.

4 years ago[lldb/DWARF] Delete some dead code in SymbolFileDWARF
Pavel Labath [Fri, 31 Jan 2020 13:45:35 +0000 (14:45 +0100)]
[lldb/DWARF] Delete some dead code in SymbolFileDWARF

- m_debug_loc(lists) are unused since the relevant logic was moved to
  DWARFContext.
- const versions of DebugInfo(), DebugAbbrev() are not used, and they
  are dangerous to use as they do not initialize the relevant objects.

4 years agoImplement -fsemantic-interposition
serge-sans-paille [Thu, 16 Jan 2020 10:56:41 +0000 (11:56 +0100)]
Implement -fsemantic-interposition

First attempt at implementing -fsemantic-interposition.

Rely on GlobalValue::isInterposable that already captures most of the expected
behavior.

Rely on a ModuleFlag to state whether we should respect SemanticInterposition or
not. The default remains no.

So this should be a no-op if -fsemantic-interposition isn't used, and if it is,
isInterposable being already used in most optimisation, they should honor it
properly.

Note that it only impacts architecture compiled with -fPIC and no pie.

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

4 years ago[llvm-objdump] avoid crash disassembling unknown instruction
Sjoerd Meijer [Fri, 31 Jan 2020 11:49:20 +0000 (11:49 +0000)]
[llvm-objdump] avoid crash disassembling unknown instruction

Disassembly of instructions can fail when llvm-objdump is not given the right set of
architecture features, for example when the source is compiled with:

  clang -march=..+ext1+ext2

and disassembly is attempted with:

  llvm-objdump -mattr=+ext1

This patch avoids further analysing unknown instructions (as was happening
before) when disassembly has failed.

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

4 years ago[lldb][NFC] Add a CompilerDecl->clang::Decl conversion function to ClangUtil
Raphael Isemann [Fri, 31 Jan 2020 09:46:08 +0000 (10:46 +0100)]
[lldb][NFC] Add a CompilerDecl->clang::Decl conversion function to ClangUtil

This automatically does the type checking for the cast.

4 years ago[lldb][NFC] Remove unnecessary ClangASTImporter checks in ClangASTSource
Raphael Isemann [Fri, 31 Jan 2020 12:00:32 +0000 (13:00 +0100)]
[lldb][NFC] Remove unnecessary ClangASTImporter checks in ClangASTSource

A ClangASTSource always has a ClangASTImporter. Let's remove these sporadic
checks with a single assert during construction. They were added originally
for the modern-type-lookup mode that didn't use a ClangASTImporter in there.

4 years ago[lldb][NFC] Remove ParserVars::m_parser_type member that was never read
Raphael Isemann [Fri, 31 Jan 2020 11:17:19 +0000 (12:17 +0100)]
[lldb][NFC] Remove ParserVars::m_parser_type member that was never read

We only assign values to this member but never read it. Also the
type in there has no side effects so let's just remove it.

4 years ago[AArch64][SVE] Add remaining SVE2 intrinsics for uniform DSP operations
Kerry McLaughlin [Fri, 31 Jan 2020 10:35:26 +0000 (10:35 +0000)]
[AArch64][SVE] Add remaining SVE2 intrinsics for uniform DSP operations

Summary:
Implements the following intrinsics:

 - @llvm.aarch64.sve.[s|u]qadd
 - @llvm.aarch64.sve.[s|u]qsub
 - @llvm.aarch64.sve.suqadd
 - @llvm.aarch64.sve.usqadd
 - @llvm.aarch64.sve.[s|u]qsubr
 - @llvm.aarch64.sve.[s|u]rshl
 - @llvm.aarch64.sve.[s|u]qshl
 - @llvm.aarch64.sve.[s|u]qrshl
 - @llvm.aarch64.sve.[s|u]rshr
 - @llvm.aarch64.sve.sqshlu
 - @llvm.aarch64.sve.sri
 - @llvm.aarch64.sve.sli
 - @llvm.aarch64.sve.[s|u]sra
 - @llvm.aarch64.sve.[s|u]rsra
 - @llvm.aarch64.sve.[s|u]aba

Reviewers: efriedma, sdesmalen, dancgr, cameron.mcinally, c-rhodes, rengolin

Reviewed By: sdesmalen

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

Tags: #llvm

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

4 years agoReland [libc++] [P0325] Implement to_array from LFTS with updates.
Marek Kurdej [Thu, 30 Jan 2020 12:27:35 +0000 (13:27 +0100)]
Reland [libc++] [P0325] Implement to_array from LFTS with updates.

Fixed expected errors and notes.

Summary:
This patch implements https://wg21.link/P0325.

Reviewers: EricWF, mclow.lists, ldionne, lichray

Reviewed By: ldionne, lichray

Subscribers: lichray, dexonsmith, zoecarver, christof, ldionne, libcxx-commits

Tags: #libc

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

4 years ago[NFC][ARM] Add test
Sam Parker [Fri, 31 Jan 2020 10:31:57 +0000 (10:31 +0000)]
[NFC][ARM] Add test

4 years ago[llvm-readobj] - Don't crash when dumping invalid dynamic relocation.
Georgii Rymar [Tue, 28 Jan 2020 15:29:55 +0000 (18:29 +0300)]
[llvm-readobj] - Don't crash when dumping invalid dynamic relocation.

Currently when we dump dynamic relocation with use of
DT_RELA/DT_RELASZ/DT_RELAENT tags, we crash when a symbol index
is larger than the number of dynamic symbols or
when there is no dynamic symbol table.

This patch adds test cases and fixes the issues.

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

4 years agoFix conversion of loops to GPU with no block/thread dimensions.
Stephan Herhut [Thu, 30 Jan 2020 10:27:17 +0000 (11:27 +0100)]
Fix conversion of loops to GPU with no block/thread dimensions.

Summary:
The current code assumes that one always maps at least one loop to block
dimensions and at least one loop to thread dimensions. If either is not
the case, a loop would get mapped twice.

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

4 years ago[llvm-readobj][test] - Cleanup testing of the --sections command line option.
Georgii Rymar [Wed, 29 Jan 2020 14:10:07 +0000 (17:10 +0300)]
[llvm-readobj][test] - Cleanup testing of the --sections command line option.

We have the `ELF\sections.test` to test --sections.

`ELF\sections.test` uses precompiled objects, it has a bug (does not test -s alias properly).
Also, we test machine specific section types in `ELF\machine-specific-section-types.test`,
so we probably do not need to test `--sections` for a MIPS object in `ELF\sections.test`.
I think it is enough to test ELF32 and ELF64 (we do not test ELF64 in this test).

`Object/readobj-shared-object.test` also tests how llvm-readobj handles
`--sections`. It is location is wrong, it is not complete, it uses precompiled binaries
and it duplicates the `ELF\sections.test` partially (it tests both ELF32 and ELF64).

We have `ELF\readelf-s-alias.test` that tests the `-s` alias for `--sections` in llvm-readobj
and `-s` as an alias for `--symbols` in llvm-readelf.
There is no need to have a separate test for such things.
The test for the `-s` alias for `--sections` can be included into the `ELF\sections.test`.
And the test for `-s` for llvm-readelf is already included into `ELF\symbols.test`.

So, this patch:
1) Removes `Object/readobj-shared-object.test`.
2) Removes `ELF\readelf-s-alias.test`
3) Rewrites the `ELF\sections.test`.
4) Removes ELF/Inputs/trivial.obj.elf-mipsel.

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

4 years ago[Support] Wrap extern TLS variable in getter function
Markus Böck [Fri, 31 Jan 2020 09:27:21 +0000 (11:27 +0200)]
[Support] Wrap extern TLS variable in getter function

This patch wraps an external thread local storage variable inside of a
getter function and makes it have internal linkage. This allows LLVM to
be built with BUILD_SHARED_LIBS on windows with MinGW. Additionally it
allows Clang versions prior to 10 to compile current trunk for MinGW.

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

4 years ago[gn build] Port 16a0313ee32
LLVM GN Syncbot [Fri, 31 Jan 2020 09:18:27 +0000 (09:18 +0000)]
[gn build] Port 16a0313ee32

4 years ago[lldb] Print the command output when 'expect' fails even if a custom msg is passed
Raphael Isemann [Fri, 31 Jan 2020 09:12:06 +0000 (10:12 +0100)]
[lldb] Print the command output when 'expect' fails even if a custom msg is passed

Currently if 'expect' fails and a custom msg is supplied, then lldbtest
will not print the actual command output. This makes it impossible to know
why the test actually failed. This just prints the command output even
if the msg parameter was supplied.

4 years ago[libc] Add utils for memory functions
Guillaume Chatelet [Mon, 27 Jan 2020 14:42:20 +0000 (15:42 +0100)]
[libc] Add utils for memory functions

Summary: This patch adds a few low level functions needed to build libc memory functions.

Reviewers: sivachandra, jfb

Subscribers: mgorny, MaskRay, tschuett, libc-commits, ckennelly

Tags: #libc-project

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

4 years ago[DWARF] Add support for 64-bit DWARF in .debug_names.
Igor Kudrin [Wed, 15 Jan 2020 03:20:58 +0000 (10:20 +0700)]
[DWARF] Add support for 64-bit DWARF in .debug_names.

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

4 years agoRevert "[libc++] [P0325] Implement to_array from LFTS with updates."
Marek Kurdej [Fri, 31 Jan 2020 08:43:48 +0000 (09:43 +0100)]
Revert "[libc++] [P0325] Implement to_array from LFTS with updates."

This reverts commit 86aae78268f31e58b619c9ae69e8b661dfacb9f4.

A test is failing on "Release" build without assertions enabled (Fedora 31 on x86_64).

4 years ago[lldb][NFC] Add safe Decl->CompilerDecl conversion function TypeSystemClang
Raphael Isemann [Fri, 31 Jan 2020 08:22:25 +0000 (09:22 +0100)]
[lldb][NFC] Add safe Decl->CompilerDecl conversion function TypeSystemClang

This adds a conversion function from clang::Decl to CompilerDecl. It checks
that the TypeSystemClang in the CompilerDecl actually fits to the clang::Decl
AST during creation, thus preventing the creation of CompilerDecl instances with
inconsistent state.

4 years ago[lldb][NFC] Cleanup ClangASTImporter::LayoutInfo
Raphael Isemann [Fri, 31 Jan 2020 08:05:20 +0000 (09:05 +0100)]
[lldb][NFC] Cleanup ClangASTImporter::LayoutInfo

4 years agoFix typo
Sebastian Neubauer [Thu, 23 Jan 2020 13:53:53 +0000 (14:53 +0100)]
Fix typo

Summary: Fix typo

Subscribers: jvesely, nhaehnle, kerbowa, llvm-commits

Tags: #llvm

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

4 years ago[mlir] Add MemRefTypeBuilder and refactor some MemRefType::get().
Tim Shen [Wed, 22 Jan 2020 21:46:11 +0000 (13:46 -0800)]
[mlir] Add MemRefTypeBuilder and refactor some MemRefType::get().

The refactored MemRefType::get() calls all intend to clone from another
memref type, with some modifications. In fact, some calls dropped memory space
during the cloning. Migrate them to the cloning API so that nothing gets
dropped if they are not explicitly listed.

It's close to NFC but not quite, as it helps with propagating memory spaces in
some places.

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

4 years ago[lldb][NFCI] Remove UserExpression::GetJITModule
Alex Langford [Fri, 31 Jan 2020 07:16:12 +0000 (23:16 -0800)]
[lldb][NFCI] Remove UserExpression::GetJITModule

UserExpression::GetJITModule was used to support an option in
UserExpression::Evaluate that let you hold onto the JIT Module used during
the expression evaluation. This was only actually used in one spot --
REPL::IOHandlerInputComplete. That method didn't actually take use the
JIT module it got back, so this feature was not used in practice.
This means that we can delete the support in UserExpression::Evaluate
and delete the UserExpression::GetJITModule method entirely.

4 years ago[lldb][NFCI] Remove unused LanguageType parameters
Alex Langford [Fri, 31 Jan 2020 05:55:18 +0000 (21:55 -0800)]
[lldb][NFCI] Remove unused LanguageType parameters

These parameters are unused in these methods, and some of them only had a
LanguageType parameter to pipe to other methods that don't use it
either.

4 years ago[lldb/Lit] Fix UnboundLocalError when reaching a timeout.
Jonas Devlieghere [Fri, 31 Jan 2020 05:23:58 +0000 (21:23 -0800)]
[lldb/Lit] Fix UnboundLocalError when reaching a timeout.

Fixes the UnboundLocalError for the local variables out, err and
exitCode when a timeout is hit.

4 years ago[SmallString] Use data() instead of begin() (NFC)
Jonas Devlieghere [Fri, 31 Jan 2020 04:15:35 +0000 (20:15 -0800)]
[SmallString] Use data() instead of begin() (NFC)

Both begin() and data() do the same thing for the SmallString case, but
the std::string and llvm::StringRef constructors that are being called
are defined as taking a pointer and size.

Addresses Craig Topper's feedback in https://reviews.llvm.org/D73640

4 years ago[GISel][KnownBits] Fix a bug where we could run out of stack space
Quentin Colombet [Fri, 31 Jan 2020 03:30:39 +0000 (19:30 -0800)]
[GISel][KnownBits] Fix a bug where we could run out of stack space

One of the exit criteria of computeKnownBits is whether we reach the max
recursive call depth. Before this patch we would check that the
depth is exactly equal to max depth to exit.

Depth may get bigger than max depth if it gets passed to a different
GISelKnownBits object.
This may happen when say a generic part uses a GISelKnownBits object
with some max depth, but then we hit TL.computeKnownBitsForTargetInstr
which creates a new GISelKnownBits object with a different and smaller
depth. In that situation, when we hit the max depth check for the first
time in the target specific GISelKnownBits object, depth may already
be bigger than the current max depth. Hence we would continue to compute
the known bits, until we ran through the full depth of the chain of
computation or ran out of stack space.

For instance, let say we have
GISelKnownBits Info(/*MaxDepth*/ = 10);
Info.getKnownBits(Foo)
// 9 recursive calls to computeKnownBitsImpl.
// Then we hit a target specific instruction.
// The target specific GISelKnownBits does this:
  GISelKnownBits TargetSpecificInfo(/*MaxDepth*/ = 6)
  TargetSpecificInfo.computeKnownBitsImpl() // <-- next max depth checks would
                                            // always return false.

This commit does not have any test case, none of the in-tree targets
use computeKnownBitsForTargetInstr.

4 years agoPR44627: Consider reversing == and <=> candidates found by ADL.
Richard Smith [Fri, 31 Jan 2020 02:40:53 +0000 (18:40 -0800)]
PR44627: Consider reversing == and <=> candidates found by ADL.

4 years agoRevert "[objc_direct] Small updates to help with adoption."
Pierre Habouzit [Fri, 31 Jan 2020 02:21:25 +0000 (18:21 -0800)]
Revert "[objc_direct] Small updates to help with adoption."

This reverts commit bebb8e2596af8fe97f9b6356ff06e4e80580cf32.

Pushed by accident, not yet reviewed

4 years ago[objc_direct] Small updates to help with adoption.
Pierre Habouzit [Fri, 31 Jan 2020 00:48:11 +0000 (16:48 -0800)]
[objc_direct] Small updates to help with adoption.

Add fixits for messaging self in MRR or using super, as the intent is
clear, and it turns out people do that a lot more than expected.

Allow for objc_direct_members on main interfaces, it's extremely useful
for internal only classes, and proves to be quite annoying for adoption.

Add some better warnings around properties direct/non-direct clashes (it
was done for methods but properties were a miss).

Radar-Id: rdar://problem/58355212
Signed-off-by: Pierre Habouzit <phabouzit@apple.com>
4 years ago[objc_direct] fix codegen for mismatched Decl/Impl return types
Pierre Habouzit [Wed, 22 Jan 2020 16:46:54 +0000 (08:46 -0800)]
[objc_direct] fix codegen for mismatched Decl/Impl return types

For non direct methods, the codegen uses the type of the Implementation.
Because Objective-C rules allow some differences between the Declaration
and Implementation return types, when the Implementation is in this
translation unit, the type of the Implementation should be preferred to
emit the Function over the Declaration.

Radar-Id: rdar://problem/58797748
Signed-off-by: Pierre Habouzit <phabouzit@apple.com>
Differential Revision: https://reviews.llvm.org/D73208

4 years ago[lldb][NFCI] Delete commented out code
Alex Langford [Fri, 31 Jan 2020 02:02:36 +0000 (18:02 -0800)]
[lldb][NFCI] Delete commented out code

4 years ago[llvm-objcopy][test] Fix tests when path contains "bar"
Fangrui Song [Tue, 7 Jan 2020 20:24:59 +0000 (12:24 -0800)]
[llvm-objcopy][test] Fix tests when path contains "bar"

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

4 years ago[X86][ELF] Prefer to lower MC_GlobalAddress operands to .Lfoo$local
Fangrui Song [Wed, 22 Jan 2020 20:27:17 +0000 (12:27 -0800)]
[X86][ELF] Prefer to lower MC_GlobalAddress operands to .Lfoo$local

For a MC_GlobalAddress reference to a dso_local external GlobalValue with a definition, emit .Lfoo$local to avoid a relocation.

-fno-pic and -fpie can infer dso_local but -fpic cannot.  In the future,
we can explore the possibility of inferring dso_local with -fpic. As the
description of D73228 says, LLVM's existing IPO optimization behaviors
(like -fno-semantic-interposition) and a previous assembly behavior give
us enough license to be aggressive here.

Reviewed By: rnk

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

4 years ago[Concepts] Check function constraints before deducing auto return type
Saar Raz [Fri, 31 Jan 2020 01:37:46 +0000 (03:37 +0200)]
[Concepts] Check function constraints before deducing auto return type

A constrained function with an auto return type would have it's definition
instantiated in order to deduce the auto return type before the constraints
are checked.

Move the constraints check after the return type deduction.

4 years agoPR41991: Accept attributes on defaulted and deleted friends.
Richard Smith [Fri, 31 Jan 2020 01:42:17 +0000 (17:42 -0800)]
PR41991: Accept attributes on defaulted and deleted friends.

Attributes are permitted on friend definitions, but we only checked for
a proper function body, not for the =default / =delete cases.

4 years agoPR44721: Don't consider overloaded operators for built-in comparisons
Richard Smith [Fri, 31 Jan 2020 01:11:47 +0000 (17:11 -0800)]
PR44721: Don't consider overloaded operators for built-in comparisons
when building a defaulted comparison.

As a convenient way of asking whether `x @ y` is valid and building it,
we previouly always performed overload resolution and built an
overloaded expression, which would both end up picking a builtin
operator candidate when given a non-overloadable type. But that's not
quite right, because it can result in our finding a user-declared
operator overload, which we should never do when applying operators
non-overloadable types.

Handle this more correctly: skip overload resolution when building
`x @ y` if the operands are not overloadable. But still perform overload
resolution (considering only builtin candidates) when checking validity,
as we don't have any other good way to ask whether a binary operator
expression would be valid.

4 years agoReplace 'AllowExplicit' bool with an enum. No functionality change.
Richard Smith [Wed, 29 Jan 2020 20:07:14 +0000 (12:07 -0800)]
Replace 'AllowExplicit' bool with an enum. No functionality change.

In passing, split it up into three values (no explicit functions /
explicit conversion functions only / any explicit functions) in
preparation for using that in a future change.

4 years ago[SafeStack][DebugInfo] Insert DW_OP_deref in correct location
Leonard Chan [Fri, 31 Jan 2020 01:09:42 +0000 (17:09 -0800)]
[SafeStack][DebugInfo] Insert DW_OP_deref in correct location

This patch addresses the issue found in https://bugs.llvm.org/show_bug.cgi?id=44585
where a DW_OP_deref was placed at the end of a dwarf expression, resulting in corrupt
symbols when debugging.

This is an attempt to reland with a few fixes for buildbot since I
haven't merged from master in a bit.

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

4 years agoWhite space only change: reflow a comment in basic_string
Martijn Vels [Tue, 28 Jan 2020 18:43:19 +0000 (13:43 -0500)]
White space only change: reflow a comment in basic_string

Summary: This change reflows a comment line. This change serves as a no-op test commit

Reviewers: mclow.lists, ldionne, EricWF

Subscribers: dexonsmith, christof, libcxx-commits

Tags: #libc

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

4 years ago[lldb][NFCI] Rename variable in ValueObject
Alex Langford [Fri, 31 Jan 2020 00:52:57 +0000 (16:52 -0800)]
[lldb][NFCI] Rename variable in ValueObject

4 years ago[GlobalISel][IRTranslator] When translating vector geps, splat the base pointer if...
Amara Emerson [Fri, 31 Jan 2020 00:25:20 +0000 (16:25 -0800)]
[GlobalISel][IRTranslator] When translating vector geps, splat the base pointer if required.

We can have geps that have a scalar base pointer, and a vector index value, which
means that the base pointer must be splatted into a vector of pointers.

This fixes crashes on arm64 GlobalISel with optimizations enabled.

4 years agoRevert "[SafeStack][DebugInfo] Insert DW_OP_deref in correct location"
Leonard Chan [Fri, 31 Jan 2020 00:18:41 +0000 (16:18 -0800)]
Revert "[SafeStack][DebugInfo] Insert DW_OP_deref in correct location"

This reverts commit fff6a1b0f1fe57b46379001db75952d2a06eab1f.

This was breaking a bunch of buildbots.

4 years agoMSVC Buggy version detection: turn pre-processor error into CMake configuration time...
Mehdi Amini [Thu, 30 Jan 2020 01:44:35 +0000 (01:44 +0000)]
MSVC Buggy version detection: turn pre-processor error into CMake configuration time check

This allows consumer to override in a cleaner way while still prevent
them from hitting bug without knowing they run an unsupported
configuration.

Recommit after fix by Christopher Tetreault to add parens and ${} to
cmake check to work around CMake configure time "unknown arguments
specified" issue

Differential Revision: https://reviews.llvm.org/D73677
Differential Revision: https://reviews.llvm.org/D73751

4 years agoAuto-completion bug fix for dot operator
Hector Diaz [Thu, 30 Jan 2020 23:07:49 +0000 (15:07 -0800)]
Auto-completion bug fix for dot operator

Summary:
There was a bug on LLDB VSCode where there was the following behavior:

//Code

```
struct foo {
    int bar:
};
...
foo my_foo = {10};
```

Trying to auto-complete my_foo.b with my_foo.bar resulted instead with my_foo.my_foo.bar

This diff fixes this bug and adds some tests to check correct behavior.

It also fixes the same bug using the arrow operator (->) when user manually requests completions.
TODO: Fix bug where no recommended completions are automatically shown with arrow operator

{F11249959}

{F11249958}

Reviewers: wallace

Reviewed By: wallace

Subscribers: teemperor, labath, lldb-commits

Tags: #lldb

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

4 years ago[SafeStack][DebugInfo] Insert DW_OP_deref in correct location
Leonard Chan [Tue, 28 Jan 2020 20:30:33 +0000 (12:30 -0800)]
[SafeStack][DebugInfo] Insert DW_OP_deref in correct location

This patch addresses the issue found in https://bugs.llvm.org/show_bug.cgi?id=44585
where a DW_OP_deref was placed at the end of a dwarf expression, resulting in
corrupt symbols when debugging.

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

4 years ago[lldb/Reproducers] Fix typo in CMake so we actually replay.
Jonas Devlieghere [Thu, 30 Jan 2020 23:51:29 +0000 (15:51 -0800)]
[lldb/Reproducers] Fix typo in CMake so we actually replay.

The CMakeLists.txt had a typo which meant that check-lldb-repro was
capturing twice instead of capturing and then replaying. This also
uncovered a missing import in lldb-repro.py. This patch fixes both
issues.

4 years ago[lldb/Reproducers] Use LLDB_RECORD_DUMMY for GetStopDescription
Jonas Devlieghere [Thu, 30 Jan 2020 23:35:09 +0000 (15:35 -0800)]
[lldb/Reproducers] Use LLDB_RECORD_DUMMY for GetStopDescription

GetStopDescription writes to a const char* with a given length. However,
the reproducer instrumentation serialized the char pointer and length
separately.

To serialize the string, we naively look for the first null byte to
determine its length. This can lead to the method overwriting the input
buffer when the assumed string length is smaller than the actual number
of bytes written by GetStopDescription.

The real solution is to have a custom serializer that takes both
arguments into account. However, given that these are output parameters,
they don't affect replay. If the string is passed as input later, it's
is recorded as such. Therefore I've replaced the instrumentation macro
with LLDB_RECORD_DUMMY which skips the serialization.

4 years agoRevert "AMDGPU: Cleanup and fix SMRD offset handling"
Matt Arsenault [Thu, 30 Jan 2020 23:39:51 +0000 (15:39 -0800)]
Revert "AMDGPU: Cleanup and fix SMRD offset handling"

This reverts commit 17dbc6611df9044d779d85b3d545bd37e5dd5200.

A test is failing on some bots

4 years agoRevert "MSVC Buggy version detection: turn pre-processor error into CMake configurati...
Mehdi Amini [Thu, 30 Jan 2020 23:38:36 +0000 (23:38 +0000)]
Revert "MSVC Buggy version detection: turn pre-processor error into CMake configuration time check"

This reverts commit b4fac782462c26baa94798e5fdb58e6810bd336b.
It broke the MSVC bot

4 years agoAMDGPU: Cleanup and fix SMRD offset handling
Matt Arsenault [Thu, 30 Jan 2020 16:42:58 +0000 (11:42 -0500)]
AMDGPU: Cleanup and fix SMRD offset handling

I believe this also fixes bugs with CI 32-bit handling, which was
incorrectly skipping offsets that look like signed 32-bit values. Also
validate the offsets are dword aligned before folding.

4 years agoCodeGen: Use Register
Matt Arsenault [Thu, 30 Jan 2020 21:05:34 +0000 (16:05 -0500)]
CodeGen: Use Register

4 years ago[AArch64][GlobalISel] Fold in G_ANYEXT/G_ZEXT into TB(N)Z
Jessica Paquette [Wed, 29 Jan 2020 21:28:30 +0000 (13:28 -0800)]
[AArch64][GlobalISel] Fold in G_ANYEXT/G_ZEXT into TB(N)Z

This is similar to the code in getTestBitOperand in AArch64ISelLowering. Instead
of implementing all of the TB(N)Z optimizations at once, this patch implements
the simplest case first. The way that this is set up should make it fairly easy
to add the rest as we go along.

The idea here is that after determining that we can use a TB(N)Z, we can
continue looking through instructions and perform further folding.

In this case, when we have a G_ZEXT or G_ANYEXT where the extended bits are not
used, we can fold it into the TB(N)Z.

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

4 years ago[AArch64][GlobalISel] Disallow vectors in convertPtrAddToAdd.
Amara Emerson [Thu, 30 Jan 2020 22:48:40 +0000 (14:48 -0800)]
[AArch64][GlobalISel] Disallow vectors in convertPtrAddToAdd.

Found by inspection, but there's no test for this yet because G_PTR_ADD is
currently illegal for vectors. I'll add the test at a later time when the
legalizer support has landed.

4 years ago[InstCombine] Remove unnecessary worklist add; NFCI
Nikita Popov [Thu, 30 Jan 2020 22:24:27 +0000 (23:24 +0100)]
[InstCombine] Remove unnecessary worklist add; NFCI

Again, this will already be added by IRBuilder.

4 years ago[Fuchsia] Never link in implicit "system dependencies" of sanitizer runtimes
Roland McGrath [Thu, 30 Jan 2020 22:20:02 +0000 (14:20 -0800)]
[Fuchsia] Never link in implicit "system dependencies" of sanitizer runtimes

This is never appropriate on Fuchsia and any future needs for
system library dependencies of compiler-supplied runtimes will
be addressed via .deplibs instead of driver hacks.

Patch By: mcgrathr

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

4 years ago[NFC] Fix check prefix add in fcanonicalize-elimination.ll
David Tenty [Thu, 30 Jan 2020 17:33:00 +0000 (12:33 -0500)]
[NFC] Fix check prefix add in fcanonicalize-elimination.ll

The test fix added by "D39306: Fix
CodeGen/AMDGPU/fcanonicalize-elimination.ll on FreeBSD 11.0" uses a test
prefix which is not actually used in the FileCheck stanza. Thus the
problem originally encountered still exists and the tests fails for host
triples that  contain "1.0", including AIX 7.1.0.

4 years agoMSVC Buggy version detection: turn pre-processor error into CMake configuration time...
Mehdi Amini [Thu, 30 Jan 2020 01:44:35 +0000 (01:44 +0000)]
MSVC Buggy version detection: turn pre-processor error into CMake configuration time check

This allows consumer to override in a cleaner way while still prevent
them from hitting bug without knowing they run an unsupported
configuration.

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

4 years agoAMDGPU: Replace subtarget check with an assert
Matt Arsenault [Thu, 30 Jan 2020 02:40:18 +0000 (21:40 -0500)]
AMDGPU: Replace subtarget check with an assert

This is already checked by the pattern subtarget predicate.

4 years agoAMDGPU: Don't use separate cache arguments for s_buffer_load node
Matt Arsenault [Thu, 30 Jan 2020 02:03:07 +0000 (21:03 -0500)]
AMDGPU: Don't use separate cache arguments for s_buffer_load node

There's not much value to this separate node from the intrinsic. Make
the operand structure the same as the intrinsic, so we can reuse the
same pattern for GlobalISel.

4 years ago[InstCombine] Remove unnecessary worklist add; NFCI
Nikita Popov [Thu, 30 Jan 2020 22:06:28 +0000 (23:06 +0100)]
[InstCombine] Remove unnecessary worklist add; NFCI

The IRBuilder will automatically add instructions to the worklist.
Adding it manually is unnecessary, but may mess up worklist order.

4 years ago[InstCombine] Create new insts in foldICmpEqIntrinsicWithConstant; NFCI
Nikita Popov [Thu, 30 Jan 2020 21:54:35 +0000 (22:54 +0100)]
[InstCombine] Create new insts in foldICmpEqIntrinsicWithConstant; NFCI

In line with current conventions, create new instructions rather
than modify two operands in place and performing manual worklist
management.

This should be NFC apart from possible worklist order changes.

4 years agoMove verification of Sema::MaximumAlignment to a .cpp file
Reid Kleckner [Thu, 30 Jan 2020 21:33:38 +0000 (13:33 -0800)]
Move verification of Sema::MaximumAlignment to a .cpp file

Saves these transitive includes:

4 years ago[scudo][standalone] Release secondary memory on purge
Kostya Kortchinsky [Thu, 30 Jan 2020 19:06:49 +0000 (11:06 -0800)]
[scudo][standalone] Release secondary memory on purge

Summary:
The Secondary's cache needs to be released when the Combined's
`releaseToOS` function is called (via `M_PURGE`) for example,
which this CL adds.

Additionally, if doing a forced release, we'll release the
transfer batch class as well since now we can do that.

There is a couple of other house keeping changes as well:
- read the page size only once in the Secondary Cache `store`
- remove the interval check for `CanRelease`: we are going to
  make that configurable via `mallopt` so this needs not be
  set in stone there.

Reviewers: cferris, hctim, pcc, eugenis

Subscribers: #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

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

4 years ago[lldb][NFC] LLDB_LOGF to LLDB_LOG conversion in ClangASTImporter
Raphael Isemann [Thu, 30 Jan 2020 21:04:18 +0000 (22:04 +0100)]
[lldb][NFC] LLDB_LOGF to LLDB_LOG conversion in ClangASTImporter

4 years ago[mlir] LLVM dialect: Generate conversions between EnumAttrCase and LLVM API
Alex Zinenko [Mon, 27 Jan 2020 13:49:34 +0000 (14:49 +0100)]
[mlir] LLVM dialect: Generate conversions between EnumAttrCase and LLVM API

Summary:
MLIR materializes various enumeration-based LLVM IR operands as enumeration
attributes using ODS. This requires bidirectional conversion between different
but very similar enums, currently hardcoded. Extend the ODS modeling of
LLVM-specific enumeration attributes to include the name of the corresponding
enum in the LLVM C++ API as well as the names of specific enumerants. Use this
new information to automatically generate the conversion functions between enum
attributes and LLVM API enums in the two-way conversion between the LLVM
dialect and LLVM IR proper.

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

4 years ago[Clang][Bundler][NFC] Replace SmallString<...> with StringRef
Sergey Dmitriev [Thu, 30 Jan 2020 20:49:25 +0000 (12:49 -0800)]
[Clang][Bundler][NFC] Replace SmallString<...> with StringRef

Reviewers: ABataev

Reviewed By: ABataev

Subscribers: cfe-commits

Tags: #clang

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

4 years ago[AMDGPU] Add file headers for few files where it is missing.
hsmahesha [Thu, 30 Jan 2020 19:33:06 +0000 (01:03 +0530)]
[AMDGPU] Add file headers for few files where it is missing.

Summary:
Added file headers for files which implement iterative lightweight scheduling
strategies. Which is basically an exercise which I undertook in order to get
used to LLVM development process.

Reviewers: arsenm, vpykhtin, cdevadas

Reviewed By: vpykhtin

Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, javed.absar, kerbowa, llvm-commits

Tags: #llvm

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

4 years ago[libc++abi] Bump PACKAGE_VERSION
Alex Langford [Thu, 30 Jan 2020 20:18:24 +0000 (12:18 -0800)]
[libc++abi] Bump PACKAGE_VERSION

4 years ago[libc] Add [EXPECT|ASSERT]_[TRUE|FALSE] unittest macros.
Siva Chandra Reddy [Wed, 29 Jan 2020 23:07:29 +0000 (15:07 -0800)]
[libc] Add [EXPECT|ASSERT]_[TRUE|FALSE] unittest macros.

Also, other EXPECT_* and ASSERT_* macros have been extended to accept
bool values.

Reviewers: abrachet, gchatelet

Subscribers: MaskRay, tschuett, libc-commits

Tags: #libc-project

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

4 years ago[mlir][NFC] Update several SPIRV operations to use declarative parsers.
River Riddle [Thu, 30 Jan 2020 19:37:35 +0000 (11:37 -0800)]
[mlir][NFC] Update several SPIRV operations to use declarative parsers.

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

4 years ago[mlir][NFC] Use declarative format for several operations in LLVM and Linalg dialects
River Riddle [Thu, 30 Jan 2020 19:32:04 +0000 (11:32 -0800)]
[mlir][NFC] Use declarative format for several operations in LLVM and Linalg dialects

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

4 years ago[mlir] Update various operations to declaratively specify their assembly format.
River Riddle [Thu, 30 Jan 2020 19:31:50 +0000 (11:31 -0800)]
[mlir] Update various operations to declaratively specify their assembly format.

Summary:
This revision switches over many operations to use the declarative methods for defining the assembly specification. This updates operations in the NVVM, ROCDL, Standard, and VectorOps dialects.

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

4 years ago[mlir] Add support for generating the parser/printer from the declarative operation...
River Riddle [Thu, 30 Jan 2020 19:31:21 +0000 (11:31 -0800)]
[mlir] Add support for generating the parser/printer from the declarative operation format.

Summary:
This revision add support, and testing, for generating the parser and printer from the declarative operation format.

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

4 years ago[mlir] Add initial support for parsing a declarative operation assembly format
River Riddle [Thu, 30 Jan 2020 19:30:23 +0000 (11:30 -0800)]
[mlir] Add initial support for parsing a declarative operation assembly format

Summary:
This is the first revision in a series that adds support for declaratively specifying the asm format of an operation. This revision
focuses solely on parsing the format. Future revisions will add support for generating the proper parser/printer, as well as
transitioning the syntax definition of many existing operations.

This was originally proposed here:
https://llvm.discourse.group/t/rfc-declarative-op-assembly-format/340

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

4 years ago[lldb/Reproducers] Fix API boundary tracking bug
Jonas Devlieghere [Thu, 30 Jan 2020 19:20:15 +0000 (11:20 -0800)]
[lldb/Reproducers] Fix API boundary tracking bug

When recording the result from the LLDB_RECORD_RESULT macro, we need to
update the boundary so we capture the copy constructor. However, when
called to record the this pointer of the (copy) constructor itself, the
boundary should not be toggled, because it is called from the
LLDB_RECORD_CONSTRUCTOR macro, which might be followed by other API
calls.

This manifested itself as an object encountered during replay that we
hadn't seen before. The index-to-object mapping would return a nullptr
and lldb would crash.

4 years ago[AIX] Minor cleanup in AsmPrinter. [NFC]
Sean Fertile [Thu, 30 Jan 2020 19:12:43 +0000 (14:12 -0500)]
[AIX] Minor cleanup in AsmPrinter. [NFC]

- Extends the comments related to function descriptors, noting how they
are only used on AIX.

- Changes the condition used to gate the creation of the current function
symbol in AsmPrinter::SetupMachineFunction to reflect being AIX
specific. The creation of the symbol is different because of AIXs
linkage conventions, not because AIX uses function descriptors.

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

4 years ago[AArch64] -fpatchable-function-entry=N,0: place patch label after BTI
Fangrui Song [Thu, 30 Jan 2020 02:00:57 +0000 (18:00 -0800)]
[AArch64] -fpatchable-function-entry=N,0: place patch label after BTI

Summary:
For -fpatchable-function-entry=N,0 -mbranch-protection=bti, after
9a24488cb67a90f889529987275c5e411ce01dda, we place the NOP sled after
the initial BTI.

```
.Lfunc_begin0:
bti c
nop
nop

.section __patchable_function_entries,"awo",@progbits,f,unique,0
.p2align 3
.xword .Lfunc_begin0
```

This patch adds a label after the initial BTI and changes the __patchable_function_entries entry to reference the label:

```
.Lfunc_begin0:
bti c
.Lpatch0:
nop
nop

.section __patchable_function_entries,"awo",@progbits,f,unique,0
.p2align 3
.xword .Lpatch0
```

This placement is compatible with the resolution in
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92424 .

A local linkage function whose address is not taken does not need a BTI.
Placing the patch label after BTI has the advantage that code does not
need to differentiate whether the function has an initial BTI.

Reviewers: mrutland, nickdesaulniers, nsz, ostannard

Subscribers: kristof.beyls, hiraditya, llvm-commits

Tags: #llvm

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

4 years agoSpeed up compilation of ASTImporter
Reid Kleckner [Wed, 29 Jan 2020 22:29:34 +0000 (14:29 -0800)]
Speed up compilation of ASTImporter

Avoid recursively instantiating importSeq. Use initializer list
expansion to stamp out a single instantiation of std::tuple of the
deduced sequence of types, and thread the error around that tuple type.
Avoids needlessly instantiating std::tuple N-1 times.

new time to compile: 0m25.985s
old time to compile: 0m35.563s

new obj size: 10,000kb
old obj size: 12,332kb

I found the slow TU by looking at ClangBuildAnalyzer results, and looked
at -ftime-trace for the file in chrome://tracing to find this.

Tested with: clang-cl, MSVC, and GCC.

Reviewed By: martong

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

4 years ago[ConstantFold][SVE][NFC] Add test for select instruction in scalable vector.
Huihui Zhang [Thu, 30 Jan 2020 18:49:10 +0000 (10:49 -0800)]
[ConstantFold][SVE][NFC] Add test for select instruction in scalable vector.

Side notes from D73669, no need to guard the iteration on vectors, as
it is explicitly looking for a ConstantVector/ConstantDataVector, which
is not expected to be scalable at the moment. So, add the test only.

4 years ago[Concepts] Add 'this' context to instantiation of member requires clause
Saar Raz [Thu, 30 Jan 2020 18:47:59 +0000 (20:47 +0200)]
[Concepts] Add 'this' context to instantiation of member requires clause

'this' context was missing in instantiation of member requires clause.

4 years ago[Concepts] Add check for dependent RC when checking function constraints
Saar Raz [Thu, 30 Jan 2020 18:46:32 +0000 (20:46 +0200)]
[Concepts] Add check for dependent RC when checking function constraints

Do not attempt to check a dependent requires clause in a function constraint
(may be triggered by, for example, DiagnoseUseOfDecl).

4 years ago[Concept] Fix incorrect check for containsUnexpandedParameterPack in CSE
Saar Raz [Thu, 30 Jan 2020 18:42:28 +0000 (20:42 +0200)]
[Concept] Fix incorrect check for containsUnexpandedParameterPack in CSE

We previously checked for containsUnexpandedParameterPack in CSEs by observing the property
in the converted arguments of the CSE. This may not work if the argument is an expanded
type-alias that contains a pack-expansion (see added test).

Check the as-written arguments when determining containsUnexpandedParameterPack and isInstantiationDependent.

4 years ago[ConstantFold][SVE] Fix constant folding for scalable vector unary operations.
Huihui Zhang [Thu, 30 Jan 2020 18:44:20 +0000 (10:44 -0800)]
[ConstantFold][SVE] Fix constant folding for scalable vector unary operations.

Summary:
Similar to issue D71445. Scalable vector should not be evaluated element by element.
Add support to handle scalable vector UndefValue.

Reviewers: sdesmalen, efriedma, apazos, huntergr, willlovett

Reviewed By: efriedma

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

Tags: #llvm

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

4 years ago[AArch64][SVE] Add remaining SVE2 mla indexed intrinsics.
Danilo Carvalho Grael [Wed, 29 Jan 2020 16:28:13 +0000 (11:28 -0500)]
[AArch64][SVE] Add remaining SVE2 mla indexed intrinsics.

Summary:
Add remaining SVE2 mla indexed intrinsics:
- sqdmlalb, sqdmlalt, sqdmlslb, sqdmlslt

Add suffix _lanes and switch immediate types to i32 for all mla indexed intrinsics to align with ACLE builtin definitions.

Reviewers: efriedma, sdesmalen, cameron.mcinally, c-rhodes, rengolin, kmclaughlin

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

Tags: #llvm

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

4 years ago[Clang][Driver] Disable llvm passes for the first host OpenMP offload compilation
Sergey Dmitriev [Thu, 30 Jan 2020 18:14:16 +0000 (10:14 -0800)]
[Clang][Driver] Disable llvm passes for the first host OpenMP offload compilation

Summary: With OpenMP offloading host compilation is done in two phases to capture host IR that is passed to all device compilations as input. But it turns out that we currently run entire LLVM optimization pipeline on host IR on both compilations which may have unpredictable effects on the resulting code. This patch fixes this problem by disabling LLVM passes on the first compilation, so the host IR that is passed to device compilations will be captured right after front end.

Reviewers: ABataev, jdoerfert, hfinkel

Reviewed By: ABataev

Subscribers: guansong, cfe-commits

Tags: #clang

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

4 years ago[ThinLTO] Disable "Always import constants" due to compile time issues
Teresa Johnson [Thu, 30 Jan 2020 17:56:43 +0000 (09:56 -0800)]
[ThinLTO] Disable "Always import constants" due to compile time issues

Summary:
Disable the always importing of constants introduced in D70404 by
default under a new internal option, since it is causing order of
magnitude compile time regressions during the thin link. Will continue
investigating why the regressions occur.

Reviewers: evgeny777, wmi

Subscribers: mehdi_amini, inglorion, hiraditya, steven_wu, dexonsmith, arphaman, llvm-commits

Tags: #llvm

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

4 years ago[libcxxabi] Insert padding in __cxa_exception struct for compatibility
Steven Wu [Thu, 30 Jan 2020 18:02:23 +0000 (10:02 -0800)]
[libcxxabi] Insert padding in __cxa_exception struct for compatibility

Summary:
Preserve the old ABI for __cxa_exception and __cxa_dependent_exception
on 64 bit platforms or ARM_EHABI platforms.

After r276215, libunwind in llvm-project labels _Unwind_Exception to be
double word aligned. That change implictly adds a padding before
unwindHeader field in __cxa_exception and __cxa_dependent_exception.
Preserve the same negative offsets in those struct by moving the padding
to the beginning of the field.

The assumption here is that if the ABI is not aware of the padding before
unwindHeader and put the referenceCount/primaryException in there, no padding
should exist before unwindHeader.

Reviewers: EricWF, mclow.lists, ldionne, jroelofs, dexonsmith, rjmccall, compnerd, phosek, ahatanak

Reviewed By: rjmccall

Subscribers: hans, smeenai, kristof.beyls, christof, jkorous, ributzka, libcxx-commits

Tags: #libc

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

4 years ago[LoopFusion] Move instructions from FC1.GuardBlock to FC0.GuardBlock and
Whitney Tsang [Thu, 30 Jan 2020 03:57:50 +0000 (03:57 +0000)]
[LoopFusion] Move instructions from FC1.GuardBlock to FC0.GuardBlock and
from FC0.ExitBlock to FC1.ExitBlock when proven safe.

Summary:
Currently LoopFusion give up when the second loop nest guard
block or the first loop nest exit block is not empty. For example:

if (0 < N) {
  for (int i = 0; i < N; ++i) {}
  x+=1;
}
y+=1;
if (0 < N) {
  for (int i = 0; i < N; ++i) {}
}
The above example should be safe to fuse.
This PR moves instructions in FC1 guard block (e.g. y+=1;) to
FC0 guard block, or instructions in FC0 exit block (e.g. x+=1;) to
FC1 exit block, which then LoopFusion is able to fuse them.
Reviewer: kbarton, jdoerfert, Meinersbur, dmgreen, fhahn, hfinkel,
bmahjour, etiotto
Reviewed By: jdoerfert
Subscribers: hiraditya, llvm-commits
Tag: LLVM
Differential Revision: https://reviews.llvm.org/D73641

4 years ago[AArch64][ARM] Always expand ordered vector reductions (PR44600)
Nikita Popov [Tue, 21 Jan 2020 20:48:07 +0000 (21:48 +0100)]
[AArch64][ARM] Always expand ordered vector reductions (PR44600)

fadd/fmul reductions without reassoc are lowered to
VECREDUCE_STRICT_FADD/FMUL nodes, which don't have legalization
support. Until that is in place, expand these intrinsics on
ARM and AArch64. Other targets always expand the vector reduction
intrinsics.

Additionally expand fmax/fmin reductions without nonan flag on
AArch64, as the backend asserts that the flag is present when
lowering VECREDUCE_FMIN/FMAX.

This fixes https://bugs.llvm.org/show_bug.cgi?id=44600.

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

4 years ago[NFC] small refactor on RenamerClangTidyCheck.cpp
Nathan James [Thu, 30 Jan 2020 17:27:32 +0000 (17:27 +0000)]
[NFC] small refactor on RenamerClangTidyCheck.cpp

4 years ago[libc] Add a missing `this->` in __llvm_libc::cpp:MutableArrayRef::end.
Siva Chandra Reddy [Thu, 30 Jan 2020 17:09:17 +0000 (09:09 -0800)]
[libc] Add a missing `this->` in __llvm_libc::cpp:MutableArrayRef::end.

I had removed it to verify a review comment, but forgot to put it back.

4 years ago[NFC][IndVarSimplify] Autogenerate exit_value_test2.ll check lines
Roman Lebedev [Thu, 30 Jan 2020 17:10:16 +0000 (20:10 +0300)]
[NFC][IndVarSimplify] Autogenerate exit_value_test2.ll check lines