platform/upstream/llvm.git
8 years ago[GVNHoist] Sink HoistedCtr into GVNHoist
David Majnemer [Mon, 18 Jul 2016 00:35:01 +0000 (00:35 +0000)]
[GVNHoist] Sink HoistedCtr into GVNHoist

HoistedCtr cannot be a mutated global variable, that will open us up to
races between threads compiling code in parallel.

llvm-svn: 275744

8 years ago[GVNHoist] Some small cleanups
David Majnemer [Mon, 18 Jul 2016 00:34:58 +0000 (00:34 +0000)]
[GVNHoist] Some small cleanups

No functional change is intended, just trying to clean things up a
little.

llvm-svn: 275743

8 years ago[GVN] Move other PRE tests to a subdirectory.
Davide Italiano [Sun, 17 Jul 2016 23:55:20 +0000 (23:55 +0000)]
[GVN] Move other PRE tests to a subdirectory.

llvm-svn: 275742

8 years ago[GVN] Move the PRE/LOADPRE test in a subdirectory.
Davide Italiano [Sun, 17 Jul 2016 23:48:18 +0000 (23:48 +0000)]
[GVN] Move the PRE/LOADPRE test in a subdirectory.

llvm-svn: 275741

8 years ago[compiler-rt] Change all asm directives to __asm__ in cpu_model.
Alina Sbirlea [Sun, 17 Jul 2016 23:45:55 +0000 (23:45 +0000)]
[compiler-rt] Change all asm directives to __asm__ in cpu_model.

Summary:
Aiming to resolve failure in sanitizer bot by changning all asm directives to __asm__.
Also, consistency.

Reviewers: llvm-commits, echristo, vitalybuka

Subscribers: mehdi_amini

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

llvm-svn: 275740

8 years ago[GVN] Use FileCheck instead of grep for tests.
Davide Italiano [Sun, 17 Jul 2016 23:21:26 +0000 (23:21 +0000)]
[GVN] Use FileCheck instead of grep for tests.

llvm-svn: 275739

8 years agotest: add missing triple to test
Saleem Abdulrasool [Sun, 17 Jul 2016 22:54:42 +0000 (22:54 +0000)]
test: add missing triple to test

The test was relying on the default triple which may not be correct.  Explicitly
provide it a triple.  Should repair the windows on Linux builder.

llvm-svn: 275738

8 years agoCodeGen: honour dllstorage on ObjC types
Saleem Abdulrasool [Sun, 17 Jul 2016 22:27:44 +0000 (22:27 +0000)]
CodeGen: honour dllstorage on ObjC types

Add support for ObjC types to respect the DLLImport/DLLExport storage
annotations.  This only effects COFF output.  This would allow usage with
clang/C2, but not with clang/LLVM due to hard coded section names.

llvm-svn: 275737

8 years agoCodeGen: whitespace, formatting cleanups, NFC
Saleem Abdulrasool [Sun, 17 Jul 2016 22:27:41 +0000 (22:27 +0000)]
CodeGen: whitespace, formatting cleanups, NFC

Format some code which was oddly formatted.  Use a bit of auto to make the code
more legible.  NFC.

llvm-svn: 275736

8 years agoCodeGen: whitespace cleanup, StringRef usage in ObjC EH type construction
Saleem Abdulrasool [Sun, 17 Jul 2016 22:27:38 +0000 (22:27 +0000)]
CodeGen: whitespace cleanup, StringRef usage in ObjC EH type construction

Clean up some formatting issues and use a bit more StringRef based operations
instead of SmallStrings.  NFC.

llvm-svn: 275735

8 years agoCheck for unconstrained hash equality before constrained hash equality.
Eric Fiselier [Sun, 17 Jul 2016 22:04:57 +0000 (22:04 +0000)]
Check for unconstrained hash equality before constrained hash equality.

This patch implements a simple optimization in __hash_table::find. When iterating
the found bucket we only constrain the bucket elements hash if it doesn't
already match the unconstrained hash of the specified key. This prevent
the performance of an expensive modulo operation.

Since the bucket element almost always matches the key, especially when the
load factor is low, this optimization has large performance impacts. For
a unordered_set<int> of random integers this patch improves the performance of
'find(...)' by 40%.

llvm-svn: 275734

8 years agoRefactor (with some rewriting) the DynamicLoaderMacOSX plugin into
Jason Molenda [Sun, 17 Jul 2016 21:27:32 +0000 (21:27 +0000)]
Refactor (with some rewriting) the DynamicLoaderMacOSX plugin into
a base class and a derived class, with the derived class containing
the methods specific to reading dyld's all_image_infos, dyld's
method of specifying images that have been loaded or unloaded, the
place where we put a breakpoint in dyld to get notified about newly
loaded or unloaded images.

This is in preparation for a second derived class which will use
some alternate methods for getting this information; that will be
a separate commit in the next few days.

There's a couple of ivars that should probably be in the derived
DyanmicLoaderMacOSX class instead of the base DynamicLoaderDarwin
class (m_dyld_image_infos, m_dyld_image_infos_stop_id).  I don't
think I'll need to use these in the new derived class - I'll
move them down to DynamicLoaderMacOSX if it works out that way;
it'll simplify locking if I can do that.

