platform/upstream/llvm.git
8 years agoPR26449: Fixes for bugs in __builtin_classify_type implementation
Andrey Bokhanko [Mon, 15 Feb 2016 10:39:04 +0000 (10:39 +0000)]
PR26449: Fixes for bugs in __builtin_classify_type implementation

This patch fixes the following bugs in __builtin_classify_type implementation:
1) Support for member functions and fields
2) Same behavior as GCC in C mode (specifically, return integer_type_class for
   enums and pointer_type_class for function pointers and arrays). Behavior in
   C++ mode didn't changed.

Also, it refactors the whole implementation, by replacing a sequence of
if-else-if with a couple of switches.

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

llvm-svn: 260881

8 years agoReverted r260879 as it caused test failures in lld.
Scott Egerton [Mon, 15 Feb 2016 10:04:38 +0000 (10:04 +0000)]
Reverted r260879 as it caused test failures in lld.

llvm-svn: 260880

8 years ago[mips] Removed the SHF_ALLOC flag from the .pdr section.
Scott Egerton [Mon, 15 Feb 2016 09:34:15 +0000 (09:34 +0000)]
[mips] Removed the SHF_ALLOC flag from the .pdr section.

Summary:
This section is used for debug information and has no need to be
in memory at runtime. With this patch, LLVM now emits the same flags as
the GNU assembler. This patch also fixes an error when compiling
the Linux kernel, The error is that there are relocations within the
.pdr section in a VDSO.

Reviewers: vkalintiris, dsanders

Subscribers: llvm-commits, dsanders

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

llvm-svn: 260879

8 years agoAVX512: Change store size of kmask. Store size of v8i1, v4i1 , v2i1 and i1 are change...
Igor Breger [Mon, 15 Feb 2016 08:25:28 +0000 (08:25 +0000)]
AVX512: Change store size of kmask. Store size of v8i1, v4i1 , v2i1 and i1 are changed to 16 bits.
If KMOVB not supported (require AVX512DQ) only KMOVW can be used so store size should be 2 bytes.

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

llvm-svn: 260878

8 years ago[OPENMP] Remove extra sync barriers for 'firstprivate' clause.
Alexey Bataev [Mon, 15 Feb 2016 08:07:17 +0000 (08:07 +0000)]
[OPENMP] Remove extra sync barriers for 'firstprivate' clause.
Sync barrier will be emitted after generation of firstprivate variables
only if one of the firstprivate vars is used in lastprivate clause.

llvm-svn: 260877

8 years agoFixed non-NULL terminating array bug in SanitizerCommon.StartSubprocessTest that...
Zia Ansari [Mon, 15 Feb 2016 05:11:51 +0000 (05:11 +0000)]
Fixed non-NULL terminating array bug in SanitizerCommon.StartSubprocessTest that caused them to fail sometimes and act flaky.

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

llvm-svn: 260876

8 years agoMinor code cleanups. NFC.
Junmo Park [Mon, 15 Feb 2016 04:30:37 +0000 (04:30 +0000)]
Minor code cleanups. NFC.

llvm-svn: 260875

8 years agoclangIndex requires LLVMIR as Core, since r260858 uses llvm/IR.
NAKAMURA Takumi [Mon, 15 Feb 2016 04:29:36 +0000 (04:29 +0000)]
clangIndex requires LLVMIR as Core, since r260858 uses llvm/IR.

llvm-svn: 260874

8 years ago[clang-tidy] ClangTidy check to flag uninitialized builtin and pointer fields.
Felix Berger [Mon, 15 Feb 2016 04:27:56 +0000 (04:27 +0000)]
[clang-tidy] ClangTidy check to flag uninitialized builtin and pointer fields.

Summary:
This patch is a continuation of http://reviews.llvm.org/D10553 by Jonathan B Coe.

The main additions are:

1. For C++11 the check suggests in-class field initialization as fix. This
makes the fields future proof towards the addition of new constructors.
2 For older language versions the fields are added in the right position
in the initializer list with more tests.
3. User documentation.

Reviewers: alexfh, jbcoe

Subscribers: cfe-commits

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

llvm-svn: 260873

8 years agoAdd isAnyPointer() matchers. Register missing matchers.
Felix Berger [Mon, 15 Feb 2016 04:00:39 +0000 (04:00 +0000)]
Add isAnyPointer() matchers. Register missing matchers.

Summary:
The isAnyPointer() matcher is useful for http://reviews.llvm.org/D15623.

Reviewers: alexfh, klimek

Subscribers: cfe-commits

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

llvm-svn: 260872

8 years agoELF: silence -Wcast-qual warnings from GCC
Saleem Abdulrasool [Mon, 15 Feb 2016 03:45:18 +0000 (03:45 +0000)]
ELF: silence -Wcast-qual warnings from GCC

Silence 4 -Wcast-qual warnings from GCC 5.1.  NFC.

llvm-svn: 260871

8 years ago[clang-tidy] Only invoke ForRangeCopyCheck on expensive-to-copy types.
Felix Berger [Mon, 15 Feb 2016 03:36:23 +0000 (03:36 +0000)]
[clang-tidy] Only invoke ForRangeCopyCheck on expensive-to-copy types.

