platform/upstream/llvm.git
5 years ago[LoadStoreVectorizer] vectorizeStoreChain - ensure we find a store type.
Simon Pilgrim [Mon, 6 May 2019 10:25:11 +0000 (10:25 +0000)]
[LoadStoreVectorizer] vectorizeStoreChain - ensure we find a store type.

Properly initialize store type to null then ensure we find a real store type in the chain.

Fixes scan-build null dereference warning and makes the code clearer.

llvm-svn: 360031

5 years ago[clangd] Boost code completion results that were named in the last few lines.
Sam McCall [Mon, 6 May 2019 10:25:10 +0000 (10:25 +0000)]
[clangd] Boost code completion results that were named in the last few lines.

Summary:
The hope is this will catch a few patterns with repetition:

  SomeClass* S = ^SomeClass::Create()

  int getFrobnicator() { return ^frobnicator_; }

  // discard the factory, it's no longer valid.
  ^MyFactory.reset();

Without triggering antipatterns too often:

  return Point(x.first, x.^second);

I'm going to gather some data on whether this turns out to be a win overall.

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

Tags: #clang

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

llvm-svn: 360030

5 years ago[CodeGen] Move X86 tests under the X86 directory
Fangrui Song [Mon, 6 May 2019 10:21:17 +0000 (10:21 +0000)]
[CodeGen] Move X86 tests under the X86 directory

llvm-svn: 360029

5 years ago[X86] X86InstrInfo::findThreeSrcCommutedOpIndices - fix unread variable warning.
Simon Pilgrim [Mon, 6 May 2019 10:15:34 +0000 (10:15 +0000)]
[X86] X86InstrInfo::findThreeSrcCommutedOpIndices - fix unread variable warning.

