platform/upstream/llvm.git
7 years ago[SLP] Vectorize jumbled memory loads.
Mohammad Shahid [Wed, 20 Sep 2017 17:19:57 +0000 (17:19 +0000)]
[SLP] Vectorize jumbled memory loads.

Summary:
This patch tries to vectorize loads of consecutive memory accesses, accessed
in non-consecutive or jumbled way. An earlier attempt was made with patch D26905
which was reverted back due to some basic issue with representing the 'use mask'
jumbled accesses.

This patch fixes the mask representation by recording the 'use mask' in the usertree entry.

Change-Id: I9fe7f5045f065d84c126fa307ef6ebe0787296df

Subscribers: mzolotukhin

Reviewed By: ayal

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

Review comments updated accordingly

Change-Id: I22ab0a8a9bac9d49d74baa81a08e1e486f5e75f0

Added a TODO for sortLoadAccesses API

Change-Id: I3c679bf1865422d1b45e17ea28f1992bca660b58

Modified the TODO for sortLoadAccesses API

Change-Id: Ie64a66cb5f9e2a7610438abb0e750c6e090f9565

Review comment update for using OpdNum to insert the mask in respective location

Change-Id: I016d0c1b29874e979efc0205bbf078991f92edce

Fixes '-Wsign-compare warning' in LoopAccessAnalysis.cpp and code rebase

Change-Id: I64b2ea5e68c1d7b6a028f5ef8251c5a97333f89b
llvm-svn: 313771

7 years ago[cmake] Add an option to build llvm with IR PGO
Vedant Kumar [Wed, 20 Sep 2017 17:16:01 +0000 (17:16 +0000)]
[cmake] Add an option to build llvm with IR PGO

This adds an LLVM_ENABLE_IR_PGO option to enable building llvm and its
tools with IR PGO instrumentation.

Usage: -DLLVM_BUILD_INSTRUMENTED=On -DLLVM_ENABLE_IR_PGO=On (both
options must be enabled)

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

llvm-svn: 313770

7 years ago[cmake] Unmark LLVM_BUILD_INSTRUMENTED_COVERAGE as experimental
Vedant Kumar [Wed, 20 Sep 2017 17:16:00 +0000 (17:16 +0000)]
[cmake] Unmark LLVM_BUILD_INSTRUMENTED_COVERAGE as experimental

The coverage bot has been stable for a while:

  http://lab.llvm.org:8080/coverage/coverage-reports/index.html

llvm-svn: 313769

7 years ago[docs] Make a note of LLVM_BUILD_INSTRUMENTED_COVERAGE
Vedant Kumar [Wed, 20 Sep 2017 17:16:00 +0000 (17:16 +0000)]
[docs] Make a note of LLVM_BUILD_INSTRUMENTED_COVERAGE

llvm-svn: 313768

7 years agoReland "[llvm-objcopy] Add support for .dynamic, .dynsym, and .dynstr"
Jake Ehrlich [Wed, 20 Sep 2017 17:11:58 +0000 (17:11 +0000)]
Reland "[llvm-objcopy] Add support for .dynamic, .dynsym, and .dynstr"

I overzealously landed this before I was sure that another change
wouldn't break the build that this change depends on.

This change adds support for sections involved in dynamic loading such
as SHT_DYNAMIC, SHT_DYNSYM, and allocated string tables.

The two added binaries used for tests can be downloaded here and here

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

llvm-svn: 313767

7 years ago[ThinLTO] Fix dead stripping analysis for SamplePGO
Teresa Johnson [Wed, 20 Sep 2017 17:09:47 +0000 (17:09 +0000)]
[ThinLTO] Fix dead stripping analysis for SamplePGO

Summary:
The fix for dead stripping analysis in the case of SamplePGO indirect
calls to local functions (r313151) introduced the possibility of an
infinite loop.

Make sure we check for the value being already live after we update it
for SamplePGO indirect call handling.

Reviewers: danielcdh

Subscribers: mehdi_amini, inglorion, llvm-commits, eraman

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

llvm-svn: 313766

7 years ago[lit] Reverse path list when updating environment vars.
Zachary Turner [Wed, 20 Sep 2017 17:08:20 +0000 (17:08 +0000)]
[lit] Reverse path list when updating environment vars.

Bug pointed out by EricWF.  This would construct a path where
items would be added in the wrong order, potentially leading
to using the wrong tools for testing.

llvm-svn: 313765

7 years agoDon't try to compute a value that is known to fail.
Rafael Espindola [Wed, 20 Sep 2017 16:42:56 +0000 (16:42 +0000)]
Don't try to compute a value that is known to fail.

We try to evaluate expressions early when possible, but it is not
possible to evaluate them early if they are based on a section.

Before we would get this wrong on ABSOLUTE expressions.

llvm-svn: 313764

7 years agoMake libcxx tests work when llvm sources are not present.
Zachary Turner [Wed, 20 Sep 2017 16:01:50 +0000 (16:01 +0000)]
Make libcxx tests work when llvm sources are not present.

Despite a strong CMake warning that this is an unsupported
libcxx build configuration, some bots still rely on being
able to check out lit and libcxx independently with no
LLVM sources, and then run lit against libcxx.

A previous patch broke that workflow, so this is making it work
again.  Unfortunately, it breaks generation of the llvm-lit
script for libcxx, but we will just have to live with that until
a solution is found that allows libcxx to make more use of
llvm build pieces.  libcxx can still run tests by using the
ninja check target, or by running lit.py directly against the
build tree or source tree.

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

llvm-svn: 313763

7 years agoDebugInfo: Remove unneeded attributes from test/DebugInfo/Generic/imported-name-inlin...
David Blaikie [Wed, 20 Sep 2017 15:59:57 +0000 (15:59 +0000)]
DebugInfo: Remove unneeded attributes from test/DebugInfo/Generic/imported-name-inlined.ll

Remove unneeded attributes from test/DebugInfo/Generic/imported-name-inlined.ll because it was causing failures on pure MIPS builds.

Patch by MiloÅ¡ Stojanović!

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

llvm-svn: 313762

7 years ago[mips] Add a valid test case to check the reason of the recent build-bot failure...
Simon Atanasyan [Wed, 20 Sep 2017 15:57:25 +0000 (15:57 +0000)]
[mips] Add a valid test case to check the reason of the recent build-bot failure. NFC

