platform/upstream/llvm.git
6 years ago[analyzer][UninitializedObjectChecker] Support for nonloc::LocAsInteger
Kristof Umann [Fri, 14 Sep 2018 10:18:26 +0000 (10:18 +0000)]
[analyzer][UninitializedObjectChecker] Support for nonloc::LocAsInteger

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

llvm-svn: 342221

6 years ago[analyzer][UninitializedObjectChecker] New flag to ignore records based on it's fields
Kristof Umann [Fri, 14 Sep 2018 10:10:09 +0000 (10:10 +0000)]
[analyzer][UninitializedObjectChecker] New flag to ignore records based on it's fields

Based on a suggestion from @george.karpenkov.

In some cases, structs are used as unions with a help of a tag/kind field.
This patch adds a new string flag (a pattern), that is matched against the
fields of a record, and should a match be found, the entire record is ignored.

For more info refer to http://lists.llvm.org/pipermail/cfe-dev/2018-August/058906.html
and to the responses to that, especially http://lists.llvm.org/pipermail/cfe-dev/2018-August/059215.html.

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

llvm-svn: 342220

6 years ago[analyzer][UninitializedObjectChecker] Refactored checker options
Kristof Umann [Fri, 14 Sep 2018 09:39:26 +0000 (09:39 +0000)]
[analyzer][UninitializedObjectChecker] Refactored checker options

Since I plan to add a number of new flags, it made sense to encapsulate
them in a new struct, in order not to pollute FindUninitializedFields's
constructor with new boolean options with super long names.

This revision practically reverts D50508, since FindUninitializedFields
now accesses the pedantic flag anyways.

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

llvm-svn: 342219

6 years ago[DWARF] reposting r342048, which was reverted in r342056 due to buildbot
Wolfgang Pieb [Fri, 14 Sep 2018 09:14:10 +0000 (09:14 +0000)]
[DWARF] reposting r342048, which was reverted in r342056 due to buildbot
errors.
Adjusted 2 test cases for ARM and darwin and fixed a bug with the original
change in dsymutil.

llvm-svn: 342218

6 years ago[analyzer][UninitializedObjectChecker] Correct dynamic type is acquired for record...
Kristof Umann [Fri, 14 Sep 2018 09:13:36 +0000 (09:13 +0000)]
[analyzer][UninitializedObjectChecker] Correct dynamic type is acquired for record pointees

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

llvm-svn: 342217

6 years agoUse Chrome and Firefox as example of success for clang
Sylvestre Ledru [Fri, 14 Sep 2018 09:08:21 +0000 (09:08 +0000)]
Use Chrome and Firefox as example of success for clang

llvm-svn: 342216

6 years ago[analyzer][UninitializedObjectChecker] Updated comments
Kristof Umann [Fri, 14 Sep 2018 09:07:40 +0000 (09:07 +0000)]
[analyzer][UninitializedObjectChecker] Updated comments

Some of the comments are incorrect, imprecise, or simply nonexistent.
Since I have a better grasp on how the analyzer works, it makes sense
to update most of them in a single swoop.

I tried not to flood the code with comments too much, this amount
feels just right to me.

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

llvm-svn: 342215

6 years agoremove 11 years old videos from the homepage. if you have a suggestion, please drop...
Sylvestre Ledru [Fri, 14 Sep 2018 09:00:48 +0000 (09:00 +0000)]
remove 11 years old videos from the homepage. if you have a suggestion, please drop me an email

llvm-svn: 342214

6 years ago[analyzer][UninitializedObjectChecker] Fixed dereferencing
Kristof Umann [Fri, 14 Sep 2018 08:58:21 +0000 (08:58 +0000)]
[analyzer][UninitializedObjectChecker] Fixed dereferencing

iThis patch aims to fix derefencing, which has been debated for months now.

Instead of working with SVals, the function now relies on TypedValueRegion.

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

llvm-svn: 342213

6 years agoupdate the doc to compare with gcc 4.9 instead of 4.2
Sylvestre Ledru [Fri, 14 Sep 2018 08:55:09 +0000 (08:55 +0000)]
update the doc to compare with gcc 4.9 instead of 4.2

llvm-svn: 342212

6 years agogcc is now returning the same output on this example, removing this example
Sylvestre Ledru [Fri, 14 Sep 2018 08:52:18 +0000 (08:52 +0000)]
gcc is now returning the same output on this example, removing this example

llvm-svn: 342211

6 years ago[ARM] bottom-top mul support in ARMParallelDSP
Sam Parker [Fri, 14 Sep 2018 08:09:09 +0000 (08:09 +0000)]
[ARM] bottom-top mul support in ARMParallelDSP

On failing to find sequences that can be converted into dual macs,
try to find sequential 16-bit loads that are used by muls which we
can then use smultb, smulbt, smultt with a wide load.

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

llvm-svn: 342210

6 years ago[LoopInterchange] Preserve ScalarEvolution, by forgetting about interchanged loops.
Florian Hahn [Fri, 14 Sep 2018 07:50:20 +0000 (07:50 +0000)]
[LoopInterchange] Preserve ScalarEvolution, by forgetting about interchanged loops.

As preparation for LoopInterchange becoming a loop pass, it needs to
preserve ScalarEvolution. Even though interchanging should not change
the trip count of the loop, it modifies loop entry, latch and exit
blocks.

I added -verify-scev to some loop interchange tests, but the verification does
not catch problems caused by missing invalidation of SE in loop interchange, as
the trip counts themselves do not change. So there might be potential to
make the SE verification covering more stuff in the future.

Reviewers: mkazantsev, efriedma, karthikthecool

Reviewed By: efriedma

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

llvm-svn: 342209

6 years ago[PDB] Use the raw PDB symbol interface more accurately
Aleksandr Urakov [Fri, 14 Sep 2018 07:46:06 +0000 (07:46 +0000)]
[PDB] Use the raw PDB symbol interface more accurately

Summary:
This patch adds some symbol tag checks before using the `IPDBRawSymbol`
interface to improve safety and readability.

Reviewers: zturner

Reviewed By: zturner

Subscribers: lldb-commits, stella.stamenova

Tags: #lldb

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

llvm-svn: 342208

6 years ago[SystemZ] Adjust cost functions for subtargets that use LI + LOC instead of IPM
Jonas Paulsson [Fri, 14 Sep 2018 06:46:55 +0000 (06:46 +0000)]
[SystemZ] Adjust cost functions for subtargets that use LI + LOC instead of IPM

After recent improvements which makes better use of LOC instead of IPM, the
TTI cost functions also needs to be updated to reflect this.

This involves sext, zext and xor of i1.

The tests were updated so that for z13 the new costs are expected, while the
old costs are still checked for on zEC12.

Review: Ulrich Weigand
https://reviews.llvm.org/D51339