Summary:
Fix oversight not checking the value of the Optional<bool> returned by
isExpensiveToCopy().

Reviewers: alexfh

Subscribers: cfe-commits

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

llvm-svn: 260870

8 years agoImprove documentation
Felix Berger [Mon, 15 Feb 2016 03:27:54 +0000 (03:27 +0000)]
Improve documentation

llvm-svn: 260869

8 years agoExpressionParser: silence some GCC warnings
Saleem Abdulrasool [Mon, 15 Feb 2016 03:23:14 +0000 (03:23 +0000)]
ExpressionParser: silence some GCC warnings

Silence a -Wreorder warning about order of member initialization and a
-Wqual-cast warning about casting away constness.  NFC.

llvm-svn: 260868

8 years agoSema: prevent assertion on stack return checking
Saleem Abdulrasool [Mon, 15 Feb 2016 01:51:24 +0000 (01:51 +0000)]
Sema: prevent assertion on stack return checking

In the case that the array indexing itself is within a type dependent context,
bail out of the evaluation.  We would previously try to symbolically evaluate
the expression which would then try to evaluate a non-address expression as an
address, triggering an assertion in Asserts builds.

We only need to consider the array subscript expression itself as in the case
that the base itself being type dependent is handled appropriately in EvalAddr.

Resolves PR26599.

llvm-svn: 260867

8 years ago[AST/index] Introduce an option 'SuppressTemplateArgsInCXXConstructors' in printing...
Argyrios Kyrtzidis [Mon, 15 Feb 2016 01:32:36 +0000 (01:32 +0000)]
[AST/index] Introduce an option 'SuppressTemplateArgsInCXXConstructors' in printing policy.

Enable it for USRs and names when indexing.
Forward references can have different template argument names; including them
makes USRs and names unstable, since the name depends on whether we saw a forward reference or not.

llvm-svn: 260866

8 years agosilence -Wreturn-type warnings
Saleem Abdulrasool [Mon, 15 Feb 2016 00:36:52 +0000 (00:36 +0000)]
silence -Wreturn-type warnings

These codepaths would generate warnings with GCC on linux even though the switch
was covered.  Add llvm_unreachable markers to indicate that the switch should be
covered.  NFC.

llvm-svn: 260865

8 years agoSema: constify EvalAddr, EvalVal
Saleem Abdulrasool [Mon, 15 Feb 2016 00:36:49 +0000 (00:36 +0000)]
Sema: constify EvalAddr, EvalVal

Propagate const throughout these methods as they are non-mutating analyzers of
state.  NFC.

llvm-svn: 260864

8 years ago[Refactor] Eliminate the global variable "InsnToMemAcc".
Hongbin Zheng [Mon, 15 Feb 2016 00:20:58 +0000 (00:20 +0000)]
[Refactor] Eliminate the global variable "InsnToMemAcc".

  Eliminate the global variable "InsnToMemAcc" to make Scop/ScopInfo become
  more protable, such that we can safely use them in a CallGraphSCC pass.

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

llvm-svn: 260863

8 years ago[FIX] Hoist accesses if AA stated they are invariant
Johannes Doerfert [Sun, 14 Feb 2016 23:37:14 +0000 (23:37 +0000)]
[FIX] Hoist accesses if AA stated they are invariant

  Before this patch it could happen that we did not hoist a load that
  was a base pointer of another load even though AA already declared the
  first one as invariant (during ScopDetection). If this case arises we
  will now skipt the "can be overwriten" check because in this case the
  over-approximating nature causes us to generate broken code.

llvm-svn: 260862

8 years ago[test/Index] Set a specific target for the test.
Argyrios Kyrtzidis [Sun, 14 Feb 2016 22:38:38 +0000 (22:38 +0000)]
[test/Index] Set a specific target for the test.

llvm-svn: 260861

8 years agoSplit ScopArrayInfo::updateSizes into two functions
Johannes Doerfert [Sun, 14 Feb 2016 22:31:39 +0000 (22:31 +0000)]
Split ScopArrayInfo::updateSizes into two functions

  The former ScopArrayInfo::updateSizes was implicitly divided into an
  updateElementType and an updateSizes. Now this partitioning is
  explicit.

llvm-svn: 260860

8 years agoSeparate more constant factors of parameters
Johannes Doerfert [Sun, 14 Feb 2016 22:30:56 +0000 (22:30 +0000)]
Separate more constant factors of parameters

  So far we separated constant factors from multiplications, however,
  only when they are at the outermost level of a parameter SCEV. Now,
  we also separate constant factors from the parameter SCEV if the
  outermost expression is a SCEVAddRecExpr. With the changes to the
  SCEVAffinator we can now improve the extractConstantFactor(...)
  function at will without worrying about any other code part. Thus,
  if needed we can implement a more comprehensive
  extractConstantFactor(...) function that will traverse the SCEV
  instead of looking only at the outermost level.

  Four test cases were affected. One did not change much and the other
  three were simplified.

llvm-svn: 260859

