platform/upstream/llvm.git
4 years ago[clangd][Hover] Make tests hermetic by setting target triplet
Kadir Cetinkaya [Wed, 29 Jan 2020 10:17:45 +0000 (11:17 +0100)]
[clangd][Hover] Make tests hermetic by setting target triplet

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

Reviewers: sammccall

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

Tags: #clang

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

4 years agoFix an implicit conversion in clang-tidy. GCC 5 complains about it.
Benjamin Kramer [Wed, 29 Jan 2020 11:05:01 +0000 (12:05 +0100)]
Fix an implicit conversion in clang-tidy. GCC 5 complains about it.

4 years ago[ARM] Add documentation for -march= and -mfpu= command line options
Momchil Velikov [Wed, 29 Jan 2020 10:38:10 +0000 (10:38 +0000)]
[ARM] Add documentation for -march= and -mfpu= command line options

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

4 years ago[AArch64][SVE] Add SVE2 intrinsics for pairwise arithmetic
Kerry McLaughlin [Wed, 29 Jan 2020 09:57:30 +0000 (09:57 +0000)]
[AArch64][SVE] Add SVE2 intrinsics for pairwise arithmetic

Summary:
Implements the following intrinsics:
 - addp
 - smaxp, sminp, umaxp & uminp
 - sadalp & uadalp

Reviewers: dancgr, efriedma, sdesmalen, c-rhodes

Reviewed By: c-rhodes

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

Tags: #llvm

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

4 years ago[DebugInfo] Make most debug line prologue errors non-fatal to parsing
James Henderson [Tue, 28 Jan 2020 14:04:42 +0000 (14:04 +0000)]
[DebugInfo] Make most debug line prologue errors non-fatal to parsing

Many of the debug line prologue errors are not inherently fatal. In most
cases, we can make reasonable assumptions and carry on. This patch does
exactly that. In the case of length problems, the approach of "assume
stated length is correct" is taken which means the offset might need
adjusting.

This is a relanding of b94191fe, fixing an LLD test and the LLDB build.

Reviewed by: dblaikie, labath

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

4 years ago[lldb] More windows StringRef fixes
Pavel Labath [Wed, 29 Jan 2020 10:15:20 +0000 (11:15 +0100)]
[lldb] More windows StringRef fixes

I don't have a windows build around, so I am just going by the buildbot
messages.

4 years ago[VE] fp32/64 fadd/fsub/fdiv/fmul isel patterns
Kazushi (Jam) Marukawa [Wed, 29 Jan 2020 09:16:42 +0000 (10:16 +0100)]
[VE] fp32/64 fadd/fsub/fdiv/fmul isel patterns

Summary: fp32/64 fadd/fsub/fdiv/fmul isel patterns and tests.

Reviewers: arsenm, craig.topper, rengolin, k-ishizaka

Subscribers: merge_guards_bot, wdng, hiraditya, llvm-commits

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

4 years ago[ARM64] Debug info for structure argument missing DW_AT_location
David Stenberg [Wed, 29 Jan 2020 08:44:02 +0000 (09:44 +0100)]
[ARM64] Debug info for structure argument missing DW_AT_location

Summary:
Prevent eliminating dbg_val due to COPY.

Fixes this
https://bugs.llvm.org/show_bug.cgi?id=40709

Patch by: Kamlesh Kumar (kamleshbhalui)

Reviewers: aprantl, dblaikie, vsk, dsanders

Reviewed By: dsanders

Subscribers: dstenb, kristof.beyls, hiraditya, llvm-commits

Tags: #debug-info, #llvm

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

4 years ago[ASTMatchers] StringRef'ify hasName
Benjamin Kramer [Wed, 29 Jan 2020 09:52:25 +0000 (10:52 +0100)]
[ASTMatchers] StringRef'ify hasName

This was just inconvenient, and we make a copy anyways.

4 years ago[VE][fix] (more) explicit StringRef to std::string
Simon Moll [Wed, 29 Jan 2020 09:42:00 +0000 (10:42 +0100)]
[VE][fix] (more) explicit StringRef to std::string

4 years ago[AMDGPU] Simplify DS and SM cases in getMemOperandsWithOffset
Jay Foad [Mon, 6 Jan 2020 14:56:24 +0000 (14:56 +0000)]
[AMDGPU] Simplify DS and SM cases in getMemOperandsWithOffset

Summary:
This removes a couple of unnecessary isReg checks, now that
memOpsHaveSameBasePtr can handle FI operands, but is otherwise NFC.

Reviewers: arsenm, rampitec

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

Tags: #llvm

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

4 years ago[VE][fix] Explicit StringRef to std::string conversion
Simon Moll [Wed, 29 Jan 2020 09:29:43 +0000 (10:29 +0100)]
[VE][fix] Explicit StringRef to std::string conversion

Adapt to changes of "[ADT] Make StringRef's std::string conversion
operator explicit" (777180a32).

4 years ago[clangd] Add a symbol-name-based blacklist for rename.
Haojian Wu [Mon, 27 Jan 2020 09:39:55 +0000 (10:39 +0100)]
[clangd] Add a symbol-name-based blacklist for rename.

Summary:
This patch adds a simple mechanism to disallow global rename
on std symbols. We might extend it to other symbols, e.g. protobuf.

