platform/upstream/llvm.git
6 years ago[sanitizer] Cleanup ReadFileToVector and ReadFileToBuffer
Vitaly Buka [Wed, 6 Jun 2018 20:53:43 +0000 (20:53 +0000)]
[sanitizer] Cleanup ReadFileToVector and ReadFileToBuffer

Summary:
Added unit-test.
Fixed behavior of max_len argument.
Call read syscall with all available buffer, not just a page.

Reviewers: eugenis

Subscribers: kubamracek, mgorny, llvm-commits

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

llvm-svn: 334130

6 years agoRemove an unrelated file accidentally submitted as part of r334095.
Rui Ueyama [Wed, 6 Jun 2018 20:46:08 +0000 (20:46 +0000)]
Remove an unrelated file accidentally submitted as part of r334095.

llvm-svn: 334129

6 years ago[HIP] Fix unbundling
Yaxun Liu [Wed, 6 Jun 2018 19:44:10 +0000 (19:44 +0000)]
[HIP] Fix unbundling

HIP uses clang-offload-bundler to bundle intermediate files for host
and different gpu archs together. When a file is unbundled,
clang-offload-bundler should be called only once, and the objects
for host and different gpu archs should be passed to the next
jobs. This is because Driver maintains CachedResults which maps
triple-arch string to output files for each job.

This patch fixes a bug in Driver::BuildJobsForActionNoCache which
uses incorrect key for CachedResults for HIP which causes
clang-offload-bundler being called mutiple times and incorrect
output files being used.

It only affects HIP.

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

llvm-svn: 334128

6 years ago[InstCombine] PR37603: low bit mask canonicalization
Roman Lebedev [Wed, 6 Jun 2018 19:38:27 +0000 (19:38 +0000)]
[InstCombine] PR37603: low bit mask canonicalization

Summary:
This is [[ https://bugs.llvm.org/show_bug.cgi?id=37603 | PR37603 ]].

https://godbolt.org/g/VCMNpS
https://rise4fun.com/Alive/idM

When doing bit manipulations, it is quite common to calculate some bit mask,
and apply it to some value via `and`.

The typical C code looks like:
```
int mask_signed_add(int nbits) {
    return (1 << nbits) - 1;
}
```
which is translated into (with `-O3`)
```
define dso_local i32 @mask_signed_add(int)(i32) local_unnamed_addr #0 {
  %2 = shl i32 1, %0
  %3 = add nsw i32 %2, -1
  ret i32 %3
}
```

But there is a second, less readable variant:
```
int mask_signed_xor(int nbits) {
    return ~(-(1 << nbits));
}
```
which is translated into (with `-O3`)
```
define dso_local i32 @mask_signed_xor(int)(i32) local_unnamed_addr #0 {
  %2 = shl i32 -1, %0
  %3 = xor i32 %2, -1
  ret i32 %3
}
```

Since we created such a mask, it is quite likely that we will use it in `and` next.
And then we may get rid of `not` op by folding into `andn`.

But now that i have actually looked:
https://godbolt.org/g/VTUDmU
_some_ backend changes will be needed too.
We clearly loose `bzhi` recognition.

Reviewers: spatel, craig.topper, RKSimon

Reviewed By: spatel

Subscribers: llvm-commits

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

llvm-svn: 334127

6 years ago[InstCombine][NFC] PR37603: low bit mask canonicalization tests
Roman Lebedev [Wed, 6 Jun 2018 19:38:21 +0000 (19:38 +0000)]
[InstCombine][NFC] PR37603: low bit mask canonicalization tests

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

llvm-svn: 334126

6 years ago[X86] Emit BZHI when mask is ~(-1 << nbits))
Roman Lebedev [Wed, 6 Jun 2018 19:38:16 +0000 (19:38 +0000)]
[X86] Emit BZHI when mask is ~(-1 << nbits))

Summary:
In D47428, i propose to choose the `~(-(1 << nbits))` as the canonical form of low-bit-mask formation.
As it is seen from these tests, there is a reason for that.

AArch64 currently better handles `~(-(1 << nbits))`, but not the more traditional `(1 << nbits) - 1` (sic!).
The other way around for X86.
It would be much better to canonicalize.

This patch is completely monkey-typing.
I don't really understand how this works :)
I have based it on `// x & (-1 >> (32 - y))` pattern.

Also, when we only have `BMI`, i wonder if we could use `BEXTR` with `start=0` ?

Related links:
https://bugs.llvm.org/show_bug.cgi?id=36419
https://bugs.llvm.org/show_bug.cgi?id=37603
https://bugs.llvm.org/show_bug.cgi?id=37610
https://rise4fun.com/Alive/idM

Reviewers: craig.topper, spatel, RKSimon, javed.absar

Reviewed By: craig.topper

Subscribers: kristof.beyls, llvm-commits

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

llvm-svn: 334125

6 years ago[NFC][X86][AArch64] Reorganize/cleanup BZHI test patterns
Roman Lebedev [Wed, 6 Jun 2018 19:38:10 +0000 (19:38 +0000)]
[NFC][X86][AArch64] Reorganize/cleanup BZHI test patterns

Summary:
In D47428, i propose to choose the `~(-(1 << nbits))` as the canonical form of low-bit-mask formation.
As it is seen from these tests, there is a reason for that.

AArch64 currently better handles `~(-(1 << nbits))`, but not the more traditional `(1 << nbits) - 1` (sic!).
The other way around for X86.
It would be much better to canonicalize.

It would seem that there is too much tests, but this is most of all the auto-generated possible variants
of C code that one would expect for BZHI to be formed, and then manually cleaned up a bit.
So this should be pretty representable, which somewhat good coverage...

Related links:
https://bugs.llvm.org/show_bug.cgi?id=36419
https://bugs.llvm.org/show_bug.cgi?id=37603
https://bugs.llvm.org/show_bug.cgi?id=37610
https://rise4fun.com/Alive/idM

Reviewers: javed.absar, craig.topper, RKSimon, spatel

Reviewed By: RKSimon

Subscribers: kristof.beyls, llvm-commits, RKSimon, craig.topper, spatel

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

llvm-svn: 334124

6 years ago[Hexagon] Implement vector-pair zero as V6_vsubw_dv
Krzysztof Parzyszek [Wed, 6 Jun 2018 19:34:40 +0000 (19:34 +0000)]
[Hexagon] Implement vector-pair zero as V6_vsubw_dv

llvm-svn: 334123

6 years agoFix MSVC 'not all control paths return a value' warning. NFCI.
Simon Pilgrim [Wed, 6 Jun 2018 19:31:39 +0000 (19:31 +0000)]
Fix MSVC 'not all control paths return a value' warning. NFCI.