<rdar://problem/25251243>

llvm-svn: 275733

8 years agoFix std::experimental::optional tests. Patch from Casey Carter.
Eric Fiselier [Sun, 17 Jul 2016 20:32:30 +0000 (20:32 +0000)]
Fix std::experimental::optional tests. Patch from Casey Carter.

llvm-svn: 275732

8 years agoInitialize the "is_loaded" local in LoadModuleAtAddress in
Jason Molenda [Sun, 17 Jul 2016 20:01:54 +0000 (20:01 +0000)]
Initialize the "is_loaded" local in LoadModuleAtAddress in
case Process::GetFileLoadAddress fails to set it to a real
value.  (fixing "conditional use of garbage value" clang warning)

llvm-svn: 275731

8 years agoAttempt to work around MSVC rejects-valid, round 2.
Richard Smith [Sun, 17 Jul 2016 20:00:59 +0000 (20:00 +0000)]
Attempt to work around MSVC rejects-valid, round 2.

llvm-svn: 275730

8 years agoAdd missing break stmt to DW_CFA_GNU_args_size case.
Jason Molenda [Sun, 17 Jul 2016 19:57:49 +0000 (19:57 +0000)]
Add missing break stmt to DW_CFA_GNU_args_size case.

llvm-svn: 275729

8 years agoUnbreak msan buildbot.
Rui Ueyama [Sun, 17 Jul 2016 19:55:22 +0000 (19:55 +0000)]
Unbreak msan buildbot.

llvm-svn: 275728

8 years agoPR28589: attempt to work around MSVC rejects-valid.
Richard Smith [Sun, 17 Jul 2016 19:24:51 +0000 (19:24 +0000)]
PR28589: attempt to work around MSVC rejects-valid.

llvm-svn: 275727

8 years agoStrip trailing whitespace
Simon Pilgrim [Sun, 17 Jul 2016 19:02:27 +0000 (19:02 +0000)]
Strip trailing whitespace

llvm-svn: 275726

8 years ago[X86] Add CTPOP/CTLZ/CTTZ scalar cost tests
Simon Pilgrim [Sun, 17 Jul 2016 18:29:19 +0000 (18:29 +0000)]
[X86] Add CTPOP/CTLZ/CTTZ scalar cost tests

llvm-svn: 275725

8 years agoRemove dead code.
Rui Ueyama [Sun, 17 Jul 2016 18:27:17 +0000 (18:27 +0000)]
Remove dead code.

llvm-svn: 275724

8 years agoAdd tests for max/minIntN(64).
Justin Lebar [Sun, 17 Jul 2016 18:19:28 +0000 (18:19 +0000)]
Add tests for max/minIntN(64).

Summary:
Given that we had a bug on max/minUIntN(64), these should have tests
too.

Reviewers: rnk

Subscribers: dylanmckay, llvm-commits

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

llvm-svn: 275723

8 years agoAvoid UB in maxIntN(64).
Justin Lebar [Sun, 17 Jul 2016 18:19:26 +0000 (18:19 +0000)]
Avoid UB in maxIntN(64).

Summary:
Previously we were relying on 2's complement underflow in an int64_t.
Now we cast to a uint64_t so we explicitly get the behavior we want.

Reviewers: rnk

Subscribers: dylanmckay, llvm-commits

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

llvm-svn: 275722

8 years agoClean up some comments in MathExtras.h.
Justin Lebar [Sun, 17 Jul 2016 18:19:25 +0000 (18:19 +0000)]
Clean up some comments in MathExtras.h.

Reviewers: rnk

Subscribers: llvm-commits, dylanmckay

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

llvm-svn: 275721

8 years agoAdd assertions checking SignExtend{32,64}'s bit width.
Justin Lebar [Sun, 17 Jul 2016 18:19:23 +0000 (18:19 +0000)]
Add assertions checking SignExtend{32,64}'s bit width.

Summary:
The bit width must be greater than zero, otherwise we shift by the
integer's width, which is UB.  Also (more obviously) the width must be
less than or equal to the integer's width, otherwise we shift by a
negative number, which is also UB.

Reviewers: rnk

Subscribers: llvm-commits, dylanmckay

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

llvm-svn: 275720

8 years agoFix isShiftedInt and isShiftedUint for widths > 32.
Justin Lebar [Sun, 17 Jul 2016 18:19:21 +0000 (18:19 +0000)]
Fix isShiftedInt and isShiftedUint for widths > 32.

Summary:
Previously we were doing 1 << S.  "1" is an int, so this doesn't work
when S >= 32.

This patch also adds some static_asserts to these functions to ensure
that we don't hit UB by shifting left too much.

Reviewers: rnk

Subscribers: llvm-commits, dylanmckay

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

llvm-svn: 275719

8 years agoUse a faster implementation of maxUIntN.
Justin Lebar [Sun, 17 Jul 2016 18:19:19 +0000 (18:19 +0000)]
Use a faster implementation of maxUIntN.

Summary:
On x86-64 with clang 3.8, before:

   mov     edx, 1
   mov     cl, dil
   shl     rdx, cl
   cmp     rdi, 64
   mov     rax, -1
   cmovne  rax, rdx
   ret

after:

  mov     ecx, 64
  sub     ecx, edi
  mov     rax, -1
  shr     rax, cl
  ret