llvm-svn: 342207

6 years ago[COFF] Allow embedded directives to be separated by null bytes
Martin Storsjo [Fri, 14 Sep 2018 06:08:56 +0000 (06:08 +0000)]
[COFF] Allow embedded directives to be separated by null bytes

The PE spec says that they will be separated by spaces, but link.exe
handles it just fine if they are separated by null bytes as well.

This adds tests to the lld repo, with the actual functional change
in LLVM in SVN r342204.

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

llvm-svn: 342206

6 years ago[COFF] Avoid copying of chunk vectors. NFC.
Martin Storsjo [Fri, 14 Sep 2018 06:08:51 +0000 (06:08 +0000)]
[COFF] Avoid copying of chunk vectors. NFC.

When declaring the pair variable as "auto Pair : Map", it is
effectively declared as
std::pair<std::pair<StringRef, uint32_t>, std::vector<Chunk *>>.
This effectively does a full, shallow copy of the Chunk vector,
just to be thrown away after each iteration.

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

llvm-svn: 342205

6 years ago[Support] Treat null bytes as separator in windows command line strings
Martin Storsjo [Fri, 14 Sep 2018 06:08:01 +0000 (06:08 +0000)]
[Support] Treat null bytes as separator in windows command line strings

When reading directives from a .drectve section, the directives are
tokenized as a normal windows command line. However in these cases,
link.exe allows the directives to be separated by null bytes, not only by
spaces.

A test case for this change will be added in the lld repo.

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

llvm-svn: 342204

