platform/upstream/llvm.git
7 years ago[OMPT] Align implementation of reenter frame address to latest (frozen) version of...
Jonas Hahnfeld [Wed, 14 Sep 2016 13:59:13 +0000 (13:59 +0000)]
[OMPT] Align implementation of reenter frame address to latest (frozen) version of OMPT spec

The latest OMPT spec changed the semantic of a tasks reenter frame to be the application frame, that will be entered, when the runtime frame drops.
Before it was the last frame in the runtime. This doesn't work for some gcc execution pathes or even clang generated code for :
Since there is no runtime frame between the executed task and the encountering task.

The test case compares exit and reenter addresses against addresses captured in application code

Patch by Joachim Protze!

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

llvm-svn: 281464

7 years ago[OMPT] extend ompt tests by checks for frame pointers
Jonas Hahnfeld [Wed, 14 Sep 2016 13:59:05 +0000 (13:59 +0000)]
[OMPT] extend ompt tests by checks for frame pointers

OMPT tests can check for right frame information of tasks:
 * parent_task_frame was directly printed as a pointer, but actually points to a struct ompt_frame {void*, void*}
 * NULL is printed in the beginning of execution and loaded to FileChecker variable [[NULL]]
 * implicit tasks now also print their frame information
 * macro to print frame address from application
 * print task info for barrier begin

Patch by Joachim Protze!

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

llvm-svn: 281463

7 years ago[tsan] Fix hanging gcd-apply and gcd-apply-race tests on macOS Sierra
Kuba Brecka [Wed, 14 Sep 2016 13:53:06 +0000 (13:53 +0000)]
[tsan] Fix hanging gcd-apply and gcd-apply-race tests on macOS Sierra

llvm-svn: 281462

7 years ago[cmake] Support overriding llvm-config query results
Michal Gorny [Wed, 14 Sep 2016 13:42:31 +0000 (13:42 +0000)]
[cmake] Support overriding llvm-config query results

Support overriding LLVM_* variables obtained from llvm-config when doing
stand-alone builds. The override of LLVM_MAIN_SRC_DIR is necessary to
provide LLVM sources when the initial directory used to build LLVM does
no longer exist when compiler-rt is built stand-alone. This is
especially the case when building the projects separately in temporary
directories with unpredictable names.

The code is based on existing CMakeLists.txt from clang. Alike clang, it
extends the override to all queried variables.

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

llvm-svn: 281461

7 years ago[clang-tidy] Add dependency on clangAnalysis to clangTidyMiscModule
Martin Bohme [Wed, 14 Sep 2016 13:33:11 +0000 (13:33 +0000)]
[clang-tidy] Add dependency on clangAnalysis to clangTidyMiscModule

Summary:
This is needed for the recently submitted misc-use-after-move check (rL281453).
For some reason, this still built under Linux, but it caused the PPC build bot
to fail.

Subscribers: beanz, cfe-commits, mgorny

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

llvm-svn: 281460

7 years agoreverting r281456
Kirill Bobyrev [Wed, 14 Sep 2016 13:23:14 +0000 (13:23 +0000)]
reverting r281456

llvm-svn: 281459

7 years ago[ELF] - Implemented --section-start, -Ttext, -Tdata, -Tbss options.
George Rimar [Wed, 14 Sep 2016 13:07:13 +0000 (13:07 +0000)]
[ELF] - Implemented --section-start, -Ttext, -Tdata, -Tbss options.

--section-start=sectionname=org
Locate a section in the output file at the absolute address given by org.
You may use this option as many times as necessary to locate multiple sections in the command line.
 org must be a single hexadecimal integer; for compatibility with other linkers,
