platform/upstream/llvm.git
8 years ago[IRCE] Add an option to skip profitability checks
Sanjoy Das [Fri, 22 Jul 2016 00:40:56 +0000 (00:40 +0000)]
[IRCE] Add an option to skip profitability checks

If `-irce-skip-profitability-checks` is passed in, IRCE will kick in in
all cases where it is legal for it to kick in.  This flag is intended to
help diagnose and analyse performance issues.

llvm-svn: 276372

8 years agoRestructure release notes.
Eugene Zelenko [Fri, 22 Jul 2016 00:34:42 +0000 (00:34 +0000)]
Restructure release notes.

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

llvm-svn: 276371

8 years ago[Coverage] Attempt to appease a Windows builder
Vedant Kumar [Fri, 22 Jul 2016 00:25:09 +0000 (00:25 +0000)]
[Coverage] Attempt to appease a Windows builder

The builder prints out the following IR:

  \5CCoverageMapping\5COutput\5Ctest\5Cf1.c

The updated test in r276367 expects path separators to be either '/' or
'\\', so it chokes on the unexpected "5C" stuff. I'm not sure what that
is, but I included a kludge that should work around it.

Failing bot:

  http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/8718

llvm-svn: 276370

8 years agoAdd support to get the shared cache information from the new
Jason Molenda [Fri, 22 Jul 2016 00:17:55 +0000 (00:17 +0000)]
Add support to get the shared cache information from the new
debugserver jGetSharedCacheInfo packet instead of reading
the dyld internal data structures directly.  This code is
(currently) only used for ios native lldb's - I should really
move this ObjectFileMachO::GetProcessSharedCacheUUID method
somewhere else, it makes less and less sense being in the
file reader.

<rdar://problem/25251243>

llvm-svn: 276369

8 years agoGVN-hoist: move check before mutating the IR
Sebastian Pop [Fri, 22 Jul 2016 00:07:01 +0000 (00:07 +0000)]
GVN-hoist: move check before mutating the IR

llvm-svn: 276368

8 years ago[Coverage] Strengthen a test case
Vedant Kumar [Fri, 22 Jul 2016 00:00:02 +0000 (00:00 +0000)]
[Coverage] Strengthen a test case

We should be able to use `mkdir` without turning on `REQUIRES: shell`.
Moreover, this test should check for a path separator which precedes the
relative filename to make sure that absolute paths are being used.

llvm-svn: 276367

8 years ago[AArch64] Cleanup sign extend in genAlternativeCodeSequence
David Majnemer [Thu, 21 Jul 2016 23:46:56 +0000 (23:46 +0000)]
[AArch64] Cleanup sign extend in genAlternativeCodeSequence

Use the machinery in MathExtras instead of rolling it by hand.

This fixes PR28624.

llvm-svn: 276366

8 years ago[analyzer] Add checker modeling potential C++ self-assignment
Devin Coughlin [Thu, 21 Jul 2016 23:42:31 +0000 (23:42 +0000)]
[analyzer] Add checker modeling potential C++ self-assignment

This checker checks copy and move assignment operators whether they are
protected against self-assignment. Since C++ core guidelines discourages
explicit checking for `&rhs==this` in general we take a different approach: in
top-frame analysis we branch the exploded graph for two cases, where &rhs==this
and &rhs!=this and let existing checkers (e.g. unix.Malloc) do the rest of the
work. It is important that we check all copy and move assignment operator in top
frame even if we checked them already since self-assignments may happen
undetected even in the same translation unit (e.g. using random indices for an
array what may or may not be the same).

This reapplies r275820 after fixing a string-lifetime issue discovered by the
bots.

A patch by Ádám Balogh!

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

llvm-svn: 276365

8 years agoGVN-hoist: add missing check for all GEP operands available
Sebastian Pop [Thu, 21 Jul 2016 23:32:39 +0000 (23:32 +0000)]
GVN-hoist: add missing check for all GEP operands available

llvm-svn: 276364

8 years ago[llvm-cov] Strengthen a test case
Vedant Kumar [Thu, 21 Jul 2016 23:31:26 +0000 (23:31 +0000)]
[llvm-cov] Strengthen a test case

Check that stylesheets work when we're not using -output-dir.

llvm-svn: 276363

8 years ago[Sparc]: Fix bug in LowerSTORE due to r275592
Douglas Katzman [Thu, 21 Jul 2016 23:28:54 +0000 (23:28 +0000)]
[Sparc]: Fix bug in LowerSTORE due to r275592

llvm-svn: 276362

8 years agoReverting r275115 which caused PR28634.
Wolfgang Pieb [Thu, 21 Jul 2016 23:28:18 +0000 (23:28 +0000)]
Reverting r275115 which caused PR28634.
When empty (forwarding) basic blocks that are referenced by user labels
are removed, incorrect code may be generated.

llvm-svn: 276361

8 years ago[InstCombine] break up foldICmpEqualityWithConstant(); NFCI
Sanjay Patel [Thu, 21 Jul 2016 23:27:36 +0000 (23:27 +0000)]
[InstCombine] break up foldICmpEqualityWithConstant(); NFCI

Almost all of these folds require changes to allow vector types.
Splitting up the logic should make that easier to do incrementally.

llvm-svn: 276360

