platform/upstream/llvm.git
8 years ago[asan/lsan] Avoid possible deadlock in dynamic ASan runtime thread initialization.
Maxim Ostapenko [Fri, 28 Oct 2016 06:49:53 +0000 (06:49 +0000)]
[asan/lsan] Avoid possible deadlock in dynamic ASan runtime thread initialization.

There is possible deadlock in dynamic ASan runtime when we dlopen() shared lib
which creates a thread at the global initialization stage. The scenario:

1) dlopen grabs a GI_pthread_mutex_lock in main thread.
2) main thread calls pthread_create, ASan intercepts it, calls real pthread_create
   and waits for the second thread to be "fully initialized".
3) Newly created thread tries to access a thread local disable_counter in LSan
   (to complete its "full initialization") and hangs in tls_get_addr_tail, because
   it also tries to acquire GI_pthread_mutex_lock.

The issue is reproducible on relative recent Glibc versions e.g. 2.23.

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

llvm-svn: 285385

8 years agoAdd more tests for optional<const T>
Eric Fiselier [Fri, 28 Oct 2016 06:40:29 +0000 (06:40 +0000)]
Add more tests for optional<const T>

llvm-svn: 285384

8 years agoUpdate mac ABI list
Eric Fiselier [Fri, 28 Oct 2016 06:09:44 +0000 (06:09 +0000)]
Update mac ABI list

llvm-svn: 285383

8 years agoAdd __libcpp_version file and __libcpp_library_version function.
Eric Fiselier [Fri, 28 Oct 2016 06:06:50 +0000 (06:06 +0000)]
Add __libcpp_version file and __libcpp_library_version function.

This patch does two seperate things. First it adds a file called
"__libcpp_version" which only contains the current libc++ version
(currently 4000). This file is not intended for use as a header. This file
is used by Clang in order to easily determine the installed libc++ version.
This allows Clang to enable/disable certain language features only when the
library supports them.

The second change is the addition of _LIBCPP_LIBRARY_VERSION macro, which
returns the version of the installed dylib since it may be different than
the headers.

llvm-svn: 285382

8 years agoRevert "[DAGCombiner] Add vector demanded elements support to computeKnownBits"
Juergen Ributzka [Fri, 28 Oct 2016 04:01:12 +0000 (04:01 +0000)]
Revert "[DAGCombiner] Add vector demanded elements support to computeKnownBits"

This seems to have increased LTO compile time bejond 2x of previous builds.
See http://lab.llvm.org:8080/green/job/clang-stage2-configure-Rlto/10676/

llvm-svn: 285381

8 years ago[Reassociate] Removing instructions mutates the IR.
Davide Italiano [Fri, 28 Oct 2016 02:47:09 +0000 (02:47 +0000)]
[Reassociate] Removing instructions mutates the IR.

Fixes PR 30784. Discussed with Justin, who pointed out that
in the new PassManager infrastructure we can have more fine-grained
control on which analyses we want to preserve, but this is the
best we can do with the current infrastructure.

llvm-svn: 285380

8 years ago[ThinLTO] Create AliasSummary when building index
Teresa Johnson [Fri, 28 Oct 2016 02:39:38 +0000 (02:39 +0000)]
[ThinLTO] Create AliasSummary when building index

Summary:
Previously we were creating the alias summary on the fly while writing
the summary to bitcode. This moves the creation of these summaries to
the module summary index builder where we build the rest of the summary
index.

This is going to be necessary for setting the NoRename flag for values
possibly used in inline asm or module level asm.

Reviewers: mehdi_amini

Subscribers: llvm-commits

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

llvm-svn: 285379

8 years ago[Modules] Make test from r285377 darwin specific
Bruno Cardoso Lopes [Fri, 28 Oct 2016 02:37:04 +0000 (02:37 +0000)]
[Modules] Make test from r285377 darwin specific

Appease buildbots:
http://bb.pgr.jp/builders/cmake-clang-x86_64-linux/builds/55876

llvm-svn: 285378

8 years ago[Modules] Add testcase for builtins used in umbrella headers
Bruno Cardoso Lopes [Fri, 28 Oct 2016 02:30:45 +0000 (02:30 +0000)]
[Modules] Add testcase for builtins used in umbrella headers

This used to work before r284797 + r285152, which exposed something
interesting; some users include builtins from umbrella headers.

Clang should emit a warning to warn users this is not a good practice
and umbrella headers shouldn't get the
implicitly-add-the-builtin-version behavior for builtin header names.

While we're not there, add the testcase to represent the way it
currently works.

llvm-svn: 285377

8 years ago[ThinLTO] Rename HasSection to NoRename (NFC)
Teresa Johnson [Fri, 28 Oct 2016 02:24:59 +0000 (02:24 +0000)]
[ThinLTO] Rename HasSection to NoRename (NFC)

Summary:
This is in preparation for a change to utilize this flag for symbols
referenced/defined in either inline or module level assembly.

Reviewers: mehdi_amini

Subscribers: llvm-commits

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

llvm-svn: 285376

8 years ago[IR] Clang-format my previous commit. NFCI.
Davide Italiano [Fri, 28 Oct 2016 01:41:56 +0000 (01:41 +0000)]
[IR] Clang-format my previous commit. NFCI.

llvm-svn: 285375

8 years ago[Acxxel] Remove setActiveDeviceForThread
Jason Henline [Fri, 28 Oct 2016 00:54:02 +0000 (00:54 +0000)]
[Acxxel] Remove setActiveDeviceForThread

Summary:
After experimenting with CUDA, I realized that we really only need to
set the active context right before creating an object such as a stream
or a device memory allocation. When we go on to use these objects later,
it is fine if the context that created them is no longer active,
operations with those objects will succeed anyway.

Since it turns out that we don't have to check the active context for
every operation, it makes sense to hide this active context from users
(by removing the "ActiveDeviceForThread" setter and getter) and to
change the Acxxel API to explicitly pass in the device ID to create
objects.

This change improves the Acxxel API and greatly simplifies the CUDA and
OpenCL implementations because they no longer require thread_local data.

Reviewers: jlebar, jprice

Subscribers: mgorny, parallel_libs-commits

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