Reviewers: rnk

Subscribers: dylanmckay, mkuper, llvm-commits

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

llvm-svn: 275718

8 years agoFix warnings in ImmutableSetTest and SequenceTest.
Justin Lebar [Sun, 17 Jul 2016 18:10:30 +0000 (18:10 +0000)]
Fix warnings in ImmutableSetTest and SequenceTest.

Doing "I++" inside of an EXPECT_* triggers

  warning: expression with side effects has no effect in an unevaluated context

because EXPECT_* partially expands to

  EqHelper<(sizeof(::testing::internal::IsNullLiteralHelper(i++)) == 1)>

which is an unevaluated context.

llvm-svn: 275717

8 years agoImplement almost-zero-cost --trace-symbol.
Rui Ueyama [Sun, 17 Jul 2016 17:50:09 +0000 (17:50 +0000)]
Implement almost-zero-cost --trace-symbol.

--trace-symbol is a command line option to watch a symbol.
Previosly, we looked up a hash table for a new symbol if the
option is given. Any code that looks up a hash table for each
symbol is expensive because the linker handles a lot of symbols.
In our design, we look up a hash table strictly only once
for a symbol, so --trace-symbol was an exception.

This patch improves efficiency of the option by merging the
hash table into the symbol table.

Instead of looking up a separate hash table with a string,
this patch sets `Traced` flag to symbols specified by --trace-symbol.
So, if you insert a symbol and get a symbol with `Traced` flag on,
you know that you need to print out a log message for the symbol.
This is nearly zero cost.

llvm-svn: 275716

8 years agoMake Lazy's ctro protected because it shouldn't be instantiated directly.
Rui Ueyama [Sun, 17 Jul 2016 17:44:41 +0000 (17:44 +0000)]
Make Lazy's ctro protected because it shouldn't be instantiated directly.

llvm-svn: 275715

8 years agoRemove duplicate public specifier.
Rui Ueyama [Sun, 17 Jul 2016 17:44:40 +0000 (17:44 +0000)]
Remove duplicate public specifier.

llvm-svn: 275714

8 years ago[X86][AVX] Added VBROADCASTF128/VBROADCASTI128 tests
Simon Pilgrim [Sun, 17 Jul 2016 17:44:18 +0000 (17:44 +0000)]
[X86][AVX] Added VBROADCASTF128/VBROADCASTI128 tests

llvm-svn: 275713

8 years agoPrint out file names for common symbols for --trace-symbol.
Rui Ueyama [Sun, 17 Jul 2016 17:36:22 +0000 (17:36 +0000)]
Print out file names for common symbols for --trace-symbol.

Previously, there was no way to get a file name for a DefinedCommon
symbol. This patch adds it.

llvm-svn: 275712

8 years agoHandle versioned symbols efficiently.
Rui Ueyama [Sun, 17 Jul 2016 17:23:17 +0000 (17:23 +0000)]
Handle versioned symbols efficiently.

Versions can be assigned to symbols in two different ways.
One is the usual version scripts, and the other is special
symbol suffix '@'. If a symbol contains '@', the string after
that is considered to specify a version name.

Previously, we look for '@' for all symbols.

Anything that works on every symbol can be expensive because
the linker has to handle a lot of symbols. The search for '@'
was not an exception.

In this patch, I made two optimizations.

The first optimization is to handle '@' only when at least one
version is defined. If no versions are defined, no versions can
be assigned to any symbols, so it's waste of time to search for '@'.

The second optimization is to scan only suffixes of symbol names
instead of entire symbol names. Symbol names can be very long, but
symbol versions are usually short, so scanning entire symbol names
is waste of time, too.

There are some error cases which we no longer be able to detect
with this patch. I don't think it's a major drawback because they
are minor errors. Speed is more important.

This change improves LLD with debug info self-link time from
6.6993 seconds to 6.3426 seconds (or -5.3%).

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

llvm-svn: 275711

8 years ago[X86] Regenerated ctlz/cttz scalar tests for 32/64-bit targets with/without LZCNT...
Simon Pilgrim [Sun, 17 Jul 2016 16:15:51 +0000 (16:15 +0000)]
[X86] Regenerated ctlz/cttz scalar tests for 32/64-bit targets with/without LZCNT/TZCNT support

llvm-svn: 275710

8 years ago[X86] Regenerated popcnt scalar tests for 32/64-bit targets with/without POPCNT support
Simon Pilgrim [Sun, 17 Jul 2016 16:04:19 +0000 (16:04 +0000)]
[X86] Regenerated popcnt scalar tests for 32/64-bit targets with/without POPCNT support

llvm-svn: 275709

8 years ago[X86][SSE] lowerVectorShuffleAsPermuteAndUnpack tidyup. NFCI.
Simon Pilgrim [Sun, 17 Jul 2016 15:48:25 +0000 (15:48 +0000)]
[X86][SSE] lowerVectorShuffleAsPermuteAndUnpack tidyup. NFCI.

Moved unpack type determination into TryUnpack lambda.

Added missing comment describing lowerVectorShuffleAsPermuteAndUnpack call.

llvm-svn: 275708