8 years ago[llvm-cov] Use relative paths to the stylesheet (for html reports)
Vedant Kumar [Thu, 21 Jul 2016 23:26:15 +0000 (23:26 +0000)]
[llvm-cov] Use relative paths to the stylesheet (for html reports)

This makes it easy to swap out the default stylesheet for a custom one.
It also shaves ~6.62 MB out of the report directory for a full coverage
build of llvm+clang.

While we're at it, prune the CSS and add tests for it.

llvm-svn: 276359

8 years agoGVH-hoist: only clone GEPs (PR28606)
Sebastian Pop [Thu, 21 Jul 2016 23:22:10 +0000 (23:22 +0000)]
GVH-hoist: only clone GEPs (PR28606)

Do not clone stored values unless they are GEPs that are special cased to avoid
hoisting them without hoisting their associated ld/st.

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

llvm-svn: 276358

8 years ago[lit] Use full config path in diagnostics.
Daniel Dunbar [Thu, 21 Jul 2016 23:20:41 +0000 (23:20 +0000)]
[lit] Use full config path in diagnostics.

 - This allows tools like emacs to automatically find the config file path when
   you step through errors.

 - Patch by Dave Abrahams.

llvm-svn: 276357

8 years ago[profile] update test case with interface change.
Xinliang David Li [Thu, 21 Jul 2016 23:19:39 +0000 (23:19 +0000)]
[profile] update test case with interface change.

See http://reviews.llvm.org/D22613, http://reviews.llvm.org/D22614

llvm-svn: 276356

8 years ago[Profile] deprecate __llvm_profile_override_default_filename (part2)
Xinliang David Li [Thu, 21 Jul 2016 23:19:18 +0000 (23:19 +0000)]
[Profile] deprecate __llvm_profile_override_default_filename (part2)

This eliminates unncessary calls and init functions.

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

llvm-svn: 276355

8 years ago[Profile] deprecate __llvm_profile_override_default_filename
Xinliang David Li [Thu, 21 Jul 2016 23:19:10 +0000 (23:19 +0000)]
[Profile] deprecate __llvm_profile_override_default_filename

This eliminates unncessary calls and init functions.

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

llvm-svn: 276354

8 years ago[lit] Bump version number.
Daniel Dunbar [Thu, 21 Jul 2016 23:17:44 +0000 (23:17 +0000)]
[lit] Bump version number.

llvm-svn: 276353

8 years ago[Sema] Handle errors during rewriteBuiltinFunctionDecl
David Majnemer [Thu, 21 Jul 2016 23:03:43 +0000 (23:03 +0000)]
[Sema] Handle errors during rewriteBuiltinFunctionDecl

rewriteBuiltinFunctionDecl can encounter errors when performing
DefaultFunctionArrayLvalueConversion.  These errors were not handled
which led to a null pointer dereference.

This fixes PR28651.

llvm-svn: 276352