Reviewers: kadircet

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

Tags: #clang

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

4 years agoFix clang unnittest build with GCC 5
Benjamin Kramer [Wed, 29 Jan 2020 09:30:36 +0000 (10:30 +0100)]
Fix clang unnittest build with GCC 5

4 years ago[lldb] Fix windows build for the StringRef conversion operator change
Pavel Labath [Wed, 29 Jan 2020 09:08:40 +0000 (10:08 +0100)]
[lldb] Fix windows build for the StringRef conversion operator change

"operator std::string()" is now explicit.

4 years ago[ARC] Fix ARCTargetMachine after 777180a32b6107
Fangrui Song [Wed, 29 Jan 2020 08:59:16 +0000 (00:59 -0800)]
[ARC] Fix ARCTargetMachine after 777180a32b6107

4 years ago[RDA][ARM] Move functionality into RDA
Sam Parker [Wed, 29 Jan 2020 08:26:11 +0000 (03:26 -0500)]
[RDA][ARM] Move functionality into RDA

Add several new helpers to RDA:
- hasLocalDefBefore
- isRegDefinedAfter
- isSafeToDefRegAt

And move two bits of logic from ARMLowOverheadLoops into RDA:
- isSafeToMove
- isSafeToRemove

Both of these have some wrappers too to make them more convienent to
use.

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

4 years ago[lldb] Don't create duplicate declarations when completing a forward declaration...
Raphael Isemann [Wed, 29 Jan 2020 08:20:06 +0000 (09:20 +0100)]
[lldb] Don't create duplicate declarations when completing a forward declaration with a definition from another source

Summary:
I noticed this strange line in `ASTImporterDelegate::ImportDefinitionTo` which doesn't make a lot of sense:
```
to_tag->setCompleteDefinition(from_tag->isCompleteDefinition());
```

It forcibly sets the imported TagDecl to be defined if the source TagDecl was defined. This doesn't make any
sense as in this code we already forced the ASTImporter to import the definition so this should always be
a no-op.

Turns out this is hiding two bugs:
1. The way we handle forward declarations in the debug info that might be completed later is that we
  import them and then mark them as having external lexical storage. This makes Clang ask for the definition
  later when it needs it (at which point we hopefully have the definition around and can complete it). However,
  this is currently not completing the forward decls with external storage but instead creates a duplicated decl
  in the target AST which is then defined. The forward decl is kept incomplete after the import and we just
  forcibly make it a definition of the record without any content with our workaround. The TestSharedLib* tests
  is only passing because of this.
2. Minimal import of lambdas is broken and never imports the definition it seems. That appears to be a bug
  in the ASTImporter which gives the definition of lambda's some special treatment. TestLambdas.py is actually
  broken but is passing because of this workaround.

This patch fixes the first bug by forcing the ASTImporter to import to the target forward declaration. We can't
delete the workaround as the second bug is still around but that will be a follow up review for the ASTImporter.
However it will get rid of all the duplicated RecordDecls that are in our expression AST that are strangely defined
but don't have any of the fields they are supposed to have.

Reviewers: shafik, labath

Reviewed By: shafik

Subscribers: aprantl, abidh, JDevlieghere, lldb-commits

Tags: #lldb

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

4 years ago[lldb] Complete return types of CXXMethodDecls to prevent crashing due to covariant...
Raphael Isemann [Wed, 29 Jan 2020 08:07:55 +0000 (09:07 +0100)]
[lldb] Complete return types of CXXMethodDecls to prevent crashing due to covariant return types

Summary:
Currently we crash in Clang's CodeGen when we call functions with covariant return types with this assert:
```
Assertion failed: (DD && "queried property of class with no definition"), function data, file clang/include/clang/AST/DeclCXX.h, line 433.
```
when calling `clang::CXXRecordDecl::isDerivedFrom` from the `ItaniumVTableBuilder`.

Clang seems to assume that the underlying record decls of covariant return types are already completed.
This is true during a normal Clang invocation as there the type checker will complete both decls when
checking if the overloaded function is valid (i.e., the return types are covariant).

When we minimally import our AST into the expression in LLDB we don't do this type checking (which
would complete the record decls) and we end up trying to access the invalid record decls from CodeGen
which makes us trigger the assert.

This patch just completes the underlying types of ptr/ref return types of virtual function so that the
underlying records are complete and we behave as Clang expects us to do.

Fixes rdar://38048657

Reviewers: lhames, shafik

Reviewed By: shafik

Subscribers: abidh, JDevlieghere, lldb-commits

Tags: #lldb

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

4 years ago[lldb] Use CompletionRequest in REPL::CompleteCode and remove translation code to...
Raphael Isemann [Mon, 27 Jan 2020 20:24:39 +0000 (21:24 +0100)]
[lldb] Use CompletionRequest in REPL::CompleteCode and remove translation code to old API

Any REPL client should just move to CompletionRequest instead of relying on
the translation code from the old API, so let's remove that translation code.

4 years ago[X86] matchAdd: don't fold a large offset into a %rip relative address
Fangrui Song [Wed, 29 Jan 2020 05:18:29 +0000 (21:18 -0800)]
[X86] matchAdd: don't fold a large offset into a %rip relative address