8 years ago[index] Factor libclang's functionality to determing the mangled name of symbols...
Argyrios Kyrtzidis [Sun, 14 Feb 2016 22:30:14 +0000 (22:30 +0000)]
[index] Factor libclang's functionality to determing the mangled name of symbols into the clangIndex library.

llvm-svn: 260858

8 years agoCodeGeneration: Add back verification of generated code
Tobias Grosser [Sun, 14 Feb 2016 20:56:49 +0000 (20:56 +0000)]
CodeGeneration: Add back verification of generated code

This got accidentally dropped in r260025

llvm-svn: 260857

8 years agoFix some typos in the clang doc
Sylvestre Ledru [Sun, 14 Feb 2016 20:20:58 +0000 (20:20 +0000)]
Fix some typos in the clang doc

llvm-svn: 260856

8 years agoFix some typos in the llvm doc
Sylvestre Ledru [Sun, 14 Feb 2016 20:16:22 +0000 (20:16 +0000)]
Fix some typos in the llvm doc

llvm-svn: 260855

8 years agoRevert "[ScopDectect] Allow memory accesses with different element types by default"
Tobias Grosser [Sun, 14 Feb 2016 19:59:29 +0000 (19:59 +0000)]
Revert "[ScopDectect] Allow memory accesses with different element types by default"

This reverts commit https://llvm.org/svn/llvm-project/polly/trunk@260853

We unfortunately still have two bugs left which show only up with
-polly-process-unprofitable and which I forgot to test before committing.

llvm-svn: 260854

8 years ago[ScopDectect] Allow memory accesses with different element types by default
Tobias Grosser [Sun, 14 Feb 2016 19:11:16 +0000 (19:11 +0000)]
[ScopDectect] Allow memory accesses with different element types by default

First support for this feature was committed in r259784. Support for
loop invariant load hoisting with different types was added by Johannes
Doerfert in r260045. This fixed the last known bug.

llvm-svn: 260853

8 years ago[X86][AVX] Fixed copy+paste typo in shuffle test
Simon Pilgrim [Sun, 14 Feb 2016 18:11:52 +0000 (18:11 +0000)]
[X86][AVX] Fixed copy+paste typo in shuffle test

llvm-svn: 260852

8 years agoAs reported in https://llvm.org/bugs/show_bug.cgi?id=25496, on FreeBSD,
Dimitry Andric [Sun, 14 Feb 2016 16:08:20 +0000 (16:08 +0000)]
As reported in https://llvm.org/bugs/show_bug.cgi?id=25496, on FreeBSD,
C++ programs compiled for profiling (using `-pg`) should be linked with
`-lc++_p` (or `-lstdc++_p`, depending on the `-stdlib=` setting), not
with the regular C++ libraries.

Add a `FreeBSD::AddCXXStdlibLibArgs()` override to handle this, and add
a test case for it.  While here, extend the test case for the proper
passing of -lm and -lm_p.

Reviewers: compnerd, davide, dws, emaste
Reviewed By: compnerd
Differential Revision: http://reviews.llvm.org/D16264

llvm-svn: 260851

8 years agoDon't leak the ASTUnit when done with testing.
Benjamin Kramer [Sun, 14 Feb 2016 13:18:06 +0000 (13:18 +0000)]
Don't leak the ASTUnit when done with testing.

Found by lsan.

llvm-svn: 260850

8 years agoUse report_fatal_error more consistently in the C API echo test
Amaury Sechet [Sun, 14 Feb 2016 10:06:34 +0000 (10:06 +0000)]
Use report_fatal_error more consistently in the C API echo test

llvm-svn: 260849

8 years agoGet constant cloning out of CloneValue so it can be used when creating globals.
Amaury Sechet [Sun, 14 Feb 2016 09:30:42 +0000 (09:30 +0000)]
Get constant cloning out of CloneValue so it can be used when creating globals.

llvm-svn: 260848

8 years agoc-index-test: Fix libdeps corresponding to r260841.
NAKAMURA Takumi [Sun, 14 Feb 2016 09:19:04 +0000 (09:19 +0000)]
c-index-test: Fix libdeps corresponding to r260841.

llvm-svn: 260847

8 years agoMove clone_params around
Amaury Sechet [Sun, 14 Feb 2016 09:14:30 +0000 (09:14 +0000)]
Move clone_params around

llvm-svn: 260846

8 years agoFix star alignment in Core.h
Amaury Sechet [Sun, 14 Feb 2016 08:58:49 +0000 (08:58 +0000)]
Fix star alignment in Core.h

llvm-svn: 260845

8 years ago[c-index-test] Fix a gcc build error.
Argyrios Kyrtzidis [Sun, 14 Feb 2016 07:08:31 +0000 (07:08 +0000)]
[c-index-test] Fix a gcc build error.

llvm-svn: 260844

8 years ago[index] Fix gcc builds.
Argyrios Kyrtzidis [Sun, 14 Feb 2016 06:53:20 +0000 (06:53 +0000)]
[index] Fix gcc builds.

llvm-svn: 260843

8 years ago[index] Enhance c-index-test tool and have it link and test the clangIndex library...
Argyrios Kyrtzidis [Sun, 14 Feb 2016 06:39:11 +0000 (06:39 +0000)]
[index] Enhance c-index-test tool and have it link and test the clangIndex library directly.