scan-build was reporting that CommutableOpIdx1 never used its original initialized value - move it down to where its first used to make the real initialization more obvious (and matches the comment that's there).

llvm-svn: 360028

5 years ago[X86] lowerVectorShuffle - use any_of to detect out of bounds shuffle indices. NFCI.
Simon Pilgrim [Mon, 6 May 2019 10:11:24 +0000 (10:11 +0000)]
[X86] lowerVectorShuffle - use any_of to detect out of bounds shuffle indices. NFCI.

Fixes cppcheck local shadow warning as well.

llvm-svn: 360027

5 years ago[clangd] Qualify uses of ::testing everywhere. NFC
Ilya Biryukov [Mon, 6 May 2019 10:08:47 +0000 (10:08 +0000)]
[clangd] Qualify uses of ::testing everywhere. NFC

Add an initial '::' qualifier to all usages of 'testing' namespace that
did not have one.

The goal is to make our code style in tests more consistent.

llvm-svn: 360026

5 years ago[Analysis] Remove duplicated std::move from LocRange constructor
Simon Pilgrim [Mon, 6 May 2019 10:04:23 +0000 (10:04 +0000)]
[Analysis] Remove duplicated std::move from LocRange constructor

scan-build was reporting that we were referencing a moved variable - in fact we were moving it twice.....

llvm-svn: 360025

5 years agoRevert r359949 "[clang] adding explicit(bool) from c++2a"
Hans Wennborg [Mon, 6 May 2019 09:51:10 +0000 (09:51 +0000)]
Revert r359949 "[clang] adding explicit(bool) from c++2a"

This caused Clang to start erroring on the following:

  struct S {
    template <typename = int> explicit S();
  };

  struct T : S {};

  struct U : T {
    U();
  };
  U::U() {}

  $ clang -c /tmp/x.cc
  /tmp/x.cc:10:4: error: call to implicitly-deleted default constructor of 'T'
  U::U() {}
     ^
  /tmp/x.cc:5:12: note: default constructor of 'T' is implicitly deleted
    because base class 'S' has no default constructor
  struct T : S {};
             ^
  1 error generated.

See discussion on the cfe-commits email thread.

This also reverts the follow-ups r359966 and r359968.

> this patch adds support for the explicit bool specifier.
>
> Changes:
> - The parsing for the explicit(bool) specifier was added in ParseDecl.cpp.
> - The storage of the explicit specifier was changed. the explicit specifier was stored as a boolean value in the FunctionDeclBitfields and in the DeclSpec class. now it is stored as a PointerIntPair<Expr*, 2> with a flag and a potential expression in CXXConstructorDecl, CXXDeductionGuideDecl, CXXConversionDecl and in the DeclSpec class.
> - Following the AST change, Serialization, ASTMatchers, ASTComparator and ASTPrinter were adapted.
> - Template instantiation was adapted to instantiate the potential expressions of the explicit(bool) specifier When instantiating their associated declaration.
> - The Add*Candidate functions were adapted, they now take a Boolean indicating if the context allowing explicit constructor or conversion function and this boolean is used to remove invalid overloads that required template instantiation to be detected.
> - Test for Semantic and Serialization were added.
>
> This patch is not yet complete. I still need to check that interaction with CTAD and deduction guides is correct. and add more tests for AST operations. But I wanted first feedback.
> Perhaps this patch should be spited in smaller patches, but making each patch testable as a standalone may be tricky.
>
> Patch by Tyker
>
> Differential Revision: https://reviews.llvm.org/D60934

llvm-svn: 360024

5 years ago[NFC] Update memcpy tests
Guillaume Chatelet [Mon, 6 May 2019 09:46:50 +0000 (09:46 +0000)]
[NFC] Update memcpy tests

Summary: Runs utils/update_llc_test_checks.py on a few memcpy files

Reviewers: courbet

Subscribers: llvm-commits

Tags: #llvm

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

Remove cfi noise by adding nounwind

llvm-svn: 360023

5 years ago[X86] Move files to correct directories after D60552
Fangrui Song [Mon, 6 May 2019 09:24:36 +0000 (09:24 +0000)]
[X86] Move files to correct directories after D60552

llvm-svn: 360022

5 years ago[SimplifyLibCalls] Simplify bcmp too.
Clement Courbet [Mon, 6 May 2019 09:15:22 +0000 (09:15 +0000)]
[SimplifyLibCalls] Simplify bcmp too.

Summary: Fixes PR40699.

Reviewers: gchatelet

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 360021

5 years ago[clangd] Always call getFormatStyleForFile().
Sam McCall [Mon, 6 May 2019 08:39:17 +0000 (08:39 +0000)]
[clangd] Always call getFormatStyleForFile().

This means "format" will no longer return an error if the -fallback-style flag
is invalid, it will log and use LLVM style. This doesn't really matter.

Also document the dependence on global variables. (This patch is a
compromise - it's probably not worth actually avoiding the globals).

llvm-svn: 360020

5 years ago[NFC] This is a test for the commit access.
Pengfei Wang [Mon, 6 May 2019 08:31:18 +0000 (08:31 +0000)]
[NFC] This is a test for the commit access.

Summary: Signed-off-by: Pengfei Wang <pengfei.wang@intel.com>

Reviewers: LuoYuanke

Subscribers: llvm-commits

Tags: #llvm

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

llvm-svn: 360019

5 years agoEnable intrinsics of AVX512_BF16, which are supported for BFLOAT16 in Cooper Lake
Luo, Yuanke [Mon, 6 May 2019 08:25:11 +0000 (08:25 +0000)]
Enable intrinsics of AVX512_BF16, which are supported for BFLOAT16 in Cooper Lake

Summary:
1. Enable infrastructure of AVX512_BF16, which is supported for BFLOAT16 in Cooper Lake;
2. Enable intrinsics for VCVTNE2PS2BF16, VCVTNEPS2BF16 and DPBF16PS instructions, which are Vector Neural Network Instructions supporting BFLOAT16 inputs and conversion instructions from IEEE single precision.
For more details about BF16 intrinsic, please refer to the latest ISE document: https://software.intel.com/en-us/download/intel-architecture-instruction-set-extensions-programming-reference

Patch by LiuTianle

Reviewers: craig.topper, smaslov, LuoYuanke, wxiao3, annita.zhang, spatel, RKSimon

Reviewed By: craig.topper

Subscribers: mgorny, cfe-commits

Tags: #clang

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

llvm-svn: 360018

5 years agoEnable AVX512_BF16 instructions, which are supported for BFLOAT16 in Cooper Lake
Luo, Yuanke [Mon, 6 May 2019 08:22:37 +0000 (08:22 +0000)]
Enable AVX512_BF16 instructions, which are supported for BFLOAT16 in Cooper Lake

Summary:
1. Enable infrastructure of AVX512_BF16, which is supported for BFLOAT16 in Cooper Lake;
2. Enable VCVTNE2PS2BF16, VCVTNEPS2BF16 and DPBF16PS  instructions, which are Vector Neural Network Instructions supporting BFLOAT16 inputs and conversion instructions from IEEE single precision.
VCVTNE2PS2BF16: Convert Two Packed Single Data to One Packed BF16 Data.
VCVTNEPS2BF16: Convert Packed Single Data to Packed BF16 Data.
VDPBF16PS: Dot Product of BF16 Pairs Accumulated into Packed Single Precision.
For more details about BF16 isa, please refer to the latest ISE document: https://software.intel.com/en-us/download/intel-architecture-instruction-set-extensions-programming-reference

Author: LiuTianle

Reviewers: craig.topper, smaslov, LuoYuanke, wxiao3, annita.zhang, RKSimon, spatel

Reviewed By: craig.topper

Subscribers: kristina, llvm-commits

Tags: #llvm

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

llvm-svn: 360017

5 years ago[clangd] Support -fallback-style, similar to clang-format.
Sam McCall [Mon, 6 May 2019 08:11:59 +0000 (08:11 +0000)]
[clangd] Support -fallback-style, similar to clang-format.

Reviewers: kadircet

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

Tags: #clang

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

llvm-svn: 360016

5 years agoDWARF v5: fix directory index in the line table
Fangrui Song [Mon, 6 May 2019 08:03:46 +0000 (08:03 +0000)]
DWARF v5: fix directory index in the line table

Summary:
Prior to DWARF v5, a directory index of 0 represents DW_AT_comp_dir.

In DWARF v5, the index starts with 0 and Entry.DirIdx is the index into
Prologue.IncludeDirectories.

Reviewed By: labath

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

llvm-svn: 360015

5 years ago[DWARF] Reimplement/simplify DWARFUnit::GetID
Pavel Labath [Mon, 6 May 2019 07:45:28 +0000 (07:45 +0000)]
[DWARF] Reimplement/simplify DWARFUnit::GetID

Summary:
The implementation of GetID used a relatively complicated algorithm,
which returned some kind of an offset of the unit in some file
(depending on the debug info flavour). The only thing this ID was used
for was to enable subseqent retrieval of the unit from the SymbolFile.

This can be made simpler if we just make the "ID" of the unit an index
into the list of the units belonging to the symbol file. We already
support indexed access to the units, so each unit already has a well
"index" -- this just makes it accessible from within the unit.

To make the distincion between "id" and "offset" clearer (and help catch
any misuses), I also rename DWARFDebugInfo::GetCompileUnit (which
accesses by offset) into DWARFDebugInfo::GetCompileUnitAtOffset.

On its own, this only brings a minor simplification, but it enables
further simplifications in the DIERef class (coming in a follow-up
patch).

Reviewers: JDevlieghere, clayborg, aprantl

Subscribers: arphaman, jdoerfert, lldb-commits, tberghammer, jankratochvil

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

llvm-svn: 360014

5 years ago[DebugInfo] GlobalOpt DW_OP_deref_size instead of DW_OP_deref.
Markus Lavin [Mon, 6 May 2019 07:20:56 +0000 (07:20 +0000)]
[DebugInfo] GlobalOpt DW_OP_deref_size instead of DW_OP_deref.

Optimization pass lib/Transforms/IPO/GlobalOpt.cpp needs to insert
DW_OP_deref_size instead of DW_OP_deref to be compatible with big-endian
targets for same reasons as in D59687.

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

llvm-svn: 360013

5 years ago[llvm-c] Make LLVMGetStringErrorTypeId a proper prototype
Anders Waldenborg [Mon, 6 May 2019 06:42:06 +0000 (06:42 +0000)]
[llvm-c] Make LLVMGetStringErrorTypeId a proper prototype

In C a function declaration with an empty argument list isn't a real
prototype, it will allow calling the function with any number of
arguments. It will also cause warnings when used in C code compiled with
'-Wstrict-prototypes'

Reviewed By: whitequark
Differential Revision: https://reviews.llvm.org/D61568

llvm-svn: 360012

5 years agoP1286R2: Remove restriction that the exception specification of a
Richard Smith [Mon, 6 May 2019 05:04:56 +0000 (05:04 +0000)]
P1286R2: Remove restriction that the exception specification of a
defaulted special member matches the implicit exception specification.

llvm-svn: 360011

5 years agoUse DiagRuntimeBehavior for -Wunsequenced to weed out false positives
Richard Smith [Mon, 6 May 2019 04:14:01 +0000 (04:14 +0000)]
Use DiagRuntimeBehavior for -Wunsequenced to weed out false positives
where either the modification or the other access is unreachable.

This reverts r359984 (which reverted r359962). The bug in clang-tidy's
test suite exposed by the original commit was fixed in r360009.

llvm-svn: 360010

5 years agoFix test to avoid assuming clang will diagnose problems in unreachable code.
Richard Smith [Mon, 6 May 2019 04:07:30 +0000 (04:07 +0000)]
Fix test to avoid assuming clang will diagnose problems in unreachable code.

llvm-svn: 360009

5 years ago[SelectionDAG] Replace llvm_unreachable at the end of getCopyFromParts with a report_...
Craig Topper [Mon, 6 May 2019 04:01:49 +0000 (04:01 +0000)]
[SelectionDAG] Replace llvm_unreachable at the end of getCopyFromParts with a report_fatal_error.

Based on PR41748, not all cases are handled in this function.

llvm_unreachable is treated as an optimization hint than can prune code paths
in a release build. This causes weird behavior when PR41748 is encountered on a
release build. It appears to generate an fp_round instruction from the floating
point code.

Making this a report_fatal_error prevents incorrect optimization of the code
and will instead generate a message to file a bug report.

llvm-svn: 360008

5 years agoFix up after r360006.
Richard Smith [Mon, 6 May 2019 04:00:45 +0000 (04:00 +0000)]
Fix up after r360006.

llvm-svn: 360007

5 years ago[c++20] Implement P1009R2: allow omitting the array bound in an array
Richard Smith [Mon, 6 May 2019 03:47:15 +0000 (03:47 +0000)]
[c++20] Implement P1009R2: allow omitting the array bound in an array
new expression.

This was voted into C++20 as a defect report resolution, so we
retroactively apply it to all prior language modes (though it can never
actually be used before C++11 mode).

llvm-svn: 360006

5 years agoThe 'CodeGenObjC/illegal-UTF8.m' get failed with Clang built with 32-bit targets...
Galina Kistanova [Mon, 6 May 2019 03:30:09 +0000 (03:30 +0000)]
The 'CodeGenObjC/illegal-UTF8.m' get failed with Clang built with 32-bit targets only (as example ARM-only) with the following error:

error: unable to create target: 'No available targets are compatible with triple "< ... any 64-bit target triple ... >"'

I didn't find any 64-bit dependencies for the test and I think removing '-m64' option should fix the problem and allow this test for any target specified by LLVM_DEFAULT_TARGET_TRIPLE.

Patch by Vlad Vereschaka.

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

llvm-svn: 360005

5 years ago[libcxxabi] Don't use -fvisibility-global-new-delete-hidden when not defining them
Petr Hosek [Mon, 6 May 2019 01:25:31 +0000 (01:25 +0000)]
[libcxxabi] Don't use -fvisibility-global-new-delete-hidden when not defining them

When builing the hermetic static library, the compiler switch
-fvisibility-global-new-delete-hidden is necessary to get the new and
delete operator definitions made correctly. However, when those
definitions are not included in the library, then this switch does harm.
With lld (though not all linkers) setting STV_HIDDEN on SHN_UNDEF
symbols makes it an error to leave them undefined or defined via dynamic
linking that should generate PLTs for -shared linking (lld makes this a
hard error even without -z defs). Though leaving the symbols undefined
would usually work in practice if the linker were to allow it (and the
user didn't pass -z defs), this actually indicates a real problem that
could bite some target configurations more subtly at runtime. For
example, x86-32 ELF -fpic code generation uses hidden visibility on
declarations in the caller's scope as a signal that the call will never
be resolved to a PLT entry and so doesn't have to meet the special ABI
requirements for PLT calls (setting %ebx). Since these functions might
actually be resolved to PLT entries at link time (we don't know what the
user is linking in when the hermetic library doesn't provide all the
symbols itself), it's not safe for the compiler to treat their
declarations at call sites as having hidden visibility.

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

llvm-svn: 360004

5 years ago[libcxx] Don't use -fvisibility-global-new-delete-hidden when not defining them
Petr Hosek [Mon, 6 May 2019 01:22:28 +0000 (01:22 +0000)]
[libcxx] Don't use -fvisibility-global-new-delete-hidden when not defining them

When builing the hermetic static library, the compiler switch
-fvisibility-global-new-delete-hidden is necessary to get the new and
delete operator definitions made correctly. However, when those
definitions are not included in the library, then this switch does harm.
With lld (though not all linkers) setting STV_HIDDEN on SHN_UNDEF
symbols makes it an error to leave them undefined or defined via dynamic
linking that should generate PLTs for -shared linking (lld makes this a
hard error even without -z defs). Though leaving the symbols undefined
would usually work in practice if the linker were to allow it (and the
user didn't pass -z defs), this actually indicates a real problem that
could bite some target configurations more subtly at runtime. For
example, x86-32 ELF -fpic code generation uses hidden visibility on
declarations in the caller's scope as a signal that the call will never
be resolved to a PLT entry and so doesn't have to meet the special ABI
requirements for PLT calls (setting %ebx). Since these functions might
actually be resolved to PLT entries at link time (we don't know what the
user is linking in when the hermetic library doesn't provide all the
symbols itself), it's not safe for the compiler to treat their
declarations at call sites as having hidden visibility.

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

llvm-svn: 360003

5 years ago[clang-tidy] openmp-exception-escape check: point to the structured-block
Roman Lebedev [Sun, 5 May 2019 21:26:32 +0000 (21:26 +0000)]
[clang-tidy] openmp-exception-escape check: point to the structured-block

I'm not sure what i was thinking when i wrote it to point at the directive.
It's at the very least confusing, and in the `for` is very misleading.

We should point at the actual Stmt out of which the exception escapes,
to highlight where it should be fixed e.g. via adding try-catch block.

Yes, this breaks existing NOLINT, which is why this change needs to
happen now, not any later.

llvm-svn: 360002

5 years ago[X86] Pull out repeated Subtarget feature tests. NFCI.
Simon Pilgrim [Sun, 5 May 2019 20:45:20 +0000 (20:45 +0000)]
[X86] Pull out repeated Subtarget feature tests. NFCI.

Avoids a scan-build "uninitialized value" warning in X86FastISel::X86SelectFPExtOrFPTrunc

llvm-svn: 360001

5 years ago[TargetLowering] getValueType - use dyn_cast directly to find VectorType. NFCI.
Simon Pilgrim [Sun, 5 May 2019 20:23:45 +0000 (20:23 +0000)]
[TargetLowering] getValueType - use dyn_cast directly to find VectorType. NFCI.

Matches what we do in other getValueType functions and fixes a null dereference warning in scan-build.

Also cleans up the rest of the function - use auto and standardize the variable names.

llvm-svn: 360000

5 years ago[TTI][X86] Make getAddressComputationCost cost value const. NFCI.
Simon Pilgrim [Sun, 5 May 2019 20:03:51 +0000 (20:03 +0000)]
[TTI][X86] Make getAddressComputationCost cost value const. NFCI.

llvm-svn: 359999

5 years ago[analyzer][UninitializedObjectChecker] PR41741: Regard all scalar types as primitive.
Kristof Umann [Sun, 5 May 2019 19:42:33 +0000 (19:42 +0000)]
[analyzer][UninitializedObjectChecker] PR41741: Regard all scalar types as primitive.

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

Pretty much the same as D61246 and D61106, this time for __complex__ types. Upon
further investigation, I realized that we should regard all types
Type::isScalarType returns true for as primitive, so I merged
isMemberPointerType(), isBlockPointerType() and isAnyComplexType()` into that
instead.

I also stumbled across yet another bug,
https://bugs.llvm.org/show_bug.cgi?id=41753, but it seems to be unrelated to
this checker.

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

llvm-svn: 359998

5 years ago[NFC] BasicBlock: generalize replaceSuccessorsPhiUsesWith(), take Old bb
Roman Lebedev [Sun, 5 May 2019 18:59:45 +0000 (18:59 +0000)]
[NFC] BasicBlock: generalize replaceSuccessorsPhiUsesWith(), take Old bb

Thus it does not assume that the old basic block is the basic block
for which we are looking at successors.

Not reviewed, but seems rather trivial, in line with the rest of
previous few patches.

llvm-svn: 359997

5 years ago[NFC] BasicBlock: refactor changePhiUses() out of replacePhiUsesWith(), use it
Roman Lebedev [Sun, 5 May 2019 18:59:39 +0000 (18:59 +0000)]
[NFC] BasicBlock: refactor changePhiUses() out of replacePhiUsesWith(), use it

Summary:
It is a common thing to loop over every `PHINode` in some `BasicBlock`
and change old `BasicBlock` incoming block to a new `BasicBlock` incoming block.
`replaceSuccessorsPhiUsesWith()` already had code to do that,
it just wasn't a function.
So outline it into a new function, and use it.

Reviewers: chandlerc, craig.topper, spatel, danielcdh

Reviewed By: craig.topper

Subscribers: llvm-commits

Tags: #llvm

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

llvm-svn: 359996

5 years ago[NFC] PHINode: introduce replaceIncomingBlockWith() function, use it
Roman Lebedev [Sun, 5 May 2019 18:59:30 +0000 (18:59 +0000)]
[NFC] PHINode: introduce replaceIncomingBlockWith() function, use it

Summary:
There is `PHINode::getBasicBlockIndex()`, `PHINode::setIncomingBlock()`
and `PHINode::getNumOperands()`, but no function to replace every
specified `BasicBlock*` predecessor with some other specified `BasicBlock*`.
Clearly, there are a lot of places that could use that functionality.

Reviewers: chandlerc, craig.topper, spatel, danielcdh

Reviewed By: craig.topper

Subscribers: llvm-commits

Tags: #llvm

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

llvm-svn: 359995

5 years ago[NFC] Instruction: introduce replaceSuccessorWith() function, use it
Roman Lebedev [Sun, 5 May 2019 18:59:22 +0000 (18:59 +0000)]
[NFC] Instruction: introduce replaceSuccessorWith() function, use it

Summary:
There is `Instruction::getNumSuccessors()`, `Instruction::getSuccessor()`
and `Instruction::setSuccessor()`, but no function to replace every
specified `BasicBlock*` successor with some other specified `BasicBlock*`.
I've found one place where it should clearly be used.

Reviewers: chandlerc, craig.topper, spatel, danielcdh

Reviewed By: craig.topper

Subscribers: llvm-commits

Tags: #llvm

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

llvm-svn: 359994

5 years ago[NFC][Utils] deleteDeadLoop(): add an assert that exit block has some non-PHI instruction
Roman Lebedev [Sun, 5 May 2019 18:59:12 +0000 (18:59 +0000)]
[NFC][Utils] deleteDeadLoop(): add an assert that exit block has some non-PHI instruction

Summary:
If `deleteDeadLoop()` is called on such a loop, that has "bad" exit block,
one that e.g. has no terminator instruction, the `DIBuilder::insertDbgValueIntrinsic()`
will be told to insert the Dbg Value Intrinsic after `nullptr`
(since there is no first non-PHI instruction), which will cause it to not insert
those instructions into any basic block. The instructions will be parent-less,
and IR verifier will complain. It is rather obvious to track down the root cause
when that happens, so let's just assert it never happens.

Reviewers: sanjoy, davide, vsk

Reviewed By: vsk

Subscribers: llvm-commits

Tags: #llvm

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

llvm-svn: 359993

5 years ago[test] Remove randomness
Jonas Devlieghere [Sun, 5 May 2019 18:54:16 +0000 (18:54 +0000)]
[test] Remove randomness

This particular test fails once every so many runs on GreenDragon. Given
that the randomness in the inferior isn't critical to the test, I
removed it in the hopes that it is the cause of the flakiness.

llvm-svn: 359992

5 years agoMove getOpcode() call into if statement. NFCI.
Simon Pilgrim [Sun, 5 May 2019 18:34:38 +0000 (18:34 +0000)]
Move getOpcode() call into if statement. NFCI.

Avoids a cppcheck "Local variable name shadows outer variable" warning.

llvm-svn: 359991

5 years agoPrecommit an FNeg InstructionSimplify test.
Cameron McInally [Sun, 5 May 2019 18:22:09 +0000 (18:22 +0000)]
Precommit an FNeg InstructionSimplify test.

llvm-svn: 359990

5 years ago[SLPVectorizer] Prefer pre-increments. NFCI.
Simon Pilgrim [Sun, 5 May 2019 17:53:09 +0000 (17:53 +0000)]
[SLPVectorizer] Prefer pre-increments. NFCI.

llvm-svn: 359989

5 years ago[LLParser] Remove unused variable after r359987. NFC
Craig Topper [Sun, 5 May 2019 17:46:17 +0000 (17:46 +0000)]
[LLParser] Remove unused variable after r359987. NFC

llvm-svn: 359988

5 years ago[LLParser] Remove unnecessary error check making sure NUW/NSW flags aren't set on...
Craig Topper [Sun, 5 May 2019 17:19:23 +0000 (17:19 +0000)]
[LLParser] Remove unnecessary error check making sure NUW/NSW flags aren't set on a non-integer operation.

Summary: This check appears to be a leftover from when add/sub/mul could be either integer or fp. The NSW/NUW flags are only set for add/sub/mul/shl earlier. And we check that those operations only have integer types just below this. So it seems unnecessary to explicitly error for NUW/NSW being used on a add/sub/mul that have the wrong type that would later error for that.

Reviewers: spatel, dblaikie, jyknight, arsenm

Reviewed By: spatel

Subscribers: wdng, llvm-commits, hiraditya

Tags: #llvm

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

llvm-svn: 359987

5 years ago[LLParser] Simplify type checking in ParseArithmetic and ParseUnaryOp.
Craig Topper [Sun, 5 May 2019 17:19:19 +0000 (17:19 +0000)]
[LLParser] Simplify type checking in ParseArithmetic and ParseUnaryOp.

Summary:
These methods previously took a 0, 1, or 2 to indicate what types were allowed, but the 0 encoding which meant both fp and integer types has been unused for years. Its leftover from when add/sub/mul used to be shared between int and fp

Simplify it by changing it to just a bool to distinquish int and fp.

Reviewers: spatel, dblaikie, jyknight, arsenm

Reviewed By: spatel

Subscribers: wdng, hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 359986

5 years ago[Constants] Simplify type checking switch in ConstantExpr::get.
Craig Topper [Sun, 5 May 2019 17:19:16 +0000 (17:19 +0000)]
[Constants] Simplify type checking switch in ConstantExpr::get.

Summary:
Remove duplicate checks that both operands have the same type. This is checked
before the switch.

Use 'integer' or 'floating-point' instead of 'arithmetic' type. I think this
might be a leftover to the days when floating point and integer operations
shared the same opcodes.

Reviewers: spatel, RKSimon, dblaikie

Reviewed By: RKSimon

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 359985

5 years agoRevert rL359962 : Use DiagRuntimeBehavior for -Wunsequenced to weed out false positives
Simon Pilgrim [Sun, 5 May 2019 17:10:05 +0000 (17:10 +0000)]
Revert rL359962 : Use DiagRuntimeBehavior for -Wunsequenced to weed out false positives
where either the modification or the other access is unreachable.
........
Try to fix buildbots

llvm-svn: 359984

5 years ago[MCA] Notify event listeners when instructions transition to the Pending state. NFCI
Andrea Di Biagio [Sun, 5 May 2019 16:07:27 +0000 (16:07 +0000)]
[MCA] Notify event listeners when instructions transition to the Pending state. NFCI

llvm-svn: 359983

5 years agoAdd FNeg IR constant folding support
Cameron McInally [Sun, 5 May 2019 16:07:09 +0000 (16:07 +0000)]
Add FNeg IR constant folding support

llvm-svn: 359982

5 years ago[X86] Make X86RegisterInfo(const Triple &TT) constructor explicit.
Simon Pilgrim [Sun, 5 May 2019 12:51:47 +0000 (12:51 +0000)]
[X86] Make X86RegisterInfo(const Triple &TT) constructor explicit.

Fixes cppcheck warning.

llvm-svn: 359981

5 years ago[clang] fixing -ast-print for variadic parameter pack in lambda capture
Nicolas Lesser [Sun, 5 May 2019 12:35:12 +0000 (12:35 +0000)]
[clang] fixing -ast-print for variadic parameter pack in lambda capture

Summary:
currently for:
```
 template<typename ... T>
void f(T... t) {
  auto l = [t...]{};
}
```
`clang -ast-print file.cpp`
outputs:

```
template <typename ...T> void f(T ...t) {
    auto l = [t]         {
        }
;
}
```
notice that there is not `...` in the capture list of the lambda. this patch fixes this issue. and add test for it.

Patch by Tyker

Reviewers: rsmith

Reviewed By: rsmith

Subscribers: cfe-commits

Tags: #clang

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

llvm-svn: 359980

5 years ago[C++] Interpret unknown identifier in parameter clause as unknown type
Nicolas Lesser [Sun, 5 May 2019 12:15:17 +0000 (12:15 +0000)]
[C++] Interpret unknown identifier in parameter clause as unknown type

instead of as parameter name without a type.

llvm-svn: 359979

5 years ago[lldb] [lit] Simplify general-purpose register tests
Michal Gorny [Sun, 5 May 2019 12:06:32 +0000 (12:06 +0000)]
[lldb] [lit] Simplify general-purpose register tests

Use output constraints for specific general-purpose registers in order
to simplify the tests.  They save us from having to manually put
the values in correct registers, and reduce the number of registers
needed as a result.

llvm-svn: 359978

5 years ago[lldb] [lit] Fix more filename mismatches in Register tests
Michal Gorny [Sun, 5 May 2019 12:06:22 +0000 (12:06 +0000)]
[lldb] [lit] Fix more filename mismatches in Register tests

llvm-svn: 359977

5 years ago[X86] Fix some cppcheck "Local variable name shadows outer variable" warnings. NFCI.
Simon Pilgrim [Sun, 5 May 2019 12:00:14 +0000 (12:00 +0000)]
[X86] Fix some cppcheck "Local variable name shadows outer variable" warnings. NFCI.

llvm-svn: 359976

5 years ago[SLPVectorizer] Make getSpillCost() const. NFCI.
Simon Pilgrim [Sun, 5 May 2019 10:37:38 +0000 (10:37 +0000)]
[SLPVectorizer] Make getSpillCost() const. NFCI.

Ideally getTreeCost() should be const as well but non-const Type creation would need to be addressed first.

llvm-svn: 359975

5 years ago[SelectionDAG] Use any_of/all_of where possible. NFCI.
Simon Pilgrim [Sun, 5 May 2019 10:30:04 +0000 (10:30 +0000)]
[SelectionDAG] Use any_of/all_of where possible. NFCI.

llvm-svn: 359974

5 years agoMove Value *RHSCIOp def into the scope where its actually used. NFCI.
Simon Pilgrim [Sun, 5 May 2019 10:27:45 +0000 (10:27 +0000)]
Move Value *RHSCIOp def into the scope where its actually used. NFCI.

llvm-svn: 359973

5 years agoAdd InstCombine tests for FNeg instruction.
Cameron McInally [Sat, 4 May 2019 14:56:08 +0000 (14:56 +0000)]
Add InstCombine tests for FNeg instruction.

llvm-svn: 359970

5 years ago[CodeGenPrepare] limit overflow intrinsic matching to a single basic block (2nd try)
Sanjay Patel [Sat, 4 May 2019 12:46:32 +0000 (12:46 +0000)]
[CodeGenPrepare] limit overflow intrinsic matching to a single basic block (2nd try)

This is a subset of the original commit from rL359879
which was reverted because it could crash when using the 'RemovedInstructions'
structure that enables delayed deletion of dead instructions. The motivating
compile-time win does not require that change though. We should get most of
that win from this change alone.

Using/updating a dominator tree to match math overflow patterns may be very
expensive in compile-time (because of the way CGP uses a DT), so just handle
the single-block case.

See post-commit thread for rL354298 for more details:
http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20190422/646276.html

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

llvm-svn: 359969

5 years ago[NFC] Add parentheses to avoid -Wparentheses.
Nicolas Lesser [Sat, 4 May 2019 11:28:11 +0000 (11:28 +0000)]
[NFC] Add parentheses to avoid -Wparentheses.

llvm-svn: 359968

5 years ago[c++20] Implement P0428R2 - Familiar template syntax for generic lambdas
Hamza Sood [Sat, 4 May 2019 10:49:46 +0000 (10:49 +0000)]
[c++20] Implement P0428R2 - Familiar template syntax for generic lambdas

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

llvm-svn: 359967

5 years ago[lldb] Fix buildbot failure due to clang AST change.
Nicolas Lesser [Sat, 4 May 2019 10:21:50 +0000 (10:21 +0000)]
[lldb] Fix buildbot failure due to clang AST change.

In r359949 several AST node constructors were modified without the
corresponding change in lldb, which caused build failures.

llvm-svn: 359966

5 years ago[llvm-nm] Convert weak.test to use yaml2obj and fix unntested 'v'
Fangrui Song [Sat, 4 May 2019 09:12:18 +0000 (09:12 +0000)]
[llvm-nm] Convert weak.test to use yaml2obj and fix unntested 'v'

This restores part of the good change reverted by r359830.

llvm-svn: 359965

5 years ago[c++20] Implement tweaked __VA_OPT__ rules from P1042R1:
Richard Smith [Sat, 4 May 2019 06:46:18 +0000 (06:46 +0000)]
[c++20] Implement tweaked __VA_OPT__ rules from P1042R1:

 * __VA_OPT__ is expanded if the *expanded* __VA_ARGS__ is non-empty,
   not if the original argument contained no tokens.
 * Placemarkers at the start and end of __VA_OPT__ are retained just
   long enough to paste them with adjacent ## operators. We never paste
   "across" a discarded placemarker.

llvm-svn: 359964

5 years ago[AMDGPU] Fixed asan error after D61536
Stanislav Mekhanoshin [Sat, 4 May 2019 06:40:20 +0000 (06:40 +0000)]
[AMDGPU] Fixed asan error after D61536

llvm-svn: 359963

5 years agoUse DiagRuntimeBehavior for -Wunsequenced to weed out false positives
Richard Smith [Sat, 4 May 2019 05:20:14 +0000 (05:20 +0000)]
Use DiagRuntimeBehavior for -Wunsequenced to weed out false positives
where either the modification or the other access is unreachable.

llvm-svn: 359962

5 years agoAMDGPU] gfx1010 hazard recognizer
Stanislav Mekhanoshin [Sat, 4 May 2019 04:30:57 +0000 (04:30 +0000)]
AMDGPU] gfx1010 hazard recognizer

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

llvm-svn: 359961

5 years agoReduce amount of work ODR hashing does.
Richard Trieu [Sat, 4 May 2019 04:22:33 +0000 (04:22 +0000)]
Reduce amount of work ODR hashing does.

When a FunctionProtoType is in the original type in a DecayedType, the decayed
type is a PointerType which points back the original FunctionProtoType.  The
visitor for ODRHashing will attempt to process both Type's, doing double work.
By chaining together multiple DecayedType's and FunctionProtoType's, this would
result in 2^N Type's visited only N DecayedType's and N FunctionProtoType's
exsit.  Another bug where VisitDecayedType and VisitAdjustedType did
redundant work doubled the work at each level, giving 4^N Type's visited.  This
patch removed the double work and detects when a FunctionProtoType decays to
itself to only check the Type once.  This lowers the exponential runtime to
linear runtime.  Fixes https://bugs.llvm.org/show_bug.cgi?id=41625

llvm-svn: 359960

5 years ago[AMDGPU] gfx1010: use fmac instructions
Stanislav Mekhanoshin [Sat, 4 May 2019 04:20:37 +0000 (04:20 +0000)]
[AMDGPU] gfx1010: use fmac instructions

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

llvm-svn: 359959

5 years agoDisallow the operand of __builtin_constant_p from modifying enclosing
Richard Smith [Sat, 4 May 2019 04:00:45 +0000 (04:00 +0000)]
Disallow the operand of __builtin_constant_p from modifying enclosing
state when it's encountered while evaluating a constexpr function.

We attempt to follow GCC trunk's behavior here, but it is somewhat
inscrutible, so our behavior is only approximately the same for now.
Specifically, we only permit modification of objects whose lifetime
began within the operand of the __builtin_constant_p. GCC appears to
have effectively the same restriction, but also some unknown restriction
based on where and how the local state of the constexpr function is
mentioned within the operand (see added testcases).

llvm-svn: 359958

5 years ago[Driver] Create non-existent directory for -fcrash-diagnostics-dir
Petr Hosek [Sat, 4 May 2019 00:55:14 +0000 (00:55 +0000)]
[Driver] Create non-existent directory for -fcrash-diagnostics-dir

When user specifies non-existent directory to -fcrash-diagnostics-dir,
create it rather than failing with an error as would be the case before.

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

llvm-svn: 359954

5 years ago[cxx_status] Don't list -fmodules / -fmodules-ts against C++ modules
Richard Smith [Sat, 4 May 2019 00:27:21 +0000 (00:27 +0000)]
[cxx_status] Don't list -fmodules / -fmodules-ts against C++ modules
support; those turn on different modules modes. The real C++ modules
support is behind -std=c++2a like the rest of C++20.

llvm-svn: 359953

5 years ago[cxx_status] Replace "SVN" entries with Clang 8 as appropriate.
Richard Smith [Sat, 4 May 2019 00:23:18 +0000 (00:23 +0000)]
[cxx_status] Replace "SVN" entries with Clang 8 as appropriate.

Also: use the "svn" color for "explicit(bool)" rather than the "full" color.
llvm-svn: 359951

5 years ago[JITLink] Add two useful Section operations: find by name, get address range.
Lang Hames [Sat, 4 May 2019 00:23:09 +0000 (00:23 +0000)]
[JITLink] Add two useful Section operations: find by name, get address range.

These operations were already used in eh-frame registration, and are likely to
be used in other runtime registrations, so this commit moves them into a header
where they can be re-used.

llvm-svn: 359950

5 years ago[clang] adding explicit(bool) from c++2a
Nicolas Lesser [Sat, 4 May 2019 00:09:00 +0000 (00:09 +0000)]
[clang] adding explicit(bool) from c++2a

this patch adds support for the explicit bool specifier.

Changes:
- The parsing for the explicit(bool) specifier was added in ParseDecl.cpp.
- The storage of the explicit specifier was changed. the explicit specifier was stored as a boolean value in the FunctionDeclBitfields and in the DeclSpec class. now it is stored as a PointerIntPair<Expr*, 2> with a flag and a potential expression in CXXConstructorDecl, CXXDeductionGuideDecl, CXXConversionDecl and in the DeclSpec class.
- Following the AST change, Serialization, ASTMatchers, ASTComparator and ASTPrinter were adapted.
- Template instantiation was adapted to instantiate the potential expressions of the explicit(bool) specifier When instantiating their associated declaration.
- The Add*Candidate functions were adapted, they now take a Boolean indicating if the context allowing explicit constructor or conversion function and this boolean is used to remove invalid overloads that required template instantiation to be detected.
- Test for Semantic and Serialization were added.

This patch is not yet complete. I still need to check that interaction with CTAD and deduction guides is correct. and add more tests for AST operations. But I wanted first feedback.
Perhaps this patch should be spited in smaller patches, but making each patch testable as a standalone may be tricky.

Patch by Tyker

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

llvm-svn: 359949

5 years agoCWG issue 727: Fix numerous bugs in support for class-scope explicit
Richard Smith [Fri, 3 May 2019 23:51:38 +0000 (23:51 +0000)]
CWG issue 727: Fix numerous bugs in support for class-scope explicit
specializations for variable templates.

llvm-svn: 359947

5 years agoExpressionParser: only force link MCJIT when needed
Saleem Abdulrasool [Fri, 3 May 2019 23:19:27 +0000 (23:19 +0000)]
ExpressionParser: only force link MCJIT when needed

This was added to support FreeBSD.  The inclusion of this header increases the
size of `lldb-server` due to MCJIT being forcefully preserved.  Conditionalise
the inclusion to shared builds of LLVM which will allow for MCJIT to be stripped
if unnecessary when performing static linking of tools.  This shaves off ~28% of
the binary size for lldb-server when linked with gold using
`-ffunction-sections` and `-fdata-sections`.

llvm-svn: 359944

5 years ago[clang-format] Fix bug in block comment reflow that joins * and /
Owen Pan [Fri, 3 May 2019 23:15:40 +0000 (23:15 +0000)]
[clang-format] Fix bug in block comment reflow that joins * and /

Fixes PR41213

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

llvm-svn: 359943

5 years ago[lld] Specify output file explicitly
Alexander Kornienko [Fri, 3 May 2019 23:11:32 +0000 (23:11 +0000)]
[lld] Specify output file explicitly

The test shouldn't try to create `a.out` in the current directory, which can be
read-only (and it is in our test setup).

llvm-svn: 359942

5 years ago[x86] add tests for fneg IR with undef; NFC
Sanjay Patel [Fri, 3 May 2019 22:47:29 +0000 (22:47 +0000)]
[x86] add tests for fneg IR with undef; NFC

llvm-svn: 359941

5 years ago[AArch64][GlobalISel] Use fcsel instead of csel for G_SELECT on FPRs
Jessica Paquette [Fri, 3 May 2019 22:37:46 +0000 (22:37 +0000)]
[AArch64][GlobalISel] Use fcsel instead of csel for G_SELECT on FPRs

This saves us some unnecessary copies.

If the inputs to a G_SELECT are floating point, we should use fcsel rather than
csel.

Changes here are...

- Teach selectCopy about s1-to-s1 copies across register banks.
- AArch64RegisterBankInfo about G_SELECT in general.
- Teach the instruction selector about the FCSEL instructions.

Also add two tests:

- select-select.mir to show that we get the expected FCSEL
- regbank-select.mir (unfortunately named) to show the register banks on
G_SELECT are properly preserved

And update fast-isel-select.ll to show that we do the same thing as other
instruction selectors in these cases.

llvm-svn: 359940

5 years agoMake the git-llvm script work on older git versions that don't support git rev-parse...
Craig Topper [Fri, 3 May 2019 22:03:29 +0000 (22:03 +0000)]
Make the git-llvm script work on older git versions that don't support git rev-parse --git-common-dir.

Not all versions of git support git rev-parse --git-common-dir. Rather than erorr or print any kind of
useful error, they just print back '--git-common-dir' instead of a directory. The git-llvm script
ends up taking this '--git-common-dir' as a diretory name to use.

Not sure exactly what happens after that, but the end result is that the 'git llvm push' ends up
looking like it pushed your commits, but really did nothing.

This patch makes the script detect the bogus directory name for --git-common-dir and falls back to using --git-dir instead.

llvm-svn: 359939

5 years ago[AMDGPU] gfx1010 wait count insertion
Stanislav Mekhanoshin [Fri, 3 May 2019 21:53:53 +0000 (21:53 +0000)]
[AMDGPU] gfx1010 wait count insertion

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

llvm-svn: 359938

5 years ago[AMDGPU] gfx1010 s_code_end generation
Stanislav Mekhanoshin [Fri, 3 May 2019 21:26:39 +0000 (21:26 +0000)]
[AMDGPU] gfx1010 s_code_end generation

Also add some missing metadata in the streamer.

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

llvm-svn: 359937

5 years agoUpdate PatternMatcher for FNeg
Cameron McInally [Fri, 3 May 2019 21:19:12 +0000 (21:19 +0000)]
Update PatternMatcher for FNeg

Match both FNeg(X) and FSub(+-0.0, X) in FNeg_match

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

llvm-svn: 359936

5 years ago[AMDGPU] gfx1010 loop alignment
Stanislav Mekhanoshin [Fri, 3 May 2019 21:17:29 +0000 (21:17 +0000)]
[AMDGPU] gfx1010 loop alignment

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

llvm-svn: 359935

5 years ago[COFF, ARM64] Fix ABI implementation of struct returns
Mandeep Singh Grang [Fri, 3 May 2019 21:12:36 +0000 (21:12 +0000)]
[COFF, ARM64] Fix ABI implementation of struct returns

Summary:
Refer the ABI doc at: https://docs.microsoft.com/en-us/cpp/build/arm64-windows-abi-conventions?view=vs-2019#return-values

Related clang patch: D60349

Reviewers: rnk, efriedma, TomTan, ssijaric

Reviewed By: rnk, efriedma

Subscribers: mstorsjo, javed.absar, kristof.beyls, llvm-commits

Tags: #llvm

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

llvm-svn: 359934

5 years ago[COFF, ARM64] Fix ABI implementation of struct returns
Mandeep Singh Grang [Fri, 3 May 2019 21:12:24 +0000 (21:12 +0000)]
[COFF, ARM64] Fix ABI implementation of struct returns

Summary:
Related llvm patch: D60348.
Patch co-authored by Sanjin Sijaric.

Reviewers: rnk, efriedma, TomTan, ssijaric, ostannard

Reviewed By: efriedma

Subscribers: dmajor, richard.townsend.arm, ostannard, javed.absar, kristof.beyls, cfe-commits

Tags: #clang

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

llvm-svn: 359932

5 years agoFixed some minor style issues in rLLDB359921 [NFC]
Raphael Isemann [Fri, 3 May 2019 21:01:45 +0000 (21:01 +0000)]
Fixed some minor style issues in rLLDB359921 [NFC]

Ran clang-format on the added test file and use the new StringRef
comparison over the temporary ConstStrings. Also aligned the
end of one of the code string literals.

llvm-svn: 359931

5 years ago[test] Make check more strict
Jonas Devlieghere [Fri, 3 May 2019 20:58:56 +0000 (20:58 +0000)]
[test] Make check more strict

Before this change the test would always pass if the path to the test
contained the number 11 in it. Thanks to Ted for pointing this out.

llvm-svn: 359930

5 years ago[lldb] Remove the 'www' folder.
Jonas Devlieghere [Fri, 3 May 2019 20:42:45 +0000 (20:42 +0000)]
[lldb] Remove the 'www' folder.

Now that the new website is live and everything is generated from the
repository, we don't need the www folder anymore.

llvm-svn: 359929

5 years ago[Alias] Add 're' alias for register
Jonas Devlieghere [Fri, 3 May 2019 20:37:09 +0000 (20:37 +0000)]
[Alias] Add 're' alias for register

This patch makes `re` an alias for `register`. Currently `re<TAB>` gives
you the choice between `register` and `reproducer`. Given that you use
`register` a lot more often, it should win for the common substring.

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

llvm-svn: 359927

5 years agoMake lldb-mi optional and change how we deal with missing tools in lit
Jonas Devlieghere [Fri, 3 May 2019 20:33:58 +0000 (20:33 +0000)]
Make lldb-mi optional and change how we deal with missing tools in lit

We don't need the variables in lit, we can use the capabilities to check
if the utility exists.

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

llvm-svn: 359926

5 years agoSupply a default implementation of IsRuntimeSupportValue.
Adrian Prantl [Fri, 3 May 2019 20:28:19 +0000 (20:28 +0000)]
Supply a default implementation of IsRuntimeSupportValue.

Thanks to Pavel for pointing this out.

llvm-svn: 359925

5 years agoShrink SectionChunk by combining Relocs and SectionName sizes
Reid Kleckner [Fri, 3 May 2019 20:17:14 +0000 (20:17 +0000)]
Shrink SectionChunk by combining Relocs and SectionName sizes

SectionChunk is one of the most frequently allocated data structures in
LLD, since there are about four per function when optimizations and
debug info are enabled (.text, .pdata, .xdata, .debug$S).

A PE COFF file cannot be larger than 2GB, so there is an inherent limit
on the length of the section name and the number of relocations.
Decompose the ArrayRef and StringRef into pointer and size, and put them
back together in the accessors for section name and relocation list.

I plan to gather complete performance numbers later by padding
SectionChunk with dead data and measuring performance after all the size
optimizations are done.

llvm-svn: 359923

5 years ago[OPENMP][NVPTX]Improve thread limit counter, NFC.
Alexey Bataev [Fri, 3 May 2019 20:00:38 +0000 (20:00 +0000)]
[OPENMP][NVPTX]Improve thread limit counter, NFC.

Summary:
Patch improves performance of the full runtime mode by moving
thread-limit counter to the shared memory. It also allows to save
global memory.

Reviewers: grokos, gtbercea, kkwli0

Subscribers: guansong, jdoerfert, caomhin, openmp-commits

Tags: #openmp

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

llvm-svn: 359922

5 years agoFix for ambiguous lookup in expressions between local variable and namespace
Shafik Yaghmour [Fri, 3 May 2019 19:59:22 +0000 (19:59 +0000)]
Fix for ambiguous lookup in expressions between local variable and namespace

Summary:
In an Objective-C context a local variable and namespace can cause an ambiguous name lookup when used in an expression. The solution involves mimicking the existing C++ solution which is to add local using declarations for local variables. This causes a different type of lookup to be used which eliminates the namespace during acceptable results filtering.

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

llvm-svn: 359921

5 years ago[Lsan] Disabling explicitally FreeBSD
David Carlier [Fri, 3 May 2019 19:46:55 +0000 (19:46 +0000)]
[Lsan] Disabling explicitally FreeBSD

As it is not implemented upon usage, it just provokes numerous linkage issues so better switch off clearly.

Reviewers: vitalybuka, morehouse

Reviewed By: morehouse

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

llvm-svn: 359920