llvm-svn: 334122

6 years ago[X86] Properly disassemble gather/scatter instructions where xmm4/ymm4/zmm4 are used...
Craig Topper [Wed, 6 Jun 2018 19:15:15 +0000 (19:15 +0000)]
[X86] Properly disassemble gather/scatter instructions where xmm4/ymm4/zmm4 are used as the index.

These encodings correspond to the cases in the normal encoding scheme where there is no index and our modrm reading code initially decodes it as such. The VSIB handling code tried to compensate for this, but failed to add the base needed to make later code do the right thing.

Fixes PR37712.

llvm-svn: 334121

6 years ago[X86] Rename vy512mem->vy512xmem and vz256xmem->vz256mem.
Craig Topper [Wed, 6 Jun 2018 19:15:12 +0000 (19:15 +0000)]
[X86] Rename vy512mem->vy512xmem and vz256xmem->vz256mem.

The index size is represented by the letter after the 'v'. The number represents the memory size. If an 'x' appears after the number its means the index register can be from VR128X/VR256X instead of VR128/VR256.

As vy512mem uses a VR256X index it should have an x.
And vz256mem uses a VR512 index so it shouldn't have an x.

I admit these names kind of suck and are confusing.

llvm-svn: 334120

6 years ago[X86][BtVer2] Add support for all vector instructions that should match the dependenc...
Simon Pilgrim [Wed, 6 Jun 2018 19:06:09 +0000 (19:06 +0000)]
[X86][BtVer2] Add support for all vector instructions that should match the dependency-breaking 'zero-idiom'

As detailed on Agner's Microarchitecture doc (21.8 AMD Bobcat and Jaguar pipeline - Dependency-breaking instructions), all these instructions are dependency breaking and zero the destination register.

llvm-svn: 334119

6 years ago[Debugify] Move debug value intrinsics closer to their operand defs
Vedant Kumar [Wed, 6 Jun 2018 19:05:42 +0000 (19:05 +0000)]
[Debugify] Move debug value intrinsics closer to their operand defs

Before this patch, debugify would insert debug value intrinsics before the
terminating instruction in a block. This had the advantage of being simple,
but was a bit too simple/unrealistic.

This patch teaches debugify to insert debug values immediately after their
operand defs. This enables better testing of the compiler.

For example, with this patch, `opt -debugify-each` is able to identify a
vectorizer DI-invariance bug fixed in llvm.org/PR32761. In this bug, the
vectorizer produced different output with/without debug info present.

Reverting Davide's bugfix locally, I see:

$ ~/scripts/opt-check-dbg-invar.sh ./bin/opt \
  .../SLPVectorizer/AArch64/spillcost-di.ll -slp-vectorizer
Comparing: -slp-vectorizer .../SLPVectorizer/AArch64/spillcost-di.ll
  Baseline: /var/folders/j8/t4w0bp8j6x1g6fpghkcb4sjm0000gp/T/tmp.iYYeL1kf
  With DI : /var/folders/j8/t4w0bp8j6x1g6fpghkcb4sjm0000gp/T/tmp.sQtQSeet
9,11c9,11
<   %5 = getelementptr inbounds %0, %0* %2, i64 %0, i32 1
<   %6 = bitcast i64* %4 to <2 x i64>*
<   %7 = load <2 x i64>, <2 x i64>* %6, align 8, !tbaa !0
---
>   %5 = load i64, i64* %4, align 8, !tbaa !0
>   %6 = getelementptr inbounds %0, %0* %2, i64 %0, i32 1
>   %7 = load i64, i64* %6, align 8, !tbaa !5
12a13
>   store i64 %5, i64* %8, align 8, !tbaa !0
14,15c15
<   %10 = bitcast i64* %8 to <2 x i64>*
<   store <2 x i64> %7, <2 x i64>* %10, align 8, !tbaa !0
---
>   store i64 %7, i64* %9, align 8, !tbaa !5
:: Found a test case ^

Running this over the *.ll files in tree, I found four additional examples
which compile differently with/without DI present. I plan on filing bugs for
these.

llvm-svn: 334118

6 years ago[Debugify] Add a quiet mode to suppress warnings
Vedant Kumar [Wed, 6 Jun 2018 19:05:41 +0000 (19:05 +0000)]
[Debugify] Add a quiet mode to suppress warnings

Suppressing warning output and module dumps significantly speeds up
fuzzing with `opt -debugify-each`.

llvm-svn: 334117

6 years ago[PATCH 2/2] [test] Add support for Samsung Exynos M4 (NFC)
Evandro Menezes [Wed, 6 Jun 2018 18:58:01 +0000 (18:58 +0000)]
[PATCH 2/2] [test] Add support for Samsung Exynos M4 (NFC)

Add test cases for Exynos M4.

llvm-svn: 334116

6 years ago[AArch64, ARM] Add support for Samsung Exynos M4
Evandro Menezes [Wed, 6 Jun 2018 18:56:00 +0000 (18:56 +0000)]
[AArch64, ARM] Add support for Samsung Exynos M4

Create a separate feature set for Exynos M4 and add test cases.

llvm-svn: 334115

6 years agoFix the test case that places intermediate in source directory.
Han Shen [Wed, 6 Jun 2018 18:53:17 +0000 (18:53 +0000)]
Fix the test case that places intermediate in source directory.

This causes "permission denied" error in some controlled test environment where source tree is read-only.

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

llvm-svn: 334114

6 years agoguard fsqrt with fmf sub flags
Michael Berg [Wed, 6 Jun 2018 18:47:55 +0000 (18:47 +0000)]
guard fsqrt with fmf sub flags

Summary:
This change uses fmf subflags to guard optimizations as well as unsafe. These changes originated from D46483.
It contains only context for fsqrt.

Reviewers: spatel, hfinkel, arsenm

Reviewed By: spatel

Subscribers: hfinkel, wdng, andrew.w.kaylor, wristow, efriedma, nemanjai

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

llvm-svn: 334113

6 years ago[MS][ARM64]: Promote _setjmp to_setjmpex as there is no _setjmp in the ARM64 libvcrun...
Reid Kleckner [Wed, 6 Jun 2018 18:39:47 +0000 (18:39 +0000)]
[MS][ARM64]: Promote _setjmp to_setjmpex as there is no _setjmp in the ARM64 libvcruntime.lib

Factor out the common setjmp call emission code.

Based on a patch by Chris January

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

llvm-svn: 334112

6 years ago[ThinLTO] Make ValueInfo operator!= consistent with operator== (NFC)
Teresa Johnson [Wed, 6 Jun 2018 18:32:16 +0000 (18:32 +0000)]
[ThinLTO] Make ValueInfo operator!= consistent with operator== (NFC)