llvm-svn: 285372

8 years ago[ConstantFold] Get the correct vector type when folding a getelementptr.
Davide Italiano [Fri, 28 Oct 2016 00:53:16 +0000 (00:53 +0000)]
[ConstantFold] Get the correct vector type when folding a getelementptr.

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

llvm-svn: 285371

8 years agoFix a crash on invalid code.
Richard Trieu [Fri, 28 Oct 2016 00:15:24 +0000 (00:15 +0000)]
Fix a crash on invalid code.

The diagnostic was attempting to access the QualType of a TypeDecl by calling
TypeDecl::getTypeForDecl.  However, the Type pointer stored there is lazily
loaded by functions in ASTContext.  In most cases, the pointer is loaded and
this does not cause a problem.  However, when more that 50 or so unknown types
are seen beforehand, this causes the Type to not be loaded, passing a null
Type to the diagnostics, leading to the crash.  Using
ASTContext::getTypeDeclType will give a proper QualType for all cases.

llvm-svn: 285370

8 years agoCheck that we got back an object from MakeFunctionCaller
Jason Molenda [Thu, 27 Oct 2016 23:52:46 +0000 (23:52 +0000)]
Check that we got back an object from MakeFunctionCaller
before we call through it.

<rdar://problem/28979705>

llvm-svn: 285369

8 years agoAMDGPU/SI: Handle hazard with s_rfe_b64
Tom Stellard [Thu, 27 Oct 2016 23:50:21 +0000 (23:50 +0000)]
AMDGPU/SI: Handle hazard with s_rfe_b64

Reviewers: arsenm

Subscribers: kzhuravl, wdng, nhaehnle, yaxunl, llvm-commits, tony-tye

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

llvm-svn: 285368

8 years agoAMDGPU/SI: Handle hazard with sgpr lane selects for v_{read,write}lane
Tom Stellard [Thu, 27 Oct 2016 23:42:29 +0000 (23:42 +0000)]
AMDGPU/SI: Handle hazard with sgpr lane selects for v_{read,write}lane

Reviewers: arsenm

Subscribers: kzhuravl, wdng, nhaehnle, yaxunl, tony-tye, llvm-commits

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

llvm-svn: 285367

8 years agoRemove accidentally commited test.
Davide Italiano [Thu, 27 Oct 2016 23:40:19 +0000 (23:40 +0000)]
Remove accidentally commited test.

llvm-svn: 285366

8 years ago[IR] Reintroduce getGEPReturnType(), it will be used in a later patch.
Davide Italiano [Thu, 27 Oct 2016 23:38:51 +0000 (23:38 +0000)]
[IR] Reintroduce getGEPReturnType(), it will be used in a later patch.

llvm-svn: 285365

8 years agoAMDGPU/SI: Fix unused variable warning on non-debug builds
Tom Stellard [Thu, 27 Oct 2016 23:28:03 +0000 (23:28 +0000)]
AMDGPU/SI: Fix unused variable warning on non-debug builds

llvm-svn: 285363

8 years agoReverting back r285355: "Update .debug_line section version information to match...
Ekaterina Romanova [Thu, 27 Oct 2016 23:20:19 +0000 (23:20 +0000)]
Reverting back r285355: "Update .debug_line section version information to match DWARF version", while I'm investigating a test failure.

llvm-svn: 285362

8 years agoRevert "[Test Suite] Pull generateSource into lldbtest"
Chris Bieneman [Thu, 27 Oct 2016 23:18:52 +0000 (23:18 +0000)]
Revert "[Test Suite] Pull generateSource into lldbtest"

This reverts commit r285357.

I committed this patch accidentally out of order. Will recommit when the change this depends on is landed.

llvm-svn: 285361

8 years ago[Coverage] Darwin: Move __llvm_covmap from __DATA to __LLVM_COV
Vedant Kumar [Thu, 27 Oct 2016 23:17:51 +0000 (23:17 +0000)]
[Coverage] Darwin: Move __llvm_covmap from __DATA to __LLVM_COV

Programs with very large __llvm_covmap sections may fail to link on
Darwin because because of out-of-range 32-bit RIP relative references.
It isn't possible to work around this by using the large code model
because it isn't supported on Darwin. One solution is to move the
__llvm_covmap section past the end of the __DATA segment.

=== Testing ===

In addition to check-{llvm,clang,profile}, I performed a link test on a
simple object after injecting ~4GB of padding into __llvm_covmap:

  @__llvm_coverage_padding = internal constant [4000000000 x i8] zeroinitializer, section "__LLVM_COV,__llvm_covmap", align 8

(This test is too expensive to check-in.)

=== Backwards Compatibility ===

This patch should not pose any backwards-compatibility concerns. LLVM
is expected to scan all of the sections in a binary for __llvm_covmap,
so changing its segment shouldn't affect anything. I double-checked this
by loading coverage produced by an unpatched compiler with a patched
llvm-cov.

Suggested by Nick Kledzik.

llvm-svn: 285360

8 years agoAMDGPU/SI: Handle hazard with > 8 byte VMEM stores
Tom Stellard [Thu, 27 Oct 2016 23:05:31 +0000 (23:05 +0000)]
AMDGPU/SI: Handle hazard with > 8 byte VMEM stores

Reviewers: arsenm

Subscribers: kzhuravl, wdng, nhaehnle, yaxunl, tony-tye, llvm-commits

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

llvm-svn: 285359

8 years agoReapply r285351 "[APFloat] Add DoubleAPFloat mode to APFloat. NFC." with
Tim Shen [Thu, 27 Oct 2016 22:52:40 +0000 (22:52 +0000)]
Reapply r285351 "[APFloat] Add DoubleAPFloat mode to APFloat. NFC." with
a workaround for old clang.

llvm-svn: 285358

8 years ago[Test Suite] Pull generateSource into lldbtest
Chris Bieneman [Thu, 27 Oct 2016 22:52:32 +0000 (22:52 +0000)]
[Test Suite] Pull generateSource into lldbtest

Summary:
Convert tests using LLDB headers to use generateSource to put the right include paths in place regardless of whether or not you're building a framework.

