platform/upstream/llvm.git
4 years agoDon't warn about missing declarations for partial template specializations
Aaron Puchert [Fri, 31 Jan 2020 23:05:36 +0000 (00:05 +0100)]
Don't warn about missing declarations for partial template specializations

Summary: Just like templates, they are excepted from the ODR rule.

Reviewed By: aaron.ballman, rsmith

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

4 years ago[scudo][standalone] Change default Android config
Kostya Kortchinsky [Thu, 30 Jan 2020 23:26:46 +0000 (15:26 -0800)]
[scudo][standalone] Change default Android config

Summary:
This changes a couple of parameters in the default Android config to
address some performance and memory footprint issues (well to be closer
to the default Bionic allocator numbers).

Subscribers: #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

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

4 years ago[lldb/Test] Fix more substr ordering issues that only repro on the bot
Jonas Devlieghere [Fri, 31 Jan 2020 22:42:41 +0000 (14:42 -0800)]
[lldb/Test] Fix more substr ordering issues that only repro on the bot

4 years ago[lldb/Test] Fix substr order in TestWatchLocationWithWatchSet.py
Jonas Devlieghere [Fri, 31 Jan 2020 22:26:27 +0000 (14:26 -0800)]
[lldb/Test] Fix substr order in TestWatchLocationWithWatchSet.py

4 years ago[lldb/Platform] Always print Kernel last
Jonas Devlieghere [Fri, 31 Jan 2020 22:23:56 +0000 (14:23 -0800)]
[lldb/Platform] Always print Kernel last

Specializations of the Platform class print the kernel after calling the
super method. By printing the kernel at the end in the super class, we
guarantee the order is the same on different platforms.

4 years agoRevert "[clang-doc] Improving Markdown Output"
Petr Hosek [Fri, 31 Jan 2020 22:30:42 +0000 (14:30 -0800)]
Revert "[clang-doc] Improving Markdown Output"

This reverts commit deae8ee6916711b9b20f73fc1a350c3a034d5b34 as it
broke the build on several bots.

4 years ago[RISCV] Implement jump pseudo-instruction
Luís Marques [Fri, 31 Jan 2020 18:52:37 +0000 (18:52 +0000)]
[RISCV] Implement jump pseudo-instruction

Summary:
Implements the jump pseudo-instruction, which is used in e.g. the Linux kernel.

Reviewers: asb, lenary
Reviewed By: lenary
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D73178

4 years ago[clang-doc] Improving Markdown Output
Petr Hosek [Fri, 31 Jan 2020 03:40:38 +0000 (19:40 -0800)]
[clang-doc] Improving Markdown Output

This change has two components. The moves the generated file
for a namespace to the directory named after the namespace in
a file named 'index.<format>'. This greatly improves the browsing
experience since the index page is shown by default for a directory.

The second improves the markdown output by adding the links to the
referenced pages for children objects and the link back to the source
code.

Patch By: Clayton

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

4 years agoRevert "[lldb/Test] Make substrs argument to self.expect ordered."
Jonas Devlieghere [Fri, 31 Jan 2020 21:48:02 +0000 (13:48 -0800)]
Revert "[lldb/Test] Make substrs argument to self.expect ordered."

Temporarily revert to fix the tests that only fail on the bots because
of the newly enforced substr order.

4 years ago[diagtree] Use a different color for unimplemented GCC diagnostic flags
Richard Smith [Fri, 31 Jan 2020 21:28:56 +0000 (13:28 -0800)]
[diagtree] Use a different color for unimplemented GCC diagnostic flags
instead of the "enabled by default" color.

It may be technically correct to list unimplemented diagnostics as
"enabled by default" but it's quite misleading.

4 years ago[lldb/Test] Make substrs argument to self.expect ordered.
Jonas Devlieghere [Fri, 31 Jan 2020 21:27:15 +0000 (13:27 -0800)]
[lldb/Test] Make substrs argument to self.expect ordered.

This patch changes the behavior of the substrs argument to self.expect.
Currently, the elements of substrs are unordered and as long as the
string appears in the output, the assertion passes.

We can be more precise by requiring that the substrings be ordered in
the way they appear. My hope is that this will make it harder to
accidentally pass a check because a string appears out of order.

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