Compare Ref pointers instead of GUID, to handle comparison with special
empty/tombstone ValueInfo. This was already done for operator==, to
support inserting ValueInfo into DenseMap, but I need the operator!=
side change for upcoming AsmParser summary parsing support.

llvm-svn: 334111

6 years ago[llvm-mca][x86] Fix all resources-x86_64.s tests to use different registers in reg...
Simon Pilgrim [Wed, 6 Jun 2018 18:20:25 +0000 (18:20 +0000)]
[llvm-mca][x86] Fix all resources-x86_64.s tests to use different registers in reg-reg cases

I noticed while working on zero-idiom + dependency-breaking support (PR36671) that most of our binary instruction tests were reusing the same src registers, which would cause the tests to fail once we enable scalar zero-idiom support on btver2. Fixed in all targets to keep them in sync.

llvm-svn: 334110

6 years ago[Hexagon] Split CTPOP of vector pairs
Krzysztof Parzyszek [Wed, 6 Jun 2018 18:03:29 +0000 (18:03 +0000)]
[Hexagon] Split CTPOP of vector pairs

llvm-svn: 334109

6 years ago[CUDA] Replace 'nv_weak' attributes in CUDA headers with 'weak'.
Artem Belevich [Wed, 6 Jun 2018 17:52:55 +0000 (17:52 +0000)]
[CUDA] Replace 'nv_weak' attributes in CUDA headers with 'weak'.

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

llvm-svn: 334108

6 years ago[ConstProp] move tests for fp <--> int; NFC
Sanjay Patel [Wed, 6 Jun 2018 16:53:56 +0000 (16:53 +0000)]
[ConstProp] move tests for fp <--> int; NFC

These were added for D5603 / rL219542, and there's a proposal to
change one side in D47807.

These are tests of constant propagation, so they shouldn't have
ever been tested/housed under InstCombine.

llvm-svn: 334107

6 years agoPR37680: fix faulty assertion condition.
Richard Smith [Wed, 6 Jun 2018 16:36:56 +0000 (16:36 +0000)]
PR37680: fix faulty assertion condition.

When looking up a template name, we can find an overload set containing a
function template and an unresolved non-type using declaration.

llvm-svn: 334106

6 years agoChange TII isCopyInstr way of returning arguments(NFC)
Petar Jovanovic [Wed, 6 Jun 2018 16:36:30 +0000 (16:36 +0000)]
Change TII isCopyInstr way of returning arguments(NFC)

Make TII isCopyInstr() return MachineOperands through pointer to pointer
instead via reference.

Patch by Nikola Prica.

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

llvm-svn: 334105

6 years ago[X86][BtVer2] Add tests for all vector instructions that should match the dependency...
Simon Pilgrim [Wed, 6 Jun 2018 16:14:37 +0000 (16:14 +0000)]
[X86][BtVer2] Add tests for all vector instructions that should match the dependency-breaking 'zero-idiom'

As detailed on Agner's Microarchitecture doc (21.8 AMD Bobcat and Jaguar pipeline - Dependency-breaking instructions), all these instructions are dependency breaking and zero the destination register.

TODO: Scalar instructions still need to be tested (need to check EFLAGS handling).
llvm-svn: 334104

6 years ago[clang-doc] Implement a YAML generator
Julie Hockett [Wed, 6 Jun 2018 16:13:17 +0000 (16:13 +0000)]
[clang-doc] Implement a YAML generator

Implmenting a YAML generator from the emitted bitcode summary of
declarations. Emits one YAML file for each declaration information.

For a more detailed overview of the tool, see the design document on the mailing list: http://lists.llvm.org/pipermail/cfe-dev/2017-December/056203.html

llvm-svn: 334103

6 years ago[asan] Fix Myraid RTEMS port broken by r333985
Walter Lee [Wed, 6 Jun 2018 15:39:47 +0000 (15:39 +0000)]
[asan] Fix Myraid RTEMS port broken by r333985

Add nop CheckASLR() function.

llvm-svn: 334102

6 years ago[clang-tidy] Store checks profiling info as JSON files
Roman Lebedev [Wed, 6 Jun 2018 15:07:51 +0000 (15:07 +0000)]
[clang-tidy] Store checks profiling info as JSON files

Summary:
Continuation of D46504.

Example output:
```
  $ clang-tidy -enable-check-profile -store-check-profile=. -checks=-*,readability-function-size source.cpp
  $ # Note that there won't be timings table printed to the console.
  $ cat *.json
  {
  "file": "/path/to/source.cpp",
  "timestamp": "2018-05-16 16:13:18.717446360",
  "profile": {
    "time.clang-tidy.readability-function-size.wall": 1.0421266555786133e+00,
    "time.clang-tidy.readability-function-size.user": 9.2088400000005421e-01,
    "time.clang-tidy.readability-function-size.sys": 1.2418899999999974e-01
  }
  }
```

There are two arguments that control profile storage:

* `-store-check-profile=<prefix>`

  By default reports are printed in tabulated format to stderr. When this option
  is passed, these per-TU profiles are instead stored as JSON.
  If the prefix is not an absolute path, it is considered to be relative to the
  directory from where you have run :program:`clang-tidy`. All `.` and `..`
  patterns in the path are collapsed, and symlinks are resolved.

  Example:
  Let's suppose you have a source file named `example.cpp`, located in
  `/source` directory.

  * If you specify `-store-check-profile=/tmp`, then the profile will be saved
    to `/tmp/<timestamp>-example.cpp.json`

  * If you run :program:`clang-tidy` from within `/foo` directory, and specify
    `-store-check-profile=.`, then the profile will still be saved to
    `/foo/<timestamp>-example.cpp.json`

Reviewers: alexfh, sbenza, george.karpenkov, NoQ, aaron.ballman

Reviewed By: alexfh, george.karpenkov, aaron.ballman

Subscribers: Quuxplusone, JonasToth, aaron.ballman, llvm-commits, rja, Eugene.Zelenko, xazax.hun, mgrang, cfe-commits

Tags: #clang-tools-extra

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

llvm-svn: 334101

6 years agoRelax shtest-run-at-line.py
Hans Wennborg [Wed, 6 Jun 2018 14:53:03 +0000 (14:53 +0000)]
Relax shtest-run-at-line.py

The test was failing on Windows machines which had bash.exe on PATH (but
not in the so called lit tools dir, containing cmp.exe, grep.exe etc.).

The problem was that the outer lit invocation would load LLVMConfig
from utils/lit/lit/llvm/config.py, which looks up the tools path with
getToolsPath(). That has a surprising side effect of also setting
bashPath, in our case setting it to empty.