This also abstracted generateSource out of TestPublicAPIHeaders.py into lldbtest.py.

Reviewers: tfiala, zturner

Subscribers: lldb-commits

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

llvm-svn: 285357

8 years ago[CMake] Rename lldb-launcher to darwin-debug
Chris Bieneman [Thu, 27 Oct 2016 22:51:41 +0000 (22:51 +0000)]
[CMake] Rename lldb-launcher to darwin-debug

Summary: This tool is only built on Darwin, and the name darwin-debug matches the Xcode project. We should have this in sync unless there is a good reason not to.

Reviewers: zturner, tfiala, labath

Subscribers: labath, mgorny, lldb-commits

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

llvm-svn: 285356

8 years agoUpdate .debug_line section version information to match DWARF version.
Ekaterina Romanova [Thu, 27 Oct 2016 22:37:25 +0000 (22:37 +0000)]
Update .debug_line section version information to match DWARF version.

In the past the compiler always emitted .debug_line version 2, though some opcodes from DWARF 3 (e.g. DW_LNS_set_prologue_end, DW_LNS_set_epilogue_begin or DW_LNS_set_isa) and from DWARF 4 could be emitted by the compiler.

This patch changes version information of .debug_line to exactly match the DWARF version. For .debug_line version 4, a new field maximum_operations_per_instruction is emitted.

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

llvm-svn: 285355

8 years agoRevert "[APFloat] Add DoubleAPFloat mode to APFloat. NFC."
Tim Shen [Thu, 27 Oct 2016 21:54:29 +0000 (21:54 +0000)]
Revert "[APFloat] Add DoubleAPFloat mode to APFloat. NFC."

This reverts r285351, since it breaks the build.

llvm-svn: 285354

8 years ago[libFuzzer] enable use_cmp by default
Kostya Serebryany [Thu, 27 Oct 2016 21:44:37 +0000 (21:44 +0000)]
[libFuzzer] enable use_cmp by default

llvm-svn: 285353

8 years ago[libcxx] Make regex_match backtrack when search fails
Tim Shen [Thu, 27 Oct 2016 21:40:34 +0000 (21:40 +0000)]
[libcxx] Make regex_match backtrack when search fails

Summary:
Fixes PR19851.
alg.re.match/ecma.pass.cpp still XFAILS on linux, but after commenting out
locale-related tests, it passes. I don't have a freebsd machine to produce a
full pass.

Reviewers: mclow.lists

Subscribers: cfe-commits, emaste

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

llvm-svn: 285352

8 years ago[APFloat] Add DoubleAPFloat mode to APFloat. NFC.
Tim Shen [Thu, 27 Oct 2016 21:39:51 +0000 (21:39 +0000)]
[APFloat] Add DoubleAPFloat mode to APFloat. NFC.

Summary:
This patch adds DoubleAPFloat mode to APFloat.

Now, an APFloat with semantics PPCDoubleDouble will have DoubleAPFloat layout
(APFloat.U.Double), which contains two underlying APFloats as
PPCDoubleDoubleImpl and IEEEdouble semantics. Currently the IEEEdouble APFloat
is not used, and the first APFloat behaves exactly the same before this change.

This patch consists of three kinds of logics:
1) Construction and destruction of APFloat. Now the ctors, dtor, assign
   opertors and factory functions construct different underlying layout
   based on the semantics passed in.
2) s/IEEE/getIEEE()/ for normal, lifetime-unrelated computation functions.
   These functions only access Floats[0] in DoubleAPFloat, which is the
   same as today's semantic.
3) A "Double dispatch" function, APFloat::convert. Converting between two
   different layouts requires appropriate logic.

Neither of these change the external behavior.

Reviewers: hfinkel, kbarton, echristo, iteratee

Subscribers: mehdi_amini, llvm-commits

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

llvm-svn: 285351

8 years agoBitcodeReader: Require clients to read the block info block at most once.
Peter Collingbourne [Thu, 27 Oct 2016 21:39:28 +0000 (21:39 +0000)]
BitcodeReader: Require clients to read the block info block at most once.

This change makes it the client's responsibility to call ReadBlockInfoBlock()
at most once. This is in preparation for a future change that will allow
there to be multiple block info blocks.

See also: http://lists.llvm.org/pipermail/llvm-dev/2016-October/106512.html

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

llvm-svn: 285350

8 years ago[docs] Update the TSan and MSan docs to refer to the new no_sanitize attribute
Anna Zaks [Thu, 27 Oct 2016 21:38:44 +0000 (21:38 +0000)]
[docs] Update the TSan and MSan docs to refer to the new no_sanitize attribute

TSan and MSan were the only remaining sanitizers referring to the deprecated
attribute for issue suppression. Update the docs to recommend
__attribute__((no_sanitize("..."))) instead.

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

llvm-svn: 285349

8 years agoCodeGen: Handle missed case of block removal during BlockPlacement.
Kyle Butt [Thu, 27 Oct 2016 21:37:20 +0000 (21:37 +0000)]
CodeGen: Handle missed case of block removal during BlockPlacement.

There is a use after free bug in the existing code. Loop layout selects
a preferred exit block, and then lays out the loop. If this block is
removed during layout, it needs to be invalidated to prevent a use after
free.

llvm-svn: 285348

8 years agoDefine ~DIHelper::DIHelper() in .cpp.
Rui Ueyama [Thu, 27 Oct 2016 21:26:57 +0000 (21:26 +0000)]
Define ~DIHelper::DIHelper() in .cpp.

llvm-svn: 285347

8 years ago[PATCH] D25483: [libcxx] [test] Fix non-Standard assumptions about how many elements...
Stephan T. Lavavej [Thu, 27 Oct 2016 21:25:12 +0000 (21:25 +0000)]
[PATCH] D25483: [libcxx] [test] Fix non-Standard assumptions about how many elements are allocated

llvm-svn: 285346

8 years ago[InstCombine] fix foldSPFofSPF() to handle vector splats
Sanjay Patel [Thu, 27 Oct 2016 21:19:40 +0000 (21:19 +0000)]
[InstCombine] fix foldSPFofSPF() to handle vector splats