you may omit the leading `0x' usually associated with hexadecimal values.
Note: there should be no white space between sectionname, the equals sign (“<=>”), and org.

-Tbss=org
-Tdata=org
-Ttext=org
Same as --section-start, with .bss, .data or .text as the sectionname.

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

llvm-svn: 281458

7 years agoSupports adding insertion around non-insertion replacements.
Eric Liu [Wed, 14 Sep 2016 13:04:51 +0000 (13:04 +0000)]
Supports adding insertion around non-insertion replacements.

Summary:
Extend `tooling::Replacements::add()` to support adding order-independent replacements.

Two replacements are considered order-independent if one of the following conditions is true:
  - They do not overlap. (This is already supported.)
  - One replacement is insertion, and the other is a replacement with
    length > 0, and the insertion is adjecent to but not contained in the
    other replacement. In this case, the replacement should always change
    the original code instead of the inserted text.

Reviewers: klimek, djasper

Subscribers: cfe-commits, klimek

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

llvm-svn: 281457

7 years ago[clang-rename] Merge rename-{at|all} & optimize.
Kirill Bobyrev [Wed, 14 Sep 2016 13:00:36 +0000 (13:00 +0000)]
[clang-rename] Merge rename-{at|all} & optimize.

Having both rename-at and rename-all both seems confusing and introduces
unneeded difficulties. Allowing to use both -qualified-name and -offset at once
while performing efficient renamings seems like a feature, too. Maintaining main
function wrappers and custom help becomes redundant while CLI becomes less
confusing.

Reviewers: alexfh

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

llvm-svn: 281456

7 years ago[clang-tidy] Make test for misc-use-after-move pass under Windows
Martin Bohme [Wed, 14 Sep 2016 12:22:35 +0000 (12:22 +0000)]
[clang-tidy] Make test for misc-use-after-move pass under Windows

Summary: Adds -fno-delayed-template-parsing

Reviewers: alexfh

Subscribers: cfe-commits

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

llvm-svn: 281455

7 years agoUse murmurhash2 instead of fnv.
Rafael Espindola [Wed, 14 Sep 2016 11:32:57 +0000 (11:32 +0000)]
Use murmurhash2 instead of fnv.

It is substantially faster by processing 8 bytes at a time.

llvm-svn: 281454

7 years ago[clang-tidy] Add check 'misc-use-after-move'
Martin Bohme [Wed, 14 Sep 2016 10:29:32 +0000 (10:29 +0000)]
[clang-tidy] Add check 'misc-use-after-move'

Summary:
The check warns if an object is used after it has been moved, without an
intervening reinitialization.

See user-facing documentation for details.

Reviewers: sbenza, Prazek, alexfh

Subscribers: beanz, mgorny, shadeware, omtcyfz, Eugene.Zelenko, Prazek, fowles, ioeric, cfe-commits

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

llvm-svn: 281453

7 years agoRevert "[modules] When merging one definition into another, propagate the list of...
Eric Liu [Wed, 14 Sep 2016 10:05:10 +0000 (10:05 +0000)]
Revert "[modules] When merging one definition into another, propagate the list of re-exporting modules from the discarded definition to the retained definition."

This reverts commit r281429.

llvm-svn: 281452

7 years agoRevert "[Thumb] Teach ISel how to lower compares of AND bitmasks efficiently"
James Molloy [Wed, 14 Sep 2016 09:45:28 +0000 (09:45 +0000)]
Revert "[Thumb] Teach ISel how to lower compares of AND bitmasks efficiently"

This reverts commit r281323. It caused chromium test failures and a selfhost failure.

llvm-svn: 281451

7 years agoMissing includes.
Vassil Vassilev [Wed, 14 Sep 2016 08:55:18 +0000 (08:55 +0000)]
Missing includes.

llvm-svn: 281450

7 years ago[ELF] Replace HasContents with HasSections. NFC
Eugene Leviant [Wed, 14 Sep 2016 08:32:36 +0000 (08:32 +0000)]
[ELF] Replace HasContents with HasSections. NFC

llvm-svn: 281449

7 years agoGlobalISel: mark pointer stores as legal on AArch64.
Tim Northover [Wed, 14 Sep 2016 08:28:54 +0000 (08:28 +0000)]
GlobalISel: mark pointer stores as legal on AArch64.

llvm-svn: 281448

7 years agoThis reapplies r281304. The issue was that I had missed
Sjoerd Meijer [Wed, 14 Sep 2016 08:20:03 +0000 (08:20 +0000)]
This reapplies r281304. The issue was that I had missed
to copy the new isAdd field in the tablegen data structure.

llvm-svn: 281447

7 years agoAVX-512: Fixed a bug in kortest.z intrinsic
Elena Demikhovsky [Wed, 14 Sep 2016 08:06:54 +0000 (08:06 +0000)]
AVX-512: Fixed a bug in kortest.z intrinsic

Lowering was wrong - X86ISD::SETCC node should return i8 type.

llvm-svn: 281446

7 years ago[AVX512BW] Change truncStore action (v16i16->v16i18). It can be legal only with AVX512VL.
Igor Breger [Wed, 14 Sep 2016 08:04:28 +0000 (08:04 +0000)]
[AVX512BW] Change truncStore action (v16i16->v16i18). It can be legal only with AVX512VL.

Differential Revision: http://reviews.llvm.org/D24547

llvm-svn: 281445

7 years ago[asan] Reify ErrorStringFunctionSizeOverflow
Filipe Cabecinhas [Wed, 14 Sep 2016 07:37:20 +0000 (07:37 +0000)]
[asan] Reify ErrorStringFunctionSizeOverflow

Summary: Continuing implementation mentioned in this thread: http://lists.llvm.org/pipermail/llvm-dev/2016-July/101933.html

Reviewers: kcc, eugenis, vitalybuka

Subscribers: llvm-commits, kubabrecka

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

llvm-svn: 281444

7 years ago[asan] Reify ErrorStringFunctionMemoryRangesOverlap
Filipe Cabecinhas [Wed, 14 Sep 2016 07:37:14 +0000 (07:37 +0000)]
[asan] Reify ErrorStringFunctionMemoryRangesOverlap

Summary: Continuing implementation mentioned in this thread: http://lists.llvm.org/pipermail/llvm-dev/2016-July/101933.html

Reviewers: kcc, eugenis, vitalybuka

Subscribers: kubabrecka, llvm-commits

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

llvm-svn: 281443

7 years ago[X86] Remove the VCVTSI2SD32 with rounding intrinsic. It's not used by clang and...
Craig Topper [Wed, 14 Sep 2016 06:27:46 +0000 (06:27 +0000)]
[X86] Remove the VCVTSI2SD32 with rounding intrinsic. It's not used by clang and not needed since 32-bit integer to double is always exact.

llvm-svn: 281442

7 years agoPerform copying to created arrays according to the packing transformation
Roman Gareev [Wed, 14 Sep 2016 06:26:09 +0000 (06:26 +0000)]
Perform copying to created arrays according to the packing transformation

This is the fourth patch to apply the BLIS matmul optimization pattern on matmul
kernels (http://www.cs.utexas.edu/users/flame/pubs/TOMS-BLIS-Analytical.pdf).
BLIS implements gemm as three nested loops around a macro-kernel, plus two
packing routines. The macro-kernel is implemented in terms of two additional
loops around a micro-kernel. The micro-kernel is a loop around a rank-1
(i.e., outer product) update. In this change we perform copying to created
arrays, which is the last step to implement the packing transformation.

Reviewed-by: Tobias Grosser <tobias@grosser.es>
Differential Revision: https://reviews.llvm.org/D23260

llvm-svn: 281441

7 years agoDocument option '-rtlib' in clang's man page and help info
Jonas Hahnfeld [Wed, 14 Sep 2016 05:52:21 +0000 (05:52 +0000)]
Document option '-rtlib' in clang's man page and help info

This patch adds an entry for "-rtlib" in the output of `man clang` and `clang -help`.

Patch by Lei Zhang!

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

llvm-svn: 281440

7 years agoCreate a getelementptr instead of sub expr for ValueOffsetPair if the
Wei Mi [Wed, 14 Sep 2016 04:39:50 +0000 (04:39 +0000)]
Create a getelementptr instead of sub expr for ValueOffsetPair if the
value is a pointer.

This patch is to fix PR30213. When expanding an expr based on ValueOffsetPair,
if the value is of pointer type, we can only create a getelementptr instead
of sub expr.

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

llvm-svn: 281439

7 years agoEnsure Polly linking works without BUILD_SHARED_LIBS
Tobias Grosser [Wed, 14 Sep 2016 03:09:48 +0000 (03:09 +0000)]
Ensure Polly linking works without BUILD_SHARED_LIBS

This change ensures all necessary symbols are resolved correctly. Before this
change on some systems, the linker may have eliminated some symbols not directly
used in bugpoint, but used in Polly.

Suggested-by: Michael Kruse <lvm@meinersbur.de>
llvm-svn: 281438

7 years agogold: Simplify. Do not unnecessarily enumerate Obj's symbols.
Peter Collingbourne [Wed, 14 Sep 2016 02:55:16 +0000 (02:55 +0000)]
gold: Simplify. Do not unnecessarily enumerate Obj's symbols.

llvm-svn: 281437

7 years ago[docs] Fix formatting of &nbsp; characters so that tables line up properly. Add
Richard Smith [Wed, 14 Sep 2016 02:24:50 +0000 (02:24 +0000)]
[docs] Fix formatting of &nbsp; characters so that tables line up properly. Add
padding around table cells so the borders of adjacent tables don't run into
each other (now that they're perfectly aligned).

llvm-svn: 281436

7 years ago[libFuzzer] start using trace-pc-guard as an alternative source of coverage
Kostya Serebryany [Wed, 14 Sep 2016 02:13:06 +0000 (02:13 +0000)]
[libFuzzer] start using trace-pc-guard as an alternative source of coverage

llvm-svn: 281435

7 years ago[docs] Order diagnostic cross-references alphabetically rather than based on
Richard Smith [Wed, 14 Sep 2016 01:55:42 +0000 (01:55 +0000)]
[docs] Order diagnostic cross-references alphabetically rather than based on
order in the .td file.

llvm-svn: 281434

7 years agoUpdate DiagnosticsReference and fix emitter to emit -Wpedantic diagnostics and groups...
Richard Smith [Wed, 14 Sep 2016 01:51:10 +0000 (01:51 +0000)]
Update DiagnosticsReference and fix emitter to emit -Wpedantic diagnostics and groups in a deterministic order.

llvm-svn: 281433

7 years ago[sanitizer-coverage] add yet another flavour of coverage instrumentation: trace-pc...
Kostya Serebryany [Wed, 14 Sep 2016 01:39:49 +0000 (01:39 +0000)]
[sanitizer-coverage] add yet another flavour of coverage instrumentation: trace-pc-guard. The intent is to eventually replace all of {bool coverage, 8bit-counters, trace-pc} with just this one. Clang part

llvm-svn: 281432

7 years ago[sanitizer-coverage] add yet another flavour of coverage instrumentation: trace-pc...
Kostya Serebryany [Wed, 14 Sep 2016 01:39:35 +0000 (01:39 +0000)]
[sanitizer-coverage] add yet another flavour of coverage instrumentation: trace-pc-guard. The intent is to eventually replace all of {bool coverage, 8bit-counters, trace-pc} with just this one. LLVM part

llvm-svn: 281431

7 years agoFollow-up to r281367: Compare uuids case-insensitively.
Nico Weber [Wed, 14 Sep 2016 01:16:54 +0000 (01:16 +0000)]
Follow-up to r281367: Compare uuids case-insensitively.

llvm-svn: 281430

7 years ago[modules] When merging one definition into another, propagate the list of
Richard Smith [Wed, 14 Sep 2016 01:05:35 +0000 (01:05 +0000)]
[modules] When merging one definition into another, propagate the list of
re-exporting modules from the discarded definition to the retained definition.

llvm-svn: 281429

7 years agoCleaned up the code that handles function return addresses in "frame diagnose."
Sean Callanan [Wed, 14 Sep 2016 00:48:19 +0000 (00:48 +0000)]
Cleaned up the code that handles function return addresses in "frame diagnose."

llvm-svn: 281428

7 years agoColor warnings purple rather than orange, to match actual Clang output.
Richard Smith [Wed, 14 Sep 2016 00:35:56 +0000 (00:35 +0000)]
Color warnings purple rather than orange, to match actual Clang output.

llvm-svn: 281427

7 years agoTurn a no-op assignment into an assertion.
Rui Ueyama [Wed, 14 Sep 2016 00:09:50 +0000 (00:09 +0000)]
Turn a no-op assignment into an assertion.

r279456 guarantees that this condition is always satisfied.

llvm-svn: 281426

7 years agoSimplify InputFile ownership management.
Rui Ueyama [Wed, 14 Sep 2016 00:05:51 +0000 (00:05 +0000)]
Simplify InputFile ownership management.

Previously, all input files were owned by the symbol table.
Files were created at various places, such as the Driver, the lazy
symbols, or the bitcode compiler, and the ownership of new files
was transferred to the symbol table using std::unique_ptr.
All input files were then free'd when the symbol table is freed
which is on program exit.

I think we don't have to transfer ownership just to free all
instance at once on exit.

In this patch, all instances are automatically collected to a
vector and freed on exit. In this way, we no longer have to
use std::unique_ptr.

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

llvm-svn: 281425

7 years ago[SE] Pack global dev handle addresses
Jason Henline [Tue, 13 Sep 2016 23:59:10 +0000 (23:59 +0000)]
[SE] Pack global dev handle addresses

Summary:
We were packing global device memory handles in
`PackedKernelArgumentArray`, but as I was implementing the CUDA
platform, I realized that CUDA wants the address of the handle, not the
handle itself. So this patch switches to packing the address of the
handle.

Reviewers: jlebar

Subscribers: jprice, jlebar, parallel_libs-commits

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

llvm-svn: 281424

7 years agoDevice doc says device is small
Jason Henline [Tue, 13 Sep 2016 23:56:47 +0000 (23:56 +0000)]
Device doc says device is small

llvm-svn: 281423

7 years ago[SE] Platforms return Device values
Jason Henline [Tue, 13 Sep 2016 23:56:46 +0000 (23:56 +0000)]
[SE] Platforms return Device values

Summary:
Platforms were returning Device pointers, but a Device is now basically
just a pointer to an underlying PlatformDevice, so we will now just pass
it around as a value.

Reviewers: jlebar

Subscribers: jprice, jlebar, parallel_libs-commits

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

llvm-svn: 281422

7 years agoAddress Pete's review comment and define OrigArg on its own line.
Akira Hatanaka [Tue, 13 Sep 2016 23:53:43 +0000 (23:53 +0000)]
Address Pete's review comment and define OrigArg on its own line.

This is a follow-up to r281419.

llvm-svn: 281421

7 years agoForce c++14 when running tests on Windows.
Zachary Turner [Tue, 13 Sep 2016 23:45:11 +0000 (23:45 +0000)]
Force c++14 when running tests on Windows.

VS 2015 and higher begin making use of c++14 in their standard
library headers.  As such, -std=c++11 makes it so you can't compile
trivial programs.  Bump this to -std=c++14 when this situation is
detected.

llvm-svn: 281420

7 years ago[ObjCARC] Traverse chain downwards to replace uses of argument passed to
Akira Hatanaka [Tue, 13 Sep 2016 23:43:11 +0000 (23:43 +0000)]
[ObjCARC] Traverse chain downwards to replace uses of argument passed to
ObjC library call with call return.

ARC contraction tries to replace uses of an argument passed to an
objective-c library call with the call return value. For example, in the
following IR, it replaces uses of argument %9 and uses of the values
discovered traversing the chain upwards (%7 and %8) with the call return
%10, if they are dominated by the call to @objc_autoreleaseReturnValue.
This transformation enables code-gen to tail-call the call to
@objc_autoreleaseReturnValue, which is necessary to enable auto release
return value optimization.

%7 = tail call i8* @objc_loadWeakRetained(i8** %6)
%8 = bitcast i8* %7 to %0*
%9 = bitcast %0* %8 to i8*
%10 = tail call i8* @objc_autoreleaseReturnValue(i8* %9)
ret %0* %8

Since r276727, llvm started removing redundant bitcasts and as a result
started feeding the following IR to ARC contraction:

%7 = tail call i8* @objc_loadWeakRetained(i8** %6)
%8 = bitcast i8* %7 to %0*
%9 = tail call i8* @objc_autoreleaseReturnValue(i8* %7)
ret %0* %8

ARC contraction no longer does the optimization described above since it
only traverses the chain upwards and fails to recognize that the
function return can be replaced by the call return. This commit changes
ARC contraction to traverse the chain downwards too and replace uses of
bitcasts with the call return.

rdar://problem/28011339

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

llvm-svn: 281419

7 years agoTestQueues could error out because the one second sleep main.c was
Jason Molenda [Tue, 13 Sep 2016 23:29:46 +0000 (23:29 +0000)]
TestQueues could error out because the one second sleep main.c was
using to enqueue all the jobs wasn't enough time on a slow/overloaded
system.  Instead use a global to indicate when all the work has
been enqueued, let's see if this makes the CIs work more reliably.

llvm-svn: 281418

7 years ago[SE] KernelSpec return best PTX
Jason Henline [Tue, 13 Sep 2016 23:29:25 +0000 (23:29 +0000)]
[SE] KernelSpec return best PTX

Summary:
Before, the kernel spec would only return PTX for exactly the requested
compute capability. With this patch it will now return the PTX with the
largest compute capability that does not exceed that requested compute
capability.

Reviewers: jlebar

Subscribers: jprice, jlebar, parallel_libs-commits

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

llvm-svn: 281417

7 years agoMissed update from r281412.
Richard Smith [Tue, 13 Sep 2016 23:03:41 +0000 (23:03 +0000)]
Missed update from r281412.

llvm-svn: 281415

7 years ago[llvm-cov] Just emit the version number in the index file
Vedant Kumar [Tue, 13 Sep 2016 23:00:13 +0000 (23:00 +0000)]
[llvm-cov] Just emit the version number in the index file

Having the version information in every view is distracting, especially
if there are several sub-views.

llvm-svn: 281414

7 years agoAlso don't inline dllimport functions referring to non-dllimport constructors.
Hans Wennborg [Tue, 13 Sep 2016 22:51:42 +0000 (22:51 +0000)]
Also don't inline dllimport functions referring to non-dllimport constructors.

The AST walker wasn't visiting CXXConstructExprs before.

This is a follow-up to r281395.

llvm-svn: 281413

7 years agoWarning flag updates:
Richard Smith [Tue, 13 Sep 2016 22:51:09 +0000 (22:51 +0000)]
Warning flag updates:
-Wdiv-by-zero may as well be an alias for -Wdivision-by-zero rather than a GCC-compatibility no-op.
-Wno-shadow should disable -Wshadow-ivar.
-Weffc++ may as well enable -Wnon-virtual-dtor like it does in GCC.

llvm-svn: 281412

7 years agorevert: [ELF] - Versionscript: support mangled symbols with the same name.
George Rimar [Tue, 13 Sep 2016 22:26:12 +0000 (22:26 +0000)]
revert: [ELF] - Versionscript: support mangled symbols with the same name.

Something broked BBots:
281318 failed on step 9:
http://lab.llvm.org:8011/builders/clang-with-lto-ubuntu/builds/413

r281317 built step 9 green:
http://lab.llvm.org:8011/builders/clang-with-lto-ubuntu/builds/415

Initial revision commits were:
This is PR30312. Info from bug page:

Both of these symbols demangle to abc::abc():
_ZN3abcC1Ev
_ZN3abcC2Ev
(These would be abc's complete object constructor and base object constructor, respectively.)
however with "abc::abc()" in the version script only one of the two receives the symbol version.

Patch fixes that.
It uses testcase created by Ed Maste (D24306).

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

llvm-svn: 281411

7 years ago[asan] alloc_dealloc_mismatch=0 by default on Android.
Evgeniy Stepanov [Tue, 13 Sep 2016 22:25:44 +0000 (22:25 +0000)]
[asan] alloc_dealloc_mismatch=0 by default on Android.

All known (to me) Android deployments are disabling this flag anyway.
The in-tree script (asan_device_setup) does that, too.

llvm-svn: 281410

7 years ago[asan] Remove lit -j5 flag for android tests.
Evgeniy Stepanov [Tue, 13 Sep 2016 22:25:41 +0000 (22:25 +0000)]
[asan] Remove lit -j5 flag for android tests.

It makes the tests extremely slow due to high latency of the test launcher.
The main reason for -j5 was high memory usage with handle_abort=1, which
is now disabled in the test runner.

llvm-svn: 281409

7 years agoFix a FIXME about MSVC 2013 in the diagnostic doc generation code
Reid Kleckner [Tue, 13 Sep 2016 22:22:56 +0000 (22:22 +0000)]
Fix a FIXME about MSVC 2013 in the diagnostic doc generation code

Ultimately it boiled down to adding a move constructor.

llvm-svn: 281408

7 years ago[AArch64] Simplify patchpoint/stackmap size test (r281301). NFC.
Ahmed Bougacha [Tue, 13 Sep 2016 22:16:40 +0000 (22:16 +0000)]
[AArch64] Simplify patchpoint/stackmap size test (r281301). NFC.

llvm-svn: 281407

7 years ago[CUDA] Do not merge CUDA target attributes.
Artem Belevich [Tue, 13 Sep 2016 22:16:30 +0000 (22:16 +0000)]
[CUDA] Do not merge CUDA target attributes.

CUDA target attributes are used for function overloading and must not be merged.

This fixes a bug where attributes were inherited during function template
specialization in CUDA and made it impossible for specialized function
to provide its own target attributes.

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

llvm-svn: 281406

7 years ago[CodeGen] Fix an assert in EmitNullConstant.
Akira Hatanaka [Tue, 13 Sep 2016 22:13:02 +0000 (22:13 +0000)]
[CodeGen] Fix an assert in EmitNullConstant.

r235815 changed CGRecordLowering::accumulateBases to ignore non-virtual
bases of size 0, which prevented adding those non-virtual bases to
CGRecordLayout's NonVirtualBases. This caused clang to assert when
CGRecordLayout::getNonVirtualBaseLLVMFieldNo was called in
EmitNullConstant. This commit fixes the bug by ignoring zero-sized
non-virtual bases in EmitNullConstant.

rdar://problem/28100139

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

llvm-svn: 281405

7 years agoObjectiveC Generics: follow-up commit to r281355.
Manman Ren [Tue, 13 Sep 2016 21:57:28 +0000 (21:57 +0000)]
ObjectiveC Generics: follow-up commit to r281355.

Correct getExtraLocalDataSize for ObjCTypeParamTypeLoc.

rdar://24619481
rdar://25060179

llvm-svn: 281404

7 years ago[CodeGen] Fix invalid shift in mul expansion
Pawel Bylica [Tue, 13 Sep 2016 21:55:41 +0000 (21:55 +0000)]
[CodeGen] Fix invalid shift in mul expansion

Summary: When expanding mul in type legalization make sure the type for shift amount can actually fit the value. This fixes PR30354 https://llvm.org/bugs/show_bug.cgi?id=30354.

Reviewers: hfinkel, majnemer, RKSimon

Subscribers: RKSimon, llvm-commits

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

llvm-svn: 281403

7 years ago[DAG] Allow build-to-shuffle combine to combine builds from two wide vectors.
Michael Kuperstein [Tue, 13 Sep 2016 21:53:32 +0000 (21:53 +0000)]
[DAG] Allow build-to-shuffle combine to combine builds from two wide vectors.

This allows us to, in some cases, create a vector_shuffle out of a build_vector, when
the inputs to the build are extract_elements from two different vectors, at least one
of which is wider than the output. (E.g. a <8 x i16> being constructed out of
elements from a <16 x i16> and a <8 x i16>).

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

llvm-svn: 281402

7 years agoTemporary fix for MS _Interlocked intrinsics
Albert Gutowski [Tue, 13 Sep 2016 21:51:37 +0000 (21:51 +0000)]
Temporary fix for MS _Interlocked intrinsics

llvm-svn: 281401

7 years agoNext set of additional error checks for invalid Mach-O files for bad load commands
Kevin Enderby [Tue, 13 Sep 2016 21:42:28 +0000 (21:42 +0000)]
Next set of additional error checks for invalid Mach-O files for bad load commands
that use the Mach::dyld_info_command type for the load commands that are
currently use in the MachOObjectFile constructor.

This contains the missing checks for LC_DYLD_INFO and
LC_DYLD_INFO_ONLY load commands and the fields for the
Mach::dyld_info_command type.

llvm-svn: 281400

7 years agoReverse commit 281375 (breaks building Chromium)
Albert Gutowski [Tue, 13 Sep 2016 21:24:51 +0000 (21:24 +0000)]
Reverse commit 281375 (breaks building Chromium)

llvm-svn: 281399

7 years agoCleaned up some of the "frame diagnose" code to use Operands as currency.
Sean Callanan [Tue, 13 Sep 2016 21:18:27 +0000 (21:18 +0000)]
Cleaned up some of the "frame diagnose" code to use Operands as currency.

Also added some utility functions around Operands to make code easier and more
compact to write.

llvm-svn: 281398

7 years ago[Hexagon] Better handling of HVX vector lowering
Krzysztof Parzyszek [Tue, 13 Sep 2016 21:16:07 +0000 (21:16 +0000)]
[Hexagon] Better handling of HVX vector lowering

- Expand SELECT_CC and BR_CC for vector types.
- Implement TLI::isShuffleMaskLegal.

llvm-svn: 281397

7 years agocmake: PollyPPCG depends on PollyISL
Tobias Grosser [Tue, 13 Sep 2016 21:09:35 +0000 (21:09 +0000)]
cmake: PollyPPCG depends on PollyISL

This line makes BUILD_SHARED_LIBS=ON work for Polly-ACC. Without it, ld
complains about missing isl symbols when constructing the shared library.

llvm-svn: 281396

7 years agoTry harder to not inline dllimport functions referencing non-dllimport functions
Hans Wennborg [Tue, 13 Sep 2016 21:08:20 +0000 (21:08 +0000)]
Try harder to not inline dllimport functions referencing non-dllimport functions

In r246338, code was added to check for this, but it failed to take into
account implicit destructor invocations because those are not reflected
in the AST. This adds a separate check for them.

llvm-svn: 281395

7 years ago[ELF] Set EF_ARM_EABI_VER5 for ARM
Rui Ueyama [Tue, 13 Sep 2016 20:51:32 +0000 (20:51 +0000)]
[ELF] Set EF_ARM_EABI_VER5 for ARM

Without this flag set, an AArch64 Linux kernel won't try to load the executable
(even if a 32 bit arm kernel will run the binary just fine).

Patch by Martin Storsjö!

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

llvm-svn: 281394

7 years agoSplit scanVersionScript. NFC.
Rui Ueyama [Tue, 13 Sep 2016 20:51:30 +0000 (20:51 +0000)]
Split scanVersionScript. NFC.

llvm-svn: 281393

7 years ago[asan] Reify ErrorSanitizerGetAllocatedSizeNotOwned
Filipe Cabecinhas [Tue, 13 Sep 2016 20:47:42 +0000 (20:47 +0000)]
[asan] Reify ErrorSanitizerGetAllocatedSizeNotOwned

Summary: Continuing implementation mentioned in this thread: http://lists.llvm.org/pipermail/llvm-dev/2016-July/101933.html

Reviewers: kcc, eugenis, vitalybuka

Subscribers: llvm-commits, kubabrecka

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

llvm-svn: 281392

7 years ago[asan] Reify ErrorMallocUsableSizeNotOwned
Filipe Cabecinhas [Tue, 13 Sep 2016 20:47:37 +0000 (20:47 +0000)]
[asan] Reify ErrorMallocUsableSizeNotOwned

Summary: Continuing implementation mentioned in this thread: http://lists.llvm.org/pipermail/llvm-dev/2016-July/101933.html

Reviewers: kcc, eugenis, vitalybuka

Subscribers: llvm-commits, kubabrecka

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

llvm-svn: 281391

7 years ago[asan] Reify ErrorAllocTypeMismatch
Filipe Cabecinhas [Tue, 13 Sep 2016 20:47:33 +0000 (20:47 +0000)]
[asan] Reify ErrorAllocTypeMismatch

Summary: Continuing implementation mentioned in this thread: http://lists.llvm.org/pipermail/llvm-dev/2016-July/101933.html

Reviewers: kcc, eugenis, vitalybuka

Subscribers: llvm-commits, kubabrecka

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

llvm-svn: 281390

7 years ago[asan] Reify ErrorFreeNotMalloced
Filipe Cabecinhas [Tue, 13 Sep 2016 20:47:29 +0000 (20:47 +0000)]
[asan] Reify ErrorFreeNotMalloced

Summary: Continuing implementation mentioned in this thread: http://lists.llvm.org/pipermail/llvm-dev/2016-July/101933.html

Reviewers: kcc, eugenis, vitalybuka

Subscribers: llvm-commits, kubabrecka

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

llvm-svn: 281389

7 years agoAdd comments.
Rui Ueyama [Tue, 13 Sep 2016 20:41:06 +0000 (20:41 +0000)]
Add comments.

llvm-svn: 281388

7 years agoAdd some unit tests for ArchSpec.
Zachary Turner [Tue, 13 Sep 2016 20:40:26 +0000 (20:40 +0000)]
Add some unit tests for ArchSpec.

I'm was trying to do some cleanup and code modernization and in
doing so I needed to change ParseMachCPUDashSubtypeTriple to take
a StringRef.  To ensure I don't break anything, I'm adding some
unit tests for this function.  As a side benefit, this also expands
test coverage of this function to all platforms, since in general
this code would rarely be exercised on non Mac platforms, and never
in the test suite.

llvm-svn: 281387

7 years agoadd tests for PR28672
Sanjay Patel [Tue, 13 Sep 2016 20:36:13 +0000 (20:36 +0000)]
add tests for PR28672

I'm not sure if we actually want to transform all of these in InstCombine yet,
so I'm not labeling these with FIXME.

llvm-svn: 281386

7 years agoRemove excessive padding from PTHWriter
Alexander Shaposhnikov [Tue, 13 Sep 2016 20:17:57 +0000 (20:17 +0000)]
Remove excessive padding from PTHWriter

The class PTHWriter is in lib/Frontend/CacheTokens.cpp
inside the anonymous namespace.
This diff changes the order of fields an removes excessive padding.
Test plan: make -j8 check-clang

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

llvm-svn: 281385

7 years ago[SE] Use real HostPlatformDevice for testing
Jason Henline [Tue, 13 Sep 2016 20:14:44 +0000 (20:14 +0000)]
[SE] Use real HostPlatformDevice for testing

Summary:
Replace uses of SimpleHostPlatformDevice in tests with
HostPlatformDevice.

Reviewers: jlebar

Subscribers: jlebar, jprice, parallel_libs-commits

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

llvm-svn: 281384

7 years ago[SemaObjC] Be more strict while parsing type arguments and protocols
Bruno Cardoso Lopes [Tue, 13 Sep 2016 20:04:35 +0000 (20:04 +0000)]
[SemaObjC] Be more strict while parsing type arguments and protocols

Fix a crash-on-invalid.

When parsing type arguments and protocols,
parseObjCTypeArgsOrProtocolQualifiers() calls ParseTypeName(), which tries to
find matching tokens for '[', '(', etc whenever they appear among potential
type names. If unmatched, ParseTypeName() yields a tok::eof token stream. This
leads to crashes since the parsing at this point is not expected to go beyond
the param list closing '>'.

Fix that by properly handling tok::eof in
parseObjCTypeArgsOrProtocolQualifiers() callers.

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

rdar://problem/25063557

llvm-svn: 281383

7 years agoWork around MSVC 2013's inability to default move special members.
Richard Smith [Tue, 13 Sep 2016 20:00:02 +0000 (20:00 +0000)]
Work around MSVC 2013's inability to default move special members.

llvm-svn: 281382

7 years agoInline small funciton.
Rui Ueyama [Tue, 13 Sep 2016 19:56:27 +0000 (19:56 +0000)]
Inline small funciton.

llvm-svn: 281381

7 years agoFix comments.
Rui Ueyama [Tue, 13 Sep 2016 19:56:25 +0000 (19:56 +0000)]
Fix comments.

llvm-svn: 281380

7 years agoReapply "InstCombine: Reduce trunc (shl x, K) width."
Matt Arsenault [Tue, 13 Sep 2016 19:43:57 +0000 (19:43 +0000)]
Reapply "InstCombine: Reduce trunc (shl x, K) width."

This reapplies r272987 with a fix for infinitely looping
when the truncated value is another shift of a constant.

llvm-svn: 281379

7 years agoAdd bunch of _Interlocked builtins
Albert Gutowski [Tue, 13 Sep 2016 19:43:33 +0000 (19:43 +0000)]
Add bunch of _Interlocked builtins

Reviewers: compnerd, thakis, Prazek, majnemer, rnk

Subscribers: cfe-commits

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

llvm-svn: 281378

7 years ago[SE] Host platform implementation
Jason Henline [Tue, 13 Sep 2016 19:28:02 +0000 (19:28 +0000)]
[SE] Host platform implementation

Summary:
This implementation does not currently support multiple concurrent streams, and
it won't allow kernels to be launched with grids larger than one block or
blocks larger than one thread. These limitations could be removed in the future
by launching new threads on the host, but that is not done in this
implementation.

Reviewers: jlebar

Subscribers: beanz, mgorny, jprice, parallel_libs-commits

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

llvm-svn: 281377

7 years agoAArch64: Cleanup tailcall CC check, enable swiftcc.
Matthias Braun [Tue, 13 Sep 2016 19:27:38 +0000 (19:27 +0000)]
AArch64: Cleanup tailcall CC check, enable swiftcc.

Cleanup/change the code that checks for possible tailcall conventions to
look the same as the one in the X86 target. This makes the distinction
between calling conventions that can guarnatee tailcalls and the ones
that may tailcall more obvious.

- Add Swift to the mayTailCall list
- PreserveMost seemed to be incorrectly part of the guarnteed tail call
  list, move it to the mayTailCall list.

llvm-svn: 281376

7 years agoAdd some MS aliases for existing intrinsics
Albert Gutowski [Tue, 13 Sep 2016 19:26:42 +0000 (19:26 +0000)]
Add some MS aliases for existing intrinsics

Reviewers: thakis, compnerd, majnemer, rsmith, rnk

Subscribers: cfe-commits

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

llvm-svn: 281375

7 years ago[SE] Add .clang-format
Jason Henline [Tue, 13 Sep 2016 19:25:43 +0000 (19:25 +0000)]
[SE] Add .clang-format

Summary:
The .clang-tidy file is copied from the top-level LLVM source directory.

Also fix warnings generated by clang-format:

* Moved SimpleHostPlatformDevice.h so its header include guard could
  have the right format.
* Changed signatures of methods taking llvm::Twine by value to take it
  by const ref instead.
* Add "noexcept" to some move constructors and assignment operators.
* Removed a bunch of places where single-statement loops and
  conditionals were surrounded with braces. (This was not found by the
  current clang-tidy, but with a local patch that I hope to upstream
  soon.)

Reviewers: jlebar, jprice

Subscribers: parallel_libs-commits

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

llvm-svn: 281374

7 years ago[analyzer] Fix ExprEngine::VisitMemberExpr
Alexander Shaposhnikov [Tue, 13 Sep 2016 19:17:20 +0000 (19:17 +0000)]
[analyzer] Fix ExprEngine::VisitMemberExpr

AST may contain intermediate ParenExpr nodes
between MemberExpr and ArrayToPointerDecay.
This diff adjusts the check in ExprEngine::VisitMemberExpr accordingly.
Test plan: make -j8 check-clang-analysis

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

llvm-svn: 281373

7 years agoAMDGPU: Remove code I think is dead
Matt Arsenault [Tue, 13 Sep 2016 19:15:25 +0000 (19:15 +0000)]
AMDGPU: Remove code I think is dead

As far as I can tell, resolveFrameIndex is supposed to be
called with a legal offset, so inserting an add shouldn't be
necessary.

llvm-svn: 281372

7 years agoSwitch to 64-bit allocator on android/aarch64.
Evgeniy Stepanov [Tue, 13 Sep 2016 19:05:33 +0000 (19:05 +0000)]
Switch to 64-bit allocator on android/aarch64.

This uses the "very compact" size class mapping that fits in the
39-bit address space.

llvm-svn: 281371

7 years ago.clang-tidy: correct style name is 'camelBack' not 'lowerCase'.
Mike Aizatsky [Tue, 13 Sep 2016 19:04:26 +0000 (19:04 +0000)]
.clang-tidy: correct style name is 'camelBack' not 'lowerCase'.

Summary: clang-tidy doesn't like to complain.

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

llvm-svn: 281370

7 years agoAMDGPU: Support commuting a FrameIndex operand
Matt Arsenault [Tue, 13 Sep 2016 19:03:12 +0000 (19:03 +0000)]
AMDGPU: Support commuting a FrameIndex operand

llvm-svn: 281369

7 years ago[LV] Clean up uniform induction variable analysis (NFC)
Matthew Simpson [Tue, 13 Sep 2016 19:01:45 +0000 (19:01 +0000)]
[LV] Clean up uniform induction variable analysis (NFC)

llvm-svn: 281368

7 years ago[clang-cl] Diagnose duplicate uuids.
Nico Weber [Tue, 13 Sep 2016 18:55:26 +0000 (18:55 +0000)]
[clang-cl] Diagnose duplicate uuids.

This mostly behaves cl.exe's behavior, even though clang-cl is stricter in some
corner cases and more lenient in others (see the included test).

To make the uuid declared previously here diagnostic work correctly, tweak
stripTypeAttributesOffDeclSpec() to keep attributes in the right order.

https://reviews.llvm.org/D24469

llvm-svn: 281367

7 years ago[LTO] Don't pass SF_Undefined symbols to the IRmover.
Davide Italiano [Tue, 13 Sep 2016 18:45:13 +0000 (18:45 +0000)]
[LTO] Don't pass SF_Undefined symbols to the IRmover.

This should fix PR 30363.

llvm-svn: 281366

7 years agoFix MSVC 2013 build by using our <thread> wrapper header
Reid Kleckner [Tue, 13 Sep 2016 18:40:04 +0000 (18:40 +0000)]
Fix MSVC 2013 build by using our <thread> wrapper header

llvm-svn: 281365

7 years ago[asan] Re-poison all redzones on activation.
Evgeniy Stepanov [Tue, 13 Sep 2016 18:38:40 +0000 (18:38 +0000)]
[asan] Re-poison all redzones on activation.

When running with start_deactivated=1 in ASAN_OPTIONS, heap redzones
are not poisoned until the first instrumented module is loaded. This
can cause false negatives even on memory allocated after activation,
because redzones are normally poisoned only once when a new allocator
region is mapped.

This change attempts to fix it by iterating over all existing
allocator chunks and poisoning their redzones.

llvm-svn: 281364