llvm-svn: 313761

7 years agoPut target deduced from executable name at the start of argument list
Serge Pavlov [Wed, 20 Sep 2017 15:22:27 +0000 (15:22 +0000)]
Put target deduced from executable name at the start of argument list

When clang is called as 'target-clang', put deduced target option at
the start of argument list so that option '--target=' specified in command
line could override it.

This change fixes PR34671.

llvm-svn: 313760

7 years ago[clangd] Put inacessible items to the end of completion list.
Ilya Biryukov [Wed, 20 Sep 2017 15:09:14 +0000 (15:09 +0000)]
[clangd] Put inacessible items to the end of completion list.

Reviewers: bkramer, krasimir

Reviewed By: krasimir

Subscribers: klimek, cfe-commits

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

llvm-svn: 313759

7 years agoRevert r313736: "[SLP] Vectorize jumbled memory loads."
Alexander Kornienko [Wed, 20 Sep 2017 14:53:07 +0000 (14:53 +0000)]
Revert r313736: "[SLP] Vectorize jumbled memory loads."

The revision breaks buildbots:
http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/6694/steps/test/logs/stdio

llvm-svn: 313758

7 years agoRevert r313753: "Fix a -Wsign-compare warning in LoopAccessAnalysis.cpp"
Alexander Kornienko [Wed, 20 Sep 2017 14:52:56 +0000 (14:52 +0000)]
Revert r313753: "Fix a -Wsign-compare warning in LoopAccessAnalysis.cpp"

llvm-svn: 313757

7 years agoReplace r313747, don't always warn on enums, rework testcases.
Roman Lebedev [Wed, 20 Sep 2017 13:50:01 +0000 (13:50 +0000)]
Replace r313747, don't always warn on enums, rework testcases.

As Aaron Ballman has pointed out, that is not really correct.
So the key problem there is the invalidity of the testcase.

Revert r313747, and rework testcase in such a way, so these
details (platform-specific default enum sigdness) are
accounted for.

Also, add a C++-specific testcase.

llvm-svn: 313756

7 years ago[X86][SSE] Add PR22415 test case
Simon Pilgrim [Wed, 20 Sep 2017 13:49:52 +0000 (13:49 +0000)]
[X86][SSE] Add PR22415 test case

llvm-svn: 313755

7 years ago[clangd] Serialize onDiagnosticsReady callbacks for the same file.
Ilya Biryukov [Wed, 20 Sep 2017 12:58:55 +0000 (12:58 +0000)]
[clangd] Serialize onDiagnosticsReady callbacks for the same file.

Summary:
Calls to onDiagnosticsReady were done concurrently before. This sometimes
led to older versions of diagnostics being reported to the user after
the newer versions.

Reviewers: klimek, bkramer, krasimir

Reviewed By: klimek

Subscribers: cfe-commits

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

llvm-svn: 313754

7 years agoFix a -Wsign-compare warning in LoopAccessAnalysis.cpp
Alexander Kornienko [Wed, 20 Sep 2017 12:18:22 +0000 (12:18 +0000)]
Fix a -Wsign-compare warning in LoopAccessAnalysis.cpp

llvm-svn: 313753

7 years ago[clang-tidy] Fix linkage-related compiler errors in clang-tidy tests
Alexander Kornienko [Wed, 20 Sep 2017 12:16:35 +0000 (12:16 +0000)]
[clang-tidy] Fix linkage-related compiler errors in clang-tidy tests

llvm-svn: 313752

7 years agoRecommit [MachineCombiner] Update instruction depths incrementally for large BBs.
Florian Hahn [Wed, 20 Sep 2017 11:54:37 +0000 (11:54 +0000)]
Recommit [MachineCombiner] Update instruction depths incrementally for large BBs.

This version of the patch fixes an off-by-one error causing PR34596. We
do not need to use std::next(BlockIter) when calling updateDepths, as
BlockIter already points to the next element.

Original commit message:
> For large basic blocks with lots of combinable instructions, the
> MachineTraceMetrics computations in MachineCombiner can dominate the compile
> time, as computing the trace information is quadratic in the number of
> instructions in a BB and it's relevant successors/predecessors.

> In most cases, knowing the instruction depth should be enough to make
> combination decisions. As we already iterate over all instructions in a basic
> block, the instruction depth can be computed incrementally. This reduces the
> cost of machine-combine drastically in cases where lots of instructions
> are combined. The major drawback is that AFAIK, computing the critical path
> length cannot be done incrementally. Therefore we only compute
> instruction depths incrementally, for basic blocks with more
> instructions than inc_threshold. The -machine-combiner-inc-threshold
> option can be used to set the threshold and allows for easier
> experimenting and checking if using incremental updates for all basic
> blocks has any impact on the performance.
>
> Reviewers: sanjoy, Gerolf, MatzeB, efriedma, fhahn
>
> Reviewed By: fhahn
>
> Subscribers: kiranchandramohan, javed.absar, efriedma, llvm-commits
>
> Differential Revision: https://reviews.llvm.org/D36619

llvm-svn: 313751

7 years ago[ScheduleOptimizer] Fix and test schedule tree statistics.
Michael Kruse [Wed, 20 Sep 2017 11:53:05 +0000 (11:53 +0000)]
[ScheduleOptimizer] Fix and test schedule tree statistics.

Fix walking over the schedule tree to collect its properties
(Number of permutable bands etc.).

Also add regression tests for these statistics.

llvm-svn: 313750

7 years ago[clangd] Run clang-format on ClangdUnit.cpp. NFC.
Ilya Biryukov [Wed, 20 Sep 2017 10:46:58 +0000 (10:46 +0000)]
[clangd] Run clang-format on ClangdUnit.cpp. NFC.

llvm-svn: 313749

7 years agoRevert r313746 "[yaml2obj] - Don't crash on invalid document."
George Rimar [Wed, 20 Sep 2017 10:24:37 +0000 (10:24 +0000)]
Revert r313746 "[yaml2obj] - Don't crash on invalid document."

It broke BB:
http://lab.llvm.org:8011/builders/llvm-hexagon-elf/builds/9781