llvm-svn: 285345

8 years ago[libFuzzer] docs: update the examples
Kostya Serebryany [Thu, 27 Oct 2016 21:03:48 +0000 (21:03 +0000)]
[libFuzzer] docs: update the examples

llvm-svn: 285344

8 years ago[asan] Test jumps which bypass variables declaration
Vitaly Buka [Thu, 27 Oct 2016 21:02:32 +0000 (21:02 +0000)]
[asan] Test jumps which bypass variables declaration

Summary:
Clang should not generate lifetime intrinsics for such variables. D24693

PR28267

Reviewers: eugenis

Subscribers: llvm-commits, kubabrecka

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

llvm-svn: 285343

8 years agoAnother additional error check for invalid Mach-O files for the
Kevin Enderby [Thu, 27 Oct 2016 20:59:10 +0000 (20:59 +0000)]
Another additional error check for invalid Mach-O files for the
obsolete load commands.

Again the philosophy of the error checking in libObject for
Mach-O files, the idea behind the checking is that we never
will return a Mach-O file out of libObject that contains unknown
things the library code can’t operate on.  So known obsolete
load commands will cause a hard error.

Also to make things clear I have added comments to the
values and structures in Support/Mach-O.h and
Support/MachO.def as to what is obsolete.

As noted in a TODO in the code, there may need to be a
non-default mode to allow some unknown values for well
structured Mach-O files with things like unknown load
load commands.  So things like using an old lldb on a newer
Mach-O file could still provide some limited functionality.

llvm-svn: 285342

8 years agoAdd documentation describing the components of a complete toolchain including Clang.
Richard Smith [Thu, 27 Oct 2016 20:55:56 +0000 (20:55 +0000)]
Add documentation describing the components of a complete toolchain including Clang.

llvm-svn: 285341

8 years ago[InstCombine] add vector tests for foldSPFofSPF to show missing folds
Sanjay Patel [Thu, 27 Oct 2016 20:51:03 +0000 (20:51 +0000)]
[InstCombine] add vector tests for foldSPFofSPF to show missing folds

llvm-svn: 285340

8 years ago[libFuzzer] docs: separate section for fuzz target
Kostya Serebryany [Thu, 27 Oct 2016 20:45:35 +0000 (20:45 +0000)]
[libFuzzer] docs: separate section for fuzz target

llvm-svn: 285339

8 years agoAMDGPU/SI: Handle s_setreg hazard in GCNHazardRecognizer
Tom Stellard [Thu, 27 Oct 2016 20:39:09 +0000 (20:39 +0000)]
AMDGPU/SI: Handle s_setreg hazard in GCNHazardRecognizer

Reviewers: arsenm

Subscribers: kzhuravl, wdng, nhaehnle, yaxunl, llvm-commits, tony-tye

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

llvm-svn: 285338

8 years ago[libFuzzer] remove large examples from the libFuzzer docs and link to the libFuzzer...
Kostya Serebryany [Thu, 27 Oct 2016 20:14:03 +0000 (20:14 +0000)]
[libFuzzer] remove large examples from the libFuzzer docs and link to the libFuzzer tutorial instead; also fix a build error in another file

llvm-svn: 285337

8 years ago[InstCombine] auto-generate checks for min/max tests
Sanjay Patel [Thu, 27 Oct 2016 19:54:15 +0000 (19:54 +0000)]
[InstCombine] auto-generate checks for min/max tests

llvm-svn: 285336

8 years ago[PPC] Adding the removed testcase again
Ehsan Amiri [Thu, 27 Oct 2016 19:10:09 +0000 (19:10 +0000)]
[PPC] Adding the removed testcase again

This testcase was originally part of r284995, but I put it in a wrong directory.
So I removed it. Before adding it back I did some small enhancements. Also I
changed the assertions a little bit, to take into account the impact of some
changes performed since code review is done.

This is similar to changes done for another testcase in the original commit.
See: https://reviews.llvm.org/D23614#577749
Basically for instead of vxor we now generate xxlxor in some cases, which is
better.

llvm-svn: 285333

8 years agoAdd support for "type lookup" to find C and C++ types
Enrico Granata [Thu, 27 Oct 2016 18:44:45 +0000 (18:44 +0000)]
Add support for "type lookup" to find C and C++ types

This is an important first step in closing the functionality gap between "type lookup" and "images lookup -t"

rdar://28971388

llvm-svn: 285332

8 years ago[coroutines] Add diagnostics for copy/move assignment operators and functions with...
Eric Fiselier [Thu, 27 Oct 2016 18:43:28 +0000 (18:43 +0000)]
[coroutines] Add diagnostics for copy/move assignment operators and functions with deduced return types.

Summary: The title says it all. Additionally this patch refactors the diagnostic code into a separate function.

Reviewers: GorNishanov, rsmith

Subscribers: majnemer, mehdi_amini, cfe-commits

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

llvm-svn: 285331

8 years ago[LoopUnroll] Check partial unrolling is enabled before initialization. NFC.
Haicheng Wu [Thu, 27 Oct 2016 18:40:02 +0000 (18:40 +0000)]
[LoopUnroll] Check partial unrolling is enabled before initialization. NFC.

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

llvm-svn: 285330

8 years ago[X86][AVX512] Fix MUL v8i64 costs on non-AVX512DQ targets
Simon Pilgrim [Thu, 27 Oct 2016 18:32:06 +0000 (18:32 +0000)]
[X86][AVX512] Fix MUL v8i64 costs on non-AVX512DQ targets

llvm-svn: 285329

8 years agoUse -fopenmp=libomp in all OpenMP offloading tests.
Samuel Antao [Thu, 27 Oct 2016 18:29:57 +0000 (18:29 +0000)]
Use -fopenmp=libomp in all OpenMP offloading tests.

This will make sure the right features are being tested even for machines that default to libgomp.

llvm-svn: 285327

8 years ago[Driver][OpenMP] Add support to create jobs for unbundling actions.
Samuel Antao [Thu, 27 Oct 2016 18:14:55 +0000 (18:14 +0000)]
[Driver][OpenMP] Add support to create jobs for unbundling actions.