For `ret i64 add (i64 ptrtoint (i32* @foo to i64), i64 1701208431)`,

```
X86DAGToDAGISel::matchAdd
  ...
// AM.setBaseReg(CurDAG->getRegister(X86::RIP, MVT::i64));
  if (!matchAddressRecursively(N.getOperand(0), AM, Depth+1) &&
// Try folding offset but fail; there is a symbolic displacement, so offset cannot be too large
      !matchAddressRecursively(Handle.getValue().getOperand(1), AM, Depth+1))
    return false;
  ...
  // Try again after commuting the operands.
// AM.Disp = Val; foldOffsetIntoAddress() does not know there will be a symbolic displacement
  if (!matchAddressRecursively(Handle.getValue().getOperand(1), AM, Depth+1) &&
// AM.setBaseReg(CurDAG->getRegister(X86::RIP, MVT::i64));
      !matchAddressRecursively(Handle.getValue().getOperand(0), AM, Depth+1))
// Succeeded! Produced leaq sym+disp(%rip),...
    return false;
```

`foldOffsetIntoAddress()` currently does not know there is a symbolic
displacement and can fold a large offset.

The produced `leaq sym+disp(%rip), %rax` instruction is relocated by
an R_X86_64_PC32. If disp is large and sym+disp-rip>=2**31, there
will be a relocation overflow.

This approach is still not elegant. Unfortunately the isRIPRelative
interface is a bit clumsy. I tried several solutions and eventually
picked this one.

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

4 years ago[Attributor][Fix] Initialize unused but loaded variable
Johannes Doerfert [Wed, 29 Jan 2020 05:51:25 +0000 (23:51 -0600)]
[Attributor][Fix] Initialize unused but loaded variable

This hopefully un-breaks:
  http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/38333

4 years ago[Attributor] Reuse existing logic to avoid duplication
Johannes Doerfert [Tue, 28 Jan 2020 15:46:15 +0000 (09:46 -0600)]
[Attributor] Reuse existing logic to avoid duplication

There was a TODO in AAValueConstantRangeArgument to reuse
AAArgumentFromCallSiteArguments. We now do this by allowing new States
to be build from the bestState.

4 years ago[Attributor][FIX] Treat invalidated attributes as changed
Johannes Doerfert [Tue, 28 Jan 2020 15:38:07 +0000 (09:38 -0600)]
[Attributor][FIX] Treat invalidated attributes as changed

If we invalidate an attribute we need to inform all dependent ones even
if the fixpoint state is not invalid. Before we only continued
invalidation if the fixpoint state was invalid, now we signal a change
in case the fixpoint state is valid.

The test case was already included in D71620 but the problem was hiding
because it only manifested with the old PM (for that input).

4 years ago[Attributor] Modularize AANoAliasCallSiteArgument to simplify extensions
Johannes Doerfert [Tue, 28 Jan 2020 04:24:32 +0000 (22:24 -0600)]
[Attributor] Modularize AANoAliasCallSiteArgument to simplify extensions

This patch modularizes the way we check for no-alias call site arguments
by putting the existing logic into helper functions. The reasoning was
not changed but special cases for readonly/readnone were added.

4 years ago[Attributor] Mark a non-defined `null` pointer as `noalias`
Johannes Doerfert [Tue, 28 Jan 2020 04:19:11 +0000 (22:19 -0600)]
[Attributor] Mark a non-defined `null` pointer as `noalias`

If `null` is not defined we cannot access it, hence the pointer is
`noalias`. While this is not helpful on it's own it simplifies later
deductions that can skip over already known `noalias` pointers in
certain situations.

4 years ago[Attributor][NFC] Remove ugly and unneeded cast
Johannes Doerfert [Tue, 28 Jan 2020 17:49:59 +0000 (11:49 -0600)]
[Attributor][NFC] Remove ugly and unneeded cast

4 years ago[Attributor][NFC] Improve debug messages
Johannes Doerfert [Tue, 28 Jan 2020 17:49:35 +0000 (11:49 -0600)]
[Attributor][NFC] Improve debug messages

4 years ago[Attributor][NFC] Internalize helper function
Johannes Doerfert [Sun, 26 Jan 2020 08:49:58 +0000 (02:49 -0600)]
[Attributor][NFC] Internalize helper function

4 years agoFix polly build after StringRef change.
Eli Friedman [Wed, 29 Jan 2020 03:44:20 +0000 (19:44 -0800)]
Fix polly build after StringRef change.

4 years agoOne more bugpoitn fix for GCC5
Benjamin Kramer [Wed, 29 Jan 2020 02:42:02 +0000 (03:42 +0100)]
One more bugpoitn fix for GCC5

4 years agoTry harder to fix bugpoint with GCC5
Benjamin Kramer [Wed, 29 Jan 2020 02:30:05 +0000 (03:30 +0100)]
Try harder to fix bugpoint with GCC5

4 years ago[driver][Darwin] Add an -ibuiltininc flag that lets Darwin driver
Alex Lorenz [Mon, 27 Jan 2020 21:01:06 +0000 (13:01 -0800)]
[driver][Darwin] Add an -ibuiltininc flag that lets Darwin driver
include Clang builtin headers even with -nostdinc