8 years agoStop printing double { characters on Dictionary StructuredData objects
Jason Molenda [Thu, 21 Jul 2016 22:50:01 +0000 (22:50 +0000)]
Stop printing double { characters on Dictionary StructuredData objects
when Dumping, thanks to Devin to catching the edit mistake I made in
r276079.

llvm-svn: 276351

8 years ago[CodeGen] Fix a crash when constant folding switch statement
Erik Pilkington [Thu, 21 Jul 2016 22:31:40 +0000 (22:31 +0000)]
[CodeGen] Fix a crash when constant folding switch statement

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

llvm-svn: 276350

8 years ago[PM] Port NaryReassociate to the new PM
Wei Mi [Thu, 21 Jul 2016 22:28:52 +0000 (22:28 +0000)]
[PM] Port NaryReassociate to the new PM

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

llvm-svn: 276349

8 years ago[MIRTesting] Abort when failing to parse a function.
Quentin Colombet [Thu, 21 Jul 2016 22:25:57 +0000 (22:25 +0000)]
[MIRTesting] Abort when failing to parse a function.

When we failed to parse a function in the mir parser, we should abort
the whole compilation instead of continuing in a weird state. Indeed,
this was creating strange machine function passes failures that were
hard to understand, until we notice that the function actually did not
get parsed correctly!

llvm-svn: 276348

8 years ago[X86] Do not use AND8ri8 in AVX512 pattern
Michael Kuperstein [Thu, 21 Jul 2016 22:24:08 +0000 (22:24 +0000)]
[X86] Do not use AND8ri8 in AVX512 pattern

This variant is (as documented in the TD) for disassembler use only, and should
not be used in patterns - it is longer, and is broken on 64-bit.

llvm-svn: 276347

8 years ago[sanitizer] trying to fix Mac bots
Kostya Serebryany [Thu, 21 Jul 2016 22:18:36 +0000 (22:18 +0000)]
[sanitizer] trying to fix Mac  bots

llvm-svn: 276346

8 years ago[InstSimplify] don't crash handling a pointer or aggregate type
Sanjay Patel [Thu, 21 Jul 2016 21:56:00 +0000 (21:56 +0000)]
[InstSimplify] don't crash handling a pointer or aggregate type

llvm-svn: 276345

8 years ago[AArch64][Inline-Asm] Return the 32-bit floating point register class
Akira Hatanaka [Thu, 21 Jul 2016 21:39:05 +0000 (21:39 +0000)]
[AArch64][Inline-Asm] Return the 32-bit floating point register class
when constraint "w" is used on a 32-bit operand.

This enables compiling the following code, which used to error out in
the backend:

void foo1(int a) {
  asm volatile ("sqxtn h0, %s0\n" : : "w"(a):);
}

Fixes PR28633.

llvm-svn: 276344

8 years ago[sanitizer] better allocator stats (with rss)
Kostya Serebryany [Thu, 21 Jul 2016 21:38:40 +0000 (21:38 +0000)]
[sanitizer] better allocator stats (with rss)

llvm-svn: 276343

8 years ago[cmake] Move the including of utils/unittests under LLVM_INCLUDE_UTILS instead of...
Michael Gottesman [Thu, 21 Jul 2016 21:35:23 +0000 (21:35 +0000)]
[cmake] Move the including of utils/unittests under LLVM_INCLUDE_UTILS instead of LLVM_INCLUDE_TESTS.

This does not change anything by default since LLVM_INCLUDE_UTILS is already set
to TRUE by default. In addition, since LLVM_INCLUDE_TESTS => LLVM_INCLUDE_UTILS,
the only way that this can cause changes is in the case where LLVM_INCLUDE_UTILS
is set to TRUE, but LLVM_INCLUDE_TESTS is FALSE. In that case, building gtest is
not a huge cost.

The reason to do this is that without this change, one can not turn off
LLVM_INCLUDE_TESTS in downstream projects that also use gtest for unittests. It
also just in general makes more sense since LLVM_INCLUDE_UTILS gates FileCheck
and other utilities that are along the lines of gtest.

Additionally from talking with chandlerc, this was not done for any specific
reason, so there is no reason not to do it and lots of benefit to doing it.

llvm-svn: 276342

8 years ago[InstSimplify] recognize trunc + icmp sgt/slt variants of select simplifications...
Sanjay Patel [Thu, 21 Jul 2016 21:26:45 +0000 (21:26 +0000)]
[InstSimplify] recognize trunc + icmp sgt/slt variants of select simplifications (PR28466)

rL245171 exposed a hole in InstSimplify that manifested in a strange way in PR28466:
https://llvm.org/bugs/show_bug.cgi?id=28466

It's possible to use trunc + icmp sgt/slt in place of an and + icmp eq/ne, so we need to
recognize that pattern to eliminate selects that are choosing between some value and some
bitmasked version of that value.

Note that there is significant room for improvement (refactoring) and enhancement (more
patterns, possibly in InstCombine rather than here).

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

llvm-svn: 276341

8 years ago[OptDiag,LDist] Convert remaining opt remarks to use the new API
Adam Nemet [Thu, 21 Jul 2016 21:21:34 +0000 (21:21 +0000)]
[OptDiag,LDist] Convert remaining opt remarks to use the new API

llvm-svn: 276340

8 years ago[LV] Move vector int induction update to end of latch
Matthew Simpson [Thu, 21 Jul 2016 21:20:15 +0000 (21:20 +0000)]
[LV] Move vector int induction update to end of latch

This patch moves the update instruction for vectorized integer induction phi
nodes to the end of the latch block. This ensures consistent placement of all
induction updates across all the kinds of int inductions we create (scalar,
splat vector, or vector phi).

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

llvm-svn: 276339

8 years agoReally fix invalid EhSectionPiece access.
Rafael Espindola [Thu, 21 Jul 2016 21:15:32 +0000 (21:15 +0000)]
Really fix invalid EhSectionPiece access.

I wonder what is the most idiomatic way to write this.

llvm-svn: 276338

8 years ago[compiler-rt] Add support for relative offset adjustment in interception
Etienne Bergeron [Thu, 21 Jul 2016 21:08:54 +0000 (21:08 +0000)]
[compiler-rt] Add support for relative offset adjustment in interception

Summary:
Some instructions can only be copied if the relative offset is adjusted.

This patch adds support for two common instruction.
It's quite common to have a indirect load in the prologue
(loading the security cookie).

Reviewers: rnk

Subscribers: llvm-commits, wang0109, chrisha

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

llvm-svn: 276336

8 years agoDisable a flaky test on Windows that uses "echo >>"
Reid Kleckner [Thu, 21 Jul 2016 21:07:47 +0000 (21:07 +0000)]
Disable a flaky test on Windows that uses "echo >>"

llvm-svn: 276335

8 years agoFix the clang-cl self-host with VS 2013 headers
Reid Kleckner [Thu, 21 Jul 2016 21:06:04 +0000 (21:06 +0000)]
Fix the clang-cl self-host with VS 2013 headers

std::numeric_limits<int64_t>::max() is not constexpr in VC 2013 headers,
and Clang complains that it isn't. MSVC 2013 itself is emitting a
dynamic initializer for this thing. Instead, use an enum.

llvm-svn: 276334

8 years agoEnable cross-compilation across architectures on android
Francis Ricci [Thu, 21 Jul 2016 21:05:14 +0000 (21:05 +0000)]
Enable cross-compilation across architectures on android

Summary:
This patch fixes cross-architecture compilation,
by allowing flags like -target and --sysroot to be set for
architecture testing and compilation.

Reviewers: tberghammer, srhines, danalbert, beanz, compnerd

Subscribers: tberghammer, llvm-commits, danalbert

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

llvm-svn: 276333

8 years ago[asan] Fix Win64 test portability issues
Reid Kleckner [Thu, 21 Jul 2016 21:04:34 +0000 (21:04 +0000)]
[asan] Fix Win64 test portability issues

The OOM test should really only run on 32-bits, since it's hard to OOM
on x64.

The operator_array_new_with_dtor_left_oob tests need to account for the
larger array cookie on x64 (8 bytes instead of 4).

Use -std=c++14 in use-after-scope-capture.cc to avoid errors in the MSVC
2015 STL on Windows. The default there is C++14 anyway.

llvm-svn: 276332

8 years agoNormalize file docs. NFC.
George Burgess IV [Thu, 21 Jul 2016 20:52:35 +0000 (20:52 +0000)]
Normalize file docs. NFC.

Having the added `\brief` made doxygen interpret it as the summary for
the `llvm` namespace (visible at:
http://llvm.org/doxygen/namespaces.html).

llvm-svn: 276331

8 years ago[PGO] Make needsComdatForCounter() available (NFC)
Rong Xu [Thu, 21 Jul 2016 20:50:02 +0000 (20:50 +0000)]
[PGO] Make needsComdatForCounter() available (NFC)

Move needsComdatForCounter() to lib/ProfileData/InstrProf.cpp from
lib/Transforms/Instrumentation/InstrProfiling.cpp to make is available for
other files.

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

llvm-svn: 276330

8 years agoFix PR28575.
Rafael Espindola [Thu, 21 Jul 2016 20:18:30 +0000 (20:18 +0000)]
Fix PR28575.

Not all relocations from a .eh_frame that point to an executable
section should be ignored. In particular, the relocation finding the
personality function should not.

This is a reduction from trying to bootstrap a static lld on linux.

llvm-svn: 276329

8 years agoadd vector tests and a simpler version of the negative tests
Sanjay Patel [Thu, 21 Jul 2016 20:11:08 +0000 (20:11 +0000)]
add vector tests and a simpler version of the negative tests

llvm-svn: 276328

8 years agoDisable thread safe statics in clang-cl, they call the CRT
Reid Kleckner [Thu, 21 Jul 2016 20:03:37 +0000 (20:03 +0000)]
Disable thread safe statics in clang-cl, they call the CRT

Also remove the needless static that was using them.

llvm-svn: 276327

8 years agoFix unsymbolize unittest. Adding win64 address.
Etienne Bergeron [Thu, 21 Jul 2016 20:02:03 +0000 (20:02 +0000)]
Fix unsymbolize unittest. Adding win64 address.

llvm-svn: 276326

8 years ago[docs] Move GitHub to GitHubSubMod
Renato Golin [Thu, 21 Jul 2016 19:52:27 +0000 (19:52 +0000)]
[docs] Move GitHub to GitHubSubMod

Given that other proposals are making their way through, it's better if we
specify what GitHub proposal this is, in case there are others that also
involve GitHub, but not sub-modules.

llvm-svn: 276325

8 years ago[compiler-rt] Fix interception of memcpy/memmove on win64
Etienne Bergeron [Thu, 21 Jul 2016 19:49:11 +0000 (19:49 +0000)]
[compiler-rt] Fix interception of memcpy/memmove on win64

Summary:
This patch is fixing running interception unittests for memcpy/memmove on
windows 64.

Reviewers: rnk

Subscribers: llvm-commits, wang0109, kubabrecka, chrisha

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

llvm-svn: 276324

8 years ago[ELF] - Basic support of linkerscript commands: DATA_SEGMENT_ALIGN, DATA_SEGMENT_END...
George Rimar [Thu, 21 Jul 2016 19:48:00 +0000 (19:48 +0000)]
[ELF] - Basic support of linkerscript commands: DATA_SEGMENT_ALIGN, DATA_SEGMENT_END, CONSTANT

It is called basic because:

CONSTANT expression can refer to COMMONPAGESIZE and MAXPAGESIZE.
This sizes are usually different and used for possible optimization of
memory consumption.
More details are here: https://sourceware.org/ml/binutils/2002-02/msg00265.html
We currently do not support this optimization, so both CONSTANT(MAXPAGESIZE)
and CONSTANT(COMMONPAGESIZE) just return Target->PageSize value.

DATA_SEGMENT_ALIGN and DATA_SEGMENT_END are used as a part of opt.
The latter one is just ignored now.
According to documentation DATA_SEGMENT_ALIGN has 2 possible
calculation, but since we do not support mentioned opt - it
is always calculated now as (ALIGN(MAXPAGESIZE) + (. & (MAXPAGESIZE - 1))).

In general this should work for now until we deside to support this opt.

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

llvm-svn: 276323

8 years agoUpdate comment.
Rui Ueyama [Thu, 21 Jul 2016 19:45:22 +0000 (19:45 +0000)]
Update comment.

llvm-svn: 276322

8 years agoTransfer ownership of the XCore backend.
Richard Osborne [Thu, 21 Jul 2016 19:20:57 +0000 (19:20 +0000)]
Transfer ownership of the XCore backend.

llvm-svn: 276321

8 years agoRevert "Invariant start/end intrinsics overloaded for address space"
Anna Thomas [Thu, 21 Jul 2016 19:06:28 +0000 (19:06 +0000)]
Revert "Invariant start/end intrinsics overloaded for address space"

This reverts commit r276316.

llvm-svn: 276320

8 years ago[IndVars] Reflow oddly formatted condition; NFC
Sanjoy Das [Thu, 21 Jul 2016 18:58:01 +0000 (18:58 +0000)]
[IndVars] Reflow oddly formatted condition; NFC

llvm-svn: 276319

8 years ago[sanitizer] allocator: remove kPopulateSize and only use SizeClassMap::MaxCached...
Kostya Serebryany [Thu, 21 Jul 2016 18:47:53 +0000 (18:47 +0000)]
[sanitizer] allocator: remove kPopulateSize and only use SizeClassMap::MaxCached; ensure that TransferBatch size is a power of two, refactor TransferBatch creation/destruction into separate functions.

llvm-svn: 276318

8 years agoReroll "Include unreferenced nested types in member list only for CodeView"
Adrian McCarthy [Thu, 21 Jul 2016 18:43:20 +0000 (18:43 +0000)]
Reroll "Include unreferenced nested types in member list only for CodeView"

Another attempt at r276271, hopefully without breaking ModuleDebugInfo test.

llvm-svn: 276317

8 years agoInvariant start/end intrinsics overloaded for address space
Anna Thomas [Thu, 21 Jul 2016 18:41:44 +0000 (18:41 +0000)]
Invariant start/end intrinsics overloaded for address space

Summary:
The llvm.invariant.start and llvm.invariant.end intrinsics currently
support specifying invariant memory objects only in the default address space.

With this change, these intrinsics are overloaded for any adddress space for memory objects
and we can use these llvm invariant intrinsics in non-default address spaces.

Example: llvm.invariant.start.p1i8(i64 4, i8 addrspace(1)* %ptr)

This overloaded intrinsic is needed for representing final or invariant memory in managed languages.

Reviewers: tstellarAMD, reames, apilipenko

Subscribers: llvm-commits

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

llvm-svn: 276316

8 years agoFix MSVC 2015 compilation failure around range-for without curly braces
Reid Kleckner [Thu, 21 Jul 2016 18:39:28 +0000 (18:39 +0000)]
Fix MSVC 2015 compilation failure around range-for without curly braces

It doesn't appear to like this pattern:
  for (auto X : Xs)
    if (...) { ... }
    else ...;

We have heard anecdotes that range based for loops are implemented as a
token rewrite in MSVC's lexer, and that the most challenging part of the
rewrite is finding the end of the for loop. That makes sense, given that
it's a lexer.

llvm-svn: 276315

8 years agoFix clang-cl warning and crash in sanitizers
Reid Kleckner [Thu, 21 Jul 2016 18:31:01 +0000 (18:31 +0000)]
Fix clang-cl warning and crash in sanitizers

Make kStderrFd a macro to avoid dynamic initialization of the
report_file global. This actually causes a crash at runtime, because
ASan initializes before static initializers run.

Remove an unused variable in asan_win.cc.

llvm-svn: 276314

8 years agoUse just built llvm-as in tests.
Rafael Espindola [Thu, 21 Jul 2016 18:08:36 +0000 (18:08 +0000)]
Use just built llvm-as in tests.

llvm-svn: 276313

8 years agomake InstCombine compare helper functions private; NFC
Sanjay Patel [Thu, 21 Jul 2016 18:07:40 +0000 (18:07 +0000)]
make InstCombine compare helper functions private; NFC

Also, rename some of them for consistency and to follow current conventions.

llvm-svn: 276312

8 years agofix https://reviews.llvm.org/D22610
Etienne Bergeron [Thu, 21 Jul 2016 17:58:04 +0000 (17:58 +0000)]
fix https://reviews.llvm.org/D22610
AppleClang can't compile the assignment expression.

llvm-svn: 276311

8 years agoAvoid a string copy, NFC
Vedant Kumar [Thu, 21 Jul 2016 17:50:07 +0000 (17:50 +0000)]
Avoid a string copy, NFC

llvm-svn: 276310

8 years agoRemove FIXME for feature test macro
JF Bastien [Thu, 21 Jul 2016 17:34:28 +0000 (17:34 +0000)]
Remove FIXME for feature test macro

The value I'd picked was correct, as per the recently published SG10 paper http://wg21.link/p0096r3

llvm-svn: 276309

8 years ago[IRTranslator] Add G_SUB opcode.
Quentin Colombet [Thu, 21 Jul 2016 17:26:50 +0000 (17:26 +0000)]
[IRTranslator] Add G_SUB opcode.

This commit adds a generic SUB opcode to global-isel.

llvm-svn: 276308

8 years ago[llvm-config][GlobalISel] Canonicalize LLVM_HAS_GLOBAL_ISEL on ON/OFF.
Quentin Colombet [Thu, 21 Jul 2016 17:26:47 +0000 (17:26 +0000)]
[llvm-config][GlobalISel] Canonicalize LLVM_HAS_GLOBAL_ISEL on ON/OFF.

Previously LLVM_HAS_GLOBAL_ISEL would directly get the value of
LLVM_BUILD_GLOBAL_ISEL. This could be any integer value and not just ON
and OFF. The problem is that lit.cfg was checking for ON to define that
global-isel was supported, thus if we were setting
LLVM_BUILD_GLOBAL_ISEL with an integer value, say 1, this test would
fail whereas we do build global-isel and want to test it.

llvm-svn: 276307

8 years ago[CMake][GlobalISel] Turn LLVM_BUILD_GLOBAL_ISEL into an option. NFC.
Quentin Colombet [Thu, 21 Jul 2016 17:26:45 +0000 (17:26 +0000)]
[CMake][GlobalISel] Turn LLVM_BUILD_GLOBAL_ISEL into an option. NFC.

Previously LLVM_BUILD_GLOBAL_ISEL was a boolean variable and although,
this is strictly identical to an option, it did not convey the
information that the user may set it. Options are here for that.

llvm-svn: 276306

8 years ago[IRTranslator] Add comments to explain the ordering of the switch. NFC.
Quentin Colombet [Thu, 21 Jul 2016 17:26:41 +0000 (17:26 +0000)]
[IRTranslator] Add comments to explain the ordering of the switch. NFC.

Group arithmetic operations, bitwise operations, and branch operations.

llvm-svn: 276305

8 years ago[InstCombine] break up visitICmpInstWithInstAndIntCst(); NFCI
Sanjay Patel [Thu, 21 Jul 2016 17:15:49 +0000 (17:15 +0000)]
[InstCombine] break up visitICmpInstWithInstAndIntCst(); NFCI

Making smaller pieces out of some of these ~1000 line functions should make
it easier to incrementally upgrade them to handle vector types.

llvm-svn: 276304

8 years agoAdd check for non-null log instance in PlatformAndroid.
Oleksiy Vyalov [Thu, 21 Jul 2016 17:03:25 +0000 (17:03 +0000)]
Add check for non-null log instance in PlatformAndroid.

llvm-svn: 276303

8 years agoAdding RELEASE_TESTERS.TXT
Renato Golin [Thu, 21 Jul 2016 16:46:44 +0000 (16:46 +0000)]
Adding RELEASE_TESTERS.TXT

llvm-svn: 276302

8 years ago[ELF] Fix bug in program header FLAGS processing + test case update (found by grimar)
Eugene Leviant [Thu, 21 Jul 2016 16:13:54 +0000 (16:13 +0000)]
[ELF] Fix bug in program header FLAGS processing + test case update (found by grimar)

llvm-svn: 276301

8 years ago[ELF] - Cleanup of LinkerScript<ELFT>::assignAddresses()
George Rimar [Thu, 21 Jul 2016 16:07:40 +0000 (16:07 +0000)]
[ELF] - Cleanup of LinkerScript<ELFT>::assignAddresses()

LinkerScript<ELFT>::assignAddresses is becoming larger and looks
it can be good time for splitting. I expect to can more SectionsCommand's there,
and dispatching some of them separatelly can help to keep method smaller either.

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

llvm-svn: 276300

8 years ago[compiler-rt] Fix memmove/memcpy overlap detection on windows
Etienne Bergeron [Thu, 21 Jul 2016 16:06:54 +0000 (16:06 +0000)]
[compiler-rt] Fix memmove/memcpy overlap detection on windows

Summary:
The memcpy and memmove functions are the same on windows.
The overlap detection logic is incorrect.

printf-1 test:
```
stdin>:2:114: note: possible intended match here
==877412==ERROR: AddressSanitizer: memcpy-param-overlap: memory ranges [0x0000002bf2a8,0x0000002bf2ad) and [0x0000002bf2a9, 0x0000002bf2ae) overlap
```                                                                                                                 ^

Reviewers: rnk

Subscribers: llvm-commits, wang0109, kubabrecka, chrisha

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

llvm-svn: 276299

8 years ago[AMDGPU] Emit read-only data to .rodata for hsa
Konstantin Zhuravlyov [Thu, 21 Jul 2016 15:59:23 +0000 (15:59 +0000)]
[AMDGPU] Emit read-only data to .rodata for hsa

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

llvm-svn: 276298

8 years ago[IRTranslator] Add G_AND opcode.
Quentin Colombet [Thu, 21 Jul 2016 15:50:42 +0000 (15:50 +0000)]
[IRTranslator] Add G_AND opcode.

This commit adds a generic AND opcode to global-isel.

llvm-svn: 276297

8 years ago[ELF] - Fixed 3 testases failtures on win32 configuration.
George Rimar [Thu, 21 Jul 2016 15:35:06 +0000 (15:35 +0000)]
[ELF] - Fixed 3 testases failtures on win32 configuration.

Had 3 testcases failtures:
ELF/eh-frame-merge.s
ELF/gc-sections-eh.s
ELF/gc-sections-lsda.s​

Problem was that OutputOff is size_t, which is 32
for this configuration and next
condition never was checked correctly:

if (PieceI->OutputOff == (uintX_t)-1)
  continue;

llvm-svn: 276296

8 years agoELF/AMDGPU: Add support for R_AMDGPU_ABS32
Konstantin Zhuravlyov [Thu, 21 Jul 2016 15:30:13 +0000 (15:30 +0000)]
ELF/AMDGPU: Add support for R_AMDGPU_ABS32

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

llvm-svn: 276295

8 years agoAMDGPU/SI: Add support for R_AMDGPU_ABS32
Konstantin Zhuravlyov [Thu, 21 Jul 2016 15:29:19 +0000 (15:29 +0000)]
AMDGPU/SI: Add support for R_AMDGPU_ABS32

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

llvm-svn: 276294

8 years ago[AArch64] Load/store opt: Don't count transient instructions towards search limits.
Geoff Berry [Thu, 21 Jul 2016 15:20:25 +0000 (15:20 +0000)]
[AArch64] Load/store opt: Don't count transient instructions towards search limits.

Summary:
This change also changes findMatchingInsn and
findMatchingUpdateInsnForward to take DBG_VALUE opcodes into account
when tracking register defs and uses, which could potentially inhibit
these optimizations in the presence of debug information.

Reviewers: mcrosier

Subscribers: aemerson, rengolin, mcrosier, llvm-commits

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

llvm-svn: 276293

8 years agoMove some IntrusiveRefCntPtrs instead of copying.
Benjamin Kramer [Thu, 21 Jul 2016 15:06:51 +0000 (15:06 +0000)]
Move some IntrusiveRefCntPtrs instead of copying.

No functionality change intended.

llvm-svn: 276292

8 years agoWeaken ThreadSafeRefCountedBase atomics.
Benjamin Kramer [Thu, 21 Jul 2016 15:06:50 +0000 (15:06 +0000)]
Weaken ThreadSafeRefCountedBase atomics.

Doesn't make a difference on x86, but avoids memory barriers on
weakly-ordered archs like PowerPC and ARM.

llvm-svn: 276291

8 years ago[compiler-rt] Disable some unittests on windows that rely on shell command
Etienne Bergeron [Thu, 21 Jul 2016 14:55:17 +0000 (14:55 +0000)]
[compiler-rt] Disable some unittests on windows that rely on shell command

Summary:
These unittests are not running on windows because they are using incorrect commands.
They were not failing on 32-bits because there is a requirement: asan-64-bits.

```
$ "nm" "C:\src\llvm\ninja64\projects\compiler-rt\test\asan\X86_64WindowsConfig\TestCases\Output\no_asan_gen_globals.c.tmp.exe"
# command stderr:
'nm': command not found
error: command failed with exit status: 127
```

```
$ "rm" "-rf" "C:\src\llvm\ninja64\projects\compiler-rt\test\asan\X86_64WindowsConfig\TestCases\Output/coverage-tracing"
$ "mkdir" "C:\src\llvm\ninja64\projects\compiler-rt\test\asan\X86_64WindowsConfig\TestCases\Output/coverage-tracing"
$ "A=x"
# command stderr:
'A=x': command not found
error: command failed with exit status: 127
```

```
$ "DIR=C:\src\llvm\ninja64\projects\compiler-rt\test\asan\X86_64WindowsConfig\TestCases\Output/coverage-order-pcs"
# command stderr:
'DIR=C:\\src\\llvm\\ninja64\\projects\\compiler-rt\\test\\asan\\X86_64WindowsConfig\\TestCases\\Output/coverage-order-pcs': command not found
error: command failed with exit status: 127
```

Reviewers: rnk

Subscribers: tberghammer, llvm-commits, danalbert, wang0109, srhines, kubabrecka, chrisha

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

llvm-svn: 276290

8 years ago[X86][SSE] Allow folding of store/zext with PEXTRW of 0'th element
Simon Pilgrim [Thu, 21 Jul 2016 14:54:17 +0000 (14:54 +0000)]
[X86][SSE] Allow folding of store/zext with PEXTRW of 0'th element

Under normal circumstances we prefer the higher performance MOVD to extract the 0'th element of a v8i16 vector instead of PEXTRW.

But as detailed on PR27265, this prevents the SSE41 implementation of PEXTRW from folding the store of the 0'th element. Additionally it prevents us from making use of the fact that the (SSE2) reg-reg version of PEXTRW implicitly zero-extends the i16 element to the i32/i64 destination register.

This patch only preferentially lowers to MOVD if we will not be zero-extending the extracted i16, nor prevent a store from being folded (on SSSE41).

Fix for PR27265.

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

llvm-svn: 276289

8 years agoUnify process launching code on linux
Pavel Labath [Thu, 21 Jul 2016 14:54:03 +0000 (14:54 +0000)]
Unify process launching code on linux

Summary:
We've had two copies of code for launching processes:
- one in NativeProcessLinux, used for launching debugged processes
- one in ProcessLauncherAndroid, used on android for launching all other kinds of processes

These have over time acquired support for various launch options, but neither supported all of
them. I now replace them with a single implementation ProcessLauncherLinux, which supports all
the options the individual versions supported and set it to be used to launch all processes on
linux.

This also works around the ETXTBSY issue on android when the process is started from the platform
instance, as that used to go through the version which did not contain the workaround.

Reviewers: tberghammer

Subscribers: tberghammer, danalbert, srhines, lldb-commits

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

llvm-svn: 276288

8 years agoFixed line endings
Simon Pilgrim [Thu, 21 Jul 2016 14:36:41 +0000 (14:36 +0000)]
Fixed line endings

llvm-svn: 276287

8 years ago[compiler-rt] Fix broken unittest on win64
Etienne Bergeron [Thu, 21 Jul 2016 14:36:25 +0000 (14:36 +0000)]
[compiler-rt] Fix broken unittest on win64

Summary:
This is an other tentative to fix:
https://reviews.llvm.org/D22588

It's less clever, but should work.

Turn out there is not an easy way to write a portable print
for a pointer in lowercase without the prefix 0x.

Reviewers: rnk

Subscribers: llvm-commits, wang0109, kubabrecka, chrisha

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

llvm-svn: 276286

8 years ago[X86][SSE] Pull out duplicate EXTRW lowering code. NFCI.
Simon Pilgrim [Thu, 21 Jul 2016 14:30:17 +0000 (14:30 +0000)]
[X86][SSE] Pull out duplicate EXTRW lowering code. NFCI.

As requested on D22509, I've pulled out the v8i16 extraction lowering as the SSE41 and pre-SSE41 implementations are effectively the same.

llvm-svn: 276285

8 years ago[profdata] Remove constructor that MSVC 2013 pretends to not understand.
Benjamin Kramer [Thu, 21 Jul 2016 14:29:11 +0000 (14:29 +0000)]
[profdata] Remove constructor that MSVC 2013 pretends to not understand.

No functionality change intended.

llvm-svn: 276284

8 years ago[ELF] - Linkerscript: add InputSectionDescription command to LS parser.
George Rimar [Thu, 21 Jul 2016 14:26:59 +0000 (14:26 +0000)]
[ELF] - Linkerscript: add InputSectionDescription command to LS parser.

This adds InputSectionDescription command to represent
the input section declaration.

This leads to next cleanup:
SectionRule removed.
ScriptConfiguration::Sections mamber removed.
LinkerScript<ELFT>::getOutputSection() removed.

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

llvm-svn: 276283

8 years ago[clang-tidy] Avoid duplicated DenseMap lookup.
Benjamin Kramer [Thu, 21 Jul 2016 14:13:45 +0000 (14:13 +0000)]
[clang-tidy] Avoid duplicated DenseMap lookup.

The std::string is still constructed on demand. No functionality change
intended.

llvm-svn: 276282

8 years ago[X86][AVX] Added support for lowering to VBROADCASTF128/VBROADCASTI128
Simon Pilgrim [Thu, 21 Jul 2016 14:10:54 +0000 (14:10 +0000)]
[X86][AVX] Added support for lowering to VBROADCASTF128/VBROADCASTI128

As reported on PR26235, we don't currently make use of the VBROADCASTF128/VBROADCASTI128 instructions (or the AVX512 equivalents) to load+splat a 128-bit vector to both lanes of a 256-bit vector.

This patch enables lowering from subvector insertion/concatenation patterns and auto-upgrades the llvm.x86.avx.vbroadcastf128.pd.256 / llvm.x86.avx.vbroadcastf128.ps.256 intrinsics to match.

We could possibly investigate using VBROADCASTF128/VBROADCASTI128 to load repeated constants as well (similar to how we already do for scalar broadcasts).

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

llvm-svn: 276281

8 years ago[include-fixer] Add mising qualifiers to all instances of an unidentified symbol.
Haojian Wu [Thu, 21 Jul 2016 13:47:09 +0000 (13:47 +0000)]
[include-fixer] Add mising qualifiers to all instances of an unidentified symbol.

Reviewers: bkramer

Subscribers: ioeric, cfe-commits

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

llvm-svn: 276280

8 years agoRevert "Include unreferenced nested types in member list only for CodeView"
Adrian McCarthy [Thu, 21 Jul 2016 13:41:25 +0000 (13:41 +0000)]
Revert "Include unreferenced nested types in member list only for CodeView"

Patch broke ModuleDebugInfo test on the build bots (but not locally).  Again.

svn revision:  r276271

This reverts commit 9da8a1b05362bc96f2855fb32b5588b89407685d.

llvm-svn: 276279

8 years ago[DemandedBits] Reduce number of duplicated DenseMap lookups.
Benjamin Kramer [Thu, 21 Jul 2016 13:37:55 +0000 (13:37 +0000)]
[DemandedBits] Reduce number of duplicated DenseMap lookups.

No functionality change intended.

llvm-svn: 276278

8 years ago[DenseMap] Add a C++17-style try_emplace method.
Benjamin Kramer [Thu, 21 Jul 2016 13:37:53 +0000 (13:37 +0000)]
[DenseMap] Add a C++17-style try_emplace method.

This provides an elegant pattern to solve the "construct if not in map
already" problem we have many times in LLVM. Without try_emplace we
either have to rely on a sentinel value (nullptr) or do two lookups.

llvm-svn: 276277

8 years agoRename StringMap::emplace_second to try_emplace.
Benjamin Kramer [Thu, 21 Jul 2016 13:37:48 +0000 (13:37 +0000)]
Rename StringMap::emplace_second to try_emplace.

Coincidentally this function maps to the C++17 try_emplace. Rename it
for consistentcy with C++17 std::map. NFC.

llvm-svn: 276276

8 years agoDelete SplitInputSection.
Rafael Espindola [Thu, 21 Jul 2016 13:32:37 +0000 (13:32 +0000)]
Delete SplitInputSection.

This opens the way for having a different Piece type for EhInputSection.

llvm-svn: 276275

8 years ago[AMDGPU] Some code cleaning in SIRegisterInfo.td
Sam Kolton [Thu, 21 Jul 2016 13:29:57 +0000 (13:29 +0000)]
[AMDGPU] Some code cleaning in SIRegisterInfo.td

Reviewers: tstellarAMD, vpykhtin

Subscribers: arsenm, kzhuravl

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

llvm-svn: 276274

8 years agoAgain, w/o the tabs
Marshall Clow [Thu, 21 Jul 2016 13:19:36 +0000 (13:19 +0000)]
Again, w/o the tabs

llvm-svn: 276273

8 years agoAnother fix to appease the no-exception bots.
Marshall Clow [Thu, 21 Jul 2016 13:18:50 +0000 (13:18 +0000)]
Another fix to appease the no-exception bots.

llvm-svn: 276272