Summary:
This patch adds the support to create jobs for the `OffloadBundlingAction` which will invoke the `clang-offload-bundler` tool to unbundle input files.

Unlike other actions, unbundling actions have multiple outputs. Therefore, this patch adds the required changes to have a variant of `Tool::ConstructJob` with multiple outputs.

The way the naming of the results is implemented is also slightly modified so that the same action can use a different offloading prefix for each use by the different offloading actions.

With this patch, it is possible to compile a functional OpenMP binary with offloading support, even with separate compilation.

Reviewers: echristo, tra, jlebar, ABataev, hfinkel

Subscribers: mkuron, whchung, mehdi_amini, cfe-commits, Hahnfeld, andreybokhanko, arpith-jacob, carlo.bertolli, caomhin

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

llvm-svn: 285326

8 years ago[Driver][OpenMP] Add support to create jobs for bundling actions.
Samuel Antao [Thu, 27 Oct 2016 18:04:42 +0000 (18:04 +0000)]
[Driver][OpenMP] Add support to create jobs for bundling actions.

Summary: This patch adds the support to create a job for the `OffloadBundlingAction` which will invoke the `clang-offload-bundler` tool.

Reviewers: echristo, tra, jlebar, ABataev, hfinkel

Subscribers: whchung, mehdi_amini, cfe-commits, Hahnfeld, andreybokhanko, arpith-jacob, carlo.bertolli, caomhin

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

llvm-svn: 285325

8 years ago[Driver][OpenMP] Update actions builder to create unbundling action when necessary.
Samuel Antao [Thu, 27 Oct 2016 18:00:51 +0000 (18:00 +0000)]
[Driver][OpenMP] Update actions builder to create unbundling action when necessary.

Summary:
Each time that offloading support is requested by the user and the input file is not a source file, an action `OffloadUnbundlingAction` is created to signal that the input file may contain bundles, so that the proper tool is then invoked to attempt to extract the components of the bundle. This patch adds the logic to create that action in offload action builder.

The job creation for the new action will be proposed in a separate patch.

Reviewers: echristo, tra, jlebar, ABataev, hfinkel

Subscribers: whchung, mehdi_amini, cfe-commits, Hahnfeld, andreybokhanko, arpith-jacob, carlo.bertolli, caomhin

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

llvm-svn: 285324

8 years ago[Driver][OpenMP] Update actions builder to create bundling action when necessary.
Samuel Antao [Thu, 27 Oct 2016 17:50:43 +0000 (17:50 +0000)]
[Driver][OpenMP] Update actions builder to create bundling action when necessary.

Summary:
In order to save the user from dealing with multiple output files (for host and device) while using separate compilation, a new action `OffloadBundlingAction` is used when the last phase is not linking. This action will then result in a job that uses the proposed bundling tool to create a single preprocessed/IR/ASM/Object file from multiple ones.

The job creation for the new action will be proposed in a separate patch.

Reviewers: echristo, tra, jlebar, ABataev, hfinkel

Subscribers: whchung, mehdi_amini, cfe-commits, Hahnfeld, andreybokhanko, arpith-jacob, carlo.bertolli, caomhin

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

llvm-svn: 285323

8 years agoDon't create a dummy ELF to process a binary file.
Rafael Espindola [Thu, 27 Oct 2016 17:45:40 +0000 (17:45 +0000)]
Don't create a dummy ELF to process a binary file.

Now that it is easy to create input section and symbols, this is
simple.

llvm-svn: 285322

8 years agoFix build breakage on buildbots that was due to 285309.
Greg Clayton [Thu, 27 Oct 2016 17:43:39 +0000 (17:43 +0000)]
Fix build breakage on buildbots that was due to 285309.

llvm-svn: 285321

8 years ago[Driver][OpenMP] Add logic for offloading-specific argument translation.
Samuel Antao [Thu, 27 Oct 2016 17:39:44 +0000 (17:39 +0000)]
[Driver][OpenMP] Add logic for offloading-specific argument translation.

Summary:
This patch includes support for argument translation that is specific of a given offloading kind. Additionally, it implements the translation for OpenMP device kinds in the gcc tool chain.

With this patch, it is possible to compile a functional OpenMP application with offloading capabilities with no separate compilation.

Reviewers: echristo, tra, jlebar, rsmith, ABataev, hfinkel

Subscribers: whchung, mehdi_amini, cfe-commits, Hahnfeld, andreybokhanko, arpith-jacob, carlo.bertolli, caomhin

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

llvm-svn: 285320

8 years ago[Driver][OpenMP] Build jobs for OpenMP offloading actions for targets using gcc tool...
Samuel Antao [Thu, 27 Oct 2016 17:31:22 +0000 (17:31 +0000)]
[Driver][OpenMP] Build jobs for OpenMP offloading actions for targets using gcc tool chains.

Summary:
This patch adds logic to create jobs for OpenMP offloading actions by:
 - tuning the jobs result information to use the offloading prefix even for (device) linking actions.
 - replacing the device inputs of the host linking jobs by a linker script that embed them in the right sections.

Reviewers: echristo, tra, jlebar, rsmith, ABataev, hfinkel

Subscribers: mkuron, whchung, mehdi_amini, cfe-commits, Hahnfeld, andreybokhanko, arpith-jacob, carlo.bertolli, caomhin

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

llvm-svn: 285319

8 years ago[InstCombine] handle simple vector integer constants in IsFreeToInvert
Sanjay Patel [Thu, 27 Oct 2016 17:30:50 +0000 (17:30 +0000)]
[InstCombine] handle simple vector integer constants in IsFreeToInvert

llvm-svn: 285318

8 years agoBe less aggressive at relaxing got access in this case.
Rafael Espindola [Thu, 27 Oct 2016 17:28:56 +0000 (17:28 +0000)]
Be less aggressive at relaxing got access in this case.

This fixes pr30803 by not relaxing that particular access. We could
also let adjustRelaxExpr know that the target is absolute so that it
uses R_RELAX_GOT_PC_NOPIC, but it is not clear if it is worth it.

llvm-svn: 285317