4 years ago[lldb/Test] Fix substrs order in self.expect for the remaining tests (NFC)
Jonas Devlieghere [Fri, 31 Jan 2020 21:26:51 +0000 (13:26 -0800)]
[lldb/Test] Fix substrs order in self.expect for the remaining tests (NFC)

Currently the substrs parameter takes a list of strings that need to be
found but the ordering isn't checked. D73766 might change that so this
changes a several tests so that the order of the strings in the substrs
list is in the order in which they appear in the output.

4 years ago[mlir][DialectConversion] Remove invalid NDEBUG wrapper.
River Riddle [Fri, 31 Jan 2020 21:26:49 +0000 (13:26 -0800)]
[mlir][DialectConversion] Remove invalid NDEBUG wrapper.

The functions are used, but empty when NDEBUG is set.

4 years ago[mlir][EDSC] NFC - Cleanups to builder-api-test.cpp
Nicolas Vasilache [Fri, 31 Jan 2020 21:07:53 +0000 (16:07 -0500)]
[mlir][EDSC] NFC - Cleanups to builder-api-test.cpp

This revision does the following post-commit cleanups:
1. don't use -1 magic constants,
2. drop commented out old test that does not belong here,
3. reformat and add a proper clang-format off on a CHECK directive.

4 years agoDebugInfo: Simplify debug-macinfo-split-dwarf.ll
David Blaikie [Fri, 31 Jan 2020 21:00:39 +0000 (13:00 -0800)]
DebugInfo: Simplify debug-macinfo-split-dwarf.ll

This test didn't need any local variables or parameters, and didn't need
to be checking the DWO ID or more detailed forms.

It was using -v to print the macro sections, but now that macro sections
are emitted when requested (-debug-macro) that's not needed either.

4 years agoPR44723: Trigger return type deduction for operator<=>s whose return
Richard Smith [Fri, 31 Jan 2020 21:05:07 +0000 (13:05 -0800)]
PR44723: Trigger return type deduction for operator<=>s whose return
types are needed to compute the return type of a defaulted operator<=>.

This raises the question of what to do if return type deduction fails.
The standard doesn't say, and implementations vary, so for now reject
that case eagerly to keep our options open.

4 years ago[mlir][Linalg] Adding support for linalg_matmul with tensors.
Nicolas Vasilache [Fri, 31 Jan 2020 19:42:34 +0000 (14:42 -0500)]
[mlir][Linalg] Adding support for linalg_matmul with tensors.

Summary:
This revision provides 2 versions of matmul with tensors to account for the differences in buffer vs value semantics:
1. `C(i, j) = sum_{r_k} A(i, r_k) * B(r_k, j)`
2. `D(i, j) = C(i, j) + sum_{r_k} A(i, r_k) * B(r_k, j)`

Reviewers: ftynse

Subscribers: mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, arpith-jacob, mgester, lucyrfox, aartbik, liufengdb, Joonsoo, llvm-commits

Tags: #llvm

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

4 years ago[lldb] [test] Skip 128-bit int tests on i386 (no __int128_t)
Michał Górny [Fri, 31 Jan 2020 20:58:43 +0000 (21:58 +0100)]
[lldb] [test] Skip 128-bit int tests on i386 (no __int128_t)

4 years agoDebugInfo: Allow dumping macinfo and macinfo.dwo from the same file
David Blaikie [Fri, 31 Jan 2020 19:45:32 +0000 (11:45 -0800)]
DebugInfo: Allow dumping macinfo and macinfo.dwo from the same file

If dumping an Split DWARF file that hasn't been split into separate
files (such as from llc - that includes the plain and .dwo sections in
the same file) allow both macinfo and macinfo.dwo sections to be dumped.

4 years ago[lldb/Test] Fix substrs order in self.expect for more tests (NFC)
Jonas Devlieghere [Fri, 31 Jan 2020 20:44:24 +0000 (12:44 -0800)]
[lldb/Test] Fix substrs order in self.expect for more tests (NFC)

Currently the substrs parameter takes a list of strings that need to be
found but the ordering isn't checked. D73766 might change that so this
changes a several tests so that the order of the strings in the substrs
list is in the order in which they appear in the output.