6 years ago[InstCombine] Add some test cases for (add (sext x), (sext y)) --> (sext (add int...
Craig Topper [Fri, 14 Sep 2018 05:16:58 +0000 (05:16 +0000)]
[InstCombine] Add some test cases for (add (sext x), (sext y)) --> (sext (add int x, y)) and (mul (sext x), (sext y)) --> (sext (mul x, y)). NFC

llvm-svn: 342203

6 years ago[NFC] Remove meaningless code from GVN
Max Kazantsev [Fri, 14 Sep 2018 04:50:38 +0000 (04:50 +0000)]
[NFC] Remove meaningless code from GVN

llvm-svn: 342202

6 years agoFix for the buildbot failure http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux...
Hideki Saito [Fri, 14 Sep 2018 02:02:57 +0000 (02:02 +0000)]
Fix for the buildbot failure lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/23635
from the commit (r342197) of https://reviews.llvm.org/D50820.

llvm-svn: 342201

6 years ago[XRay][clang] Emit "never-instrument" attribute
Dean Michael Berris [Fri, 14 Sep 2018 01:59:12 +0000 (01:59 +0000)]
[XRay][clang] Emit "never-instrument" attribute

Summary:
Before this change, we only emit the XRay attributes in LLVM IR when the
-fxray-instrument flag is provided. This may cause issues with thinlto
when the final binary is being built/linked with -fxray-instrument, and
the constitutent LLVM IR gets re-lowered with xray instrumentation.

With this change, we can honour the "never-instrument "attributes
provided in the source code and preserve those in the IR. This way, even
in thinlto builds, we retain the attributes which say whether functions
should never be XRay instrumented.

This change addresses llvm.org/PR38922.

Reviewers: mboerger, eizan

Subscribers: mehdi_amini, dexonsmith, cfe-commits, llvm-commits

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

llvm-svn: 342200

6 years ago[ODRHash] Fix early exit that skipped code.
Richard Trieu [Fri, 14 Sep 2018 01:15:28 +0000 (01:15 +0000)]
[ODRHash] Fix early exit that skipped code.

There is a bit of code at the end of AddDeclaration that should be run on
every exit of the function.  However, there was an early exit beforehand
that could be triggered, which causes a small amount of data to skip the
hashing, leading to false positive mismatch.  Use a separate function so
that this code is always run.

llvm-svn: 342199

6 years ago[clangd] Fix TUScheduler typos
Fangrui Song [Fri, 14 Sep 2018 00:56:11 +0000 (00:56 +0000)]
[clangd] Fix TUScheduler typos

llvm-svn: 342198

6 years ago[VPlan] Implement initial vector code generation support for simple outer loops.
Hideki Saito [Fri, 14 Sep 2018 00:36:00 +0000 (00:36 +0000)]
[VPlan] Implement initial vector code generation support for simple outer loops.

Summary:
[VPlan] Implement vector code generation support for simple outer loops.

Context: Patch Series #1 for outer loop vectorization support in LV  using VPlan. (RFC: http://lists.llvm.org/pipermail/llvm-dev/2017-December/119523.html).

This patch introduces vector code generation support for simple outer loops that are currently supported in the VPlanNativePath. Changes here essentially do the following:

  - force vector code generation using explicit vectorize_width

  - add conservative early returns in cost model and other places for VPlanNativePath

  - add code for setting up outer loop inductions

  - support for widening non-induction PHIs that can result from inner loops and uniform conditional branches

  - support for generating uniform inner branches

We plan to add a handful C outer loop executable tests once the initial code generation support is committed. This patch is expected to be NFC for the inner loop vectorizer path. Since we are moving in the direction of supporting outer loop vectorization in LV, it may also be time to rename classes such as InnerLoopVectorizer.

Reviewers: fhahn, rengolin, hsaito, dcaballe, mkuper, hfinkel, Ayal

Reviewed By: fhahn, hsaito

Subscribers: dmgreen, bollu, tschuett, rkruppe, rogfer01, llvm-commits

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

llvm-svn: 342197

6 years agoRelax alignment assumptions in a test after r342194
Vedant Kumar [Fri, 14 Sep 2018 00:16:37 +0000 (00:16 +0000)]
Relax alignment assumptions in a test after r342194

Don't hardcode align 8.

Fixes a bot failure:
http://lab.llvm.org:8011/builders/clang-cmake-armv8-full/builds/6373

llvm-svn: 342196

6 years agoUpdate a clang-tidy test for r342194
Vedant Kumar [Thu, 13 Sep 2018 23:50:20 +0000 (23:50 +0000)]
Update a clang-tidy test for r342194

The location of implicit captures has changed. Update a use-after-move
checker test to reflect that.

This fixes a bot failure:
http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/36500

llvm-svn: 342195

6 years ago[Sema] Remove location from implicit capture init expr
Vedant Kumar [Thu, 13 Sep 2018 23:28:25 +0000 (23:28 +0000)]
[Sema] Remove location from implicit capture init expr

A lambda's closure is initialized when the lambda is declared. For
implicit captures, the initialization code emitted from EmitLambdaExpr
references source locations *within the lambda body* in the function
containing the lambda. This results in a poor debugging experience: we
step to the line containing the lambda, then into lambda, out again,
over and over, until every capture's field is initialized.

To improve stepping behavior, assign the starting location of the lambda
to expressions which initialize an implicit capture within it.

rdar://39807527

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

llvm-svn: 342194

6 years ago[NFC] Link LLVMCore into LLVMExegesisARMTests.
Richard Diamond [Thu, 13 Sep 2018 23:18:33 +0000 (23:18 +0000)]
[NFC] Link LLVMCore into LLVMExegesisARMTests.

Fixes missing `llvm::LLVMContext::~LLVMContext()` symbols w/
`BUILD_SHARED_LIBS`.

llvm-svn: 342193

6 years agoFix crash on call to __builtin_memcpy with a null pointer to an
Richard Smith [Thu, 13 Sep 2018 22:47:33 +0000 (22:47 +0000)]
Fix crash on call to __builtin_memcpy with a null pointer to an
incomplete type.

Also improve the diagnostics for similar situations.

llvm-svn: 342192

6 years agoCOFF: Add support for /force:multiple option
Rui Ueyama [Thu, 13 Sep 2018 22:05:10 +0000 (22:05 +0000)]
COFF: Add support for /force:multiple option

Patch by Thomas Roughton.

This patch adds support for linking with multiple definitions to LLD's
COFF driver, in line with link.exe's /force:multiple option.

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

llvm-svn: 342191

6 years agosvn add the new files...
Jim Ingham [Thu, 13 Sep 2018 21:59:16 +0000 (21:59 +0000)]
svn add the new files...

I started from a clean slate to do the checkin, but forgot to svn add the new files.
Do that now.

Also add the one new source file to CMakeLists.txt

llvm-svn: 342190

6 years ago[AMDGPU] Removed unused method
Tim Renouf [Thu, 13 Sep 2018 21:56:25 +0000 (21:56 +0000)]
[AMDGPU] Removed unused method

Summary:
I accidentally left this behind in D50306, and it causes a build warning
when I build with gcc7.

Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, t-tye, llvm-commits

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

Change-Id: I30f7a47047e9d9d841f652da66d2fea19e74842c
llvm-svn: 342189

6 years agoRemember to sort the Xcode project file. NFC.
Jim Ingham [Thu, 13 Sep 2018 21:55:00 +0000 (21:55 +0000)]
Remember to sort the Xcode project file.  NFC.

llvm-svn: 342188

6 years ago[SanitizerCoverage] Create comdat for global arrays.
Matt Morehouse [Thu, 13 Sep 2018 21:45:55 +0000 (21:45 +0000)]
[SanitizerCoverage] Create comdat for global arrays.

Summary:
Place global arrays in comdat sections with their associated functions.
This makes sure they are stripped along with the functions they
reference, even on the BFD linker.

Reviewers: eugenis

Reviewed By: eugenis

Subscribers: eraman, hiraditya, llvm-commits

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

llvm-svn: 342186

6 years agoAdd a "scripted" breakpoint type to lldb.
Jim Ingham [Thu, 13 Sep 2018 21:35:32 +0000 (21:35 +0000)]
Add a "scripted" breakpoint type to lldb.

This change allows you to write a new breakpoint type where the
logic for setting breakpoints is determined by a Python callback
written using the SB API's.

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

llvm-svn: 342185

6 years ago[NFC][InstCombine] PR38708 - inefficient pattern for high-bits checking 3.
Roman Lebedev [Thu, 13 Sep 2018 21:34:47 +0000 (21:34 +0000)]
[NFC][InstCombine] PR38708 - inefficient pattern for high-bits checking 3.

The last, non-canonical variant:
https://godbolt.org/z/aCMsPk
https://rise4fun.com/Alive/I6f

It can only happen due to the extra use on the inner shift.
But here it is ok.

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

llvm-svn: 342184

6 years ago[DAGCombine] Fix crash when store merging created an extract_subvector with invalid...
Amara Emerson [Thu, 13 Sep 2018 21:28:58 +0000 (21:28 +0000)]
[DAGCombine] Fix crash when store merging created an extract_subvector with invalid index.

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

llvm-svn: 342183

6 years agoLLVMExegesisX86Tests: link to LLVMCore, too.
Roman Lebedev [Thu, 13 Sep 2018 21:26:09 +0000 (21:26 +0000)]
LLVMExegesisX86Tests: link to LLVMCore, too.

Fixes build for me.
Refs. D52054

[215/217] Linking CXX executable unittests/tools/llvm-exegesis/X86/LLVMExegesisX86Tests
FAILED: unittests/tools/llvm-exegesis/X86/LLVMExegesisX86Tests
: && /usr/bin/g++  -pipe -O2 -g0 -UNDEBUG -fPIC -fvisibility-inlines-hidden -Werror=date-time -std=c++11 -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wno-maybe-uninitialized -Wno-class-memaccess -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wno-comment -fdiagnostics-color -ffunction-sections -fdata-sections -pipe -O2 -g0 -UNDEBUG  -fuse-ld=lld -Wl,--color-diagnostics -Wl,-allow-shlib-undefined     -Wl,-O3 -Wl,--gc-sections unittests/tools/llvm-exegesis/X86/CMakeFiles/LLVMExegesisX86Tests.dir/AssemblerTest.cpp.o unittests/tools/llvm-exegesis/X86/CMakeFiles/LLVMExegesisX86Tests.dir/AnalysisTest.cpp.o unittests/tools/llvm-exegesis/X86/CMakeFiles/LLVMExegesisX86Tests.dir/SnippetGeneratorTest.cpp.o unittests/tools/llvm-exegesis/X86/CMakeFiles/LLVMExegesisX86Tests.dir/RegisterAliasingTest.cpp.o unittests/tools/llvm-exegesis/X86/CMakeFiles/LLVMExegesisX86Tests.dir/TargetTest.cpp.o  -o unittests/tools/llvm-exegesis/X86/LLVMExegesisX86Tests  -Wl,-rpath,/build/llvm-build-GCC-release/lib lib/libLLVMMC.so.8svn lib/libLLVMMCParser.so.8svn lib/libLLVMObject.so.8svn lib/libLLVMSymbolize.so.8svn lib/libLLVMX86CodeGen.so.8svn lib/libLLVMX86AsmParser.so.8svn lib/libLLVMX86AsmPrinter.so.8svn lib/libLLVMX86Desc.so.8svn lib/libLLVMX86Disassembler.so.8svn lib/libLLVMX86Info.so.8svn lib/libLLVMX86Utils.so.8svn lib/libLLVMSupport.so.8svn -lpthread lib/libgtest_main.so.8svn lib/libgtest.so.8svn -lpthread lib/libLLVMExegesis.so.8svn lib/libLLVMExegesisX86.so.8svn && :
ld.lld: error: undefined symbol: llvm::LLVMContext::~LLVMContext()
>>> referenced by AssemblerTest.cpp
>>>               unittests/tools/llvm-exegesis/X86/CMakeFiles/LLVMExegesisX86Tests.dir/AssemblerTest.cpp.o:(exegesis::(anonymous namespace)::X86MachineFunctionGeneratorTest_DISABLED_JitFunction_Test::TestBody())

ld.lld: error: undefined symbol: llvm::LLVMContext::~LLVMContext()
>>> referenced by AssemblerTest.cpp
>>>               unittests/tools/llvm-exegesis/X86/CMakeFiles/LLVMExegesisX86Tests.dir/AssemblerTest.cpp.o:(exegesis::(anonymous namespace)::X86MachineFunctionGeneratorTest_DISABLED_JitFunctionXOR32rr_Default_Test::TestBody())

ld.lld: error: undefined symbol: llvm::LLVMContext::~LLVMContext()
>>> referenced by AssemblerTest.cpp
>>>               unittests/tools/llvm-exegesis/X86/CMakeFiles/LLVMExegesisX86Tests.dir/AssemblerTest.cpp.o:(void exegesis::MachineFunctionGeneratorBaseTest::Check<int, int, int, int, int, int, int, int>(exegesis::ExegesisTarget const&, llvm::ArrayRef<unsigned int>, llvm::MCInst, int, int, int, int, int, int, int, int))

ld.lld: error: undefined symbol: llvm::LLVMContext::~LLVMContext()
>>> referenced by AssemblerTest.cpp
>>>               unittests/tools/llvm-exegesis/X86/CMakeFiles/LLVMExegesisX86Tests.dir/AssemblerTest.cpp.o:(exegesis::(anonymous namespace)::X86MachineFunctionGeneratorTest_DISABLED_JitFunctionMOV32ri_Test::TestBody())
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.

llvm-svn: 342182

6 years agoAdd support for descriptions with command completions.
Raphael Isemann [Thu, 13 Sep 2018 21:26:00 +0000 (21:26 +0000)]
Add support for descriptions with command completions.

Summary:
This patch adds a framework for adding descriptions to the command completions we provide.
It also adds descriptions for completed top-level commands so that we can test this code.

Completions are in general supposed to be displayed alongside the completion itself. The descriptions
can be used to provide additional information about the completion to the user. Examples for descriptions
are function signatures when completing function calls in the expression command or the binary name
when providing completion for a symbol.

There is still some boilerplate code from the old completion API left in LLDB (mostly because the respective
APIs are reused for non-completion related purposes, so the CompletionRequest doesn't make sense to be
used), so that's why I still had to change some function signatures. Also, as the old API only passes around a
list of matches, and the descriptions are for these functions just another list, I had to add some code that
essentially just ensures that both lists are always the same side (e.g. all the manual calls to
`descriptions->AddString(X)` below a `matches->AddString(Y)` call).

The initial command descriptions that come with this patch are just reusing the existing
short help that is already added in LLDB.

An example completion with descriptions looks like this:
```
(lldb) pl
Available completions:
        platform -- Commands to manage and create platforms.
        plugin   -- Commands for managing LLDB plugins.
```

Reviewers: #lldb, jingham

Reviewed By: #lldb, jingham

Subscribers: jingham, JDevlieghere, lldb-commits

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

llvm-svn: 342181

6 years ago[llvm-exegesis] Add missing MC dependency to CMakeLists.txt
Sam Clegg [Thu, 13 Sep 2018 21:17:16 +0000 (21:17 +0000)]
[llvm-exegesis] Add missing MC dependency to CMakeLists.txt

See rL342148

This probably only shows up in BUILD_SHARED_LIBS=ON builds
which might explain how it crept in.

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

llvm-svn: 342180

6 years ago[bindings/go] Add DebugLoc parameter to InsertXXXAtEnd()
Peter Collingbourne [Thu, 13 Sep 2018 21:16:39 +0000 (21:16 +0000)]
[bindings/go] Add DebugLoc parameter to InsertXXXAtEnd()

These functions previously passed nil for the location, which always resulted in a crash.

This is a signature breaking change, but I cannot see how they could have been used before.

Patch by Ben Clayton!

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

llvm-svn: 342179

6 years agoAdd dependency on new llvm-cxxmap tool to check-llvm.
Richard Smith [Thu, 13 Sep 2018 21:15:34 +0000 (21:15 +0000)]
Add dependency on new llvm-cxxmap tool to check-llvm.

llvm-svn: 342178

6 years agoDiagnose likely typos in #include directives.
Richard Smith [Thu, 13 Sep 2018 21:10:08 +0000 (21:10 +0000)]
Diagnose likely typos in #include directives.

Summary:
When someone writes

  #include "<some_file>"

or

  #include " some_file "

the compiler returns "file not fuond..." with fonts and quotes that may
make it hard to see there are excess quotes or surprising bytes in the
filename.  Assuming that files are usually logically named and start and
end with an alphanumeric character, we can check for the file's
existence by stripping the non-alphanumeric leading or trailing
characters.  If the file is found, emit a non-fatal error with a
FixItHint.

Patch by Christy Lee!

Reviewers: aaron.ballman, erikjv, rsmith

Reviewed By: rsmith

Subscribers: lebedev.ri, xbolva00, sammccall, modocache, erikjv, aaron.ballman, cfe-commits

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

llvm-svn: 342177

6 years ago[MachineInstr] In addRegisterKilled and addRegisterDead, don't remove operands from...
Craig Topper [Thu, 13 Sep 2018 20:51:27 +0000 (20:51 +0000)]
[MachineInstr] In addRegisterKilled and addRegisterDead, don't remove operands from inline assembly instructions if they have an associated flag operand.

INLINEASM instructions use extra operands to carry flags. If a register operand is removed without removing the flag operand, then the flags will no longer make sense.

This patch fixes this by preventing the removal when a flag operand is present.

The included test case was generated by MS inline assembly. Longer term maybe we should fix the inline assembly parsing to not generate redundant operands.

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

llvm-svn: 342176

6 years ago[X86] Fix register resizings for inline assembly register operands.
Nirav Dave [Thu, 13 Sep 2018 20:33:56 +0000 (20:33 +0000)]
[X86] Fix register resizings for inline assembly register operands.

When replacing a named register input to the appropriately sized
sub/super-register. In the case of a 64-bit value being assigned to a
register in 32-bit mode, match GCC's assignment.

Reviewers: eli.friedman, craig.topper

Subscribers: nickdesaulniers, llvm-commits, hiraditya

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

llvm-svn: 342175

6 years ago[X86] Cleanup pair returns. NFCI.
Nirav Dave [Thu, 13 Sep 2018 20:33:27 +0000 (20:33 +0000)]
[X86] Cleanup pair returns. NFCI.

llvm-svn: 342174

6 years ago[InstCombine] Inefficient pattern for high-bits checking 2 (PR38708)
Roman Lebedev [Thu, 13 Sep 2018 20:33:12 +0000 (20:33 +0000)]
[InstCombine] Inefficient pattern for high-bits checking 2 (PR38708)

Summary:
It is sometimes important to check that some newly-computed value
is non-negative and only n bits wide (where n is a variable.)
There are many ways to check that:
https://godbolt.org/z/o4RB8D
The last variant seems best?
(I'm sure there are some other variations i haven't thought of..)

More complicated, canonical pattern:
https://rise4fun.com/Alive/uhA

We do need to have two `switch()`'es like this,
to not mismatch the swappable predicates.

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

Reviewers: spatel, craig.topper, RKSimon

Reviewed By: spatel

Subscribers: llvm-commits

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

llvm-svn: 342173

6 years ago[PartiallyInlineLibCalls] Add DebugCounter support
George Burgess IV [Thu, 13 Sep 2018 20:33:04 +0000 (20:33 +0000)]
[PartiallyInlineLibCalls] Add DebugCounter support

This adds DebugCounter support to the PartiallyInlineLibCalls pass,
which should make debugging/automated bisection easier in the future.

Patch by Zhizhou Yang!

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

llvm-svn: 342172

6 years ago[NFC][InstCombine] Test what happens if 'unefficient high bit check' pattern is on...
Roman Lebedev [Thu, 13 Sep 2018 20:33:02 +0000 (20:33 +0000)]
[NFC][InstCombine] Test what happens if 'unefficient high bit check' pattern is on both sides.

Came up in https://reviews.llvm.org/D52001#1233827
While we don't do a good job here, we at least want to make
sure that we don't have any inf-loops.

llvm-svn: 342171

6 years ago[DCE] Add DebugCounter support
George Burgess IV [Thu, 13 Sep 2018 20:29:50 +0000 (20:29 +0000)]
[DCE] Add DebugCounter support

Patch by Zhizhou Yang!

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

llvm-svn: 342170

6 years agoRevert "[cmake] Fix a unittest when `LLVM_LINK_LLVM_DYLIB` is requested."
Volodymyr Sapsai [Thu, 13 Sep 2018 20:24:36 +0000 (20:24 +0000)]
Revert "[cmake] Fix a unittest when `LLVM_LINK_LLVM_DYLIB` is requested."

This reverts commit r342150 as it caused test failure

    LLVM-Unit :: Passes/./PluginsTests/PluginsTests.LoadPlugin

on multiple bots.

llvm-svn: 342169

6 years agoAdd flag to llvm-profdata to allow symbols in profile data to be remapped, and
Richard Smith [Thu, 13 Sep 2018 20:22:02 +0000 (20:22 +0000)]
Add flag to llvm-profdata to allow symbols in profile data to be remapped, and
add a tool to generate symbol remapping files.

Summary:
The new tool llvm-cxxmap builds a symbol mapping table from a file containing
a description of partial equivalences to apply to mangled names and files
containing old and new symbol tables.

Reviewers: davidxl

Subscribers: mgorny, llvm-commits

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

llvm-svn: 342168

6 years agoNativeProcessProtocol: Sink ReadMemoryWithoutTrap into base class
Pavel Labath [Thu, 13 Sep 2018 20:17:40 +0000 (20:17 +0000)]
NativeProcessProtocol: Sink ReadMemoryWithoutTrap into base class

The two existing implementations have the function implemented
identically, and there's no reason to believe that this would be
different for other implementations.

llvm-svn: 342167

6 years agoFix a couple of mangling canonicalizer corner case bugs.
Richard Smith [Thu, 13 Sep 2018 20:00:21 +0000 (20:00 +0000)]
Fix a couple of mangling canonicalizer corner case bugs.

Summary:
The hash computed for an ArrayType was different when first constructed
versus when later profiled due to the constructor default argument, and
we were not tracking constructor / destructor variant as part of the
mangled name AST, leading to incorrect equivalences.

Reviewers: erik.pilkington

Subscribers: llvm-commits

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

llvm-svn: 342166

6 years agoSupport -fno-omit-frame-pointer with -pg.
Stephen Hines [Thu, 13 Sep 2018 19:50:02 +0000 (19:50 +0000)]
Support -fno-omit-frame-pointer with -pg.

Summary:
Previously, any instance of -fomit-frame-pointer would make it such that
-pg was an invalid flag combination. If -fno-omit-frame-pointer is
passed later on the command line (such that it actually takes effect),
-pg should be allowed.

Reviewers: nickdesaulniers

Reviewed By: nickdesaulniers

Subscribers: manojgupta, nickdesaulniers, cfe-commits, kongyi, chh, pirama

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

llvm-svn: 342165

6 years ago[hwasan] use a single Printf per line when printing a report (more friendly to androi...
Kostya Serebryany [Thu, 13 Sep 2018 19:14:22 +0000 (19:14 +0000)]
[hwasan] use a single Printf per line when printing a report (more friendly to android logging)

llvm-svn: 342164

6 years ago[InstCombine] Fold (xor (min/max X, Y), -1) -> (max/min ~X, ~Y) when X and Y are...
Craig Topper [Thu, 13 Sep 2018 18:52:58 +0000 (18:52 +0000)]
[InstCombine] Fold (xor (min/max X, Y), -1) -> (max/min ~X, ~Y) when X and Y are freely invertible.

This allows the xor to be removed completely.

This might help with recomitting r341674, but seems good regardless.

Coincidentally fixes PR38915.

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

llvm-svn: 342163

6 years ago[InstCombine] Add test cases for D51964. NFC
Craig Topper [Thu, 13 Sep 2018 18:52:56 +0000 (18:52 +0000)]
[InstCombine] Add test cases for D51964. NFC

llvm-svn: 342162

6 years agoCommon infrastructure for reading a profile remapping file and building
Richard Smith [Thu, 13 Sep 2018 18:51:44 +0000 (18:51 +0000)]
Common infrastructure for reading a profile remapping file and building
a mangling remapper from it.

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

llvm-svn: 342161

6 years ago [RISCV][MC] Reject bare symbols for the simm6 and simm6nonzero operand types
Ana Pazos [Thu, 13 Sep 2018 18:37:23 +0000 (18:37 +0000)]
 [RISCV][MC] Reject bare symbols for the simm6 and simm6nonzero operand types

Summary:
Fixed assertions due to invalid fixup when encoding compressed instructions
 (c.addi, c.addiw, c.li, c.andi) with bare symbols with/without modifiers.
  This matches GAS behavior as well.

This bug was uncovered by a LLVM MC Disassembler Protocol Buffer Fuzzer
for the RISC-V assembly language.

Reviewers: asb

Reviewed By: asb

Subscribers: rbar, johnrusso, simoncook, sabuasal, niosHD, kito-cheng, shiva0217, zzheng, edward-jones, mgrang, rogfer01, MartinMosbeck, brucehoult, the_o, rkruppe, PkmX, jocewei, asb

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

llvm-svn: 342160

6 years ago[RISCV] Fix decoding of invalid instruction with C extension enabled.
Ana Pazos [Thu, 13 Sep 2018 18:21:19 +0000 (18:21 +0000)]
[RISCV] Fix decoding of invalid instruction with C extension enabled.

Summary:
The illegal instruction 0x00 0x00 is being wrongly decoded as
c.addi4spn with 0 immediate.

The invalid instruction 0x01 0x61 is being wrongly decoded as
c.addi16sp with 0 immediate.

This bug was uncovered by a LLVM MC Disassembler Protocol Buffer Fuzzer
for the RISC-V assembly language.

Reviewers: asb

Reviewed By: asb

Subscribers: rbar, johnrusso, simoncook, sabuasal, niosHD, kito-cheng, shiva0217, zzheng, edward-jones, mgrang, rogfer01, MartinMosbeck, brucehoult, the_o, rkruppe, PkmX, jocewei, asb

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

llvm-svn: 342159

6 years agolld-link: For nonexisting inputs, omit follow-on diagnostics
Nico Weber [Thu, 13 Sep 2018 18:13:21 +0000 (18:13 +0000)]
lld-link: For nonexisting inputs, omit follow-on diagnostics

For lld-link missing.obj, lld-link currently prints:

  lld-link: error: could not open foo.obj: No such file or directory
  lld-link: warning: /machine is not specified. x64 is assumed
  lld-link: error: subsystem must be defined

The 2nd and 3rd diagnostics are consequences of the input not existing and are
not interesting. If input files are missing, the best thing we can do is point
that out and then return.

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

llvm-svn: 342158

6 years ago[WebAssembly] Fix signature of `main` in FixFunctionBitcasts
Sam Clegg [Thu, 13 Sep 2018 17:13:10 +0000 (17:13 +0000)]
[WebAssembly] Fix signature of `main` in FixFunctionBitcasts

Also, add a check to ensure that when main has the expected signature
we do not create a wrapper.

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

llvm-svn: 342157

6 years ago[AArch64] Add integer abs testcases for D51873.
Simon Pilgrim [Thu, 13 Sep 2018 17:11:25 +0000 (17:11 +0000)]
[AArch64] Add integer abs testcases for D51873.

llvm-svn: 342156

6 years ago[clangd] Introduce PostingList interface
Kirill Bobyrev [Thu, 13 Sep 2018 17:11:03 +0000 (17:11 +0000)]
[clangd] Introduce PostingList interface

This patch abstracts `PostingList` interface and reuses existing
implementation. It will be used later to test different `PostingList`
representations.

No functionality change is introduced, this patch is mostly refactoring
so that the following patches could focus on functionality while not
being too hard to review.

Reviewed By: sammccall, ioeric

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

llvm-svn: 342155

6 years ago[cmake] Fix missing DEPENDS.
Richard Diamond [Thu, 13 Sep 2018 17:10:44 +0000 (17:10 +0000)]
[cmake] Fix missing DEPENDS.

Not sure how I didn't catch this.

llvm-svn: 342154

6 years ago[LLDB] - Improved DWARF5 support.
George Rimar [Thu, 13 Sep 2018 17:06:47 +0000 (17:06 +0000)]
[LLDB] - Improved DWARF5 support.

This patch improves the support of DWARF5.
Particularly the reporting of source code locations.

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

llvm-svn: 342153

6 years ago[NFC]Refactor MultiVersion Resolver Emission to combine types
Erich Keane [Thu, 13 Sep 2018 16:58:24 +0000 (16:58 +0000)]
[NFC]Refactor MultiVersion Resolver Emission to combine types

Previously, both types (plus the future target-clones) of
multiversioning had a separate ResolverOption structure and emission
function.  This patch combines the two, at the expense of a slightly
more expensive sorting function.

llvm-svn: 342152

6 years ago[OPENMP] Fix PR38903: Crash on instantiation of the non-dependent
Alexey Bataev [Thu, 13 Sep 2018 16:54:05 +0000 (16:54 +0000)]
[OPENMP] Fix PR38903: Crash on instantiation of the non-dependent
declare reduction.

If the declare reduction construct with the non-dependent type is
defined in the template construct, the compiler might crash on the
template instantition. Reworked the whole instantiation scheme for the
declare reduction constructs to fix this problem correctly.

llvm-svn: 342151

6 years ago[cmake] Fix a unittest when `LLVM_LINK_LLVM_DYLIB` is requested.
Richard Diamond [Thu, 13 Sep 2018 16:39:52 +0000 (16:39 +0000)]
[cmake] Fix a unittest when `LLVM_LINK_LLVM_DYLIB` is requested.

llvm-svn: 342150

6 years ago[InstCombine] remove checks for IsFreeToInvert()
Sanjay Patel [Thu, 13 Sep 2018 16:18:12 +0000 (16:18 +0000)]
[InstCombine] remove checks for IsFreeToInvert()

I accidentally committed this diff with rL342147 because
I had applied D51964. We probably do need those checks,
but D51964 has tests and more discussion/motivation,
so they should be re-added with that patch.

llvm-svn: 342149

6 years agoRenovate CMake files in the `llvm-(cfi-verify|exegesis|mca)` tools.
Richard Diamond [Thu, 13 Sep 2018 16:15:03 +0000 (16:15 +0000)]
Renovate CMake files in the `llvm-(cfi-verify|exegesis|mca)` tools.

llvm-svn: 342148

6 years ago[InstCombine] reorder folds to reduce chance of infinite loops
Sanjay Patel [Thu, 13 Sep 2018 16:04:06 +0000 (16:04 +0000)]
[InstCombine] reorder folds to reduce chance of infinite loops

I don't have a test case for this, but it's motivated by
the discussion in D51964, and I've added TODO comments for
the better fix - move simplifications into instsimplify
because that's more efficient and reduces risk of infinite
loops in instcombine caused by transforms trying to do the
opposite folds.

In this case, we know that the transform that tries to move
'not' through min/max can be fooled by the multiple uses
of a value in another min/max, so try to squash the
foldSPFofSPF() patterns first.

llvm-svn: 342147

6 years ago[ELF] Guard --fix-cortex-a53-843419 against --just-syms
Peter Smith [Thu, 13 Sep 2018 15:49:13 +0000 (15:49 +0000)]
[ELF] Guard --fix-cortex-a53-843419 against --just-syms

If --just-syms is used the mapping symbols from the ELF file will be
absolute symbols with no section. The code to process mapping symbols in
--fix-cortex-a53-843419 assumes that these symbols have a defining section
so a crash will result when --just-syms is used. The simple fix is to not
process the symbol when it doesn't have a section.

Fixes PR37971

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

llvm-svn: 342146

6 years agoAdd missing REQUIRES x86 to test/COFF/icf-safe.s
Azharuddin Mohammed [Thu, 13 Sep 2018 15:40:19 +0000 (15:40 +0000)]
Add missing REQUIRES x86 to test/COFF/icf-safe.s

Reviewers: ruiu, pcc

Reviewed By: ruiu

Subscribers: llvm-commits

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

llvm-svn: 342145

6 years agoFix typo in error message. NFC.
Azharuddin Mohammed [Thu, 13 Sep 2018 15:37:13 +0000 (15:37 +0000)]
Fix typo in error message. NFC.

Summary: It should be "wasm-ld", not "wasm-lld".

Reviewers: ruiu

Reviewed By: ruiu

Subscribers: aheejin, sunfish, llvm-commits

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

llvm-svn: 342144

6 years ago[clangd] Fix Dexp build
Kirill Bobyrev [Thu, 13 Sep 2018 15:35:55 +0000 (15:35 +0000)]
[clangd] Fix Dexp build

%s/MaxCandidateCount/Limit/g after rL342138.

llvm-svn: 342143

6 years ago[DWARFExpression] Read literars as unsigned values.
Jonas Devlieghere [Thu, 13 Sep 2018 15:18:39 +0000 (15:18 +0000)]
[DWARFExpression] Read literars as unsigned values.

After landing r341457, we started seeing a failure on the swift-lldb
bots. The change was correct and pretty straightforward, a DW_OP_constu
was replaced with DW_OP_lit23, the value remaining identical.

  0x000000f4: DW_TAG_variable
DW_AT_location    (0x00000000
  [0x0000000100000a51,  0x0000000100000d47): DW_OP_lit23, DW_OP_stack_value)
DW_AT_name        ("number")

However, this broke LLDB.

  (Int) number = <extracting data from value failed>

The value was read correctly, but apparently the value's type was different.
When reading a constu it was reading a uint64 (m_type = e_ulonglong) while for
the literal, it got a signed int (m_type = e_sint). This change makes sure we
read the value as an unsigned.

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

llvm-svn: 342142

6 years ago[ARM] Allow truncs as sources in ARM CGP
Sam Parker [Thu, 13 Sep 2018 15:14:12 +0000 (15:14 +0000)]
[ARM] Allow truncs as sources in ARM CGP

We previously only allowed truncs as sinks, but now allow them as
sources too. We do this by checking that the result type is the
narrow type that we're trying to optimise for.

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

llvm-svn: 342141

6 years ago[ARM] Fix FixConst for ARMCodeGenPrepare
Sam Parker [Thu, 13 Sep 2018 14:48:10 +0000 (14:48 +0000)]
[ARM] Fix FixConst for ARMCodeGenPrepare

Part of FixConsts wrongly assumes either a 8- or 16-bit constant
which can result in the wrong constants being generated during
promotion.

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

llvm-svn: 342140

6 years agoPrint correctly dependency paths on Windows
David Bolvansky [Thu, 13 Sep 2018 14:27:32 +0000 (14:27 +0000)]
Print correctly dependency paths on Windows

Summary:
Before:
main.o: main.c ../include/lib\test.h

After:
main.o: main.c ../include/lib/test.h

Fixes PR38877

Reviewers: zturner

Subscribers: xbolva00, cfe-commits

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

llvm-svn: 342139

6 years ago[clangd] Cleanup FuzzyFindRequest filtering limit semantics
Kirill Bobyrev [Thu, 13 Sep 2018 14:27:03 +0000 (14:27 +0000)]
[clangd] Cleanup FuzzyFindRequest filtering limit semantics

As discussed during D51860 review, it is better to use `llvm::Optional`
here as it has clear semantics which reflect intended behavior.

Reviewed By: sammccall

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

llvm-svn: 342138

6 years ago[clangd] Use JSON format in benchmark requests reader
Kirill Bobyrev [Thu, 13 Sep 2018 14:21:50 +0000 (14:21 +0000)]
[clangd] Use JSON format in benchmark requests reader

After `FuzzyFindRequest` JSON (de)serialization was introduced, it
should replace ad-hoc fuzzy-find request parsing implemented in the
IndexBenchmark driver.

Reviewed By: ilya-biryukov

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

llvm-svn: 342137

6 years ago[MC/Dwarf] Unclamp DWARF linetables format on Darwin.
Jonas Devlieghere [Thu, 13 Sep 2018 13:13:50 +0000 (13:13 +0000)]
[MC/Dwarf] Unclamp DWARF linetables format on Darwin.

In r319995, we fixed the line table format to version 2 on Darwin
because dsymutil didn't yet understand the new format which caused test
failures for the LLDB bots. This has been resolved in the meantime so
there's no reason to keep this limitation.

rdar://problem/35968332

llvm-svn: 342136

6 years ago[clangd] Allow all LSP methods to signal cancellation via $/cancelRequest
Sam McCall [Thu, 13 Sep 2018 12:58:36 +0000 (12:58 +0000)]
[clangd] Allow all LSP methods to signal cancellation via $/cancelRequest

Summary:
The cancelable scopes are managed by JSONRPCDispatcher so that all Handlers
run in cancelable contexts.
(Previously ClangdServer did this, for code completion only).

Cancellation request processing is therefore also in JSONRPCDispatcher.
(Previously it was in ClangdLSPServer).

This doesn't actually make any new commands *respect* cancellation - they'd
need to check isCancelled() and bail out. But it opens the door to doing
this incrementally, and putting such logic in common machinery like TUScheduler.

I also rewrote the ClangdServer class/threading comments because I wanted to
add to it and I got carried away.

Reviewers: ilya-biryukov, kadircet

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

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

llvm-svn: 342135

6 years ago[clangd] Clarify and hide -index flag.
Eric Liu [Thu, 13 Sep 2018 12:53:23 +0000 (12:53 +0000)]
[clangd] Clarify and hide -index flag.

Summary:
The wording implies global index support, which is confusing.
As most users shouldn't care about this flag, also make it hidden to avoid
further confusion.

Reviewers: sammccall, ilya-biryukov

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

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

llvm-svn: 342134

6 years agoAMDGPU: Fix not preserving alignent in call setups
Matt Arsenault [Thu, 13 Sep 2018 12:14:31 +0000 (12:14 +0000)]
AMDGPU: Fix not preserving alignent in call setups

If an argument was passed on the stack, this
was using the default alignment.

I'm not sure there's an observable change from this. This
was observable due to bugs in expansion of unaligned
loads and stores, but since that is fixed I don't think
this matters much.

llvm-svn: 342133

6 years agoDAG: Fix expansion of unaligned FP loads and stores
Matt Arsenault [Thu, 13 Sep 2018 12:14:23 +0000 (12:14 +0000)]
DAG: Fix expansion of unaligned FP loads and stores

This was trying to scalarizing a scalar FP type,
resulting in an assert.

Fixes unaligned f64 stack stores for AMDGPU.

llvm-svn: 342132

6 years agoAMDGPU: Fix some outdated datalayouts in tests
Matt Arsenault [Thu, 13 Sep 2018 11:56:28 +0000 (11:56 +0000)]
AMDGPU: Fix some outdated datalayouts in tests

llvm-svn: 342131

6 years ago[clangd] Simplify cancellation public API
Sam McCall [Thu, 13 Sep 2018 11:47:48 +0000 (11:47 +0000)]
[clangd] Simplify cancellation public API

Summary:
Task is no longer exposed:
 - task cancellation is hidden as a std::function
 - task creation returns the new context directly
 - checking is via free function only, with no way to avoid the context lookup
The implementation is essentially the same, but a bit terser as it's hidden.

isCancelled() is now safe to use outside any task (it returns false).
This will leave us free to sprinkle cancellation in e.g. TUScheduler without
needing elaborate test setup, and lets callers that don't cancel "just work".

Updated the docs to describe the new expected use pattern.
One thing I noticed: there's nothing async-specific about the cancellation.
Async tasks can be cancelled from any thread (typically the one that created
them), sync tasks can be cancelled from any *other* thread in the same way.
So the docs now refer to "long-running" tasks instead of async ones.

Updated usage in code complete, without any structural changes.
I didn't update all the names of the helpers in ClangdLSPServer (these will
likely be moved to JSONRPCDispatcher anyway).

Reviewers: ilya-biryukov, kadircet

Subscribers: ioeric, MaskRay, jkorous, arphaman, jfb, cfe-commits

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

llvm-svn: 342130

6 years ago[docs] Provide pointers to known editor plugins and extensions
Kirill Bobyrev [Thu, 13 Sep 2018 11:40:12 +0000 (11:40 +0000)]
[docs] Provide pointers to known editor plugins and extensions

Many editors provide extensions and plugins with LSP Client
functionality. Many of these are known to work with Clangd, this patch
points users to the relevant resources for better experience.

Reviewed By: ioeric, ilya-biryukov

Differential Revision

llvm-svn: 342129

6 years agoFix unused variable warning. NFCI.
Simon Pilgrim [Thu, 13 Sep 2018 10:54:23 +0000 (10:54 +0000)]
Fix unused variable warning. NFCI.

llvm-svn: 342128

6 years agoARM: align loops to 4 bytes on Cortex-M3 and Cortex-M4.
Tim Northover [Thu, 13 Sep 2018 10:28:05 +0000 (10:28 +0000)]
ARM: align loops to 4 bytes on Cortex-M3 and Cortex-M4.

The Technical Reference Manuals for these two CPUs state that branching
to an unaligned 32-bit instruction incurs an extra pipeline reload
penalty. That's bad.

This also enables the optimization at -Os since it costs on average one
byte per loop in return for 1 cycle per iteration, which is pretty good
going.

llvm-svn: 342127

6 years ago[AArch64] Enable return address signing for static ctors
Oliver Stannard [Thu, 13 Sep 2018 10:25:36 +0000 (10:25 +0000)]
[AArch64] Enable return address signing for static ctors

Functions generated by clang and included in the .init_array section (such as
static constructors) do not follow the usual code path for adding
target-specific function attributes, so we have to add the return address
signing attribute here too, as is currently done for the sanitisers.

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

llvm-svn: 342126

6 years agoFix MSVC "illegal conversion; more than one user-defined conversion has been implicit...
Simon Pilgrim [Thu, 13 Sep 2018 10:10:18 +0000 (10:10 +0000)]
Fix MSVC "illegal conversion; more than one user-defined conversion has been implicitly applied" warning. NFCI.

llvm-svn: 342125

6 years ago[clangd] Don't create child AND and OR iterators with one posting list
Kirill Bobyrev [Thu, 13 Sep 2018 10:02:48 +0000 (10:02 +0000)]
[clangd] Don't create child AND and OR iterators with one posting list

`AND( AND( Child ) ... )` -> `AND( Child ... )`
`AND( OR( Child ) ... )` -> `AND( Child ... )`

This simple optimization results in 5-6% performance improvement in the
benchmark with 2000 serialized `FuzzyFindRequest`s.

Reviewed By: ilya-biryukov

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

llvm-svn: 342124

6 years ago[clangd] Rename global-symbol-builder to clangd-indexer.
Ilya Biryukov [Thu, 13 Sep 2018 09:44:11 +0000 (09:44 +0000)]
[clangd] Rename global-symbol-builder to clangd-indexer.

Summary:
Given that the indexer binary is put directly into ./bin directory
when built, 'clangd-' prefix seems to provide better context to the
reader than 'global-'.

The new name is also shorter and easier to type.

Reviewers: ioeric, sammccall, kadircet

Reviewed By: ioeric, sammccall

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

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

llvm-svn: 342123

6 years ago[XRay] Bug fixes for FDR custom event and arg-logging
Dean Michael Berris [Thu, 13 Sep 2018 09:25:42 +0000 (09:25 +0000)]
[XRay] Bug fixes for FDR custom event and arg-logging

Summary:
This change has a number of fixes for FDR mode in compiler-rt along with
changes to the tooling handling the traces in llvm.

In the runtime, we do the following:

- Advance the "last record" pointer appropriately when writing the
  custom event data in the log.

- Add XRAY_NEVER_INSTRUMENT in the rewinding routine.

- When collecting the argument of functions appropriately marked, we
  should not attempt to rewind them (and reset the counts of functions
  that can be re-wound).

In the tooling, we do the following:

- Remove the state logic in BlockIndexer and instead rely on the
  presence/absence of records to indicate blocks.

- Move the verifier into a loop associated with each block.

Reviewers: mboerger, eizan

Subscribers: llvm-commits, hiraditya

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

llvm-svn: 342122

6 years agoRemove byte counting from SourceManager [NFC]
Raphael Isemann [Thu, 13 Sep 2018 09:19:40 +0000 (09:19 +0000)]
Remove byte counting from SourceManager [NFC]

Summary:
Similar to what we did in D50681, we now stop manually byte counting here
in the SourceManager.

Reviewers: #lldb, JDevlieghere

Reviewed By: #lldb, JDevlieghere

Subscribers: JDevlieghere, abidh, lldb-commits

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

llvm-svn: 342121