Some projects use -nostdinc, but need to access some intrinsics files when building specific files.
The new -ibuiltininc flag lets them use this flag when compiling these files to ensure they can
find Clang's builtin headers.

The use of -nobuiltininc after the -ibuiltininc flag does not add the builtin header
search path to the list of header search paths.

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

4 years agoMake bugpoint work with gcc5 again.
Benjamin Kramer [Wed, 29 Jan 2020 02:11:00 +0000 (03:11 +0100)]
Make bugpoint work with gcc5 again.

4 years agoFix more implicit conversions. Getting closer to having clang working with gcc 5...
Benjamin Kramer [Wed, 29 Jan 2020 01:57:59 +0000 (02:57 +0100)]
Fix more implicit conversions. Getting closer to having clang working with gcc 5 again

4 years agoFix conversions in clang and examples
Benjamin Kramer [Wed, 29 Jan 2020 01:48:15 +0000 (02:48 +0100)]
Fix conversions in clang and examples

4 years agoGCC5 buildbot made it to clang. Fix implicit conversions it found.
Benjamin Kramer [Wed, 29 Jan 2020 01:19:22 +0000 (02:19 +0100)]
GCC5 buildbot made it to clang. Fix implicit conversions it found.

4 years ago[NFC] Fix unused variable warning.
Nate Voorhies [Wed, 29 Jan 2020 00:07:48 +0000 (16:07 -0800)]
[NFC] Fix unused variable warning.

Reviewers: dschuff

Reviewed By: dschuff

Subscribers: hiraditya, aheejin, llvm-commits

Tags: #llvm

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

4 years ago[CodeExtractor] Remove stale llvm.assume calls from extracted region
Vedant Kumar [Wed, 29 Jan 2020 01:03:39 +0000 (17:03 -0800)]
[CodeExtractor] Remove stale llvm.assume calls from extracted region

During extraction, stale llvm.assume handles may be retained in the
original function. The setup is:

1) CodeExtractor unregisters assumptions in the blocks that are to be
   extracted.

2) Extraction happens. There are now two functions: f1 and f1.extracted.

3) Leftover assumptions in f1 (/not/ removed as they were not in the set of
   blocks to be extracted) now have affected-value llvm.assume handles in
   f1.extracted.

When assumptions for a value used in f1 are looked up, ValueTracking can assert
as some of the handles are in the wrong function. To fix this, simply erase the
llvm.assume calls in the extracted function.

Alternatives include flushing the assumption cache in the original function, or
walking all values used in the original function to prune stale affected-value
handles. Both seem more expensive.

Testing: check-llvm, LNT run with -mllvm -hot-cold-split enabled

rdar://58460728

4 years agoAnother stab at making the gold plugin compile again
Benjamin Kramer [Wed, 29 Jan 2020 01:12:23 +0000 (02:12 +0100)]
Another stab at making the gold plugin compile again

4 years ago[lldb/API] Fix bogus copy assignment operator
Jonas Devlieghere [Wed, 29 Jan 2020 01:09:49 +0000 (17:09 -0800)]
[lldb/API] Fix bogus copy assignment operator

The copy assignment operator is supposed to return the class and not
void. Fix the methods and the reproducer instrumentation macros.

4 years agoAnother round of GCC5 fixes.
Benjamin Kramer [Wed, 29 Jan 2020 01:09:24 +0000 (02:09 +0100)]
Another round of GCC5 fixes.

4 years ago[clangd] Fix null check in FindTarget.
Sam McCall [Wed, 29 Jan 2020 01:01:42 +0000 (02:01 +0100)]
[clangd] Fix null check in FindTarget.

I've hit this stack trace a few times but don't have a good reproducer.
The code is unsafe by inspection, though.

4 years ago[WebAssembly] Preserve debug frame base information through register coloring
Derek Schuff [Tue, 28 Jan 2020 21:46:03 +0000 (13:46 -0800)]
[WebAssembly] Preserve debug frame base information through register coloring

2 fixes:

Register coloring can re-assign virtual registers. When the frame base register
is colored, update the DwarfFrameBase accordingly When the frame base register
is stackified, do not attempt to encode DW_AT_frame_base as a local In the
future we will presumably want to handle this case better but for now we can
emit worse debug info rather than crashing.

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

4 years agoFix one round of implicit conversions found by g++5.
Benjamin Kramer [Wed, 29 Jan 2020 00:49:54 +0000 (01:49 +0100)]
Fix one round of implicit conversions found by g++5.

4 years agoFix clangd-xpc-test-client build after 777180a32b6107
Nico Weber [Wed, 29 Jan 2020 00:48:31 +0000 (19:48 -0500)]
Fix clangd-xpc-test-client build after 777180a32b6107

4 years ago[lldb/API] Implement the copy (assignment) constructor for SBLaunchInfo
Jonas Devlieghere [Wed, 29 Jan 2020 00:44:30 +0000 (16:44 -0800)]
[lldb/API] Implement the copy (assignment) constructor for SBLaunchInfo

Currently the constructor is compiler generated which means it doesn't
get instrumented for the reproducers.

4 years agoFix xpc build after 777180a32b6107
Nico Weber [Wed, 29 Jan 2020 00:35:11 +0000 (19:35 -0500)]
Fix xpc build after 777180a32b6107