4 years ago[lldb] Move clang-based files out of Symbol
Alex Langford [Wed, 29 Jan 2020 19:59:28 +0000 (11:59 -0800)]
[lldb] Move clang-based files out of Symbol

Summary:
This change represents the move of ClangASTImporter, ClangASTMetadata,
ClangExternalASTSourceCallbacks, ClangUtil, CxxModuleHandler, and
TypeSystemClang from lldbSource to lldbPluginExpressionParserClang.h

This explicitly removes knowledge of clang internals from lldbSymbol,
moving towards a more generic core implementation of lldb.

Reviewers: JDevlieghere, davide, aprantl, teemperor, clayborg, labath, jingham, shafik

Subscribers: emaste, mgorny, arphaman, jfb, usaxena95, lldb-commits

Tags: #lldb

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

4 years ago[lldb/Test] Fix substrs order in self.expect for more tests (NFC)
Jonas Devlieghere [Fri, 31 Jan 2020 20:19:03 +0000 (12:19 -0800)]
[lldb/Test] Fix substrs order in self.expect for more tests (NFC)

Currently the substrs parameter takes a list of strings that need to be
found but the ordering isn't checked. D73766 might change that so this
changes a several tests so that the order of the strings in the substrs
list is in the order in which they appear in the output.

4 years ago[mlir][NFC] Refactor DialectConversion debug logging
River Riddle [Fri, 31 Jan 2020 19:46:53 +0000 (11:46 -0800)]
[mlir][NFC] Refactor DialectConversion debug logging

Summary:
This revision beefs up the debug logging within dialect conversion. Given the nature of multi-level legalization, and legalization in general, it is one of the harder pieces of infrastructure to debug. This revision adds nice formatting to make the output log easier to parse:

```
Legalizing operation : 'std.constant'(0x608000002420) {
  * Fold {
  } -> FAILURE : unable to fold

  * Pattern : 'std.constant -> ()' {
  } -> FAILURE : pattern failed to match

  * Pattern : 'std.constant -> ()' {
  } -> FAILURE : pattern failed to match

  * Pattern : 'std.constant -> (spv.constant)' {
    ** Insert  : 'spv.constant'(0x608000002c20)
    ** Replace : 'std.constant'(0x608000002420)

    //===-------------------------------------------===//
    Legalizing operation : 'spv.constant'(0x608000002c20) {
    } -> SUCCESS : operation marked legal by the target
    //===-------------------------------------------===//
  } -> SUCCESS : pattern applied successfully
} -> SUCCESS
```

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

4 years ago[InstCombine] Push negation through multiply (PR44234)
Nikita Popov [Fri, 24 Jan 2020 21:11:41 +0000 (22:11 +0100)]
[InstCombine] Push negation through multiply (PR44234)

Fixes https://bugs.llvm.org/show_bug.cgi?id=44234 by adding
multiply support to freelyNegateValue(). Only one of the operands
needs to be negatible, so this still fits within the framework.

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

4 years ago[libc] Use cpp::Array instead of cpp::ArrayRef in memory/utils_test.
Siva Chandra Reddy [Fri, 31 Jan 2020 19:39:06 +0000 (11:39 -0800)]
[libc] Use cpp::Array instead of cpp::ArrayRef in memory/utils_test.

Building with address-sanitizer shows that using ArrayRef ends up
accessing a temporary outside its scope.

4 years ago[Typo fix] RNG: Take pass name as argument instead of pass pointer.
Dominic Chen [Fri, 31 Jan 2020 19:34:49 +0000 (14:34 -0500)]
[Typo fix] RNG: Take pass name as argument instead of pass pointer.

Summary: With the new pass manager, it is not possible to obtain a pointer to the pass.

Reviewers: jfb, rinon, yln

Subscribers: hiraditya, dexonsmith, llvm-commits

Tags: #llvm

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

4 years ago[mlir] [VectorOps] fixed bug in vector.insert_strided_slice lowering
aartbik [Fri, 31 Jan 2020 18:56:22 +0000 (10:56 -0800)]
[mlir] [VectorOps] fixed bug in vector.insert_strided_slice lowering