llvm-svn: 260842

8 years ago[index] Allow calling createIndexingAction() without passing another action to wrap...
Argyrios Kyrtzidis [Sun, 14 Feb 2016 06:39:03 +0000 (06:39 +0000)]
[index] Allow calling createIndexingAction() without passing another action to wrap over.

llvm-svn: 260841

8 years ago[TableGen] Remove constant string argument from a method that's only called once...
Craig Topper [Sun, 14 Feb 2016 05:22:01 +0000 (05:22 +0000)]
[TableGen] Remove constant string argument from a method that's only called once. We can just hardcode the string inside. There already other things that make the method not reusable. NFC

llvm-svn: 260840

8 years agoFix lib/tsan/go/buildgo.sh for FreeBSD after r243051.
Dimitry Andric [Sun, 14 Feb 2016 00:26:32 +0000 (00:26 +0000)]
Fix lib/tsan/go/buildgo.sh for FreeBSD after r243051.

FreeBSD also needs to have sanitizer_linux_libcdep.cc included,
otherwise linking will fail with "undefined reference to
`__sanitizer::GetRSS()'".

While here, tabify the FreeBSD part, similar to the other parts.

llvm-svn: 260839

8 years ago[PM/AA] Wire BasicAA's new pass manager class up to the pass registry.
Chandler Carruth [Sat, 13 Feb 2016 23:46:24 +0000 (23:46 +0000)]
[PM/AA] Wire BasicAA's new pass manager class up to the pass registry.

This ensures that all of the various pieces are working. The next patch
will wire up commandline-driven alias analysis chain building and allow
BasicAA to work with the AAManager.

llvm-svn: 260838

8 years ago[OpenMP] Rename the offload entry points.
Samuel Antao [Sat, 13 Feb 2016 23:35:10 +0000 (23:35 +0000)]
[OpenMP] Rename the offload entry points.

Summary:
Unlike other outlined regions in OpenMP, offloading entry points have to have be visible (external linkage) for the device side. Using dots in the names of the entries can be therefore problematic for some toolchains, e.g. NVPTX.

Also the patch drops the column information in the unique name of the entry points. The parsing of directives ignore unknown tokens, preventing several target  regions to be implemented in the same line. Therefore, the line information is sufficient for the name to be unique. Also, the preprocessor printer does not preserve the column information, causing offloading-entry detection issues if the host uses an integrated preprocessor and the target doesn't (or vice versa).

Reviewers: hfinkel, arpith-jacob, carlo.bertolli, kkwli0, ABataev

Subscribers: cfe-commits, fraggamuffin, caomhin

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

llvm-svn: 260837

8 years ago[PM/AA] Actually wire the AAManager I built for the new pass manager
Chandler Carruth [Sat, 13 Feb 2016 23:32:00 +0000 (23:32 +0000)]
[PM/AA] Actually wire the AAManager I built for the new pass manager
into the new pass manager and fix the latent bugs there.

This lets everything live together nicely, but it isn't really useful
yet. I never finished wiring the AA layer up for the new pass manager,
and so subsequent patches will change this to do that wiring and get AA
stuff more fully integrated into the new pass manager. Turns out this is
necessary even to get functionattrs ported over. =]

llvm-svn: 260836

8 years agoSupport: Fix incremental build when re-configuring targets
Duncan P. N. Exon Smith [Sat, 13 Feb 2016 22:58:43 +0000 (22:58 +0000)]
Support: Fix incremental build when re-configuring targets

r180893 added an indirect include of llvm/Config/Targets.def to
llvm/Support/CodeGen.h, which in turn is included by things like
llvm/IR/Module.h.  After a full build of LLVM and Clang, ninja had to
rebuild 1274 files after reconfiguring.

This commit strips CodeGen.h back down to just a pile of enums and moves
the expensive includes over to CodeGenCWrappers.h (which is only
included in two places).  This gets ninja down to 88 files if you
reconfigure with, e.g., -DLLVM_TARGETS_TO_BUILD=X86.

llvm-svn: 260835

8 years ago[X86][AVX] Lower shuffles as repeated lane shuffles then lane-crossing shuffles
Simon Pilgrim [Sat, 13 Feb 2016 21:54:04 +0000 (21:54 +0000)]
[X86][AVX] Lower shuffles as repeated lane shuffles then lane-crossing shuffles

This patch attempts to represent a shuffle as a repeating shuffle (recognisable by is128BitLaneRepeatedShuffleMask) with the source input(s) in their original lanes, followed by a single permutation of the 128-bit lanes to their final destinations.

On AVX2 we can additionally attempt to match using 64-bit sub-lane permutation. AVX2 can also now match a similar 'broadcasted' repeating shuffle.

This patch has several benefits:

 * Avoids prematurely matching with lowerVectorShuffleByMerging128BitLanes which can require both inputs to have their input lanes permuted before shuffling.
 * Can replace PERMPS/PERMD instructions - although these are useful for cross-lane unary shuffling, they require their shuffle mask to be pre-loaded (and increase register pressure).
 * Matching the repeating shuffle makes use of a lot of existing shuffle lowering.

There is an outstanding minor AVX1 regression (combine_unneeded_subvector1 in vector-shuffle-combining.ll) of a previously 128-bit shuffle + subvector splat being converted to a subvector splat + (2 instruction) 256-bit shuffle, I intend to fix this in a followup patch for review.

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

llvm-svn: 260834

8 years ago[AST] Add a print() method in DeclarationName that accepts a PrintingPolicy.
Argyrios Kyrtzidis [Sat, 13 Feb 2016 21:46:50 +0000 (21:46 +0000)]
[AST] Add a print() method in DeclarationName that accepts a PrintingPolicy.

llvm-svn: 260833

8 years agoRemove Proc feature flags for X86 processors that are used to inherit features from...
Craig Topper [Sat, 13 Feb 2016 21:35:37 +0000 (21:35 +0000)]
Remove Proc feature flags for X86 processors that are used to inherit features from one processor to another. This exposed extra features to the -mattr command line that we shouldn't. Replace with just inherited listconcats.

llvm-svn: 260832

8 years agoFix a leak in the generated code for attributes with strings.
Benjamin Kramer [Sat, 13 Feb 2016 18:11:49 +0000 (18:11 +0000)]
Fix a leak in the generated code for attributes with strings.

Storing std::strings in attributes simply doesn't work, we never call
the destructor. Use an array of StringRefs instead of std::strings and
copy the data into memory taken from the ASTContext.

llvm-svn: 260831

8 years ago[TableGen] Fix comment about 64-bit type I missed when I removed the underlying type...
Craig Topper [Sat, 13 Feb 2016 17:58:14 +0000 (17:58 +0000)]
[TableGen] Fix comment about 64-bit type I missed when I removed the underlying type in r260808.

llvm-svn: 260830

8 years ago[libFuzzer] remove std::vector operations from hot paths, NFC
Kostya Serebryany [Sat, 13 Feb 2016 17:56:51 +0000 (17:56 +0000)]
[libFuzzer] remove std::vector operations from hot paths, NFC

llvm-svn: 260829

8 years ago[x86-64] allow mfence even with -mno-sse (PR23203)
Sanjay Patel [Sat, 13 Feb 2016 17:26:29 +0000 (17:26 +0000)]
[x86-64] allow mfence even with -mno-sse (PR23203)

As shown in:
https://llvm.org/bugs/show_bug.cgi?id=23203
...we currently die because lowering believes that mfence is allowed without SSE2 on x86-64,
but the instruction def doesn't know that.

I don't know if allowing mfence without SSE is right, but if not, at least now it's consistently wrong. :)

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

llvm-svn: 260828

8 years ago[APInt] No need for a copy when taking min/max of an APInt.
Benjamin Kramer [Sat, 13 Feb 2016 17:23:27 +0000 (17:23 +0000)]
[APInt] No need for a copy when taking min/max of an APInt.

llvm-svn: 260827

8 years ago[ConstantFolding] Reduce APInt and APFloat copying.
Benjamin Kramer [Sat, 13 Feb 2016 16:54:14 +0000 (16:54 +0000)]
[ConstantFolding] Reduce APInt and APFloat copying.

llvm-svn: 260826

8 years ago[AggressiveAntiDepBreaker] Skip some unnecessary BitVector copies.
Benjamin Kramer [Sat, 13 Feb 2016 16:39:39 +0000 (16:39 +0000)]
[AggressiveAntiDepBreaker] Skip some unnecessary BitVector copies.

llvm-svn: 260825

8 years agoUse ArrayRef to hide SmallVector details, kill a useless vector copy along the way.
Benjamin Kramer [Sat, 13 Feb 2016 16:01:12 +0000 (16:01 +0000)]
Use ArrayRef to hide SmallVector details, kill a useless vector copy along the way.

llvm-svn: 260824

8 years agoRValue refs do not work that way.
Benjamin Kramer [Sat, 13 Feb 2016 16:00:13 +0000 (16:00 +0000)]
RValue refs do not work that way.

llvm-svn: 260823

8 years agoDon't copy a DenseMap just to do lookup in it.
Benjamin Kramer [Sat, 13 Feb 2016 15:49:17 +0000 (15:49 +0000)]
Don't copy a DenseMap just to do lookup in it.

Also remove the now unused isPodLike specialization. DenseMap only uses
it for copies.

llvm-svn: 260822

8 years agoUse unique_ptr to manage Scop inside ScopInfo.
Hongbin Zheng [Sat, 13 Feb 2016 15:13:02 +0000 (15:13 +0000)]
Use unique_ptr to manage Scop inside ScopInfo.

llvm-svn: 260821

8 years agoMove AccFuncMap from ScopInfo into Scop
Hongbin Zheng [Sat, 13 Feb 2016 15:12:58 +0000 (15:12 +0000)]
Move AccFuncMap from ScopInfo into Scop

  Since the origin AccFuncMap in ScopInfo is used by the underlying Scop
  only, and it must stay alive until we delete the Scop. It will be better
  if we simply move the origin AccFuncMap in ScopInfo into the Scop class.

llvm-svn: 260820

8 years agoDo not carry LoopInfo along with a Scop.
Hongbin Zheng [Sat, 13 Feb 2016 15:12:54 +0000 (15:12 +0000)]
Do not carry LoopInfo along with a Scop.

  Make Scop become more portable such that we can use it in a CallGraphSCC pass.
  The first step is to drop the analyses that are only used during Scop construction.
  This patch drop LoopInfo from Scop.

llvm-svn: 260819

8 years agoDo not carry DominatorTree along with a Scop.
Hongbin Zheng [Sat, 13 Feb 2016 15:12:51 +0000 (15:12 +0000)]
Do not carry DominatorTree along with a Scop.

  Make Scop become more portable such that we can use it in a CallGraphSCC pass.
  The first step is to drop the analyses that are only used during Scop construction.
  This patch drop DominatorTree from Scop.

llvm-svn: 260818

8 years agoDo not carry ScopDetection along with a Scop.
Hongbin Zheng [Sat, 13 Feb 2016 15:12:47 +0000 (15:12 +0000)]
Do not carry ScopDetection along with a Scop.

  Make Scop become more portable such that we can use it in a CallGraphSCC pass.
  The first step is to drop the analyses that are only used during Scop construction.
  This patch drop ScopDecection from Scop.

llvm-svn: 260817

8 years ago[Hexagon] Replace use of "std::map::emplace" with "insert"
Krzysztof Parzyszek [Sat, 13 Feb 2016 14:06:01 +0000 (14:06 +0000)]
[Hexagon] Replace use of "std::map::emplace" with "insert"

Gcc 4.7.2-4 does not seem to have "emplace" in its implementation of map.
This should fix the build failure on polly-amd64-linux.

llvm-svn: 260816

8 years agoReduce the number of implicit StringRef->std::string conversions by threading StringR...
Benjamin Kramer [Sat, 13 Feb 2016 13:42:54 +0000 (13:42 +0000)]
Reduce the number of implicit StringRef->std::string conversions by threading StringRef through more APIs.

No functionality change intended.

llvm-svn: 260815

8 years agoFix use after free.
Benjamin Kramer [Sat, 13 Feb 2016 13:42:41 +0000 (13:42 +0000)]
Fix use after free.

Found by asan.

llvm-svn: 260814

8 years ago[attrs] Move the norecurse deduction to operate on the node set rather
Chandler Carruth [Sat, 13 Feb 2016 08:47:51 +0000 (08:47 +0000)]
[attrs] Move the norecurse deduction to operate on the node set rather
than the SCC object, and have it scan the instruction stream directly
rather than relying on call records.

This makes the behavior of this routine consistent between libc routines
and LLVM intrinsics for libc routines. We can go and start teaching it
about those being norecurse, but we should behave the same for the
intrinsic and the libc routine rather than differently. I chatted with
James Molloy and the inconsistency doesn't seem intentional and likely
is due to intrinsic calls not being modelled in the call graph analyses.

This also fixes a bug where we would deduce norecurse on optnone
functions, when generally we try to handle optnone functions as-if they
were replaceable and thus unanalyzable.

llvm-svn: 260813

8 years agoHexagonFrameLowering.cpp: Appease msc18 to give an explicit constructor SlotInfo...
NAKAMURA Takumi [Sat, 13 Feb 2016 07:29:49 +0000 (07:29 +0000)]
HexagonFrameLowering.cpp: Appease msc18 to give an explicit constructor SlotInfo() instead of member initializers.

llvm-svn: 260812

8 years ago[OPENMP] NFC rewrite ParseOpenMPDirectiveKind
Dmitry Polukhin [Sat, 13 Feb 2016 06:53:38 +0000 (06:53 +0000)]
[OPENMP] NFC rewrite ParseOpenMPDirectiveKind

New implementation is easier to read and extend.

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

llvm-svn: 260811

8 years ago[libFuzzer] don't require seed in fuzzer::Mutate, instead use the global Fuzzer objec...
Kostya Serebryany [Sat, 13 Feb 2016 06:24:18 +0000 (06:24 +0000)]
[libFuzzer] don't require seed in fuzzer::Mutate, instead use the global Fuzzer object for fuzzer::Mutate. This makes custom mutators fast

llvm-svn: 260810

8 years ago[TableGen] Use range-based for loops. NFC
Craig Topper [Sat, 13 Feb 2016 06:03:32 +0000 (06:03 +0000)]
[TableGen] Use range-based for loops. NFC

llvm-svn: 260809

8 years agoNo need to make the subtarget feature bit enum a uint64_t. This was a leftover from...
Craig Topper [Sat, 13 Feb 2016 06:03:29 +0000 (06:03 +0000)]
No need to make the subtarget feature bit enum a uint64_t. This was a leftover from when the feature bit enum contained masks instead of bit indices.

llvm-svn: 260808

8 years ago[index] Change some default parameters to fix an MSVC ICE.
Argyrios Kyrtzidis [Sat, 13 Feb 2016 05:17:15 +0000 (05:17 +0000)]
[index] Change some default parameters to fix an MSVC ICE.

Many thanks to Yunzhong Gao for tracking this down!

llvm-svn: 260807

8 years agoLiveIntervalAnalysis: Remove LiveVariables requirement
Matthias Braun [Sat, 13 Feb 2016 04:35:31 +0000 (04:35 +0000)]
LiveIntervalAnalysis: Remove LiveVariables requirement

This requirement was a huge hack to keep LiveVariables alive because it
was optionally used by TwoAddressInstructionPass and PHIElimination.
However we have AnalysisUsage::addUsedIfAvailable() which we can use in
those passes.

llvm-svn: 260806

8 years agoAMDGPU: Prepare for reducing private element size.
Matt Arsenault [Sat, 13 Feb 2016 04:18:53 +0000 (04:18 +0000)]
AMDGPU: Prepare for reducing private element size.

Tests for the new scalarize all private access options will be
included with a future commit.

The only functional change is to make the split/scalarize behavior
for private access of > 4 element vectors to be consistent
with the flat/global handling. This makes the spilling worse
in the two changed tests.

llvm-svn: 260804

8 years agoAdditional fix to my change in r259983 to handle the
Jason Molenda [Sat, 13 Feb 2016 04:15:02 +0000 (04:15 +0000)]
Additional fix to my change in r259983 to handle the
case where a core file has a kernel binary and a user
process dyld in the same one.  Without this, we were
always picking the dyld and trying to process it as a
kernel.

<rdar://problem/24446112>

llvm-svn: 260803

8 years agolibclang/CMakeLists.txt: Prune IndexingContext.h out of ADDITIONAL_HEADERS. VS IDE...
NAKAMURA Takumi [Sat, 13 Feb 2016 04:01:49 +0000 (04:01 +0000)]
libclang/CMakeLists.txt: Prune IndexingContext.h out of ADDITIONAL_HEADERS. VS IDE uses it.

llvm-svn: 260802

8 years ago[libFuzzer] remove the C++-ish variant of FuzzerDriver from the interface
Kostya Serebryany [Sat, 13 Feb 2016 03:59:26 +0000 (03:59 +0000)]
[libFuzzer] remove the C++-ish variant of FuzzerDriver from the interface

llvm-svn: 260801

8 years ago[libFuzzer] simplify CTOR of MutationDispatcher
Kostya Serebryany [Sat, 13 Feb 2016 03:46:26 +0000 (03:46 +0000)]
[libFuzzer] simplify CTOR of MutationDispatcher

llvm-svn: 260800

8 years ago[libFuzzer] get rid of MutationDispatcher::Impl (simplify the code; NFC)
Kostya Serebryany [Sat, 13 Feb 2016 03:37:24 +0000 (03:37 +0000)]
[libFuzzer] get rid of MutationDispatcher::Impl (simplify the code; NFC)

llvm-svn: 260799

8 years ago[libFuzzer] get rid of UserSuppliedFuzzer; NFC
Kostya Serebryany [Sat, 13 Feb 2016 03:25:16 +0000 (03:25 +0000)]
[libFuzzer] get rid of UserSuppliedFuzzer; NFC

llvm-svn: 260798

8 years ago[libFuzzer] simplify the code around Random. NFC
Kostya Serebryany [Sat, 13 Feb 2016 03:00:53 +0000 (03:00 +0000)]
[libFuzzer] simplify the code around Random. NFC

llvm-svn: 260797

8 years ago[libFuzzer] remove UserSuppliedFuzzer from the interface (it was a bad idea).
Kostya Serebryany [Sat, 13 Feb 2016 02:39:30 +0000 (02:39 +0000)]
[libFuzzer] remove UserSuppliedFuzzer from the interface (it was a bad idea).

llvm-svn: 260796

8 years agoFix the ASTPrinter output for ascii char literals >127.
Steven Watanabe [Sat, 13 Feb 2016 02:31:28 +0000 (02:31 +0000)]
Fix the ASTPrinter output for ascii char literals >127.

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

llvm-svn: 260795

8 years ago[libFuzzer] provide a plain C interface for custom mutators (experimental)
Kostya Serebryany [Sat, 13 Feb 2016 02:29:38 +0000 (02:29 +0000)]
[libFuzzer] provide a plain C interface for custom mutators (experimental)

llvm-svn: 260794

8 years ago[TestLibCxxAtomic] Skip for GCC.
Siva Chandra [Sat, 13 Feb 2016 02:11:11 +0000 (02:11 +0000)]
[TestLibCxxAtomic] Skip for GCC.

Summary: This is the form on other libc++ tests.

Reviewers: sivachandra

Subscribers: lldb-commits

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

llvm-svn: 260793

8 years agoAMDGPU/SI: Add llvm.amdgcn.mov.dpp intrinsic
Tom Stellard [Sat, 13 Feb 2016 02:09:49 +0000 (02:09 +0000)]
AMDGPU/SI: Add llvm.amdgcn.mov.dpp intrinsic

This intrinsic will be used to expose dpp functionality to higher-level
languages. It will map to the dpp version of v_mov_b32.

llvm-svn: 260792

8 years ago[Cloning] Clone every Function's Debug Info
Keno Fischer [Sat, 13 Feb 2016 02:04:29 +0000 (02:04 +0000)]
[Cloning] Clone every Function's Debug Info

Summary:
Export the CloneDebugInfoMetadata utility, which clones all debug info
associated with a function into the first module. Also use this function
in CloneModule on each function we clone (the CloneFunction entrypoint
already does this).

Without this, cloning a module will lead to DI quality regressions,
especially since r252219 reversed the Function <-> DISubprogram edge
(before we could get lucky and have this edge preserved if the
DISubprogram itself was, e.g. due to location metadata).

This was verified to fix missing debug information in julia and
a unittest to verify the new behavior is included.

Patch by Yichao Yu! Thanks!

Reviewers: loladiro, pcc
Differential Revision: http://reviews.llvm.org/D17165

llvm-svn: 260791

8 years agoAdd AMDGPU related triple vendors/OSes
Matt Arsenault [Sat, 13 Feb 2016 01:56:21 +0000 (01:56 +0000)]
Add AMDGPU related triple vendors/OSes

As support expands to more runtimes, we'll need to
distinguish between more than just HSA and unknown.
This also lets us stop using unknown everywhere.

llvm-svn: 260790

8 years ago[llvm-size] Remove variable used only once.
Davide Italiano [Sat, 13 Feb 2016 01:52:47 +0000 (01:52 +0000)]
[llvm-size] Remove variable used only once.

The use of auto and the name were very weird anyway.

llvm-svn: 260789

8 years agoAccept "-Weverything" in clang diagnistic pragmas
Sunil Srivastava [Sat, 13 Feb 2016 01:44:05 +0000 (01:44 +0000)]
Accept "-Weverything" in clang diagnistic pragmas

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

llvm-svn: 260788

8 years ago[Sema] More changes to fix Objective-C fallout from r249995.
Bob Wilson [Sat, 13 Feb 2016 01:41:41 +0000 (01:41 +0000)]
[Sema] More changes to fix Objective-C fallout from r249995.

This is a follow-up to PR26085. That was fixed in r257710 but the testcase
there was incomplete. There is a related issue where the overload resolution
for Objective-C incorrectly picks a method that is not valid without a
bridge cast. The call to Sema::CheckSingleAssignmentConstraints that was
added to SemaOverload.cpp's IsStandardConversion() function does not catch
that case and reports that the method is Compatible even when it is not.

The root cause here is that various Objective-C-related functions in Sema
do not consistently return a value to indicate whether there was an error.
This was fine in the past because they would report diagnostics when needed,
but r257710 changed them to suppress reporting diagnostics when checking
during overload resolution.

This patch adds a new ACR_error result to the ARCConversionResult enum and
updates Sema::CheckObjCARCConversion to return that value when there is an
error. Most of the calls to that function do not check the return value,
so adding this new result does not affect them. The one exception is in
SemaCast.cpp where it specifically checks for ACR_unbridged, so that is
also OK. The call in Sema::CheckSingleAssignmentConstraints can then check
for an ACR_okay result and identify assignments as Incompatible. To
preserve the existing behavior, it only changes the return value to
Incompatible when the new Diagnose argument (from r257710) is false.

Similarly, the CheckObjCBridgeRelatedConversions and
ConversionToObjCStringLiteralCheck need to identify when an assignment is
Incompatible. Those functions already return appropriate values but they
need some fixes related to the new Diagnose argument.

llvm-svn: 260787

8 years ago[llvm-size] Make error handling uniform.
Davide Italiano [Sat, 13 Feb 2016 01:38:16 +0000 (01:38 +0000)]
[llvm-size] Make error handling uniform.

llvm-svn: 260786

8 years ago[RecursiveASTVisitor] Introduce dataTraverseStmtPre()/dataTraverseStmtPost() to allow...
Argyrios Kyrtzidis [Sat, 13 Feb 2016 01:24:19 +0000 (01:24 +0000)]
[RecursiveASTVisitor] Introduce dataTraverseStmtPre()/dataTraverseStmtPost() to allow clients to do before/after actions during data recursive visitation.

This should fix the asan bot that hits stack overflow in a couple of test/Index tests.

llvm-svn: 260785

8 years agoAMDGPU: Cleanup includes and random macros
Matt Arsenault [Sat, 13 Feb 2016 01:24:08 +0000 (01:24 +0000)]
AMDGPU: Cleanup includes and random macros

llvm-svn: 260784

8 years agoAMDGPU: Add sin/cos builtins
Matt Arsenault [Sat, 13 Feb 2016 01:21:09 +0000 (01:21 +0000)]
AMDGPU: Add sin/cos builtins

llvm-svn: 260783

8 years agoAMDGPU: Add intrinsics for sin/cos
Matt Arsenault [Sat, 13 Feb 2016 01:19:56 +0000 (01:19 +0000)]
AMDGPU: Add intrinsics for sin/cos

These provide direct access to the hardware instruction without
the unit version required like llvm.sin/llvm.cos lowering requires.

llvm-svn: 260782

8 years agoAMDGPU: Update builtin for intrinsic change
Matt Arsenault [Sat, 13 Feb 2016 01:03:09 +0000 (01:03 +0000)]
AMDGPU: Update builtin for intrinsic change

llvm-svn: 260781