4 years ago[X86] Use SelectionDAG::getZExtOrTrunc to simplify some code. NFCI
Craig Topper [Wed, 29 Jan 2020 00:13:51 +0000 (16:13 -0800)]
[X86] Use SelectionDAG::getZExtOrTrunc to simplify some code. NFCI

4 years ago[X86] Add test case for llvm.flt.rounds
Craig Topper [Tue, 28 Jan 2020 23:37:22 +0000 (15:37 -0800)]
[X86] Add test case for llvm.flt.rounds

4 years ago[lldb/API] Implement the copy (assignment) constructor for SBPlatform
Jonas Devlieghere [Wed, 29 Jan 2020 00:13:15 +0000 (16:13 -0800)]
[lldb/API] Implement the copy (assignment) constructor for SBPlatform

Currently the constructor is compiler generated which means it doesn't
get instrumented for the reproducers.

4 years agoFix AVR build after 777180a32b6107
Nico Weber [Wed, 29 Jan 2020 00:22:22 +0000 (19:22 -0500)]
Fix AVR build after 777180a32b6107

4 years ago[lldb] Remove unused header from ValueObject.cpp
Alex Langford [Tue, 28 Jan 2020 22:44:32 +0000 (14:44 -0800)]
[lldb] Remove unused header from ValueObject.cpp

In commit 5eaf44f99f0a0a3bdfa892892b8aaca841c8dbe0 I removed the last
instance of TypeSystemClang from ValueObject, so the header is no longer
needed.

4 years agoAddress implicit conversions detected by g++ 5 only.
Benjamin Kramer [Wed, 29 Jan 2020 00:01:09 +0000 (01:01 +0100)]
Address implicit conversions detected by g++ 5 only.

4 years agoOne more batch of things found by g++ 6
Benjamin Kramer [Tue, 28 Jan 2020 23:49:35 +0000 (00:49 +0100)]
One more batch of things found by g++ 6

4 years ago[AliasAnalysis] Add missing FMRB_* enums.
Eli Friedman [Wed, 22 Jan 2020 00:51:17 +0000 (16:51 -0800)]
[AliasAnalysis] Add missing FMRB_* enums.

Previously, the enums didn't account for all the possible cases, which
could cause misleading results (particularly for a "switch" on
FunctionModRefBehavior).

Fixes regression in polly from recent patch to add writeonly to memset.

While I'm here, also fix a few dubious uses of the FMRB_* enum values.

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

4 years agoFix a couple more implicit conversions that Clang doesn't diagnose.
Benjamin Kramer [Tue, 28 Jan 2020 23:42:56 +0000 (00:42 +0100)]
Fix a couple more implicit conversions that Clang doesn't diagnose.

4 years agoA bunch more implicit string conversions that my Clang didn't detect.
Benjamin Kramer [Tue, 28 Jan 2020 23:29:48 +0000 (00:29 +0100)]
A bunch more implicit string conversions that my Clang didn't detect.

4 years ago[NFC] Removing experimental designation for ninja in docs.
Nate Voorhies [Tue, 28 Jan 2020 19:11:04 +0000 (11:11 -0800)]
[NFC] Removing experimental designation for ninja in docs.

Summary:
Ninja is no longer an experimental tool, documentation changed to
reflect this.

Reviewers: nikola

Reviewed By: nikola

Subscribers: cfe-commits

Tags: #clang

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

4 years agoFix another implicit conversion in the directory watcher
Jonas Devlieghere [Tue, 28 Jan 2020 23:28:13 +0000 (15:28 -0800)]
Fix another implicit conversion in the directory watcher

4 years ago[tblgen] Fix implicit conversion only diagnosed by g++ 6
Benjamin Kramer [Tue, 28 Jan 2020 23:25:44 +0000 (00:25 +0100)]
[tblgen] Fix implicit conversion only diagnosed by g++ 6

4 years ago[NFC] Fix comment typo
Francis Visoiu Mistrih [Tue, 28 Jan 2020 23:23:28 +0000 (15:23 -0800)]
[NFC] Fix comment typo

4 years agoFix more implicit conversions
Jonas Devlieghere [Tue, 28 Jan 2020 23:19:17 +0000 (15:19 -0800)]
Fix more implicit conversions

4 years ago[Driver] Fix implicit conversion guarded by #ifdef _WIN32
Benjamin Kramer [Tue, 28 Jan 2020 23:18:16 +0000 (00:18 +0100)]
[Driver] Fix implicit conversion guarded by #ifdef _WIN32

4 years agoFix implicit conversions in example code.
Benjamin Kramer [Tue, 28 Jan 2020 23:17:07 +0000 (00:17 +0100)]
Fix implicit conversions in example code.

4 years ago[lldb/Plugin] Fix implicit conversion in GDBRemote
Jonas Devlieghere [Tue, 28 Jan 2020 23:16:56 +0000 (15:16 -0800)]
[lldb/Plugin] Fix implicit conversion in GDBRemote

4 years ago[lldb/Reproducer] s/nullptr_t/std::nullptr_t/
Jonas Devlieghere [Tue, 28 Jan 2020 23:14:40 +0000 (15:14 -0800)]
[lldb/Reproducer] s/nullptr_t/std::nullptr_t/