Summary:
Rationale:
When lowering to LLVM for different rank insert (n vs k), the offset
arrays needs to drop one dimension (becomes n-1), but the strides
array needs to be preserved (remains k). With regression test.
Note that this example was actually in the documentation, so
extra important to do it right :-)

Reviewers: nicolasvasilache, andydavis1, ftynse

Reviewed By: nicolasvasilache, ftynse

Subscribers: Joonsoo, merge_guards_bot, mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, arpith-jacob, mgester, lucyrfox, liufengdb, llvm-commits

Tags: #llvm

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

4 years agoRNG: Take pass name as argument instead of pass pointer.
Dominic Chen [Fri, 24 Jan 2020 22:21:14 +0000 (17:21 -0500)]
RNG: Take pass name as argument instead of pass pointer.

Summary: With the new pass manager, it is not possible to obtain a pointer to the pass.

Reviewers: jfb, rinon, yln

Subscribers: hiraditya, dexonsmith, llvm-commits

Tags: #llvm

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

4 years ago[GlobalISel] Tweak lowering of G_SMULO/G_UMULO
Jay Foad [Thu, 16 Jan 2020 14:46:36 +0000 (14:46 +0000)]
[GlobalISel] Tweak lowering of G_SMULO/G_UMULO

Summary:
Applying this cleanup:

    -      MIRBuilder.buildInstr(TargetOpcode::G_ASHR)
    -        .addDef(Shifted)
    -        .addUse(Res)
    -        .addUse(ShiftAmt);
    +      MIRBuilder.buildAShr(Shifted, Res, ShiftAmt);