llvm-svn: 313748

7 years ago[Sema] CheckTautologicalComparisonWithZero(): always complain about enums
Roman Lebedev [Wed, 20 Sep 2017 10:15:27 +0000 (10:15 +0000)]
[Sema] CheckTautologicalComparisonWithZero(): always complain about enums

Hopefully fixes test-clang-msc-x64-on-i686-linux-RA build.

The underlying problem is that the enum is signed there.
Yet still, it is invalid for it to contain negative values,
so the comparison is always tautological in this case.

No differential, but related to https://reviews.llvm.org/D37629

llvm-svn: 313747

7 years ago[yaml2obj] - Don't crash on invalid document.
George Rimar [Wed, 20 Sep 2017 09:57:11 +0000 (09:57 +0000)]
[yaml2obj] - Don't crash on invalid document.

Previously jaml2obj would segfault on empty document.
(without yaml description).
Patch fixes the issue.

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

llvm-svn: 313746

7 years ago[Sema] Move some stuff into -Wtautological-unsigned-enum-zero-compare
Roman Lebedev [Wed, 20 Sep 2017 09:54:47 +0000 (09:54 +0000)]
[Sema] Move some stuff into -Wtautological-unsigned-enum-zero-compare

Recommit. Original commit was reverted because buildbots broke.
The error was only reproducible in the build with assertions.
The problem was that the diagnostic expected true/false as
bool, while it was provided as string "true"/"false".

Summary:
As requested by Sam McCall:
> Enums (not new I guess). Typical case: if (enum < 0 || enum > MAX)
> The warning strongly suggests that the enum < 0 check has no effect
> (for enums with nonnegative ranges).
> Clang doesn't seem to optimize such checks out though, and they seem
> likely to catch bugs in some cases. Yes, only if there's UB elsewhere,
> but I assume not optimizing out these checks indicates a deliberate
> decision to stay somewhat compatible with a technically-incorrect
> mental model.
> If this is the case, should we move these to a
> -Wtautological-compare-enum subcategory?

Reviewers: rjmccall, rsmith, aaron.ballman, sammccall, bkramer, djasper

Reviewed By: aaron.ballman

Subscribers: jroelofs, cfe-commits

Tags: #clang

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

llvm-svn: 313745

7 years agoclang-format clang-format.
Manuel Klimek [Wed, 20 Sep 2017 09:51:03 +0000 (09:51 +0000)]
clang-format clang-format.

llvm-svn: 313744

7 years ago[X86][SSE] Remove unnecessary NonceMasks from combineX86ShufflesRecursively calls...
Simon Pilgrim [Wed, 20 Sep 2017 09:36:11 +0000 (09:36 +0000)]
[X86][SSE] Remove unnecessary NonceMasks from combineX86ShufflesRecursively calls (NFCI)

llvm-svn: 313743

7 years agoFix clang-format's detection of structured bindings.
Manuel Klimek [Wed, 20 Sep 2017 09:29:37 +0000 (09:29 +0000)]
Fix clang-format's detection of structured bindings.