Fixes error: unknown type name 'nullptr_t'; did you mean
'std::nullptr_t'.

4 years agoFix implicit conversion in the lldb Python plugin
Benjamin Kramer [Tue, 28 Jan 2020 23:06:33 +0000 (00:06 +0100)]
Fix implicit conversion in the lldb Python plugin

4 years ago[lldb/Reproducer] Include result in recording statements
Jonas Devlieghere [Tue, 28 Jan 2020 22:47:29 +0000 (14:47 -0800)]
[lldb/Reproducer] Include result in recording statements

Include the return value in the recording log statements. This helps
diagnose uninstrumented (copy assignment) constructors.

4 years ago[Support] Fix implicit std::string conversions on Win32.
Benjamin Kramer [Tue, 28 Jan 2020 23:02:26 +0000 (00:02 +0100)]
[Support] Fix implicit std::string conversions on Win32.

4 years ago[ADT] Make StringRef's std::string conversion operator explicit
Benjamin Kramer [Tue, 28 Jan 2020 22:30:02 +0000 (23:30 +0100)]
[ADT] Make StringRef's std::string conversion operator explicit

This has the same behavior as converting std::string_view to
std::string. This is an expensive conversion, so explicit conversions
are helpful for avoiding unneccessary string copies.

4 years ago[libcxx] Link against android_support when needed
Shoaib Meenai [Tue, 28 Jan 2020 01:29:41 +0000 (17:29 -0800)]
[libcxx] Link against android_support when needed

libc++ on Android needs to be linked against libandroid_support on API
levels less than 21 to provide needed functions that aren't in the libc
on those platforms (e.g. posix_memalign for libcxxabi). libc++ from the
NDK is a linker script that pulls in libandroid_support, but for
building libc++ itself, we need to explicitly add libandroid_support as
a dependency. Moreover, libc++ headers reference the functions provided
by libandroid_support, so it needs to be added as a public dependency.

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

4 years ago[asan] Fix test compilation on Android API <= 17
Shoaib Meenai [Tue, 28 Jan 2020 01:25:38 +0000 (17:25 -0800)]
[asan] Fix test compilation on Android API <= 17

mlockall and munlockall were introduced in Android API 17, so avoid
referencing them on prior versions.

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

4 years ago[runtimes] Fix passing lists to runtimes configures
Shoaib Meenai [Tue, 28 Jan 2020 01:04:21 +0000 (17:04 -0800)]
[runtimes] Fix passing lists to runtimes configures

We have to replace the ";" with "|" (since LLVMExternalProjectUtils uses
"|" as the `LIST_SEPARATOR` when invoking `ExternalProject_Add`) in
order for lists to be passed correctly to the runtimes CMake configures.
Remove the special case for `LLVM_ENABLE_RUNTIMES`, since it'll just get
handled by the general logic now.

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

4 years agoMake llvm::StringRef to std::string conversions explicit.
Benjamin Kramer [Tue, 28 Jan 2020 19:23:46 +0000 (20:23 +0100)]
Make llvm::StringRef to std::string conversions explicit.

This is how it should've been and brings it more in line with
std::string_view. There should be no functional change here.

This is mostly mechanical from a custom clang-tidy check, with a lot of
manual fixups. It uncovers a lot of minor inefficiencies.

This doesn't actually modify StringRef yet, I'll do that in a follow-up.

4 years ago[lldb] Delete ValueObject::GetBaseClassPath
Alex Langford [Tue, 28 Jan 2020 01:59:12 +0000 (17:59 -0800)]
[lldb] Delete ValueObject::GetBaseClassPath

Summary:
This method has exactly one call site, which is only actually executed
if `ValueObject::IsBaseClass` returns false. However, the first thing
that `ValueObject::GetBaseClassPath` does is check if `ValueObject::IsBaseClass`
is true. Because this can never be the case, this method always returns false
and is therefore effectively dead.

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

4 years ago[AArch64][SVE] Add SVE2 mla indexed intrinsics.
Danilo Carvalho Grael [Tue, 28 Jan 2020 21:09:51 +0000 (16:09 -0500)]
[AArch64][SVE] Add SVE2 mla indexed intrinsics.

Summary:
Add SVE2 mla indexed intrinsics:
- smlalb, smalalt, umlalb, umlalt, smlslb, smlslt, umlslb, umlslt.

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

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

Tags: #llvm

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

4 years ago[AArch64][GlobalISel] Fold G_AND into G_BRCOND
Jessica Paquette [Tue, 28 Jan 2020 19:35:44 +0000 (11:35 -0800)]
[AArch64][GlobalISel] Fold G_AND into G_BRCOND

When the G_BRCOND is fed by a eq or ne G_ICMP, it may be possible to fold a
G_AND into the branch by producing a tbnz/tbz instead.

This happens when

  1. We have a ne/eq G_ICMP feeding into the G_BRCOND
  2. The G_ICMP is a comparison against 0
  3. One of the operands of the G_AND is a power of 2 constant

This is very similar to the code in AArch64TargetLowering::LowerBR_CC.

Add opt-and-tbnz-tbz to test this.

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