8 years ago[CodeGen] Provide an appropriate alignment for dynamic allocas
David Majnemer [Thu, 27 Oct 2016 17:18:24 +0000 (17:18 +0000)]
[CodeGen] Provide an appropriate alignment for dynamic allocas

GCC documents __builtin_alloca as aligning the storage to at least
__BIGGEST_ALIGNMENT__.

MSVC documents essentially the same for the x64 ABI:
https://msdn.microsoft.com/en-us/library/x9sx5da1.aspx

The 32-bit ABI follows the same rule: it emits a call to _alloca_probe_16

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

llvm-svn: 285316

8 years ago[MS ABI] Reuse getVFPtrOffsets instead of using getClassAtVTableLocation
David Majnemer [Thu, 27 Oct 2016 17:11:51 +0000 (17:11 +0000)]
[MS ABI] Reuse getVFPtrOffsets instead of using getClassAtVTableLocation

getClassAtVTableLocation hunts through virtual bases without using the
MDC layout which is indicative of a bug.

Instead, reuse the getVFPtrOffsets machinery to calculate which
subobject within the MDC is responsible for the vfptr.

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

llvm-svn: 285315

8 years ago[Driver][OpenMP] Add specialized action builder for OpenMP offloading actions.
Samuel Antao [Thu, 27 Oct 2016 17:08:03 +0000 (17:08 +0000)]
[Driver][OpenMP] Add specialized action builder for OpenMP offloading actions.

Summary:
This patch adds a new specialized action builder to create OpenMP offloading actions. The specialized builder is added to the action builder already containing the CUDA specialized builder.

OpenMP offloading dependences between host and device actions (expressed with OffloadActions) are different that what is used for CUDA:
 - Device compile action depends on the host compile action - the device frontend extracts the information about the declarations that have to be emitted by looking into the metadata produced by the host frontend.
 - The host link action depends on the device link actions - the device images are embedded in the host binary at link time.

Reviewers: echristo, tra, rsmith, jlebar, ABataev, hfinkel

Subscribers: mkuron, whchung, mehdi_amini, cfe-commits, Hahnfeld, andreybokhanko, arpith-jacob, carlo.bertolli, caomhin

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

llvm-svn: 285314

8 years ago[X86][AVX512DQ] Move v2i64 and v4i64 MUL lowering to tablegen
Simon Pilgrim [Thu, 27 Oct 2016 17:07:40 +0000 (17:07 +0000)]
[X86][AVX512DQ] Move v2i64 and v4i64 MUL lowering to tablegen

As suggested by @igorb on D26011

llvm-svn: 285313

8 years agoARM: ensure that the Windows DBZ check is in range
Saleem Abdulrasool [Thu, 27 Oct 2016 16:59:22 +0000 (16:59 +0000)]
ARM: ensure that the Windows DBZ check is in range

The Windows ARM target expects the compiler to emit a division-by-zero check.
The check would use the form of:

    cmp r?, #0
    cbz .Ltrap
    b .Lbody
  .Lbody:
    ...
  .Ltrap:
    udf #249 @ __brkdiv0

This works great most of the time.  However, if the body of the function is
greater than 127 bytes, the branch target limitation of cbz becomes an issue.
This occurs in the unoptimized code generation cases sometimes (like in
compiler-rt).

Since this is a matter of correctness, possibly pay a small penalty instead.  We
now form this slightly differently:

    cbnz .Lbody
    udf #249 @ __brkdiv0
  .Lbody:
    ...

The positive case is through the branch instead of being the next instruction.
However, because of the basic block layout, the negated branch is going to be
a short distance always (2 bytes away, after the inserted __brkdiv0).

The new t__brkdiv0 instruction is required to explicitly mark the instruction as
a terminator as the generic UDF instruction is not a terminator.

Addresses PR30532!

llvm-svn: 285312

8 years ago[Driver][OpenMP] Create tool chains for OpenMP offloading kind.
Samuel Antao [Thu, 27 Oct 2016 16:38:05 +0000 (16:38 +0000)]
[Driver][OpenMP] Create tool chains for OpenMP offloading kind.

Summary: This patch adds new logic to create the necessary tool chains to support offloading for OpenMP. The OpenMP related options are checked and the tool chains created accordingly. Diagnostics are emitted in case the options are illegal or express unknown targets.

Reviewers: echristo, tra, jlebar, rsmith, ABataev, hfinkel

Subscribers: whchung, mkuron, mehdi_amini, cfe-commits, Hahnfeld, arpith-jacob, carlo.bertolli, caomhin

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

llvm-svn: 285311

8 years agoExpand -Wlogical-not-parentheses to also fire on `!x & A`.
Nico Weber [Thu, 27 Oct 2016 16:32:06 +0000 (16:32 +0000)]
Expand -Wlogical-not-parentheses to also fire on `!x & A`.

This is a misspelling of the intended !(x & A) negated bit test that happens in
practice every now and then.

I ran this on Chromium and all its dependencies, and it fired 0 times -- no
false or true positives, but it would've caught a bug in an in-progress change
that had to be caught by a Visual Studio warning instead.

https://reviews.llvm.org/D26035

llvm-svn: 285310

8 years agoSwitch all DWARF variables for tags, attributes and forms over to use the llvm::dwarf...
Greg Clayton [Thu, 27 Oct 2016 16:32:04 +0000 (16:32 +0000)]
Switch all DWARF variables for tags, attributes and forms over to use the llvm::dwarf enumerations instead of using raw uint16_t values. This allows easier debugging as users can see the values of the enumerations in the variables view that will show the enumeration string instead of just a number.

https://reviews.llvm.org/D26013

llvm-svn: 285309

8 years agoAdd Loop Sink pass to reverse the LICM based of basic block frequency.
Dehao Chen [Thu, 27 Oct 2016 16:30:08 +0000 (16:30 +0000)]
Add Loop Sink pass to reverse the LICM based of basic block frequency.

Summary: LICM may hoist instructions to preheader speculatively. Before code generation, we need to sink down the hoisted instructions inside to loop if it's beneficial. This pass is a reverse of LICM: looking at instructions in preheader and sinks the instruction to basic blocks inside the loop body if basic block frequency is smaller than the preheader frequency.