8 years ago[ThinLTO] Perform profile-guided indirect call promotion
Teresa Johnson [Sun, 17 Jul 2016 14:47:01 +0000 (14:47 +0000)]
[ThinLTO] Perform profile-guided indirect call promotion

Summary:
To enable profile-guided indirect call promotion in ThinLTO mode, we
simply add call graph edges for each profitable target from the profile
to the summaries, then the summary-guided importing will consider the
callee for importing as usual.

Also we need to enable the indirect call promotion pass creation in the
PassManagerBuilder when PerformThinLTO=true (we are in the ThinLTO
backend), so that the newly imported functions are considered for
promotion in the backends.

The IC promotion profiles refer to callees by GUID, which required
adding GUIDs to the per-module VST in bitcode (and assigning them
valueIds similar to how they are assigned valueIds in the combined
index).

Reviewers: mehdi_amini, xur

Subscribers: mehdi_amini, davidxl, llvm-commits

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

llvm-svn: 275707

8 years agoAddress review comments.
Teresa Johnson [Sun, 17 Jul 2016 14:46:58 +0000 (14:46 +0000)]
Address review comments.

llvm-svn: 275706

8 years agoRefactor indirect call promotion profitability analysis (NFC)
Teresa Johnson [Sun, 17 Jul 2016 14:46:54 +0000 (14:46 +0000)]
Refactor indirect call promotion profitability analysis (NFC)

Summary:
Refactored the profitability analysis out of the IC promotion pass and
into lib/Analysis so that it can be accessed by the summary index
builder in a follow-on patch to enable IC promotion in ThinLTO (D21932).

Reviewers: davidxl, xur

Subscribers: llvm-commits

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

llvm-svn: 275705

8 years agotest commit
Guy Blank [Sun, 17 Jul 2016 12:10:35 +0000 (12:10 +0000)]
test commit

llvm-svn: 275703

8 years agoX86: Updated a test file. NFC.
Elena Demikhovsky [Sun, 17 Jul 2016 07:03:13 +0000 (07:03 +0000)]
X86: Updated a test file. NFC.

This test shows subotimal code generated for AVX-512 vs PENTIUM4.
The issue will be fixed in an upcomming commit.

llvm-svn: 275702

8 years agoAdd a pointer to a source file to SymbolBody.
Rui Ueyama [Sun, 17 Jul 2016 03:11:46 +0000 (03:11 +0000)]
Add a pointer to a source file to SymbolBody.

Previously, each subclass of SymbolBody had a pointer to a source
file from which it was created. So, there was no single way to get
a source file for a symbol. We had getSourceFile<ELFT>(), but the
function was a bit inconvenient as it's a template.

This patch makes SymbolBody have a pointer to a source file.
If a symbol is not created from a file, the pointer has a nullptr.

llvm-svn: 275701

8 years agoDo not invoke FileCheck with `not` command.
Rui Ueyama [Sun, 17 Jul 2016 01:34:39 +0000 (01:34 +0000)]
Do not invoke FileCheck with `not` command.

We should use CHECK-NOT instead.

llvm-svn: 275700

8 years ago[CodeGen] Some assorted cleanups
David Majnemer [Sun, 17 Jul 2016 00:39:12 +0000 (00:39 +0000)]
[CodeGen] Some assorted cleanups

No functional change, just some cleanups:
- Use auto when it is appropriate.
- There were some strange static_casts which were superfluous.
- Use range-based for loops when appropriate.
- The dyn_cast_or_null construct was used when null was impossible.

llvm-svn: 275699

8 years ago[PM] Convert IVUsers analysis to new pass manager.
Dehao Chen [Sat, 16 Jul 2016 22:51:33 +0000 (22:51 +0000)]
[PM] Convert IVUsers analysis to new pass manager.

Summary: Convert IVUsers analysis to new pass manager.

Reviewers: davidxl, silvas

Subscribers: junbuml, sanjoy, llvm-commits, mzolotukhin

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

llvm-svn: 275698

8 years agoCodeGen: use StringRefs more in ObjC class generation, NFC
Saleem Abdulrasool [Sat, 16 Jul 2016 22:42:06 +0000 (22:42 +0000)]
CodeGen: use StringRefs more in ObjC class generation, NFC

Rather than building up a number of SmallString-s in order to construct a
std::string, use more StringRefs and construct the string once before use.  This
avoids unnecessary string constructions.  NFC.

llvm-svn: 275697

8 years agoCodeGen: simplify using a local variable, NFC
Saleem Abdulrasool [Sat, 16 Jul 2016 22:42:04 +0000 (22:42 +0000)]
CodeGen: simplify using a local variable, NFC

Add a couple of local variables for the class interface and the super class
interface.  This allows for the repeated access of the information to be cached
and makes the code simpler to understand.  NFC.

llvm-svn: 275696

8 years agoAttempt to unbreak Windows bot.
Rui Ueyama [Sat, 16 Jul 2016 19:16:15 +0000 (19:16 +0000)]
Attempt to unbreak Windows bot.

llvm-svn: 275695

8 years agoRemove redundant namespace specifiers.
Rui Ueyama [Sat, 16 Jul 2016 18:55:47 +0000 (18:55 +0000)]
Remove redundant namespace specifiers.

llvm-svn: 275694