4 years ago[CodeGen] Attach no-builtin attributes to function definitions with no Decl
Francis Visoiu Mistrih [Mon, 27 Jan 2020 18:40:14 +0000 (10:40 -0800)]
[CodeGen] Attach no-builtin attributes to function definitions with no Decl

When using -fno-builtin[-<name>], we don't attach the IR attributes to
function definitions with no Decl, like the ones created through
`CreateGlobalInitOrDestructFunction`.

This results in projects using -fno-builtin or -ffreestanding to start
seeing symbols like _memset_pattern16.

The fix changes the behavior to always add the attribute if LangOptions
requests it.

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

4 years ago[lldb] Remove ClangASTImporter from Target
Alex Langford [Thu, 23 Jan 2020 21:49:54 +0000 (13:49 -0800)]
[lldb] Remove ClangASTImporter from Target

Target is one of the classes responsible for vending ClangASTImporter.
Target doesn't need to know anything about ClangASTImporter, so if we
instead have ClangPersistentVariables vend it, we can preserve
existing behavior while improving layering and removing dependencies
from non-plugins to plugins.

4 years ago[llvm] Ensure InlineCost-related fields are initialized
Mircea Trofin [Tue, 28 Jan 2020 21:36:46 +0000 (13:36 -0800)]
[llvm] Ensure InlineCost-related fields are initialized

Summary: Small fix - never hurts to have things initialized.

Reviewers: davidxl, eraman

Reviewed By: davidxl

Subscribers: haicheng, llvm-commits

Tags: #llvm

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

4 years ago[GlobalMerge] Preserve symbol visibility when merging globals
Michael Spang [Tue, 28 Jan 2020 20:43:07 +0000 (12:43 -0800)]
[GlobalMerge] Preserve symbol visibility when merging globals

Symbols created for merged external global variables have default
visibility. This can break programs when compiling with -Oz
-fvisibility=hidden as symbols that should be hidden will be exported at
link time.

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

4 years agoRevert "[MS] Overhaul how clang passes overaligned args on x86_32"
Hans Wennborg [Tue, 28 Jan 2020 21:17:31 +0000 (22:17 +0100)]
Revert "[MS] Overhaul how clang passes overaligned args on x86_32"

It broke some Chromium tests, so let's revert until it can be fixed; see
https://crbug.com/1046362

This reverts commit 2af74e27ed7d0832cbdde9cb969aaca7a42e99f9.

4 years ago[lldb/Reproducer] Include deserialized value in log statement
Jonas Devlieghere [Tue, 28 Jan 2020 21:23:36 +0000 (13:23 -0800)]
[lldb/Reproducer] Include deserialized value in log statement

Extend the replay log statement to include the deserialized value.

4 years ago[lldb] [test] Restrict x86-64-write register test to x86-64
Michał Górny [Tue, 28 Jan 2020 21:14:33 +0000 (22:14 +0100)]
[lldb] [test] Restrict x86-64-write register test to x86-64

4 years ago[gn build] (manually) port 90a10f00ff8
Nico Weber [Tue, 28 Jan 2020 21:00:54 +0000 (16:00 -0500)]
[gn build] (manually) port 90a10f00ff8

4 years ago[mlir][Linalg][doc] Add Design Document for the Linalg Dialect
Nicolas Vasilache [Tue, 28 Jan 2020 20:47:18 +0000 (15:47 -0500)]
[mlir][Linalg][doc] Add Design Document for the Linalg Dialect

4 years ago[LoopUnrollAndJamPass] Clean unnecessary includes. [NFCI]
Alina Sbirlea [Tue, 28 Jan 2020 19:34:13 +0000 (11:34 -0800)]
[LoopUnrollAndJamPass] Clean unnecessary includes. [NFCI]

4 years ago[NFCI][LoopUnrollAndJam] Minor changes.
Whitney Tsang [Tue, 28 Jan 2020 20:21:48 +0000 (20:21 +0000)]
[NFCI][LoopUnrollAndJam] Minor changes.

Summary:
1. Add assertions.
2. Verify more analyses.
These changes are moved out of https://reviews.llvm.org/D73129 to
simplify that review.

Reviewer: dmgreen, jdoerfert, Meinersbur, kbarton, bmahjour, etiotto
Reviewed By: dmgreen
Subscribers: fhahn, hiraditya, zzheng, llvm-commits, prithayan, anhtuyen
Tag: LLVM
Differential Revision: https://reviews.llvm.org/D73204

4 years ago[Instrumentation] Set hidden visibility for the bias variable
Petr Hosek [Tue, 28 Jan 2020 07:28:03 +0000 (23:28 -0800)]
[Instrumentation] Set hidden visibility for the bias variable

We have to avoid using a GOT relocation to access the bias variable,
setting the hidden visibility achieves that.

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

4 years agoFix compiling with clang-cl inside a Visual Studio 2019 16.4 command prompt.
Alexandre Ganea [Tue, 28 Jan 2020 19:48:12 +0000 (14:48 -0500)]
Fix compiling with clang-cl inside a Visual Studio 2019 16.4 command prompt.

This was introduced by 0d17410e919124b3a9194b9bdbe2ce39dd779941 and was preventing from compiling with clang-cl on Windows.
The problem was that clang-cl detects the triple from the current env vars (was x86_64-pc-windows-msvc19.24.28315 for me, as I happen to always run inside a VS2019 cmd prompt).