Reviewers: hfinkel, davidxl, chandlerc

Subscribers: anna, modocache, mgorny, beanz, reames, dberlin, chandlerc, mcrosier, junbuml, sanjoy, mzolotukhin, llvm-commits

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

llvm-svn: 285308

8 years ago[Driver][CUDA][OpenMP] Reimplement tool selection in the driver.
Samuel Antao [Thu, 27 Oct 2016 16:29:20 +0000 (16:29 +0000)]
[Driver][CUDA][OpenMP] Reimplement tool selection in the driver.

Summary:
This creates a tool selector in the driver that replaces the existing one. The goal is to better organize the code and make the selector easier to scale, in particular in the presence of offload actions that can be collapsed.

The current implementation became more confusing when the support for offloading actions was added. This concern was expressed by Eric in http://reviews.llvm.org/D9888.

This patch does not add new testing, it preserves the existing functionality.

Reviewers: echristo, tra, jlebar, rsmith, ABataev, hfinkel

Subscribers: whchung, guansong, mkuron, mehdi_amini, cfe-commits, Hahnfeld, andreybokhanko, caomhin, arpith-jacob, carlo.bertolli

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

llvm-svn: 285307

8 years ago[coroutines] Add allocation and deallocation substatements.
Gor Nishanov [Thu, 27 Oct 2016 16:28:31 +0000 (16:28 +0000)]
[coroutines] Add allocation and deallocation substatements.

Summary:
SemaCoroutine: Add allocation / deallocation substatements.
CGCoroutine/Test: Emit allocation and deallocation + test.

Reviewers: rsmith

Subscribers: ABataev, EricWF, llvm-commits, mehdi_amini

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

llvm-svn: 285306

8 years ago[mips] Do not allow -opt-bisect-limit to skip the PIC call optimization pass.
Vasileios Kalintiris [Thu, 27 Oct 2016 15:50:36 +0000 (15:50 +0000)]
[mips] Do not allow -opt-bisect-limit to skip the PIC call optimization pass.

r282428 added the MipsOptimizePICCall as an opt-in pass that can be
skipped when using the -opt-bisect-limit option. However, this pass is
needed because it generates code that conforms to the o32 ABI
specification by using the $t9 register for PIC calls with JALR
instructions.

This bug was exposed by the fact that skipFunction() also checks for
the "optnone" attribute. This caused functions with that attribute to
break the requirements of the o32 ABI.

llvm-svn: 285305

8 years ago[X86][AVX512DQ] Improve lowering of MUL v2i64 and v4i64
Simon Pilgrim [Thu, 27 Oct 2016 15:27:00 +0000 (15:27 +0000)]
[X86][AVX512DQ] Improve lowering of MUL v2i64 and v4i64

With DQI but without VLX, lower v2i64 and v4i64 MUL operations with v8i64 MUL (vpmullq).

Updated cost table accordingly.

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

llvm-svn: 285304

8 years ago[ValueTracking] fix matchSelectPattern to allow vector splat folds of min/max/abs...
Sanjay Patel [Thu, 27 Oct 2016 15:26:10 +0000 (15:26 +0000)]
[ValueTracking] fix matchSelectPattern to allow vector splat folds of min/max/abs/nabs

llvm-svn: 285303

8 years agoRemove duplicated default move ctors/move assign. No functional change.
Benjamin Kramer [Thu, 27 Oct 2016 15:23:44 +0000 (15:23 +0000)]
Remove duplicated default move ctors/move assign. No functional change.

llvm-svn: 285302

8 years agoAttempt to make clang-format.py python 3 - compatible.
Alexander Kornienko [Thu, 27 Oct 2016 15:15:23 +0000 (15:15 +0000)]
Attempt to make clang-format.py python 3 - compatible.

llvm-svn: 285301