8 years agoResurrect code that was lost in conflicting commits.
Rui Ueyama [Sat, 16 Jul 2016 18:45:25 +0000 (18:45 +0000)]
Resurrect code that was lost in conflicting commits.

llvm-svn: 275693

8 years agoUse skip() instead of peek() and expect().
Rui Ueyama [Sat, 16 Jul 2016 18:45:23 +0000 (18:45 +0000)]
Use skip() instead of peek() and expect().

llvm-svn: 275692

8 years ago[InstCombine] allow X + signbit --> X ^ signbit for vector splats
Sanjay Patel [Sat, 16 Jul 2016 18:29:26 +0000 (18:29 +0000)]
[InstCombine] allow X + signbit --> X ^ signbit for vector splats

llvm-svn: 275691

8 years agoadd vector test to show missing transform
Sanjay Patel [Sat, 16 Jul 2016 18:24:18 +0000 (18:24 +0000)]
add vector test to show missing transform

llvm-svn: 275690

8 years agoIPRA: avoid double query to the map (NFC)
Mehdi Amini [Sat, 16 Jul 2016 18:20:26 +0000 (18:20 +0000)]
IPRA: avoid double query to the map (NFC)

llvm-svn: 275689

8 years agoupdate tests to use FileCheck, consolidate tests, fix comments
Sanjay Patel [Sat, 16 Jul 2016 18:08:22 +0000 (18:08 +0000)]
update tests to use FileCheck, consolidate tests, fix comments

llvm-svn: 275688

8 years agoupdate test to use FileCheck
Sanjay Patel [Sat, 16 Jul 2016 16:31:58 +0000 (16:31 +0000)]
update test to use FileCheck

llvm-svn: 275687

8 years agoauto-generate checks
Sanjay Patel [Sat, 16 Jul 2016 16:27:58 +0000 (16:27 +0000)]
auto-generate checks

llvm-svn: 275686

8 years agoauto-ggenerate checks
Sanjay Patel [Sat, 16 Jul 2016 16:24:06 +0000 (16:24 +0000)]
auto-ggenerate checks

llvm-svn: 275685

8 years ago[InstCombine] reassociate logic ops with constants separated by a zext
Sanjay Patel [Sat, 16 Jul 2016 15:20:19 +0000 (15:20 +0000)]
[InstCombine] reassociate logic ops with constants separated by a zext

This is a partial implementation of a general fold for associative+commutative operators:
(op (cast (op X, C2)), C1) --> (cast (op X, op (C1, C2)))
(op (cast (op X, C2)), C1) --> (op (cast X), op (C1, C2))

There are 7 associative operators and 13 cast types, so this could potentially go a lot further.

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

llvm-svn: 275684

8 years agoUpdate for r275682:
George Rimar [Sat, 16 Jul 2016 12:34:06 +0000 (12:34 +0000)]
Update for r275682:

I think
# REQUIRES: shell
is required instead of
# XFAIL: win32

llvm-svn: 275683

8 years agoRecommit r275257 "[ELF] - Implement extern "c++" version script tag"
George Rimar [Sat, 16 Jul 2016 12:26:39 +0000 (12:26 +0000)]
Recommit r275257 "[ELF] - Implement extern "c++" version script tag"

BSD toolchain contains a bug:
https://sourceforge.net/p/elftoolchain/tickets/491/

In short demangler works differently, fix was to update the testcase.
It should fix the FreeBSD bot failture:
http://lab.llvm.org:8011/builders/lld-x86_64-freebsd/builds/19432/steps/test_lld/logs/stdio

Original commit message was:
[ELF] - Implement extern "c++" version script tag