The outer lit invocation would thus configure the pdbg0 and pdbg1
substitutions based on not running with bash.

But the inner lit invocation would not load LLVMConfig, so bash
would be found on PATH, that would be used as external shell,
and so the output wouldn't match pdbg0 and pdbg1.

It seems weird to me that getBashPath() will return different results
depending on whether getToolsPath() has been called before, but I
also don't know how to fix it properly.

This commit just relaxes the test case, because there doesn't seem
to be much point in testing for the exact syntax of the run file
as long as it works.

(See https://crbug.com/850023)

llvm-svn: 334100

6 years ago[GlobalMerge] Set the alignment on merged global structs
David Green [Wed, 6 Jun 2018 14:48:32 +0000 (14:48 +0000)]
[GlobalMerge] Set the alignment on merged global structs

If no alignment is set, the abi/preferred alignment of structs will be
used which may be higher than required. This can lead to extra padding
and in the end an increase in data size.

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

llvm-svn: 334099

6 years agoAvoid UnicodeEncodeError on non-ascii reviewer names
Kristof Beyls [Wed, 6 Jun 2018 14:19:58 +0000 (14:19 +0000)]
Avoid UnicodeEncodeError on non-ascii reviewer names

... by using unicode instead of byte strings where non-ascii strings can be
formatted in.

llvm-svn: 334098

6 years ago[Driver] Add flag "--dependent-lib=..." when enabling asan or ubsan on PS4.
Pierre Gousseau [Wed, 6 Jun 2018 14:04:15 +0000 (14:04 +0000)]
[Driver] Add flag "--dependent-lib=..." when enabling asan or ubsan on PS4.

NFC for targets other than PS4.

Simplify users' workflow when enabling asan or ubsan and calling the linker separately.

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

llvm-svn: 334096

6 years ago[lld] Add REQUIRES: x86 where needed to tests
Joel Jones [Wed, 6 Jun 2018 13:56:51 +0000 (13:56 +0000)]
[lld] Add REQUIRES: x86 where needed to tests

If building lld without x86 support, tests that require that support should
be treated as unsupported, not errors.

Tested using:
  1. cmake '-DLLVM_TARGETS_TO_BUILD=AArch64;X86'
     make check-lld
     =>
     Expected Passes    : 1406
     Unsupported Tests  : 287

  2. cmake '-DLLVM_TARGETS_TO_BUILD=AArch64'
     make check-lld
     =>
     Expected Passes    : 410
     Unsupported Tests  : 1283

Patch by Joel Jones

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

llvm-svn: 334095

6 years ago[mips] Add testcase for i64, i128 addition for the DSP ASE
Simon Dardis [Wed, 6 Jun 2018 13:30:39 +0000 (13:30 +0000)]
[mips] Add testcase for i64, i128 addition for the DSP ASE

llvm-svn: 334094

6 years agoAdd semicolon to recent MSVC fix.
Tim Northover [Wed, 6 Jun 2018 13:28:49 +0000 (13:28 +0000)]
Add semicolon to recent MSVC fix.

llvm-svn: 334093

6 years agogetDependences to new C++ interface
Tobias Grosser [Wed, 6 Jun 2018 13:10:32 +0000 (13:10 +0000)]
getDependences to new C++ interface

Reviewers: Meinersbur, grosser, bollu, cs15btech11044, jdoerfert

Reviewed By: grosser

Subscribers: pollydev, llvm-commits

Tags: #polly

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

llvm-svn: 334092

6 years agoFix MSVC 'implicit double to float truncation and 'not all control paths return a...
Simon Pilgrim [Wed, 6 Jun 2018 12:48:27 +0000 (12:48 +0000)]
Fix MSVC 'implicit double to float truncation and 'not all control paths return a value' warnings. NFCI.

llvm-svn: 334091

6 years agoInstCombine: ignore debug instructions during fence combine
Tim Northover [Wed, 6 Jun 2018 12:46:02 +0000 (12:46 +0000)]
InstCombine: ignore debug instructions during fence combine

We should never get different CodeGen based on whether the code is being
compiled in debug mode so we must skip over @llvm.dbg.value (and similar)
calls.

Should fix at least the worst part of PR37690.

llvm-svn: 334090

6 years ago[clangd] Boost fuzzy match score by 2x (so a maximum of 2) when the query is the...
Sam McCall [Wed, 6 Jun 2018 12:38:37 +0000 (12:38 +0000)]
[clangd] Boost fuzzy match score by 2x (so a maximum of 2) when the query is the full identifier name.

Summary: Fix a couple of bugs in tests an in Quality to keep tests passing.

Reviewers: ioeric

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

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

llvm-svn: 334089

6 years ago[DWARF] Add (empty) DebugNamesDWARFIndex class and a setting to control its use
Pavel Labath [Wed, 6 Jun 2018 11:35:23 +0000 (11:35 +0000)]
[DWARF] Add (empty) DebugNamesDWARFIndex class and a setting to control its use

Summary:
This patch adds the skeleton for implementing the DWARF v5 name index
class. All of the methods are stubbed out and will be implemented in
subsequent patches. The interesting part of the patch is the addition of
a "ignore-file-indexes" setting to the dwarf plugin which enables a
user to force using manual indexing path in lldb (for example as a
debugging aid). I have also added a test that verifies that file indexes
are used by default.

Reviewers: JDevlieghere, clayborg, jingham

Subscribers: mgorny, mehdi_amini, aprantl, lldb-commits

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

llvm-svn: 334088

6 years agoUpdate the project name in README.txt
Greg Bedwell [Wed, 6 Jun 2018 11:15:54 +0000 (11:15 +0000)]
Update the project name in README.txt

Per llvm.org: "The name "LLVM" itself is not an acronym; it is the full
name of the project."

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

llvm-svn: 334087

6 years agoFix MSVC '*/' found outside of comment warning. NFCI.
Simon Pilgrim [Wed, 6 Jun 2018 11:10:11 +0000 (11:10 +0000)]
Fix MSVC '*/' found outside of comment warning. NFCI.

llvm-svn: 334086

6 years agoFix compilation of WebAssembly and RISCV after r334078
Ilya Biryukov [Wed, 6 Jun 2018 10:57:50 +0000 (10:57 +0000)]
Fix compilation of WebAssembly and RISCV after r334078

llvm-svn: 334085

6 years ago[mips] Partially revert r334031
Simon Dardis [Wed, 6 Jun 2018 10:54:30 +0000 (10:54 +0000)]
[mips] Partially revert r334031

The test changes in r334031 give unstable pass/fail results on the
llvm-clang-x86_64-expensive-checks-win buildbot. Revert the test changes to
turn the bot green.

llvm-svn: 334084

6 years ago[X86][BMI][TBM] Only demand bottom 16-bits of the BEXTR control op (PR34042)
Simon Pilgrim [Wed, 6 Jun 2018 10:52:10 +0000 (10:52 +0000)]
[X86][BMI][TBM] Only demand bottom 16-bits of the BEXTR control op (PR34042)

Only the bottom 16-bits of BEXTR's control op are required (0:8 INDEX, 15:8 LENGTH).

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

llvm-svn: 334083

6 years ago[cmake] fix a typo in llvm_config macro
Pavel Labath [Wed, 6 Jun 2018 10:07:08 +0000 (10:07 +0000)]
[cmake] fix a typo in llvm_config macro

Summary:
The macro parses out the USE_SHARED option out of the argument list, but
then ignores it and accesses the variable with the same name instead. It
seems the intention here was to check the argument value.

Technically, this is NFC, because the only in-tree usage
(add_llvm_executable) of USE_SHARED sets both the variable and the
argument when calling llvm_config, but it makes the usage of this macro
for out-of-tree users more sensible.

Reviewers: mgorny, beanz

Reviewed By: mgorny

Subscribers: foutrelis, llvm-commits

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

llvm-svn: 334082

6 years ago[lit] Do not run Python tests w/ LLDB_DISABLE_PYTHON
Michal Gorny [Wed, 6 Jun 2018 09:44:14 +0000 (09:44 +0000)]
[lit] Do not run Python tests w/ LLDB_DISABLE_PYTHON

Skip all Python-based tests as unsupported when LLDB_DISABLE_PYTHON is
enabled.  Otherwise, those tests simply fail being unable to import lldb
module.

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

llvm-svn: 334080

6 years ago[llvm-exegesis] move Mode from Key to BenchmarResult.
Clement Courbet [Wed, 6 Jun 2018 09:42:36 +0000 (09:42 +0000)]
[llvm-exegesis] move Mode from Key to BenchmarResult.

Moves the Mode field out of the Key. The existing yaml benchmark results can be fixed with the following script:

```
readonly FILE=$1
readonly MODE=latency # Change to uops to fix a uops benchmark.
cat $FILE | \
  sed "/^\ \+mode:\ \+$MODE$/d" | \
  sed "/^cpu_name.*$/i mode:            $MODE"
```

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

Authored by: Guillaume Chatelet

llvm-svn: 334079

6 years ago[MC] Pass MCSubtargetInfo to fixupNeedsRelaxation and applyFixup
Peter Smith [Wed, 6 Jun 2018 09:40:06 +0000 (09:40 +0000)]
[MC] Pass MCSubtargetInfo to fixupNeedsRelaxation and applyFixup

On targets like Arm some relaxations may only be performed when certain
architectural features are available. As functions can be compiled with
differing levels of architectural support we must make a judgement on
whether we can relax based on the MCSubtargetInfo for the function. This
change passes through the MCSubtargetInfo for the function to
fixupNeedsRelaxation so that the decision on whether to relax can be made
per function. In this patch, only the ARM backend makes use of this
information. We must also pass the MCSubtargetInfo to applyFixup because
some fixups skip error checking on the assumption that relaxation has
occurred, to prevent code-generation errors applyFixup must see the same
MCSubtargetInfo as fixupNeedsRelaxation.

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

llvm-svn: 334078

6 years agoFix compile error with libstdc++.
Ilya Biryukov [Wed, 6 Jun 2018 09:22:19 +0000 (09:22 +0000)]
Fix compile error with libstdc++.

By adding a ctor to create fuzzer_allocator<T> from fuzzer_allocator<U>.
This mimics construcotrs of std::allocator<T>.

Without the constructors, some versions of libstdc++ can't compile
`vector<bool, fuzzer_allocator<bool>>`.

llvm-svn: 334077

6 years agoRevert "PDB support of function-level linking and splitted functions"
Pavel Labath [Wed, 6 Jun 2018 09:16:00 +0000 (09:16 +0000)]
Revert "PDB support of function-level linking and splitted functions"

This reverts commit r334030 because it adds a broken test.

llvm-svn: 334076

6 years agoAdded documentation for Masked Vector Expanding Load and Compressing Store Intrinsics
Elena Demikhovsky [Wed, 6 Jun 2018 09:11:46 +0000 (09:11 +0000)]
Added documentation for Masked Vector Expanding Load and Compressing Store Intrinsics

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

llvm-svn: 334075

6 years agoAdjust symbol score based on crude symbol type.
Sam McCall [Wed, 6 Jun 2018 08:53:36 +0000 (08:53 +0000)]
Adjust symbol score based on crude symbol type.

Summary: Numbers are guesses to be adjusted later.

Reviewers: ioeric

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

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

llvm-svn: 334074

6 years agoChange test to output 'pcm' to the temp dir, not the source dir
Ilya Biryukov [Wed, 6 Jun 2018 08:50:12 +0000 (08:50 +0000)]
Change test to output 'pcm' to the temp dir, not the source dir

llvm-svn: 334073

6 years agoFix build - use llvm::make_unique
Ivan Donchevskii [Wed, 6 Jun 2018 08:25:54 +0000 (08:25 +0000)]
Fix build - use llvm::make_unique

llvm-svn: 334072

6 years ago[MIPS GlobalISel] Add lowerCall
Petar Jovanovic [Wed, 6 Jun 2018 07:24:52 +0000 (07:24 +0000)]
[MIPS GlobalISel] Add lowerCall

Add minimal support to lower function calls.
Support only functions with arguments/return that go through registers
and have type i32.

Patch by Petar Avramovic.

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

llvm-svn: 334071

6 years ago[Frontend] Honor UserFilesAreVolatile flag getting file buffer in ASTUnit
Ivan Donchevskii [Wed, 6 Jun 2018 07:17:26 +0000 (07:17 +0000)]
[Frontend] Honor UserFilesAreVolatile flag getting file buffer in ASTUnit

Do not memory map the main file if the flag UserFilesAreVolatile is set to true
in ASTUnit when calling FileSystem::getBufferForFile.

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

llvm-svn: 334070

6 years agoRemove unused code from __functional_base. NFC.
Eric Fiselier [Wed, 6 Jun 2018 06:42:27 +0000 (06:42 +0000)]
Remove unused code from __functional_base. NFC.

Patch from Arthur O'Dwyer.

`__user_alloc_construct_impl` is used by <experimental/memory_resource>, but
this `__user_alloc_construct` is never used.

Also, `<experimental/memory_resource>` doesn't need a full definition of
`std::tuple`; just the forward declaration in `<__tuple>` will suffice.

Reviewed as https://reviews.llvm.org/D46806

llvm-svn: 334069

6 years ago[Support] Use zx_cache_flush on Fuchsia to flush instruction cache
Petr Hosek [Wed, 6 Jun 2018 06:26:18 +0000 (06:26 +0000)]
[Support] Use zx_cache_flush on Fuchsia to flush instruction cache

Fuchsia doesn't use __clear_cache, instead it provide zx_cache_flush
system call. Use it to flush instruction cache.

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

llvm-svn: 334068

6 years ago[Analyzer][Z3] Test fixes for Z3 constraint manager
Vlad Tsyrklevich [Wed, 6 Jun 2018 06:25:51 +0000 (06:25 +0000)]
[Analyzer][Z3] Test fixes for Z3 constraint manager

Summary:
Since Z3 tests have been not been running [1] some tests needed to be
updated. I also added a regression test for [1].

[1] https://reviews.llvm.org/D47722

Reviewers: george.karpenkov, NoQ, ddcc

Reviewed By: george.karpenkov

Subscribers: mikhail.ramalho, dcoughlin, xazax.hun, szepet, zzheng, a.sidorin, cfe-commits

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

llvm-svn: 334067

6 years ago[Analyzer] Fix the Z3 lit test config
Vlad Tsyrklevich [Wed, 6 Jun 2018 06:25:37 +0000 (06:25 +0000)]
[Analyzer] Fix the Z3 lit test config

Summary:
The '%analyze' extra_args config argument seems to have been erroneously
deleted in r315627 disabling Z3 tests for the clang analyzer. Add the
flag back.

Reviewers: george.karpenkov, NoQ, ddcc

Reviewed By: george.karpenkov

Subscribers: xazax.hun, szepet, delcypher, a.sidorin, llvm-commits

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

llvm-svn: 334066

6 years ago[Analyzer] Fix Z3ConstraintManager crash (PR37646)
Vlad Tsyrklevich [Wed, 6 Jun 2018 06:09:02 +0000 (06:09 +0000)]
[Analyzer] Fix Z3ConstraintManager crash (PR37646)

Summary:
Fix another Z3ConstraintManager crash, use fixAPSInt() to extend a
boolean APSInt.

Reviewers: george.karpenkov, NoQ, ddcc

Reviewed By: george.karpenkov

Subscribers: xazax.hun, szepet, a.sidorin, cfe-commits

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

llvm-svn: 334065

6 years ago[XRay][compiler-rt] Refactor recursion guard for Basic and FDR Mode
Dean Michael Berris [Wed, 6 Jun 2018 06:07:48 +0000 (06:07 +0000)]
[XRay][compiler-rt] Refactor recursion guard for Basic and FDR Mode

Summary:
This change extracts the recursion guard implementation from FDR Mode
and updates it to do the following:

- Do the atomic operation correctly to be signal-handler safe.

- Make it usable in both FDR and Basic Modes.

Before this change, the recursion guard relied on an unsynchronised read
and write on a volatile thread-local. A signal handler could then run in
between the read and the write, and then be able to run instrumented
code as part of the signal handling. Using an atomic exchange instead
fixes that by doing a proper mutual exclusion even in the presence of
signal handling.

Reviewers: kpw, eizan, jfb

Reviewed By: eizan

Subscribers: llvm-commits

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

llvm-svn: 334064

6 years ago[Fuchsia] Include install-distribution-stripped in bootstrap targets
Petr Hosek [Wed, 6 Jun 2018 05:18:39 +0000 (05:18 +0000)]
[Fuchsia] Include install-distribution-stripped in bootstrap targets

This enables the use of install-distribution-stripped target in the
2-stage builds.

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

llvm-svn: 334063

6 years ago[Sema] Fix parsing of anonymous union in language linkage specification
Jan Korous [Wed, 6 Jun 2018 05:16:34 +0000 (05:16 +0000)]
[Sema] Fix parsing of anonymous union in language linkage specification

C++17 [dcl.link]p4:
A linkage specification does not establish a scope.

C++17 [class.union.anon]p2:
Namespace level anonymous unions shall be declared static.

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

rdar://problem/37545925

llvm-svn: 334062

6 years ago[X86] Move the vec_set/vec_ext builtins for 64-bit elements to BuiltinsX86_64.def.
Craig Topper [Wed, 6 Jun 2018 04:51:52 +0000 (04:51 +0000)]
[X86] Move the vec_set/vec_ext builtins for 64-bit elements to BuiltinsX86_64.def.

The instructions these correspond to and the intrinsics that use them are only available in 64-bit mode.

llvm-svn: 334061

6 years agoFix std::tuple errors
Reid Kleckner [Wed, 6 Jun 2018 01:44:10 +0000 (01:44 +0000)]
Fix std::tuple errors

llvm-svn: 334060

6 years agoImplement bittest intrinsics generically for non-x86 platforms
Reid Kleckner [Wed, 6 Jun 2018 01:35:08 +0000 (01:35 +0000)]
Implement bittest intrinsics generically for non-x86 platforms

I tested these locally on an x86 machine by disabling the inline asm
codepath and confirming that it does the same bitflips as we do with the
inline asm.

Addresses code review feedback.

llvm-svn: 334059

6 years ago[libFuzzer] initial implementation of -data_flow_trace. It parses the data flow trace...
Kostya Serebryany [Wed, 6 Jun 2018 01:23:29 +0000 (01:23 +0000)]
[libFuzzer] initial implementation of -data_flow_trace. It parses the data flow trace and prints the summary, but doesn't use the information in any other way yet

llvm-svn: 334058

6 years ago[X86] Add builtins for vector element insert and extract for different 128 and 256...
Craig Topper [Wed, 6 Jun 2018 00:24:55 +0000 (00:24 +0000)]
[X86] Add builtins for vector element insert and extract for different 128 and 256 bit vector types. Use them to implement the extract and insert intrinsics.

Previously we were just using extended vector operations in the header file.

This unfortunately allowed non-constant indices to be used with the intrinsics. This is incompatible with gcc, icc, and MSVC. It also introduces a different performance characteristic because non-constant index gets lowered to a vector store and an element sized load.

By adding the builtins we can check for the index to be a constant and ensure its in range of the vector element count.

User code still has the option to use extended vector operations themselves if they need non-constant indexing.

llvm-svn: 334057

6 years agoFix test failures after r334053.
Eric Fiselier [Wed, 6 Jun 2018 00:13:49 +0000 (00:13 +0000)]
Fix test failures after r334053.

llvm-svn: 334056

6 years ago[CodeGen] assume max/default throughput for unspecified instructions
Sanjay Patel [Tue, 5 Jun 2018 23:34:45 +0000 (23:34 +0000)]
[CodeGen] assume max/default throughput for unspecified instructions

This is a fix for the problem arising in D47374 (PR37678):
https://bugs.llvm.org/show_bug.cgi?id=37678

We may not have throughput info because it's not specified in the model
or it's not available with variant scheduling, so assume that those
instructions can execute/complete at max-issue-width.

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

llvm-svn: 334055

6 years ago[X86] Implement __builtin_ia32_vec_ext_v2si correctly even though we only use it...
Craig Topper [Tue, 5 Jun 2018 22:40:03 +0000 (22:40 +0000)]
[X86] Implement __builtin_ia32_vec_ext_v2si correctly even though we only use it with an index of 0.

This builtin takes an index as its second operand, but the codegen hardcodes an index of 0 and doesn't use the operand. The only use of the builtin in the header file passes 0 to the operand so this works for that usage. But its more correct to use the real operand.

llvm-svn: 334054

6 years agoFix PR37694 - std::vector doesn't correctly move construct allocators.
Eric Fiselier [Tue, 5 Jun 2018 22:32:52 +0000 (22:32 +0000)]
Fix PR37694 - std::vector doesn't correctly move construct allocators.

C++2a[container.requirements.general]p8 states that when move constructing
a container, the allocator is move constructed. Vector previously copy
constructed these allocators. This patch fixes that bug.

Additionally it cleans up some unnecessary allocator conversions
when copy constructing containers. Libc++ uses
__internal_allocator_traits::select_on_copy_construction to select
the correct allocator during copy construction, but it unnecessarily
converted the resulting allocator to the user specified allocator
type and back. After this patch list and forward_list no longer
do that.

Technically we're supposed to be using allocator_traits<allocator_type>::select_on_copy_construction,
but that should seemingly be addressed as a separate patch, if at all.

llvm-svn: 334053

6 years ago[Mips] Remove uneeded variants of ADDC/ADDE lowering
Amaury Sechet [Tue, 5 Jun 2018 22:13:56 +0000 (22:13 +0000)]
[Mips] Remove uneeded variants of ADDC/ADDE lowering

Summary: As it turns out, the lowering for the Mips16* family of target is the exact same thing as what the ops expands to, so the code handling them can be removed and the ops only enabled for the MipsSE* family of targets.

Reviewers: smaksimovic, atanasyan, abeserminji

Subscribers: sdardis, arichardson, llvm-commits

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

llvm-svn: 334052

6 years ago[X86] Make __builtin_ia32_vec_ext_v2si require ICE for its index argument. Add warnin...
Craig Topper [Tue, 5 Jun 2018 21:54:35 +0000 (21:54 +0000)]
[X86] Make __builtin_ia32_vec_ext_v2si require ICE for its index argument. Add warnings for out of range indices for __builtin_ia32_vec_ext_v2si, __builtin_ia32_vec_ext_v4hi, and __builtin_ia32_vec_set_v4hi.

These should take a constant value for an index and that constant should be a valid element number.

llvm-svn: 334051

6 years ago[CodeGenPrepare] Move Extension Instructions Through Logical And Shift Instructions
Guozhi Wei [Tue, 5 Jun 2018 21:03:52 +0000 (21:03 +0000)]
[CodeGenPrepare] Move Extension Instructions Through Logical And Shift Instructions

CodeGenPrepare pass move extension instructions close to load instructions in different BB, so they can be combined later. But the extension instructions can't move through logical and shift instructions in current implementation. This patch enables this enhancement, so we can eliminate more extension instructions.

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

This is re-commit of r331783, which was reverted by r333305. The performance regression was caused by some unlucky alignment, not a code generation problem.

llvm-svn: 334049

6 years ago[FileSystem] Remove OpenFlags param from several functions.
Zachary Turner [Tue, 5 Jun 2018 19:58:26 +0000 (19:58 +0000)]
[FileSystem] Remove OpenFlags param from several functions.

There was only one place in the entire codebase where a non
default value was being passed, and that place was already hidden
in an implementation file.  So we can delete the extra parameter
and all existing clients continue to work as they always have,
while making the interface a bit simpler.

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

llvm-svn: 334046

6 years agoAMDGPU: Preserve metadata when widening loads
Matt Arsenault [Tue, 5 Jun 2018 19:52:56 +0000 (19:52 +0000)]
AMDGPU: Preserve metadata when widening loads

Preserves the low bound of the !range. I don't think
it's legal to do anything with the top half since it's
theoretically reading garbage.

llvm-svn: 334045

6 years agoAMDGPU: Use more custom insert/extract_vector_elt lowering
Matt Arsenault [Tue, 5 Jun 2018 19:52:46 +0000 (19:52 +0000)]
AMDGPU: Use more custom insert/extract_vector_elt lowering

Apply to i8 vectors.

llvm-svn: 334044

6 years ago[Hexagon] Add pattern to generate 64-bit neg instruction
Krzysztof Parzyszek [Tue, 5 Jun 2018 19:52:39 +0000 (19:52 +0000)]
[Hexagon] Add pattern to generate 64-bit neg instruction

llvm-svn: 334043

6 years ago[Hexagon] Add more patterns for generating abs/absp instructions
Krzysztof Parzyszek [Tue, 5 Jun 2018 19:00:50 +0000 (19:00 +0000)]
[Hexagon] Add more patterns for generating abs/absp instructions

llvm-svn: 334038

6 years agoguard fneg with fmf sub flags
Michael Berg [Tue, 5 Jun 2018 18:49:47 +0000 (18:49 +0000)]
guard fneg with fmf sub flags

Summary: This change uses fmf subflags to guard optimizations as well as unsafe. These changes originated from D46483.

Reviewers: spatel, hfinkel

Reviewed By: spatel

Subscribers: nemanjai

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

llvm-svn: 334037

6 years ago[lsan] Do not check for leaks in the forked process
Vitaly Buka [Tue, 5 Jun 2018 18:15:57 +0000 (18:15 +0000)]
[lsan] Do not check for leaks in the forked process

Summary:
If calling process had threads then forked process will fail to detect
references from them.

Fixes https://github.com/google/sanitizers/issues/836

Reviewers: alekseyshl

Subscribers: llvm-commits

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

llvm-svn: 334036

6 years agoNFC: adding baseline fneg case for fmf
Michael Berg [Tue, 5 Jun 2018 18:12:25 +0000 (18:12 +0000)]
NFC: adding baseline fneg case for fmf

llvm-svn: 334035

6 years ago[LSan] Report proper error on allocator failures instead of CHECK(0)-ing
Alex Shlyapnikov [Tue, 5 Jun 2018 18:02:09 +0000 (18:02 +0000)]
[LSan] Report proper error on allocator failures instead of CHECK(0)-ing

Summary:
Following up on and complementing D44404.

Currently many allocator specific errors (OOM, for example) are reported as
a text message and CHECK(0) termination, not stack, no details, not too
helpful nor informative. To improve the situation, detailed and
structured errors were defined and reported under the appropriate conditions.

Reviewers: eugenis

Subscribers: srhines, mgorny, delcypher, llvm-commits, #sanitizers

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

llvm-svn: 334034

6 years ago[clangd] Fix inverted test again, sigh
Sam McCall [Tue, 5 Jun 2018 18:00:48 +0000 (18:00 +0000)]
[clangd] Fix inverted test again, sigh

llvm-svn: 334033

6 years ago[clangd] Quality fixes (uninit var, missing debug output, pattern decl CCRs).
Sam McCall [Tue, 5 Jun 2018 17:58:12 +0000 (17:58 +0000)]
[clangd] Quality fixes (uninit var, missing debug output, pattern decl CCRs).

llvm-svn: 334032

6 years ago[mips] Fix the predicates for arithmetic operations
Simon Dardis [Tue, 5 Jun 2018 17:53:22 +0000 (17:53 +0000)]
[mips] Fix the predicates for arithmetic operations

Reviewers: smaksimovic, atanasyan, abeserminji

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

llvm-svn: 334031

6 years agoPDB support of function-level linking and splitted functions
Aaron Smith [Tue, 5 Jun 2018 17:19:21 +0000 (17:19 +0000)]
PDB support of function-level linking and splitted functions

Summary:
The patch adds support of splitted functions (when MSVC is used with PGO) and function-level linking feature.

SymbolFilePDB::ParseCompileUnitLineTable function relies on fact that ranges of compiled source files in the binary are continuous and don't intersect each other. The function creates LineSequence for each file and inserts it into LineTable, and implementation of last one relies on continuity of the sequence. But it's not always true when function-level linking enabled, e.g. in added input test file test-pdb-function-level-linking.exe there is xstring's std__basic_string_char_std__char_traits_char__std__allocator_char_____max_size (.00454820) between test-pdb-function-level-linking.cpp's foo (.00454770) and main (.004548F0).

To fix the problem this patch renews the sequence on each address gap.

Reviewers: asmith, zturner

Reviewed By: asmith

Subscribers: mgorny, lldb-commits

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

llvm-svn: 334030

6 years ago[UpdateTestChecks] Error if --llvm-mca-binary gets an empty string
Greg Bedwell [Tue, 5 Jun 2018 17:16:19 +0000 (17:16 +0000)]
[UpdateTestChecks] Error if --llvm-mca-binary gets an empty string

If the command line was mistyped like:
./update_mca_test_checks.py --llvm-mca-binary= /path/to/llvm-mca *.s
                                              ^-- extra whitespace

then /path/to/llvm-mca would get treated by argparse as a test-path
pattern and could actually be opened in write mode and overwritten.

llvm-svn: 334029

6 years ago[llvm-mca] Correctly update the CyclesLeft of a register read in the presence of...
Andrea Di Biagio [Tue, 5 Jun 2018 17:12:02 +0000 (17:12 +0000)]
[llvm-mca] Correctly update the CyclesLeft of a register read in the presence of partial register updates.

This patch fixe the logic in ReadState::cycleEvent(). That method was not
correctly updating field `TotalCycles`.

Added extra code comments in class ReadState to better describe each field.

llvm-svn: 334028

6 years agoRemove a self-referencing #include
Fangrui Song [Tue, 5 Jun 2018 16:59:40 +0000 (16:59 +0000)]
Remove a self-referencing #include

llvm-svn: 334027

6 years ago[clangd] Boost code completion results that are narrowly scoped (local, members)
Sam McCall [Tue, 5 Jun 2018 16:30:25 +0000 (16:30 +0000)]
[clangd] Boost code completion results that are narrowly scoped (local, members)

Summary:
This signal is considered a relevance rather than a quality signal because it's
dependent on the query (the fact that it's completion, and implicitly the query
context).

This is part of the effort to reduce reliance on Sema priority, so we can have
consistent ranking between Index and Sema results.

Reviewers: ioeric

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

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

llvm-svn: 334026

6 years ago[lit, pdb] Fix func-symbols.test (on Windows)
Stella Stamenova [Tue, 5 Jun 2018 16:20:36 +0000 (16:20 +0000)]
[lit, pdb] Fix func-symbols.test (on Windows)

Summary: This test was failing sporadically on windows because the order in which the symbols are generated was different between builds. To fix the test, we need to run FileCheck twice - once for each set of symbols we want to verify. The test only runs on Windows.

Reviewers: asmith, zturner, labath

Subscribers: stella.stamenova, llvm-commits

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

llvm-svn: 334025

6 years agoDo not show unrelated "-m is missing" error message.
Rui Ueyama [Tue, 5 Jun 2018 16:13:40 +0000 (16:13 +0000)]
Do not show unrelated "-m is missing" error message.

Previously, "-m is missing" error message is shown if you pass a
nonexistent file or don't pass any file at all to lld, as shown below:

  $ ld.lld nonexistent.o
  ld.lld: error: cannot open nonexistent.o: No such file or directory
  ld.lld: error: target emulation unknown: -m or at least one .o file required

This patch eliminates the second error message because it's not related
and even inaccurate (you passed a .o file though it didn't exist).

llvm-svn: 334024

6 years ago[X86][SSE] Use multiplication scale factors for v8i16 SHL on pre-AVX2 targets.
Simon Pilgrim [Tue, 5 Jun 2018 15:17:39 +0000 (15:17 +0000)]
[X86][SSE] Use multiplication scale factors for v8i16 SHL on pre-AVX2 targets.

Similar to v4i32 SHL, convert v8i16 shift amounts to scale factors instead to improve performance and reduce instruction count. We were already doing this for constant shifts, this adds variable shift support.

Reduces the serial nature of the codegen, which relies on chains of plendvb/pand+pandn+por shifts.

This is a step towards adding support for vXi16 vector rotates.

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

llvm-svn: 334023

6 years ago[MC][X86] Allow assembler variable assignment to register name.
Nirav Dave [Tue, 5 Jun 2018 15:13:39 +0000 (15:13 +0000)]
[MC][X86] Allow assembler variable assignment to register name.

Summary:
Allow extended parsing of variable assembler assignment syntax and modify X86 to permit
VAR = register assignment. As we emit these as .set directives when possible, we inline
such expressions in output assembly.

Fixes PR37425.

Reviewers: rnk, void, echristo

Reviewed By: rnk

Subscribers: nickdesaulniers, llvm-commits, hiraditya

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

llvm-svn: 334022