Correctly determine when [ is part of a structured binding instead of a
lambda.

To be able to reuse the implementation already available, this patch also:
- sets the Previous link of FormatTokens in the UnwrappedLineParser
- moves the isCppStructuredBinding function into FormatToken

Before:
  auto const const &&[x, y] { A *i };

After:
  auto const const && [x, y]{A * i};

Fixing formatting of the type of the structured binding is still missing.

llvm-svn: 313742

7 years ago[ELF] - Fix segfault when processing .eh_frame.
George Rimar [Wed, 20 Sep 2017 09:27:41 +0000 (09:27 +0000)]
[ELF] - Fix segfault when processing .eh_frame.

Its a PR34648 which was a segfault that happened because
we stored pointers to elements in DenseMap.
When DenseMap grows such pointers are invalidated.
Solution implemented is to keep elements by pointer
and not by value.

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

llvm-svn: 313741

7 years ago[IfConversion] Add testcases [NFC]
Mikael Holmen [Wed, 20 Sep 2017 08:23:29 +0000 (08:23 +0000)]
[IfConversion] Add testcases [NFC]

These tests should have been included in r310697 / D34099 but apparently
I missed them.

llvm-svn: 313737

7 years ago[SLP] Vectorize jumbled memory loads.
Mohammad Shahid [Wed, 20 Sep 2017 08:18:28 +0000 (08:18 +0000)]
[SLP] Vectorize jumbled memory loads.

Summary:
This patch tries to vectorize loads of consecutive memory accesses, accessed
in non-consecutive or jumbled way. An earlier attempt was made with patch D26905
which was reverted back due to some basic issue with representing the 'use mask' of
jumbled accesses.

This patch fixes the mask representation by recording the 'use mask' in the usertree entry.

Change-Id: I9fe7f5045f065d84c126fa307ef6ebe0787296df

Reviewers: mkuper, loladiro, Ayal, zvi, danielcdh

Reviewed By: Ayal

Subscribers: mzolotukhin

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

Commit after rebase for patch D36130

Change-Id: I8add1c265455669ef288d880f870a9522c8c08ab
llvm-svn: 313736

7 years ago'into' instruction should not be decoded as a valid instr in 64-bit mode
Andrew V. Tischenko [Wed, 20 Sep 2017 08:17:17 +0000 (08:17 +0000)]
'into' instruction should not be decoded as a valid instr in 64-bit mode

llvm-svn: 313735

7 years agoRevert rL313697, "Compact EhSectionPiece from 32 bytes to 16 bytes."
NAKAMURA Takumi [Wed, 20 Sep 2017 08:03:18 +0000 (08:03 +0000)]
Revert rL313697, "Compact EhSectionPiece from 32 bytes to 16 bytes."

It broke selfhosting.
http://lab.llvm.org:8011/builders/clang-with-lto-ubuntu/builds/4896

llvm-svn: 313731

7 years ago[clangd] Introduced Logger interface.
Ilya Biryukov [Wed, 20 Sep 2017 07:24:15 +0000 (07:24 +0000)]
[clangd] Introduced Logger interface.

Summary: This fixes a bunch of logging-related FIXMEs.

Reviewers: bkramer, krasimir, malaperle

Reviewed By: malaperle

Subscribers: malaperle, klimek, cfe-commits, mgorny

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

llvm-svn: 313730

7 years agoImplement C++ [basic.link]p8.
Richard Smith [Wed, 20 Sep 2017 07:22:00 +0000 (07:22 +0000)]
Implement C++ [basic.link]p8.

If a function or variable has a type with no linkage (and is not extern "C"),
any use of it requires a definition within the same translation unit; the idea
is that it is not possible to define the entity elsewhere, so any such use is
necessarily an error.

There is an exception, though: some types formally have no linkage but
nonetheless can be referenced from other translation units (for example, this
happens to anonymous structures defined within inline functions). For entities
with those types, we suppress the diagnostic except under -pedantic.

llvm-svn: 313729

7 years ago[asan] Try to fix windows test by fflush(stderr)
Vitaly Buka [Wed, 20 Sep 2017 07:16:08 +0000 (07:16 +0000)]
[asan] Try to fix windows test by fflush(stderr)

llvm-svn: 313728

7 years ago[asan] Resolve FIXME by converting gtest into lit test
Vitaly Buka [Wed, 20 Sep 2017 07:01:19 +0000 (07:01 +0000)]
[asan] Resolve FIXME by converting gtest into lit test

llvm-svn: 313727

7 years agoSignal polling is supported with pselect (re-land r313704 without a Windows breakage)
Eugene Zemtsov [Wed, 20 Sep 2017 06:56:46 +0000 (06:56 +0000)]
Signal polling is supported with pselect (re-land r313704 without a Windows breakage)

Older Android API levels don't have ppoll, but LLDB works just fine,
since on Android it always uses pselect anyway.

llvm-svn: 313726

7 years agoRevert "Add support for attribute 'noescape'."
Akira Hatanaka [Wed, 20 Sep 2017 06:55:43 +0000 (06:55 +0000)]
Revert "Add support for attribute 'noescape'."

This reverts commit r313722.

It looks like compiler-rt/lib/tsan/rtl/tsan_libdispatch_mac.cc cannot be
compiled because some of the functions declared in the file do not match
the ones in the SDK headers (which are annotated with 'noescape').

llvm-svn: 313725

7 years ago[X86] Remove isel checks for immediate size on floating point compare and xop compare...
Craig Topper [Wed, 20 Sep 2017 06:38:41 +0000 (06:38 +0000)]
[X86] Remove isel checks for immediate size on floating point compare and xop compare instructions. NFCI

If these checks fail we end up not selecting an instruction at all. So we are already relying on the immediate being checked upstream of isel. So doing the check in isel is just bloat to the isel table. Interestingly, we didn't check on the AVX512 version of the instructions anyway.

llvm-svn: 313724

7 years ago[AMDGPU] Fixed memory leak with inliner replaced
Stanislav Mekhanoshin [Wed, 20 Sep 2017 06:34:28 +0000 (06:34 +0000)]
[AMDGPU] Fixed memory leak with inliner replaced

Delete inliner before replacing it.

llvm-svn: 313723

7 years agoAdd support for attribute 'noescape'.
Akira Hatanaka [Wed, 20 Sep 2017 06:32:45 +0000 (06:32 +0000)]
Add support for attribute 'noescape'.

The attribute informs the compiler that the annotated pointer parameter
of a function cannot escape and enables IRGen to attach attribute
'nocapture' to parameters that are annotated with the attribute. That is
the only optimization that currently takes advantage of 'noescape', but
there are other optimizations that will be added later that improves
IRGen for ObjC blocks.

rdar://problem/19886775

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

llvm-svn: 313722

7 years agoRevert "Add support for attribute 'noescape'."
Akira Hatanaka [Wed, 20 Sep 2017 06:27:39 +0000 (06:27 +0000)]
Revert "Add support for attribute 'noescape'."

This reverts r313717.

I closed the wrong phabricator review.

llvm-svn: 313721

7 years agoAdd support for attribute 'noescape'.
Akira Hatanaka [Wed, 20 Sep 2017 06:22:51 +0000 (06:22 +0000)]
Add support for attribute 'noescape'.

The attribute informs the compiler that the annotated pointer parameter
of a function cannot escape and enables IRGen to attach attribute
'nocapture' to parameters that are annotated with the attribute. That is
the only optimization that currently takes advantage of 'noescape', but
there are other optimizations that will be added later that improves
IRGen for ObjC blocks.

rdar://problem/19886775

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

llvm-svn: 313720

7 years agoAMDGPU: Move r600 only code into r600 only td file
Matt Arsenault [Wed, 20 Sep 2017 06:11:25 +0000 (06:11 +0000)]
AMDGPU: Move r600 only code into r600 only td file

llvm-svn: 313719

7 years ago[AMDGPU] Fix regression in test clang/test/CodeGen/backend-unsupported-error.ll
Stanislav Mekhanoshin [Wed, 20 Sep 2017 06:10:15 +0000 (06:10 +0000)]
[AMDGPU] Fix regression in test clang/test/CodeGen/backend-unsupported-error.ll

llvm-svn: 313718

7 years ago[Sema][ObjC] Warn about mismatches in attributes between overriding and
Akira Hatanaka [Wed, 20 Sep 2017 05:39:18 +0000 (05:39 +0000)]
[Sema][ObjC] Warn about mismatches in attributes between overriding and
overridden methods when compiling for non-ARC.

Previously, clang would error out when compiling for ARC, but didn't
print any diagnostics when compiling for non-ARC.

This was pointed out in the patch review for attribute noescape:

https://reviews.llvm.org/D32210

llvm-svn: 313717

7 years agoAMDGPU: Match load d16 hi instructions
Matt Arsenault [Wed, 20 Sep 2017 05:01:53 +0000 (05:01 +0000)]
AMDGPU: Match load d16 hi instructions

Also starts selecting global loads for constant address
in some cases. Some end up selecting to mubuf still, which
requires investigation.

We still get sub-optimal regalloc and extra waitcnts inserted
due to not really tracking the liveness of the separate register
halves.

llvm-svn: 313716

7 years agoDiagnosticInfoOptimizationBase: Appease g++-4.8.2 not confused to add an explicit...
NAKAMURA Takumi [Wed, 20 Sep 2017 04:39:02 +0000 (04:39 +0000)]
DiagnosticInfoOptimizationBase: Appease g++-4.8.2 not confused to add an explicit type to resolve emit() as non-template function.

llvm-svn: 313715

7 years ago[AMDGPU] Port of HSAIL inliner
Stanislav Mekhanoshin [Wed, 20 Sep 2017 04:25:58 +0000 (04:25 +0000)]
[AMDGPU] Port of HSAIL inliner

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

llvm-svn: 313714

7 years agoAMDGPU: Cleanup load/store PatFrags
Matt Arsenault [Wed, 20 Sep 2017 03:43:35 +0000 (03:43 +0000)]
AMDGPU: Cleanup load/store PatFrags

Try to use a consistent naming scheme.

llvm-svn: 313713

7 years agoAMDGPU: Match store d16_hi instructions
Matt Arsenault [Wed, 20 Sep 2017 03:20:09 +0000 (03:20 +0000)]
AMDGPU: Match store d16_hi instructions

llvm-svn: 313712

7 years agoTighten the invariants around LoopBase::invalidate
Sanjoy Das [Wed, 20 Sep 2017 02:31:57 +0000 (02:31 +0000)]
Tighten the invariants around LoopBase::invalidate

Summary:
With this change:
 - Methods in LoopBase trip an assert if the receiver has been invalidated
 - LoopBase::clear frees up the memory held the LoopBase instance

This change also shuffles things around as necessary to work with this stricter invariant.

Reviewers: chandlerc

Subscribers: mehdi_amini, mcrosier, llvm-commits

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

llvm-svn: 313708

7 years agoRollback r313704 because of the Windows build break
Eugene Zemtsov [Wed, 20 Sep 2017 01:57:59 +0000 (01:57 +0000)]
Rollback r313704 because of the Windows build break

llvm-svn: 313707

7 years agoReverting due to Green Dragon bot failure.
Mike Edwards [Wed, 20 Sep 2017 01:21:02 +0000 (01:21 +0000)]
Reverting due to Green Dragon bot failure.

http://green.lab.llvm.org/green/job/clang-stage1-cmake-RA-incremental/42594/

llvm-svn: 313706

7 years agoClang-format few files to make later diffs leaner; NFC
Sanjoy Das [Wed, 20 Sep 2017 01:12:09 +0000 (01:12 +0000)]
Clang-format few files to make later diffs leaner; NFC

llvm-svn: 313705

7 years agoSignal polling is supported with pselect
Eugene Zemtsov [Wed, 20 Sep 2017 00:39:04 +0000 (00:39 +0000)]
Signal polling is supported with pselect

Older Android API levels don't have ppoll, but LLDB works just fine,
since on Android it always uses pselect anyway.

llvm-svn: 313704

7 years ago[COFF] Adjust secrel limit check
Shoaib Meenai [Wed, 20 Sep 2017 00:21:58 +0000 (00:21 +0000)]
[COFF] Adjust secrel limit check

According to Microsoft's PE/COFF documentation, a SECREL relocation is
"The 32-bit offset of the target from the beginning of its section". By
my reading, the "from the beginning of its section" implies that the
offset is unsigned.

Change from an assertion to an error, since it's possible to trigger
this condition normally for input files with very large sections, and we
should fail gracefully for those instead of asserting.

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

llvm-svn: 313703

7 years agoGVNSink: Make ModelledPHIs constructor linear (and avoid edge case it worries about...
Daniel Berlin [Wed, 20 Sep 2017 00:07:27 +0000 (00:07 +0000)]
GVNSink: Make ModelledPHIs constructor linear (and avoid edge case it worries about) by avoiding getIncomingValueForBlock

llvm-svn: 313702

7 years agoRevert "[GVNSink] Remove dependency on SmallPtrSet iteration order."
Daniel Berlin [Wed, 20 Sep 2017 00:07:25 +0000 (00:07 +0000)]
Revert "[GVNSink] Remove dependency on SmallPtrSet iteration order."

This reverts commit r312156, because now the op and block arrays are not in the same order :(.

llvm-svn: 313701

7 years agoNewGVN: Remove unused includes
Daniel Berlin [Wed, 20 Sep 2017 00:07:12 +0000 (00:07 +0000)]
NewGVN: Remove unused includes

llvm-svn: 313700

7 years ago[COFF] Check for sections larger than 4 GiB
Shoaib Meenai [Tue, 19 Sep 2017 23:58:05 +0000 (23:58 +0000)]
[COFF] Check for sections larger than 4 GiB

Sections are limited to 4 GiB. Error out early if a section exceeds this
size, rather than overflowing the section size and getting confusing
assertion failures/segfaults later.

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

llvm-svn: 313699

7 years agoMake lit stop writing pyc files.
Zachary Turner [Tue, 19 Sep 2017 23:50:28 +0000 (23:50 +0000)]
Make lit stop writing pyc files.

Many svn-based buildbots seem to be getting stuck continually
in tree conflicts due to the output of pyc files.  I'm disabling
these as a temporary measure in an attempt to get everything
stable again.

I'll try to remove this code once I understand the problem
better.

llvm-svn: 313698

7 years agoCompact EhSectionPiece from 32 bytes to 16 bytes.
Rui Ueyama [Tue, 19 Sep 2017 23:36:48 +0000 (23:36 +0000)]
Compact EhSectionPiece from 32 bytes to 16 bytes.

EhSectionPiece used to have a pointer to a section, but that pointer was
mostly redundant because we almost always know what the section is without
using that pointer. This patch removes the pointer from the struct.

This patch also use uint32_t/int32_t instead of size_t to represent
offsets that are hardly be larger than 4 GiB. At the moment, I think it is
OK even if we cannot handle .eh_frame sections larger than 4 GiB.

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

llvm-svn: 313697

7 years ago[MIRPrinter] Print empty successor lists when they cannot be guessed
Quentin Colombet [Tue, 19 Sep 2017 23:34:12 +0000 (23:34 +0000)]
[MIRPrinter] Print empty successor lists when they cannot be guessed

This re-applies commit r313685, this time with the proper updates to
the test cases.

Original commit message:
Unreachable blocks in the machine instr representation are these
weird empty blocks with no successors.
The MIR printer used to not print empty lists of successors. However,
the MIR parser now treats non-printed list of successors as "please
guess it for me". As a result, the parser tries to guess the list of
successors and given the block is empty, just assumes it falls through
the next block (if any).

For instance, the following test case used to fail the verifier.
The MIR printer would print

         entry
        /      \
   true (def)   false (no list of successors)
       |
 split.true (use)

The MIR parser would understand this:

         entry
        /      \
   true (def)   false
       |        /  <-- invalid edge
 split.true (use)

Because of the invalid edge, we get the "def does not
dominate all uses" error.

The fix consists in printing empty successor lists, so that the parser
knows what to do for unreachable blocks.

rdar://problem/34022159

llvm-svn: 313696

7 years ago[LoopInfo] Make LoopBase and Loop destructors non-public
Sanjoy Das [Tue, 19 Sep 2017 23:19:00 +0000 (23:19 +0000)]
[LoopInfo] Make LoopBase and Loop destructors non-public

Summary:
See comment for why I think this is a good idea.

This change also:

 - Removes an SCEV test case.  The SCEV test was not testing anything useful (most of it was `#if 0` ed out) and it would need to be updated to deal with a private ~Loop::Loop.
 - Updates the loop pass manager test case to deal with a private ~Loop::Loop.
 - Renames markAsRemoved to markAsErased to contrast with removeLoop, via the usual remove vs. erase idiom we already have for instructions and basic blocks.

Reviewers: chandlerc

Subscribers: mehdi_amini, mcrosier, llvm-commits

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

llvm-svn: 313695

7 years ago[libc++] Replace __sync_* functions with __libcpp_atomic_* functions
Weiming Zhao [Tue, 19 Sep 2017 23:18:03 +0000 (23:18 +0000)]
[libc++] Replace __sync_* functions with __libcpp_atomic_* functions

Summary:
This patch replaces __sync_* with __libcpp_atomic_* and adds a wrapper
function for __atomic_exchange to support _LIBCPP_HAS_NO_THREADS.

Reviewers: EricWF, jroelofs, mclow.lists, compnerd

Reviewed By: EricWF, compnerd

Subscribers: compnerd, efriedma, cfe-commits, joerg, llvm-commits

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

llvm-svn: 313694

7 years agoAdd override for ClangDiagnosticHandler::isAnyRemarkEnabled()
Adam Nemet [Tue, 19 Sep 2017 23:00:59 +0000 (23:00 +0000)]
Add override for ClangDiagnosticHandler::isAnyRemarkEnabled()

This is used by the new closure-based variant of
OptimizationRemarkEmitter::emit().

llvm-svn: 313693

7 years ago[WebAssembly] Add support for naming wasm data segments
Sam Clegg [Tue, 19 Sep 2017 23:00:57 +0000 (23:00 +0000)]
[WebAssembly] Add support for naming wasm data segments

Add adds support for naming data segments.  This is useful
useful linkers so that they can merge similar sections.

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

llvm-svn: 313692

7 years agoAllow ORE.emit to take a closure to delay building the remark object
Adam Nemet [Tue, 19 Sep 2017 23:00:55 +0000 (23:00 +0000)]
Allow ORE.emit to take a closure to delay building the remark object

In the lambda we are now returning the remark by value so we need to preserve
its type in the insertion operator.  This requires making the insertion
operator generic.

I've also converted a few cases to use the new API.  It seems to work pretty
well.  See the LoopUnroller for a slightly more interesting case.

llvm-svn: 313691

7 years ago[ForwardOpTree] Allow out-of-quota in examination part of forwardTree.
Michael Kruse [Tue, 19 Sep 2017 22:53:20 +0000 (22:53 +0000)]
[ForwardOpTree] Allow out-of-quota in examination part of forwardTree.

Computing the reaching definition in forwardTree() can take a long time
if the coefficients are large. When the forwarding is
carried-out (doIt==true), forwardTree() must execute entirely or not at
all to get a consistent output, which means we cannot just allow
out-of-quota errors to happen in the middle of the processing.

We introduce the class IslQuotaScope which allows to opt-in code that is
conformant and has been tested with out-of-quota events. In case of
ForwardOpTree, out-of-quota is allowed during the operand tree
examination, but not during the transformation. The same forwardTree()
recursion is used for examination and execution, meaning that the
reaching definition has already been computed in the examination tree
walk and cached for reuse in the transformation tree walk.

This should fix the time-out of grtestutils.ll of the asop buildbot. If
the compilation still takes too long, we can reduce the max-operations
allows for -polly-optree.

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

llvm-svn: 313690

7 years agoRevert "Introduce the llvm-cfi-verify tool."
Vlad Tsyrklevich [Tue, 19 Sep 2017 22:36:32 +0000 (22:36 +0000)]
Revert "Introduce the llvm-cfi-verify tool."

This reverts commit r313688, it caused build failures for
llvm-i686-linux-RA

llvm-svn: 313689

7 years agoIntroduce the llvm-cfi-verify tool.
Vlad Tsyrklevich [Tue, 19 Sep 2017 22:33:09 +0000 (22:33 +0000)]
Introduce the llvm-cfi-verify tool.

Summary: Introduces the llvm-cfi-verify tool to llvm. Includes the design document (docs/CFIVerify.rst). Current implementation of the tool is simply a disassembler that identifies and prints the indirect control flow instructions.

Reviewers: vlad.tsyrklevich

Reviewed By: vlad.tsyrklevich

Patch by Mitch Phillips

Subscribers: llvm-commits, kcc, pcc, mgorny

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

llvm-svn: 313688

7 years agoCodeGen: use range based for loops (NFC)
Saleem Abdulrasool [Tue, 19 Sep 2017 22:10:20 +0000 (22:10 +0000)]
CodeGen: use range based for loops (NFC)

Simplify the RPOT traversal by using a range based for loop for the
iterator dereference.

llvm-svn: 313687

7 years agoRevert "[MIRPrinter] Print empty successor lists when they cannot be guessed"
Quentin Colombet [Tue, 19 Sep 2017 22:03:50 +0000 (22:03 +0000)]
Revert "[MIRPrinter] Print empty successor lists when they cannot be guessed"

This reverts commit r313685.

I thought I had ran ninja check, but apparently I didn't...
Need to update a bunch of mir tests.

llvm-svn: 313686

7 years ago[MIRPrinter] Print empty successor lists when they cannot be guessed
Quentin Colombet [Tue, 19 Sep 2017 21:55:51 +0000 (21:55 +0000)]
[MIRPrinter] Print empty successor lists when they cannot be guessed

Unreachable blocks in the machine instr representation are these
weird empty blocks with no successors.
The MIR printer used to not print empty lists of successors. However,
the MIR parser now treats non-printed list of successors as "please
guess it for me". As a result, the parser tries to guess the list of
successors and given the block is empty, just assumes it falls through
the next block (if any).

For instance, the following test case used to fail the verifier.
The MIR printer would print
          entry
         /      \
    true (def)   false (no list of successors)
        |
  split.true (use)

The MIR parser would understand this:
          entry
         /      \
    true (def)   false
        |        /  <-- invalid edge
  split.true (use)

Because of the invalid edge, we get the "def does not
dominate all uses" error.

The fix consists in printing empty successor lists, so that the parser
knows what to do for unreachable blocks.

rdar://problem/34022159

llvm-svn: 313685

7 years agoFix 32-bit buildbots by removing tests that are dependent on pointer-size comparisons.
Andrew Kaylor [Tue, 19 Sep 2017 21:43:01 +0000 (21:43 +0000)]
Fix 32-bit buildbots by removing tests that are dependent on pointer-size comparisons.

The recently behavior in the code that these tests were meant to be checking will be ammended as soon as a suitable change can be properly reviewed.

llvm-svn: 313684

7 years agoRevert "[Sema] Move some stuff into -Wtautological-unsigned-enum-zero-compare"
Roman Lebedev [Tue, 19 Sep 2017 21:40:41 +0000 (21:40 +0000)]
Revert "[Sema] Move some stuff into -Wtautological-unsigned-enum-zero-compare"

This reverts commit r313677.

Buildbots fail with assertion failure
Failing Tests (7):
    Clang :: Analysis/null-deref-ps.c
    Clang :: CodeGen/enum.c
    Clang :: Sema/compare.c
    Clang :: Sema/outof-range-constant-compare.c
    Clang :: Sema/tautological-unsigned-enum-zero-compare.c
    Clang :: Sema/tautological-unsigned-zero-compare.c
    Clang :: SemaCXX/compare.cpp

llvm-svn: 313683

7 years agoReland "[llvm-objcopy] Add support for nested and overlapping segments"
Jake Ehrlich [Tue, 19 Sep 2017 21:37:35 +0000 (21:37 +0000)]
Reland "[llvm-objcopy] Add support for nested and overlapping segments"

I didn't initialize a pointer to be nullptr that I needed to.

This change adds support for nested and even overlapping segments. This means
that PT_PHDR, PT_GNU_RELRO, PT_TLS, and PT_DYNAMIC can be supported properly.

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

llvm-svn: 313682

7 years agoRename CieRecord instance variables.
Rui Ueyama [Tue, 19 Sep 2017 21:31:57 +0000 (21:31 +0000)]
Rename CieRecord instance variables.

CieRecord is a struct containing a CIE and FDEs, but oftentimes the
struct itself is named `Cie` which caused some confusion. This patch
renames them `CieRecords` or `Rec`.

llvm-svn: 313681

7 years ago[ARM] Relax 'cpsie'/'cpsid' flag parsing.
Jonathan Roelofs [Tue, 19 Sep 2017 21:23:19 +0000 (21:23 +0000)]
[ARM] Relax 'cpsie'/'cpsid' flag parsing.

The ARM docs suggest in examples that the flags can have either case, and there
are applications in the wild that (libopencm3, for example) that expect to be
able to use the uppercase spelling.

https://reviews.llvm.org/D37953

llvm-svn: 313680

7 years agoRevert "[DebugInfo] Insert DW_OP_deref when spilling indirect DBG_VALUEs"
Reid Kleckner [Tue, 19 Sep 2017 21:18:32 +0000 (21:18 +0000)]
Revert "[DebugInfo] Insert DW_OP_deref when spilling indirect DBG_VALUEs"

This reverts r313640, originally r313400, one more time for essentially
the same issue. My BitVector of spilled location numbers isn't working
because we coalesce identical DBG_VALUE locations as we rewrite them,
invalidating the location numbers used to index the BitVector.

llvm-svn: 313679

7 years agoImport all inlined indirect call targets for SamplePGO.
Dehao Chen [Tue, 19 Sep 2017 21:18:14 +0000 (21:18 +0000)]
Import all inlined indirect call targets for SamplePGO.

Summary: In the ThinLTO compilation, if a function is inlined in the profiling binary, we need to inline it before annotation. If the callee is not available in the primary module, a first step is needed to import that callee function. For the current implementation, if the call is an indirect call, which has been promoted to >1 targets and inlined, SamplePGO will only import one target with the largest sample count. This patch fixed the bug to import all targets instead.

Reviewers: tejohnson, davidxl

Reviewed By: tejohnson

Subscribers: sanjoy, llvm-commits, mehdi_amini

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

llvm-svn: 313678

7 years ago[Sema] Move some stuff into -Wtautological-unsigned-enum-zero-compare
Roman Lebedev [Tue, 19 Sep 2017 21:11:35 +0000 (21:11 +0000)]
[Sema] Move some stuff into -Wtautological-unsigned-enum-zero-compare

Summary:
As requested by Sam McCall:
> Enums (not new I guess). Typical case: if (enum < 0 || enum > MAX)
> The warning strongly suggests that the enum < 0 check has no effect
> (for enums with nonnegative ranges).
> Clang doesn't seem to optimize such checks out though, and they seem
> likely to catch bugs in some cases. Yes, only if there's UB elsewhere,
> but I assume not optimizing out these checks indicates a deliberate
> decision to stay somewhat compatible with a technically-incorrect
> mental model.
> If this is the case, should we move these to a
> -Wtautological-compare-enum subcategory?

Reviewers: rjmccall, rsmith, aaron.ballman, sammccall, bkramer, djasper

Reviewed By: aaron.ballman

Subscribers: jroelofs, cfe-commits

Tags: #clang

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

llvm-svn: 313677

7 years ago[MSP430] Align functions on 2-byte boundary instead of 4.
Vadzim Dambrouski [Tue, 19 Sep 2017 21:05:20 +0000 (21:05 +0000)]
[MSP430] Align functions on 2-byte boundary instead of 4.

Summary:
There is no benefit in having the 4-byte alignment, and removing this
restriction can save a lot of space for some applications.

Reviewers: asl, awygle

Reviewed By: awygle

Subscribers: llvm-commits

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

llvm-svn: 313676

7 years ago[OpenMP] fix seg-faults printing diagnostics with invalid ordered(n) values
Rachel Craik [Tue, 19 Sep 2017 21:04:23 +0000 (21:04 +0000)]
[OpenMP] fix seg-faults printing diagnostics with invalid ordered(n) values

When the value specified for n in ordered(n) is larger than the number of loops a segmentation fault can occur in one of two ways when attempting to print out a diagnostic for an associated depend(sink : vec):
1) The iteration vector vec contains less than n items
2) The iteration vector vec contains a variable that is not a loop control variable
This patch addresses both of these issues.

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

llvm-svn: 313675

7 years ago[TableGen] Generate formatted DAGISelEmitter without relying on formatted_raw_ostream.
Craig Topper [Tue, 19 Sep 2017 21:03:57 +0000 (21:03 +0000)]
[TableGen] Generate formatted DAGISelEmitter without relying on formatted_raw_ostream.

The generated DAG isel file currently makes use of formatted_raw_ostream primarily for generating a hierarchical representation while also skipping over the initial comment that contains the current index.

It was reported in D37957 that this formatting might be slow due to the need to keep track of column numbers by monitoring all the written data for new lines.

This patch attempts to rewrite the emitter to make use of simpler formatting mechanisms to generate a fairly similar output. The main difference is that the number in the index comment is now right justified and padded with spaces inside the comment. Previously we appended the spaces after the comment.

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

llvm-svn: 313674

7 years agollvm-dwarfdump: un-hide more command line options
Adrian Prantl [Tue, 19 Sep 2017 20:58:57 +0000 (20:58 +0000)]
llvm-dwarfdump: un-hide more command line options

llvm-svn: 313673

7 years agoMove test into non-target-specific directory.
Adrian Prantl [Tue, 19 Sep 2017 20:58:56 +0000 (20:58 +0000)]
Move test into non-target-specific directory.

llvm-svn: 313672

7 years ago[SimplifyCFG] fix typos/formatting; NFC
Sanjay Patel [Tue, 19 Sep 2017 20:58:14 +0000 (20:58 +0000)]
[SimplifyCFG] fix typos/formatting; NFC

llvm-svn: 313671

7 years ago[AMDGPU] Prevent post-RA scheduler from breaking memory clauses
Stanislav Mekhanoshin [Tue, 19 Sep 2017 20:54:38 +0000 (20:54 +0000)]
[AMDGPU] Prevent post-RA scheduler from breaking memory clauses

The pre-RA scheduler does load/store clustering, but post-RA
scheduler undoes it. Add mutation to prevent it.

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

llvm-svn: 313670

7 years ago[SystemZ] Fix truncstore + bswap codegen bug
Ulrich Weigand [Tue, 19 Sep 2017 20:50:05 +0000 (20:50 +0000)]
[SystemZ] Fix truncstore + bswap codegen bug

SystemZTargetLowering::combineSTORE contains code to transform a
combination of STORE + BSWAP into a STRV type instruction.

This transformation is correct for regular stores, but not for
truncating stores.  The routine neglected to check for that case.

Fixes a miscompilation of llvm-objcopy with clang, which caused
test suite failures in the SystemZ multistage build bot.

llvm-svn: 313669

7 years agoRevert "ExecutionEngine: add R_AARCH64_ABS{16,32}"
Saleem Abdulrasool [Tue, 19 Sep 2017 20:35:25 +0000 (20:35 +0000)]
Revert "ExecutionEngine: add R_AARCH64_ABS{16,32}"

This reverts commit SVN r313654.  Seems that it is triggering an
assertion on Windows specifically.  Revert until I can build on Windows
and look into what is happening there.

llvm-svn: 313668

7 years agoSimplify. NFC.
Rui Ueyama [Tue, 19 Sep 2017 20:28:03 +0000 (20:28 +0000)]
Simplify. NFC.

llvm-svn: 313667

7 years agoTeach clang to tolerate the 'p = nullptr + n' idiom used by glibc
Andrew Kaylor [Tue, 19 Sep 2017 20:26:40 +0000 (20:26 +0000)]
Teach clang to tolerate the 'p = nullptr + n' idiom used by glibc

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

llvm-svn: 313666

7 years agoRevert "[llvm-objcopy] Add support for .dynamic, .dynsym, and .dynstr"
Jake Ehrlich [Tue, 19 Sep 2017 20:00:04 +0000 (20:00 +0000)]
Revert "[llvm-objcopy] Add support for .dynamic, .dynsym, and .dynstr"

This reverts commit r313663. Broken because overlapping-sections was
reverted.

llvm-svn: 313665

7 years agoRevert "[llvm-objcopy] Add support for nested and overlapping segments"
Jake Ehrlich [Tue, 19 Sep 2017 19:52:09 +0000 (19:52 +0000)]
Revert "[llvm-objcopy] Add support for nested and overlapping segments"

This reverts commit r313656. Appears to be broken on Windows.

llvm-svn: 313664

7 years ago[llvm-objcopy] Add support for .dynamic, .dynsym, and .dynstr
Jake Ehrlich [Tue, 19 Sep 2017 19:21:09 +0000 (19:21 +0000)]
[llvm-objcopy] Add support for .dynamic, .dynsym, and .dynstr

This change adds support for sections involved in dynamic loading such
as SHT_DYNAMIC, SHT_DYNSYM, and allocated string tables.

The two added binaries used for tests can be downloaded [[
https://drive.google.com/file/d/0B3gtIAmiMwZXOXE3T0RobFg4ZTg/view?usp=sharing
| here ]] and [[
https://drive.google.com/file/d/0B3gtIAmiMwZXTFJSQUJZMGxNSXc/view?usp=sharing
| here ]]

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

llvm-svn: 313663