caused an assertion failure here:

    llc: /home/jayfoad2/git/llvm-project/llvm/lib/CodeGen/MachineRegisterInfo.cpp:404: llvm::MachineInstr *llvm::MachineRegisterInfo::getVRegDef(unsigned int) const: Assertion `(I.atEnd() || std::next(I) == def_instr_end()) && "getVRegDef assumes a single definition or no definition"' failed.

    #4  0x00000000050a6d96 in llvm::MachineRegisterInfo::getVRegDef (this=0x74606a0, Reg=2147483650) at /home/jayfoad2/git/llvm-project/llvm/lib/CodeGen/MachineRegisterInfo.cpp:403
    #5  0x00000000066148f6 in llvm::getConstantVRegValWithLookThrough (VReg=2147483650, MRI=..., LookThroughInstrs=false, HandleFConstant=true) at /home/jayfoad2/git/llvm-project/llvm/lib/CodeGen/GlobalISel/Utils.cpp:244
    #6  0x00000000066147da in llvm::getConstantVRegVal (VReg=2147483650, MRI=...) at /home/jayfoad2/git/llvm-project/llvm/lib/CodeGen/GlobalISel/Utils.cpp:210
    #7  0x0000000006615367 in llvm::ConstantFoldBinOp (Opcode=101, Op1=2147483650, Op2=2147483656, MRI=...) at /home/jayfoad2/git/llvm-project/llvm/lib/CodeGen/GlobalISel/Utils.cpp:341
    #8  0x000000000657eee0 in llvm::CSEMIRBuilder::buildInstr (this=0x7465010, Opc=101, DstOps=..., SrcOps=..., Flag=...) at /home/jayfoad2/git/llvm-project/llvm/lib/CodeGen/GlobalISel/CSEMIRBuilder.cpp:160
    #9  0x0000000003645958 in llvm::MachineIRBuilder::buildAShr (this=0x7465010, Dst=..., Src0=..., Src1=..., Flags=...) at /home/jayfoad2/git/llvm-project/llvm/include/llvm/CodeGen/GlobalISel/MachineIRBuilder.h:1298
    #10 0x00000000065c35b1 in llvm::LegalizerHelper::lower (this=0x7fffffffb5f8, MI=..., TypeIdx=0, Ty=...) at /home/jayfoad2/git/llvm-project/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp:2020

because at this point there are two instructions defining Res: the
original G_SMULO/G_UMULO and the new G_MUL that we built. The fix is
to modify the original mul in place, so that there is only ever one
definition of Res.

Reviewers: arsenm, aditya_nandakumar

Subscribers: wdng, rovka, hiraditya, volkan, Petar.Avramovic, llvm-commits

Tags: #llvm

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

4 years ago[AArch64][GlobalISel] Walk through G_TRUNC in getTestBitReg
Jessica Paquette [Thu, 30 Jan 2020 22:53:37 +0000 (14:53 -0800)]
[AArch64][GlobalISel] Walk through G_TRUNC in getTestBitReg

When you encounter a G_TRUNC, you are moving from a larger type to a smaller
type.

Asking for the i-th bit on a larger value is the same as asking for the i-th
bit on a smaller value.

So, we should always be able to walk through G_TRUNC when computing the bit
for a TB(N)Z.

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

4 years ago[lldb/Symbol] Use StringRef ctor to prevent incorrect overload
Jonas Devlieghere [Fri, 31 Jan 2020 18:54:41 +0000 (10:54 -0800)]
[lldb/Symbol] Use StringRef ctor to prevent incorrect overload

Use the StringRef constructor instead of toStringRef so we don't end up
with the wrong overload (llvm::toStringRef(bool)).

Fixes PR44736

4 years ago[DAG] SimplifyMultipleUseDemandedBits - peek through unused ISD::INSERT_SUBVECTOR...
Simon Pilgrim [Fri, 31 Jan 2020 18:57:10 +0000 (18:57 +0000)]
[DAG] SimplifyMultipleUseDemandedBits - peek through unused ISD::INSERT_SUBVECTOR subvectors

If we don't demand any elements of the inserted subvector then just skip it.

4 years ago[mlir] Remove the dependency of StdToLLVM on LoopToStd
Alex Zinenko [Fri, 31 Jan 2020 18:46:57 +0000 (19:46 +0100)]
[mlir] Remove the dependency of StdToLLVM on LoopToStd

This is a leftover of a temporary state where loop operations were in Standard
dialect.

4 years ago[mlir] Linalg tiling: generate code avoding out-of-bounds accesses
Alex Zinenko [Wed, 29 Jan 2020 10:33:57 +0000 (11:33 +0100)]
[mlir] Linalg tiling: generate code avoding out-of-bounds accesses

Summary:
After the `subview` operation was migrated from Linalg to Standard, it changed
semantics and does not guarantee the absence of out-of-bounds accesses through
the created view anymore. Compute the size of the subview to make sure it
always fits within the view (subviews in last iterations of the loops may be
smaller than those in other iterations).

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

4 years agoOrc: Remove an unnecessary explicit scope
David Blaikie [Fri, 31 Jan 2020 18:14:18 +0000 (10:14 -0800)]
Orc: Remove an unnecessary explicit scope

(was useful at some point in the past for scoping some error handling
that's since been tidied up a bit)

4 years ago[lldb/Test] Fix substrs order in self.expect for more tests (NFC)
Jonas Devlieghere [Fri, 31 Jan 2020 18:28:15 +0000 (10:28 -0800)]
[lldb/Test] Fix substrs order in self.expect for more tests (NFC)

Currently the substrs parameter takes a list of strings that need to be
found but the ordering isn't checked. D73766 might change that so this
changes a several tests so that the order of the strings in the substrs
list is in the order in which they appear in the output.

4 years ago[yaml2obj] Internlize DocNum. NFC
Fangrui Song [Fri, 31 Jan 2020 18:08:42 +0000 (10:08 -0800)]
[yaml2obj] Internlize DocNum. NFC

4 years agoOrc: Remove redundant std::move
David Blaikie [Fri, 31 Jan 2020 18:09:41 +0000 (10:09 -0800)]
Orc: Remove redundant std::move

4 years ago[Concepts] Fix isDeclarationSpecifier to detect type-constraints correctly
Saar Raz [Fri, 31 Jan 2020 18:05:09 +0000 (20:05 +0200)]
[Concepts] Fix isDeclarationSpecifier to detect type-constraints correctly

isDeclarationSpecifiers did not handle some cases of placeholder-type-specifiers with
type-constraints, causing parsing bugs in abbreviated constructor templates.

Add comprehensive handling of type-constraints to isDeclarationSpecifier.

4 years ago[DAG] Enable ISD::INSERT_SUBVECTOR SimplifyMultipleUseDemandedBits handling
Simon Pilgrim [Fri, 31 Jan 2020 18:02:21 +0000 (18:02 +0000)]
[DAG] Enable ISD::INSERT_SUBVECTOR SimplifyMultipleUseDemandedBits handling

This allows SimplifyDemandedBits to call SimplifyMultipleUseDemandedBits to create a simpler ISD::INSERT_SUBVECTOR, which is particularly useful for cases where we're splitting into subvectors anyhow.

4 years ago[AMDGPU] fixed divergence driven shift operations selection
alex-t [Fri, 31 Jan 2020 17:49:00 +0000 (20:49 +0300)]
[AMDGPU] fixed divergence driven shift operations selection

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

Reviewers: rampitec

4 years ago[PGO][PGSO] Handle MBFIWrapper
Hiroshi Yamauchi [Wed, 29 Jan 2020 17:36:31 +0000 (09:36 -0800)]
[PGO][PGSO] Handle MBFIWrapper

Some code gen passes use MBFIWrapper to keep track of the frequency of new
blocks. This was not taken into account and could lead to incorrect frequencies
as MBFI silently returns zero frequency for unknown/new blocks.

Add a variant for MBFIWrapper in the PGSO query interface.

Depends on D73494.

4 years ago[GlobalISel] Tidy up unnecessary calls to createGenericVirtualRegister
Jay Foad [Fri, 31 Jan 2020 12:40:31 +0000 (12:40 +0000)]
[GlobalISel] Tidy up unnecessary calls to createGenericVirtualRegister

Summary:
As a side effect some redundant copies of constant values are removed by
CSEMIRBuilder.

Reviewers: aemerson, arsenm, dsanders, aditya_nandakumar

Subscribers: sdardis, jvesely, wdng, nhaehnle, rovka, hiraditya, jrtc27, atanasyan, volkan, Petar.Avramovic, kerbowa, llvm-commits

Tags: #llvm

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

4 years ago[lldb][NFC] Fix expect calls with wrong order of 'substrs' items for D73766
Raphael Isemann [Fri, 31 Jan 2020 08:02:32 +0000 (09:02 +0100)]
[lldb][NFC] Fix expect calls with wrong order of 'substrs' items for D73766

Currently the substrs parameter takes a list of strings
that need to be found but the ordering isn't checked. D73766
might change that so this changes a several tests so that
the order of the strings in the substrs list is in the order
in which they appear in the output.

4 years ago- Update .clang-tidy to ignore parameters of main like functions for naming violation...
Nathan James [Fri, 31 Jan 2020 16:49:13 +0000 (16:49 +0000)]
- Update .clang-tidy to ignore parameters of main like functions for naming violations in clang and llvm directory

Summary: Every call to a main like function in llvm and clang lib violates the naming convention for parameters. This prevents clang-tidy warning on such breaches.

Reviewers: alexfh, hokein

Reviewed By: hokein

Subscribers: merge_guards_bot, aheejin, cfe-commits, llvm-commits

Tags: #clang, #llvm

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

4 years ago[AArch64][SVE] Add SVE2 mla unpredicated intrinsics.
Danilo Carvalho Grael [Thu, 30 Jan 2020 22:21:39 +0000 (17:21 -0500)]
[AArch64][SVE] Add SVE2 mla unpredicated intrinsics.

Summary:
Add intrinsics for the MLA unpredicated sve2 instructions:
- smlalb, smlalt, umlalb, umlalt, smlslb, smlslt, umlslb, umlslt
- sqdmlalb, sqdmlalt, sqdmlslb, sqdmlslt
- sqdmlalbt, sqdmlslbt

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

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

Tags: #llvm

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

4 years ago[NFC] Introduce a type to model memory operation
Guillaume Chatelet [Fri, 31 Jan 2020 14:40:31 +0000 (15:40 +0100)]
[NFC] Introduce a type to model memory operation

Summary: This is a first step before changing the types to llvm::Align and introduce functions to ease client code.

Reviewers: courbet

Subscribers: arsenm, sdardis, nemanjai, jvesely, nhaehnle, hiraditya, kbarton, jrtc27, atanasyan, jsji, kerbowa, llvm-commits

Tags: #llvm

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

4 years ago[NFC] [lldb] Unindent DWARFDebugInfoEntry::GetDWARFDeclContext
Jan Kratochvil [Fri, 31 Jan 2020 15:49:31 +0000 (16:49 +0100)]
[NFC] [lldb] Unindent DWARFDebugInfoEntry::GetDWARFDeclContext

Reduce code indentation level.

4 years agoAMDGPU: Fix potential use of undefined value
Matt Arsenault [Fri, 31 Jan 2020 15:38:36 +0000 (10:38 -0500)]
AMDGPU: Fix potential use of undefined value

4 years ago[lldb] Revert refactorization from: Move non-DWARF code: DWARFUnit -> SymbolFileDWARF
Jan Kratochvil [Fri, 31 Jan 2020 15:04:40 +0000 (16:04 +0100)]
[lldb] Revert refactorization from: Move non-DWARF code: DWARFUnit -> SymbolFileDWARF

Reverting part of commit 789beeeca3cdeecc00cd731c940e52effdd7c7df.

Its DWARFDebugInfoEntry::GetDWARFDeclContext() refactorization for
return value is now adding it in opposite order.

4 years agoAMDGPU/GlobalISel: Combine FMIN_LEGACY/FMAX_LEGACY
Matt Arsenault [Thu, 23 Jan 2020 03:31:24 +0000 (22:31 -0500)]
AMDGPU/GlobalISel: Combine FMIN_LEGACY/FMAX_LEGACY

Try out using combine definition rules.

This really should be a post-legalizer combine, but the combiner pass
is currently pre-legalize. Most of the target combines are really
post-legalize, so we should probably move the pass.

4 years ago[PATCH] D73727: [SLP] drop poison-generating flags for shuffle reduction ops (PR44536)
Sanjay Patel [Fri, 31 Jan 2020 14:37:47 +0000 (09:37 -0500)]
[PATCH] D73727: [SLP] drop poison-generating flags for shuffle reduction ops (PR44536)

We may calculate reassociable math ops in arbitrary order when creating a shuffle reduction,
so there's no guarantee that things like 'nsw' hold on those intermediate values. Drop all
poison-generating flags for safety.

This change is limited to shuffle reductions because I don't think we have a problem in the
general case (where we intersect flags of each scalar op that goes into a vector op), but if
there's evidence of other cases being wrong, we can extend this fix to cover those cases.

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

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

4 years ago[lldb] Add a basic unit test for the SharedCluster class
Pavel Labath [Fri, 31 Jan 2020 14:45:58 +0000 (15:45 +0100)]
[lldb] Add a basic unit test for the SharedCluster class

4 years ago[lldb] Remove some dead code from SharingPtr.h
Pavel Labath [Fri, 31 Jan 2020 14:45:16 +0000 (15:45 +0100)]
[lldb] Remove some dead code from SharingPtr.h

These classes are not used.

4 years ago[mlir][spirv] Convert linalg.generic for reduction to SPIR-V ops
Lei Zhang [Sun, 26 Jan 2020 16:10:29 +0000 (11:10 -0500)]
[mlir][spirv] Convert linalg.generic for reduction to SPIR-V ops

This commit adds a pattern to lower linalg.generic for reduction
to spv.GroupNonUniform* ops. Right now this only supports integer
reduction on 1-D input memref. Shader entry point ABI is queried
to make sure that the input memref's shape matches the local
workgroup's invocation configuration. This makes sure that the
workload fits in one local workgroup so that we can leverage
SPIR-V group non-uniform operations.

linglg.generic is a structured op that preserves the right level
of information. It is easier to recognize reduction at this level
than performing analysis on loops.

This commit also exposes `getElementPtr` in SPIRVLowering.h given
that it's a generally useful utility function.

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

4 years ago[clang-format] Fixes for spaces around C# object initializers
Jonathan Coe [Fri, 31 Jan 2020 14:08:46 +0000 (14:08 +0000)]
[clang-format] Fixes for spaces around C# object initializers

Summary: Fix spaces around typename and [] in C# object initializers.

Reviewers: MyDeveloperDay, klimek, krasimir

Reviewed By: MyDeveloperDay, krasimir

Subscribers: cfe-commits

Tags: #clang-format, #clang

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

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.