4 years ago[InstCombine] refactor foldVectorCmp(); NFC
Sanjay Patel [Tue, 28 Jan 2020 19:39:42 +0000 (14:39 -0500)]
[InstCombine] refactor foldVectorCmp(); NFC

We can handle other patterns here as shown in PR44588.

4 years ago[CMake] Set ASM compiler for external projects
Petr Hosek [Tue, 28 Jan 2020 03:14:32 +0000 (19:14 -0800)]
[CMake] Set ASM compiler for external projects

This is necessary on Windows, otherwise CMake fails. It's not
conventional on Windows to use cl for assembly (you'd use ml or ml64
instead), but CMake has a separate ASM_MASM mode for that, and clang-cl
works fine for assembly so we'll use that on Windows for consistency.

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

4 years agoDon't fail step out if remote server doesn't implement qMemoryRegionInfo
Ted Woodward [Tue, 28 Jan 2020 19:31:40 +0000 (13:31 -0600)]
Don't fail step out if remote server doesn't implement qMemoryRegionInfo

Summary:
The return address validation in D71372 will fail if the memory permissions can't be determined. Many embedded stubs either don't implement the qMemoryRegionInfo packet, or don't have memory permissions at all.

Remove the return from the if clause that calls GetLoadAddressPermissions, so this call failing doesn't cause the step out to abort. Instead, assume that the memory permission check doesn't apply to this type of target.

Reviewers: labath, jingham, clayborg, mossberg

Reviewed By: labath

Subscribers: lldb-commits

Tags: #lldb

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

4 years ago[lsan] Support LeakSanitizer runtime on Fuchsia
Roland McGrath [Tue, 28 Jan 2020 19:34:53 +0000 (11:34 -0800)]
[lsan] Support LeakSanitizer runtime on Fuchsia

Support LeakSanitizer runtime on Fuchsia.

Patch By: mcgrathr

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

4 years ago[Fuchsia] Remove aarch64-fuchsia target-specific -mcmodel=kernel
Roland McGrath [Tue, 28 Jan 2020 19:32:08 +0000 (11:32 -0800)]
[Fuchsia] Remove aarch64-fuchsia target-specific -mcmodel=kernel

Under --target=aarch64-fuchsia, -mcmodel=kernel has the effect of
(the default) -mcmodel=small plus -mtp=el1 (which did not exist when
this behavior was added). Fuchsia's kernel now uses -mtp=el1
directly instead of -mcmodel=kernel, so remove this special support.

Patch By: mcgrathr

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

4 years ago[mlir] Add primitive transform pattern to rewrite linalg.fill into vector.broadcast...
Ahmed Taei [Sat, 25 Jan 2020 00:23:16 +0000 (16:23 -0800)]
[mlir] Add primitive transform pattern to rewrite linalg.fill into vector.broadcast form.

Summary:
This diff adds a transformation patter to rewrite linalg.fill as broadcasting a scaler into a vector.
It uses the same preconditioning as matmul (memory is contiguous).

Reviewers: nicolasvasilache

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

Tags: #llvm

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

4 years ago[mlir] Optimize OpResult use case for single result operations.
River Riddle [Tue, 28 Jan 2020 19:19:20 +0000 (11:19 -0800)]
[mlir] Optimize OpResult use case for single result operations.

Summary:
Operation represents all of the uses of each result with one use list, so manipulating the use list of a specific result requires filtering the main use list. This revision adds an optimization for the case of single result operations to avoid this filtering.

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

4 years agollvm-symbolizer test: Add a bit of extra detail on how to compile/reproduce this
David Blaikie [Tue, 28 Jan 2020 19:02:16 +0000 (11:02 -0800)]
llvm-symbolizer test: Add a bit of extra detail on how to compile/reproduce this

The details are also in the .test file, but doesn't hurt to make it a
bit clearer.

4 years ago[ELF][PPC32] Support --emit-relocs link of R_PPC_PLTREL24
Fangrui Song [Tue, 28 Jan 2020 08:01:20 +0000 (00:01 -0800)]
[ELF][PPC32] Support --emit-relocs link of R_PPC_PLTREL24

Similar to R_MIPS_GPREL16 and R_MIPS_GPREL32 (D45972).

If the addend of an R_PPC_PLTREL24 is >= 0x8000, it indicates that r30
is relative to the input section .got2.

```
addis 30, 30, .got2+0x8000-.L1$pb@ha
addi 30, 30, .got2+0x8000-.L1$pb@l
...
bl foo+0x8000@PLT
```

After linking, the relocation will be relative to the output section .got2.
To compensate for the shift `address(input section .got2) - address(output section .got2) = ppc32Got2OutSecOff`, adjust by `ppc32Got2OutSecOff`:

```
addis 30, 30, .got2+0x8000-.L1+ppc32Got2OutSecOff$pb@ha
addi 30, 30, .got2+0x8000-.L1+ppc32Got2OutSecOff$pb@ha$pb@l
...
bl foo+0x8000+ppc32Got2OutSecOff@PLT
```

This rule applys to a relocatable link or a non-relocatable link with --emit-relocs.

Reviewed By: Bdragon28

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