Patch implements 'extern' version script tag.
Currently only values in quotes(") are supported.

Matching of externs is performed in the same pass as exact match of globals.

Differential revision: http://reviews.llvm.org/D21930

llvm-svn: 275682

8 years ago[clang-rename] remove obsolete tests and apply fixes to existing
Kirill Bobyrev [Sat, 16 Jul 2016 08:55:01 +0000 (08:55 +0000)]
[clang-rename] remove obsolete tests and apply fixes to existing

Few tests introduced by previous patch had obsolete counterparts.

Applied fixes to {Dynamic|Static}CastExpr.cpp

llvm-svn: 275681

8 years agoGPGPU: Abort if any dummy function is called
Tobias Grosser [Sat, 16 Jul 2016 07:30:27 +0000 (07:30 +0000)]
GPGPU: Abort if any dummy function is called

This ensures that accidental calls to these functions will break loadly instead
of corrupting the stack with invalid return values.

These functions have been introduced earlier as replacement of pet and parts of
ppcg which we will never use and consequently have not been imported or compiled
into Polly.

llvm-svn: 275680

8 years agoRevert "Revert r275029 - Update Clang tests after adding inference for the returned...
Hal Finkel [Sat, 16 Jul 2016 07:22:09 +0000 (07:22 +0000)]
Revert "Revert r275029 - Update Clang tests after adding inference for the returned argument attribute"

This reverts commit r275043 after reapplying the underlying LLVM commit.

llvm-svn: 275679

8 years agoRevert "Revert r275027 - Let FuncAttrs infer the 'returned' argument attribute"
Hal Finkel [Sat, 16 Jul 2016 07:21:28 +0000 (07:21 +0000)]
Revert "Revert r275027 - Let FuncAttrs infer the 'returned' argument attribute"

This reverts commit r275042; the initial commit triggered self-hosting failures
on ARM/AArch64. James Molloy identified the problematic backend code, which has
been disabled in r275677. Trying again...

Original commit message:

Let FuncAttrs infer the 'returned' argument attribute

A function can have one argument with the 'returned' attribute, indicating that
the associated argument is always the return value of the function. Add
FuncAttrs inference logic.

llvm-svn: 275678

8 years agoDisable this-return argument forwarding on ARM/AArch64
Hal Finkel [Sat, 16 Jul 2016 07:07:29 +0000 (07:07 +0000)]
Disable this-return argument forwarding on ARM/AArch64

r275042 reverted function-attribute inference for the 'returned' attribute
because the feature triggered self-hosting failures on ARM and AArch64. James
Molloy determined that the this-return argument forwarding feature, which
directly ties the returned input argument to the returned value, was the cause.
It seems likely that this forwarding code contains, or triggers, a subtle bug.
Disabling for now until we can track that down.

llvm-svn: 275677

8 years agoRe-commit [AMDGPU] Add metadata for runtime
Yaxun Liu [Sat, 16 Jul 2016 05:09:21 +0000 (05:09 +0000)]
Re-commit [AMDGPU] Add metadata for runtime

Attempting to fix lit test failure on ppc.

llvm-svn: 275676

8 years agoSimplify. NFC.
Rui Ueyama [Sat, 16 Jul 2016 04:19:29 +0000 (04:19 +0000)]
Simplify. NFC.

llvm-svn: 275675

8 years agoRename SymbolVersions VersionDefinitions.
Rui Ueyama [Sat, 16 Jul 2016 04:09:27 +0000 (04:09 +0000)]
Rename SymbolVersions VersionDefinitions.

SymbolVersions sounds like it had versions for a symbol, so rename it.

llvm-svn: 275674

8 years agoRename Version VersionDefinition.
Rui Ueyama [Sat, 16 Jul 2016 04:02:00 +0000 (04:02 +0000)]
Rename Version VersionDefinition.

The identifier `Version` was used too often in the code to handle
symbol versions. The struct that contains version definitions is
named `Version`. Local variables for version ID are named `Version`.
Local varaible for version string are named `Version`.

This patch give them different names.

llvm-svn: 275673

8 years agoUse ScriptParserBase::skip() instead of peek() and next().
Rui Ueyama [Sat, 16 Jul 2016 03:45:59 +0000 (03:45 +0000)]
Use ScriptParserBase::skip() instead of peek() and next().

skip(S) consumes a token if the next token is S,
so it can be used instead of peek() & next().

llvm-svn: 275672

8 years ago[AVX512] Remove CodeGenOnly VBROADCAST m_Int instructions. They can be implemented...
Craig Topper [Sat, 16 Jul 2016 03:42:59 +0000 (03:42 +0000)]
[AVX512] Remove CodeGenOnly VBROADCAST m_Int instructions. They can be implemented with patterns selecting existing instructions. NFC

llvm-svn: 275671

8 years agoSimplify. NFC.
Rui Ueyama [Sat, 16 Jul 2016 03:12:16 +0000 (03:12 +0000)]
Simplify. NFC.

llvm-svn: 275670

8 years agoSimplify default symbol version management. NFC.
Rui Ueyama [Sat, 16 Jul 2016 03:08:26 +0000 (03:08 +0000)]
Simplify default symbol version management. NFC.

llvm-svn: 275669

8 years ago[Driver] Add flags for enabling both types of PGO Instrumentation
Sean Silva [Sat, 16 Jul 2016 02:54:58 +0000 (02:54 +0000)]
[Driver] Add flags for enabling both types of PGO Instrumentation

The flags:
Enable IR-level instrumentation -fprofile-generate or -fprofile-generate=
When applying profile data: -fprofile-use=/path/to/profdata

Patch by Jake VanAdrighem!

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

llvm-svn: 275668

8 years agoRemove redundant variable.
Rui Ueyama [Sat, 16 Jul 2016 02:47:42 +0000 (02:47 +0000)]
Remove redundant variable.

llvm-svn: 275667

8 years agoSet sh_addralign in the constructor for consistency. NFC.
Rui Ueyama [Sat, 16 Jul 2016 02:36:00 +0000 (02:36 +0000)]
Set sh_addralign in the constructor for consistency. NFC.

llvm-svn: 275666

8 years agoMake Verdef and Verdaux adjacent in the version definition section.
Rui Ueyama [Sat, 16 Jul 2016 02:29:45 +0000 (02:29 +0000)]
Make Verdef and Verdaux adjacent in the version definition section.

Previously, Verdefs and Verdauxs are separated in the section.
The new layout is easier to write as we do not have to maintain
two pointers and can avoid passing a reference to a pointer.

llvm-svn: 275665

8 years agollc: Add support for -run-pass none
Matthias Braun [Sat, 16 Jul 2016 02:24:59 +0000 (02:24 +0000)]
llc: Add support for -run-pass none

This does not schedule any passes besides the ones necessary to
construct and print the machine function. This is useful to test .mir
file reading and printing.

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

llvm-svn: 275664

8 years agollc: Move pass query/add code into an own function; NFC
Matthias Braun [Sat, 16 Jul 2016 02:24:15 +0000 (02:24 +0000)]
llc: Move pass query/add code into an own function; NFC

llvm-svn: 275663

8 years agoARM/MIR: Move test from MIR to CodeGen/ARM directory
Matthias Braun [Sat, 16 Jul 2016 02:24:13 +0000 (02:24 +0000)]
ARM/MIR: Move test from MIR to CodeGen/ARM directory

test/CodeGen/MIR/ARM/ARMLoadStoreDBG.mir is an actual test for the ARM
load store optimization pass and not a test of the mir parser/printer.

It belongs to test/CodeGen/ARM; This also updates the test to use the
new -run-pass llc syntax.

llvm-svn: 275662

8 years agoARM: Initialize LoadStore passes in TargetMachine
Matthias Braun [Sat, 16 Jul 2016 02:24:10 +0000 (02:24 +0000)]
ARM: Initialize LoadStore passes in TargetMachine

Initializing them in LLVMInitializeARMTarget() makes them visible early
enough for "llc -run-pass usage".

This required the pass to be renamed from "arm-load-store-opt" to
"arm-ldst-opt", because there already exists an arm-load-store-opt
cl::opt switch which would now clash with the passname getting added as
a switch in opt. On the bright side the pass name now matches the
DEBUG_TYPE name. Renamed "arm-prera-load-store-opt" to
"arm-repra-ldst-opt" as well for consistency.

llvm-svn: 275661

8 years agoUse SymbolVersion::Id instead of a hard-coded local variable.
Rui Ueyama [Sat, 16 Jul 2016 02:00:43 +0000 (02:00 +0000)]
Use SymbolVersion::Id instead of a hard-coded local variable.

llvm-svn: 275660

8 years agoReword comment to be more clear.
Eric Christopher [Sat, 16 Jul 2016 01:55:45 +0000 (01:55 +0000)]
Reword comment to be more clear.

llvm-svn: 275659

8 years agoMIParser: reject subregister indexes on physregs
Matthias Braun [Sat, 16 Jul 2016 01:36:18 +0000 (01:36 +0000)]
MIParser: reject subregister indexes on physregs

llvm-svn: 275658

8 years agoFix modules buildbot after r275633.
Richard Smith [Sat, 16 Jul 2016 01:05:39 +0000 (01:05 +0000)]
Fix modules buildbot after r275633.

llvm-svn: 275657

8 years agoDon't do uint64_t(1) << 64 in maxUIntN.
Justin Lebar [Sat, 16 Jul 2016 00:59:41 +0000 (00:59 +0000)]
Don't do uint64_t(1) << 64 in maxUIntN.

Summary:
This shift is undefined behavior (and, as compiled by clang, gives the
wrong answer for maxUIntN(64)).

Reviewers: mkuper

Subscribers: llvm-commits, jroelofs, rsmith

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

llvm-svn: 275656

8 years agoRemove extra semi-colon. Fixes warning and Werror bots.
Eric Christopher [Sat, 16 Jul 2016 00:58:34 +0000 (00:58 +0000)]
Remove extra semi-colon. Fixes warning and Werror bots.

llvm-svn: 275655

8 years ago[ObjC] Implement @available in the Parser and AST
Erik Pilkington [Sat, 16 Jul 2016 00:35:23 +0000 (00:35 +0000)]
[ObjC] Implement @available in the Parser and AST

This patch adds a new AST node: ObjCAvailabilityCheckExpr, and teaches the
Parser and Sema to generate it. This node represents an availability check of
the form:

  @available(macos 10.10, *);

Which will eventually compile to a runtime check of the host's OS version. This
is the first patch of the feature I proposed here:
http://lists.llvm.org/pipermail/cfe-dev/2016-July/049851.html

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

llvm-svn: 275654

8 years agoReimplement ExternalSemaSource delegation in terms of
Richard Smith [Sat, 16 Jul 2016 00:35:14 +0000 (00:35 +0000)]
Reimplement ExternalSemaSource delegation in terms of
MultiplexExternalSemaSource to remove one of the places that needs updating
every time the ExternalSemaSource interface changes.

llvm-svn: 275653

8 years agoFixed the location of the Swift bindings in the Xcode build.
Sean Callanan [Sat, 16 Jul 2016 00:18:24 +0000 (00:18 +0000)]
Fixed the location of the Swift bindings in the Xcode build.

$BUILT_PRODUCTS_DIR is usually the same as $CONFIGURATION_BUILD_DIR, but differs
when LLDB is being built BuildAndIntegration, in which case $BUILT_PRODUCTS_DIR
is more accurate.

llvm-svn: 275652

8 years agoUse std::string instead of StringRef when generating the auxiliar triple in the front...
Samuel Antao [Sat, 16 Jul 2016 00:15:56 +0000 (00:15 +0000)]
Use std::string instead of StringRef when generating the auxiliar triple in the frontend tool.

llvm-svn: 275651

8 years agoAttempt to fix breakage caused by r275645 for Windows bots.
Samuel Antao [Fri, 15 Jul 2016 23:51:21 +0000 (23:51 +0000)]
Attempt to fix breakage caused by r275645 for Windows bots.

llvm-svn: 275650

8 years ago[libFuzzer] add hooks for strstr, strcasestr, strcasecmp, strncasecmp
Kostya Serebryany [Fri, 15 Jul 2016 23:27:19 +0000 (23:27 +0000)]
[libFuzzer] add hooks for strstr, strcasestr, strcasecmp, strncasecmp

llvm-svn: 275648

8 years ago[llvm-cov] Attempt to appease an older builder
Vedant Kumar [Fri, 15 Jul 2016 23:15:35 +0000 (23:15 +0000)]
[llvm-cov] Attempt to appease an older builder

It's using a version of clang which can't (or won't) deduce an implicit
conversion from a SmallString to a StringRef. Write the conversion out
explicitly:

  http://lab.llvm.org:8011/builders/lldb-x86_64-ubuntu-14.04-buildserver/builds/8574

llvm-svn: 275647

8 years agobugpoint: add flag -verbose-errors
Sebastian Pop [Fri, 15 Jul 2016 23:15:06 +0000 (23:15 +0000)]
bugpoint: add flag -verbose-errors

The default behavior of bugpoint is to print "<crash>" when it finds a reduced
test that crashes compilation.  With this flag we now can see the output of the
crashing program.  This is useful to make sure it is the same error being
tracked down and not a different error that happens to crash the compiler as
well.

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

llvm-svn: 275646

8 years ago[CUDA][OpenMP] Create generic offload action
Samuel Antao [Fri, 15 Jul 2016 23:13:27 +0000 (23:13 +0000)]
[CUDA][OpenMP] Create generic offload action

Summary:
This patch replaces the CUDA specific action by a generic offload action. The offload action may have multiple dependences classier in “host” and “device”. The way this generic offloading action is used is very similar to what is done today by the CUDA implementation: it is used to set a specific toolchain and architecture to its dependences during the generation of jobs.

This patch also proposes propagating the offloading information through the action graph so that that information can be easily retrieved at any time during the generation of commands. This allows e.g. the "clang tool” to evaluate whether CUDA should be supported for the device or host and ptas to easily retrieve the target architecture.

This is an example of how the action graphs would look like (compilation of a single CUDA file with two GPU architectures)
```
0: input, "cudatests.cu", cuda, (host-cuda)
1: preprocessor, {0}, cuda-cpp-output, (host-cuda)
2: compiler, {1}, ir, (host-cuda)
3: input, "cudatests.cu", cuda, (device-cuda, sm_35)
4: preprocessor, {3}, cuda-cpp-output, (device-cuda, sm_35)
5: compiler, {4}, ir, (device-cuda, sm_35)
6: backend, {5}, assembler, (device-cuda, sm_35)
7: assembler, {6}, object, (device-cuda, sm_35)
8: offload, "device-cuda (nvptx64-nvidia-cuda:sm_35)" {7}, object
9: offload, "device-cuda (nvptx64-nvidia-cuda:sm_35)" {6}, assembler
10: input, "cudatests.cu", cuda, (device-cuda, sm_37)
11: preprocessor, {10}, cuda-cpp-output, (device-cuda, sm_37)
12: compiler, {11}, ir, (device-cuda, sm_37)
13: backend, {12}, assembler, (device-cuda, sm_37)
14: assembler, {13}, object, (device-cuda, sm_37)
15: offload, "device-cuda (nvptx64-nvidia-cuda:sm_37)" {14}, object
16: offload, "device-cuda (nvptx64-nvidia-cuda:sm_37)" {13}, assembler
17: linker, {8, 9, 15, 16}, cuda-fatbin, (device-cuda)
18: offload, "host-cuda (powerpc64le-unknown-linux-gnu)" {2}, "device-cuda (nvptx64-nvidia-cuda)" {17}, ir
19: backend, {18}, assembler
20: assembler, {19}, object
21: input, "cuda", object
22: input, "cudart", object
23: linker, {20, 21, 22}, image
```
The changes in this patch pass the existent regression tests (keeps the existent functionality) and resulting binaries execute correctly in a Power8+K40 machine.

Reviewers: echristo, hfinkel, jlebar, ABataev, tra

Subscribers: guansong, andreybokhanko, tcramer, mkuron, cfe-commits, arpith-jacob, carlo.bertolli, caomhin

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

llvm-svn: 275645

8 years ago[asan] trying to fix the windows build
Kostya Serebryany [Fri, 15 Jul 2016 23:13:03 +0000 (23:13 +0000)]
[asan] trying to fix the windows build

llvm-svn: 275644

8 years agoReapply "Mips: Avoid implicit iterator conversions, NFC"
Duncan P. N. Exon Smith [Fri, 15 Jul 2016 23:09:47 +0000 (23:09 +0000)]
Reapply "Mips: Avoid implicit iterator conversions, NFC"

This reverts commit r275562, effectively reapplying r275141.  Doug
Gilmore reported that there was an error when bisecting the Mips
buildbot failure, and that r275141 was not to blame after all.  Here is
the green build:
https://dmz-portal.mips.com/bb/builders/LLVM%20with%20integrated%20assembler%20and%20fPIC%20and%20-O0/builds/803

llvm-svn: 275643