8 years agoMove 'quoted' for string_view from <string_view> to <iomanip> (where the other versio...
Marshall Clow [Thu, 27 Oct 2016 15:10:07 +0000 (15:10 +0000)]
Move 'quoted' for string_view from <string_view> to <iomanip> (where the other versions of 'quoted' live. No functional change.

llvm-svn: 285300

8 years ago[InstCombine] add tests for missing folds of vector abs/nabs/min/max
Sanjay Patel [Thu, 27 Oct 2016 15:02:45 +0000 (15:02 +0000)]
[InstCombine] add tests for missing folds of vector abs/nabs/min/max

llvm-svn: 285299

8 years agoFix memory issue in AttrBuilder::removeAttribute uses.
Bjorn Pettersson [Thu, 27 Oct 2016 14:48:09 +0000 (14:48 +0000)]
Fix memory issue in AttrBuilder::removeAttribute uses.

Summary:
Found when running Valgrind.

This removes two unnecessary assignments when using
AttrBuilder::removeAttribute.

AttrBuilder::removeAttribute returns a reference to the object.
As the LHSes were the same as the callees, the assignments
resulted in memcpy calls where dst = src.

Commited on behalf-of: dstenb (David Stenberg)

Reviewers: mkuper, rnk

Subscribers: llvm-commits

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

llvm-svn: 285298

8 years ago[Hexagon] Do not expand ISD::SELECT for HVX vectors
Krzysztof Parzyszek [Thu, 27 Oct 2016 14:30:16 +0000 (14:30 +0000)]
[Hexagon] Do not expand ISD::SELECT for HVX vectors

llvm-svn: 285297

8 years ago[DAGCombiner] Add vector demanded elements support to computeKnownBits
Simon Pilgrim [Thu, 27 Oct 2016 14:29:28 +0000 (14:29 +0000)]
[DAGCombiner] Add vector demanded elements support to computeKnownBits

Currently computeKnownBits returns the common known zero/one bits for all elements of vector data, when we may only be interested in one/some of the elements.

This patch adds a DemandedElts argument that allows us to specify the elements we actually care about. The original computeKnownBits implementation calls with a DemandedElts demanding all elements to match current behaviour. Scalar types set this to 1.

The approach was found to be easier than trying to add a per-element known bits solution, for a similar usefulness given the combines where computeKnownBits is typically used.

I've only added support for a few opcodes so far (the ones that have proven straightforward to test), all others will default to demanding all elements but can be updated in due course.

DemandedElts support could similarly be added to computeKnownBitsForTargetNode in a future commit.

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

llvm-svn: 285296

8 years agoDo not print include_next/pragma once warnings when input is a header.
Erik Verbruggen [Thu, 27 Oct 2016 14:17:10 +0000 (14:17 +0000)]
Do not print include_next/pragma once warnings when input is a header.

r276653 suppressed the pragma once warning when generating a PCH file.
This patch extends that to any main file for which clang is told (with
the -x option) that it's a header file. It will also suppress the
warning "#include_next in primary source file".

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

llvm-svn: 285295

8 years agoStore OSABI in Config.
Rafael Espindola [Thu, 27 Oct 2016 14:00:51 +0000 (14:00 +0000)]
Store OSABI in Config.

This allows us to set a value for it based on -m.

llvm-svn: 285294

8 years ago[InstCombine] auto-generate better checks; NFC
Sanjay Patel [Thu, 27 Oct 2016 13:55:37 +0000 (13:55 +0000)]
[InstCombine] auto-generate better checks; NFC

llvm-svn: 285293

8 years agoAdd documentation for the transparent_union attribute
Alex Lorenz [Thu, 27 Oct 2016 13:51:30 +0000 (13:51 +0000)]
Add documentation for the transparent_union attribute

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

llvm-svn: 285292

8 years agoFix warnings from python difflib.
Alexander Kornienko [Thu, 27 Oct 2016 13:46:49 +0000 (13:46 +0000)]
Fix warnings from python difflib.

llvm-svn: 285291

8 years agoUse fewer allocators.
Rafael Espindola [Thu, 27 Oct 2016 13:32:32 +0000 (13:32 +0000)]
Use fewer allocators.

Instead of having 3 section allocators per file, have 3 for all files.

This is a substantial performance improvement for some cases. Linking
chromium without gc speeds up by 1.065x.

This requires using _exit in fatal since we have to avoid destructing
an InputSection if fatal is called from the constructor.

Thanks to Rui for the suggestion.

llvm-svn: 285290

8 years ago[Sema] -Wunused-variable warning for array variables should behave
Alex Lorenz [Thu, 27 Oct 2016 13:30:51 +0000 (13:30 +0000)]
[Sema] -Wunused-variable warning for array variables should behave
similarly to scalar variables.

This commit makes the -Wunused-variable warning behaviour more consistent:
Now clang won't warn for array variables where it doesn't warn for scalar
variables.

rdar://24158862

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

llvm-svn: 285289

8 years agoRevert r285285 "[Object/ELF] - Fixed behavior when SectionHeaderTable->sh_size is...
George Rimar [Thu, 27 Oct 2016 12:18:50 +0000 (12:18 +0000)]
Revert r285285 "[Object/ELF] - Fixed behavior when SectionHeaderTable->sh_size is too large."
It broke BB.

llvm-svn: 285288

8 years agoAdd const versions of Expr::getInits() and Expr::inits()
Erik Verbruggen [Thu, 27 Oct 2016 12:12:08 +0000 (12:12 +0000)]
Add const versions of Expr::getInits() and Expr::inits()

llvm-svn: 285287

8 years ago[SLP] Fix for PR30626: Compiler crash inside SLP Vectorizer.
Alexey Bataev [Thu, 27 Oct 2016 12:02:28 +0000 (12:02 +0000)]
[SLP] Fix for PR30626: Compiler crash inside SLP Vectorizer.

After successfull horizontal reduction vectorization attempt for PHI node
vectorizer tries to update root binary op by combining vectorized tree
and the ReductionPHI node. But during vectorization this ReductionPHI
can be vectorized itself and replaced by the `undef` value, while the
instruction itself is marked for deletion. This 'marked for deletion'
PHI node then can be used in new binary operation, causing "Use still
stuck around after Def is destroyed" crash upon PHI node deletion.

Also the test is fixed to make it perform actual testing.

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

llvm-svn: 285286

8 years ago[Object/ELF] - Fixed behavior when SectionHeaderTable->sh_size is too large.
George Rimar [Thu, 27 Oct 2016 11:50:04 +0000 (11:50 +0000)]
[Object/ELF] - Fixed behavior when SectionHeaderTable->sh_size is too large.

Elf.h already has code checking that section table does not go past end of file.
Problem is that this check may not work on values greater than UINT64_MAX / Header->e_shentsize
because of calculation overflow.

Parch fixes the issue.

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

llvm-svn: 285285

8 years ago[Object/ELF] - Do not allow overflow when checking section size/offset.
George Rimar [Thu, 27 Oct 2016 11:44:56 +0000 (11:44 +0000)]
[Object/ELF] - Do not allow overflow when checking section size/offset.

Overflow was the reason of incorrect passing the check,
patch fixes the case.

Differentail revision: https://reviews.llvm.org/D25514

llvm-svn: 285284

8 years agoFixed a memory leak related to task dependencies.
Andrey Churbanov [Thu, 27 Oct 2016 11:43:07 +0000 (11:43 +0000)]
Fixed a memory leak related to task dependencies.

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

Patch by Alex Duran.

llvm-svn: 285283

8 years ago[Object/ELF] - Do not crash if string table sh_size is equal to zero.
George Rimar [Thu, 27 Oct 2016 11:41:57 +0000 (11:41 +0000)]
[Object/ELF] - Do not crash if string table sh_size is equal to zero.

Revealed using "id_000038,sig_11,src_000015,op_havoc,rep_16" from PR30540,
when sh_size was 0, crash happened.

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

llvm-svn: 285282

8 years agoFix MSVC warning about missing 'this' from lambda default capture mode
Simon Pilgrim [Thu, 27 Oct 2016 10:51:29 +0000 (10:51 +0000)]
Fix MSVC warning about missing 'this' from lambda default capture mode

llvm-svn: 285281

8 years ago[ARM] Add newline char to test.
Sam Parker [Thu, 27 Oct 2016 10:43:02 +0000 (10:43 +0000)]
[ARM] Add newline char to test.

Missed a newline in the previous commit.

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

llvm-svn: 285280