platform/upstream/llvm.git
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

8 years agoAMDGPU: Rename intrinsic to better match instruction name
Matt Arsenault [Sat, 13 Feb 2016 01:03:00 +0000 (01:03 +0000)]
AMDGPU: Rename intrinsic to better match instruction name

Also fixes missing f32 test.

llvm-svn: 260780

8 years agoDisable two tests that use a lot of stack under ASan.
Alexey Samsonov [Sat, 13 Feb 2016 01:02:59 +0000 (01:02 +0000)]
Disable two tests that use a lot of stack under ASan.

llvm-svn: 260779

8 years agoUpdate page to list supported targets
Matt Arsenault [Sat, 13 Feb 2016 01:02:06 +0000 (01:02 +0000)]
Update page to list supported targets

llvm-svn: 260778

8 years agoSplit sources for amdgcn and r600
Matt Arsenault [Sat, 13 Feb 2016 01:01:59 +0000 (01:01 +0000)]
Split sources for amdgcn and r600

Most files remain in a common amdgpu directory.

Also switches barriers to to use convergent,
and use llvm.amdgcn.s.barrier.

This now requires 3.9/trunk to build amdgcn.

llvm-svn: 260777

8 years agoMake -Wnull-conversion more useful.
Richard Trieu [Sat, 13 Feb 2016 00:58:53 +0000 (00:58 +0000)]
Make -Wnull-conversion more useful.

When a null constant is used in a macro, walk through the macro stack to
determine where the null constant is written and where the context is located.
Only warn if both locations are within the same macro expansion.  This helps
function-like macros which involve pointers be treated as if they were
functions.

llvm-svn: 260776

8 years ago[TSan] Adjust expectation for check_analyze.sh
Alexey Samsonov [Sat, 13 Feb 2016 00:55:58 +0000 (00:55 +0000)]
[TSan] Adjust expectation for check_analyze.sh

r260695 caused extra push/pop instruction pair in __tsan_read1
implementation. Still, that change in InstCombine is believed to
be good, as it reduces the number of instructions performed.

Adjust the expectations to match the newly generated code.

llvm-svn: 260775

8 years agoAMDGPU/SI: Add instruction defs for VOP1 DPP instructions
Tom Stellard [Sat, 13 Feb 2016 00:51:31 +0000 (00:51 +0000)]
AMDGPU/SI: Add instruction defs for VOP1 DPP instructions

Reviewers: nhaustov, cfang, arsenm

Subscribers: arsenm, llvm-commits

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

llvm-svn: 260774

8 years agoAMDGPU: Fix broken condition causing warning
Matt Arsenault [Sat, 13 Feb 2016 00:36:10 +0000 (00:36 +0000)]
AMDGPU: Fix broken condition causing warning

llvm-svn: 260773

8 years agoAdding an SBThread::StepInto that takes an end-line, also moved the code that figures
Jim Ingham [Sat, 13 Feb 2016 00:31:47 +0000 (00:31 +0000)]
Adding an SBThread::StepInto that takes an end-line, also moved the code that figures
out the address range for the step to SymbolContext.

llvm-svn: 260772

8 years agoAMDGPU/SI: Organize intrinsics by subtarget
Tom Stellard [Sat, 13 Feb 2016 00:29:57 +0000 (00:29 +0000)]
AMDGPU/SI: Organize intrinsics by subtarget

Reviewers: arsenm

Subscribers: llvm-commits

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

llvm-svn: 260771

8 years ago[TestLibCxxAtomic] Fix Makefile so that the test builds on Linux.
Siva Chandra [Sat, 13 Feb 2016 00:09:42 +0000 (00:09 +0000)]
[TestLibCxxAtomic] Fix Makefile so that the test builds on Linux.

Reviewers: granata.enrico

Subscribers: lldb-commits

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

llvm-svn: 260770

8 years agoDon't combine fp_round (fp_round x) if f80 to f16 is generated
Pirama Arumuga Nainar [Sat, 13 Feb 2016 00:08:05 +0000 (00:08 +0000)]
Don't combine fp_round (fp_round x) if f80 to f16 is generated

Summary:
This patch skips DAG combine of fp_round (fp_round x) if it results in
an fp_round from f80 to f16.

fp_round from f80 to f16 always generates an expensive (and as yet,
unimplemented) libcall to __truncxfhf2.  This prevents selection of
native f16 conversion instructions from f32 or f64.  Moreover, the first
(value-preserving) fp_round from f80 to either f32 or f64 may become a
NOP in platforms like x86.

Reviewers: ab

Subscribers: srhines, llvm-commits

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

llvm-svn: 260769

8 years agoRemoved many JIT workarounds from IRForTarget.
Sean Callanan [Sat, 13 Feb 2016 00:01:46 +0000 (00:01 +0000)]
Removed many JIT workarounds from IRForTarget.

Since IRExecutionUnit is now capable of looking up symbols, and the JIT is up to
the task of generating the appropriate relocations, we don't need to do all the
work that IRForTarget used to do to fixup symbols at the IR level.

We also don't need to allocate data manually (with its attendant bugs) because
the JIT is capable of doing so without crashing.

We also don't need the awkward lldb.call.realName metadata to determine what
calls are objc_msgSend, because they now just reference objc_msgSend.

To make this work, we ensure that we recognize which symbols are extern "C" and
report them to the compiler as such.  We also report the full Decl of functions
rather than just making up top-level functions with the appropriate types.

This should not break any testcases, but let me know if you run into any issues.

<rdar://problem/22864926>

llvm-svn: 260768

8 years agoFix stripping of _ when looking for symbols in IRExecutionUnit.
Sean Callanan [Fri, 12 Feb 2016 23:55:13 +0000 (23:55 +0000)]
Fix stripping of _ when looking for symbols in IRExecutionUnit.

Previously we would try both versions of a symbol -- the one with _ in it and
the one without -- in all cases, because we didn't know what the current
platform's policy was.  However, stripping _ is only necessary on platforms
where _ is the prefix for global symbols.

There's an API that does this, though, on llvm::DataLayout, so this patch fixes
IRExecutionUnit to use that API to determine whether or not to strip _ from the
symbol or not.

llvm-svn: 260767

8 years agoFix Windows buildbot breakage.
Alexey Samsonov [Fri, 12 Feb 2016 23:51:06 +0000 (23:51 +0000)]
Fix Windows buildbot breakage.

llvm-svn: 260766

8 years agoAMDGPU/SI: Detect uniform branches and emit s_cbranch instructions
Tom Stellard [Fri, 12 Feb 2016 23:45:29 +0000 (23:45 +0000)]
AMDGPU/SI: Detect uniform branches and emit s_cbranch instructions

Reviewers: arsenm

Subscribers: mareko, MatzeB, qcolombet, arsenm, llvm-commits

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

llvm-svn: 260765

8 years agoDisable the vzeroupper insertion pass on PS4.
Yunzhong Gao [Fri, 12 Feb 2016 23:37:57 +0000 (23:37 +0000)]
Disable the vzeroupper insertion pass on PS4.

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

llvm-svn: 260764

8 years agocmake: Simplify the iOS.cmake toolchain
Justin Bogner [Fri, 12 Feb 2016 23:36:05 +0000 (23:36 +0000)]
cmake: Simplify the iOS.cmake toolchain

- Remove a comment that was clearly copy pasted from Android.cmake and
  isn't relevant.
- Remove the toolchain's sensitivity to the environment. It's less
  error prone to just allow users to set CMAKE_OSX_SYSROOT if they
  want to use a custom SDK.
- Stop explicitly setting -mios-version-min to the default value. It
  just adds needless complexity.

This makes building the native tablegen work for me even when SDKROOT
is set in the environment (or passed in as -DCMAKE_OSX_SYSROOT).

llvm-svn: 260763

8 years ago[index] Add llvm/Support/DataTypes.h header to fix build failures in the bots.
Argyrios Kyrtzidis [Fri, 12 Feb 2016 23:30:07 +0000 (23:30 +0000)]
[index] Add llvm/Support/DataTypes.h header to fix build failures in the bots.

llvm-svn: 260762

8 years agoRemove an unnecessary include
Enrico Granata [Fri, 12 Feb 2016 23:12:27 +0000 (23:12 +0000)]
Remove an unnecessary include

llvm-svn: 260761

8 years ago[libclang] Separate the underlying indexing functionality of libclang and introduce...
Argyrios Kyrtzidis [Fri, 12 Feb 2016 23:10:59 +0000 (23:10 +0000)]
[libclang] Separate the underlying indexing functionality of libclang and introduce it into the clangIndex library.

It is a general goodness for libclang itself to mostly be a wrapper of functionality provided by the libraries.

llvm-svn: 260760

8 years ago[WebAssembly] Report more meaningful error messages for some unsupported
Derek Schuff [Fri, 12 Feb 2016 22:56:03 +0000 (22:56 +0000)]
[WebAssembly] Report more meaningful error messages for some unsupported
ops.

Computed gotos and RETURNADDR may never be supported; we can do
FRAMEADDR in the future.

llvm-svn: 260759

8 years ago[Hexagon] Optimize stack slot spills
Krzysztof Parzyszek [Fri, 12 Feb 2016 22:53:35 +0000 (22:53 +0000)]
[Hexagon] Optimize stack slot spills

Replace spills to memory with spills to registers, if possible. This
applies mostly to predicate registers (both scalar and vector), since
they are very limited in number. A spill of a predicate register may
happen even if there is a general-purpose register available. In cases
like this the stack spill/reload may be eliminated completely.

This optimization will consider all stack objects, regardless of where
they came from and try to match the live range of the stack slot with
a dead range of a register from an appropriate register class.

llvm-svn: 260758

8 years agoFix remaining Clang-tidy readability-redundant-control-flow warnings; other minor...
Eugene Zelenko [Fri, 12 Feb 2016 22:53:10 +0000 (22:53 +0000)]
Fix remaining Clang-tidy readability-redundant-control-flow warnings; other minor fixes.

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

llvm-svn: 260757

8 years agoDarwin: pass -stdlib=libc++ down to cc1 whenever we're targeting libc++
Tim Northover [Fri, 12 Feb 2016 22:30:42 +0000 (22:30 +0000)]
Darwin: pass -stdlib=libc++ down to cc1 whenever we're targeting libc++

Recent refactoring meant it only got passed down when explicitly specified,
which breaks header search on Darwin.

llvm-svn: 260755

8 years ago[llvm-pdbdump] Start to decode some streams
David Majnemer [Fri, 12 Feb 2016 22:27:44 +0000 (22:27 +0000)]
[llvm-pdbdump] Start to decode some streams

We can decode a little bit of the first stream now.

llvm-svn: 260754

8 years ago[Hexagon] Mark HVX registers as volatile
Krzysztof Parzyszek [Fri, 12 Feb 2016 22:26:44 +0000 (22:26 +0000)]
[Hexagon] Mark HVX registers as volatile

llvm-svn: 260753

8 years agoData formatter support for libc++ std::atomic<T>
Enrico Granata [Fri, 12 Feb 2016 22:18:24 +0000 (22:18 +0000)]
Data formatter support for libc++ std::atomic<T>

On libc++ std::atomic is a fairly simple data type (layout wise, at least), wrapping actual contents in a member variable named "__a_"

All the formatters are doing is "peel away" this intermediate layer and exposing user data as direct children or values of the std::atomic root variable

Fixes rdar://24329405

llvm-svn: 260752

8 years agofix test to use FileCheck
Sanjay Patel [Fri, 12 Feb 2016 22:07:54 +0000 (22:07 +0000)]
fix test to use FileCheck

llvm-svn: 260751

8 years ago[WebAssembly] Update test expectations after r260737
Derek Schuff [Fri, 12 Feb 2016 22:05:08 +0000 (22:05 +0000)]
[WebAssembly] Update test expectations after r260737

llvm-svn: 260750

8 years agoFix MemorySanitizer.ptrtoint test on big-endian targets.
Evgeniy Stepanov [Fri, 12 Feb 2016 22:00:22 +0000 (22:00 +0000)]
Fix MemorySanitizer.ptrtoint test on big-endian targets.

llvm-svn: 260749

8 years ago[Hexagon] Recognize more cases in copyPhysReg and stack slot load/store
Krzysztof Parzyszek [Fri, 12 Feb 2016 21:56:41 +0000 (21:56 +0000)]
[Hexagon] Recognize more cases in copyPhysReg and stack slot load/store

llvm-svn: 260748

8 years agoDisable recognition of "using" declarations at translation-unit level.
Sean Callanan [Fri, 12 Feb 2016 21:55:05 +0000 (21:55 +0000)]
Disable recognition of "using" declarations at translation-unit level.

Currently CountDeclLevels uses the ASTs which have no distinction between
separate translation units.  If one .o file has a "using" declaration at
translation unit level, that "using" declaration will be in the same translation
unit as functions from other .o files in the same module.  This leads to
erroneous name conflicts as the CountDeclLevels-based function filtering logic
accepts too many fucntions.

In the future we will identify the translation units for top-level Decls more
reliably and restore that functionality.  There's a TODO to that effect in the
code.

llvm-svn: 260747

8 years ago[codeview] Describe local variables in registers
Reid Kleckner [Fri, 12 Feb 2016 21:48:30 +0000 (21:48 +0000)]
[codeview] Describe local variables in registers

llvm-svn: 260746

8 years agoELF: Add wildcard pattern matching to SECTIONS linker script command.
Rui Ueyama [Fri, 12 Feb 2016 21:47:28 +0000 (21:47 +0000)]
ELF: Add wildcard pattern matching to SECTIONS linker script command.

Each rule in SECTIONS commands is something like ".foo *(.baz.*)",
which instructs the linker to collect all sections whose name matches
".baz.*" from all files and put them into .foo section.

Previously, we didn't recognize the wildcard character. This patch
adds that feature.

Performance impact is a bit concerning because a linker script can
contain hundreds of SECTIONS rules, and doing pattern matching against
each rule would be too expensive. We could merge all patterns into
single DFA so that it takes O(n) to the input size. However, it is
probably too much at this moment -- we don't know whether the
performance of pattern matching matters or not. So I chose to
implement the simplest algorithm in this patch. I hope this simple
pattern matcher is sufficient.

llvm-svn: 260745

8 years ago[CMake] Fixing bots I broke.
Chris Bieneman [Fri, 12 Feb 2016 21:46:25 +0000 (21:46 +0000)]
[CMake] Fixing bots I broke.

llvm-svn: 260744

8 years agoTrying to fix the MSVC build.
Rafael Espindola [Fri, 12 Feb 2016 21:36:59 +0000 (21:36 +0000)]
Trying to fix the MSVC build.

llvm-svn: 260743

8 years ago[CMake] Improve the clang order-file generation workflow
Chris Bieneman [Fri, 12 Feb 2016 21:36:55 +0000 (21:36 +0000)]
[CMake] Improve the clang order-file generation workflow

Summary:
This commit re-lands r259862. The underlying cause of the build breakage was an incorrectly written capabilities test. In tools/Driver/CMakeLists.txt I was attempting to check if a linker flag worked, the test was passing it to the compiler, not the linker. CMake doesn't have a linker test, so we have a hand-rolled one.

Original Patch Review: http://reviews.llvm.org/D16896

Original Summary:
With this change generating clang order files using dtrace uses the following workflow:

cmake <whatever options you want>

ninja generate-order-file

ninja clang

This patch works by setting a default path to the order file (which can be overridden by the user). If the order file doesn't exist during configuration CMake will create an empty one.

CMake then ties up the dependencies between the clang link job and the order file, and generate-order-file overwrites CLANG_ORDER_FILE with the new order file.

Reviewers: bogner

Subscribers: cfe-commits

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

llvm-svn: 260742

8 years ago[PGO] Add another interface for annotateValueSite
Rong Xu [Fri, 12 Feb 2016 21:36:17 +0000 (21:36 +0000)]
[PGO] Add another interface for annotateValueSite

Add another interface to function annotateValueSite() which directly uses the
VauleData array.

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

llvm-svn: 260741

8 years ago[WebAssembly] Fix byval for empty types.
Dan Gohman [Fri, 12 Feb 2016 21:30:18 +0000 (21:30 +0000)]
[WebAssembly] Fix byval for empty types.

llvm-svn: 260740

8 years ago[AArch64] Enable post-RA MI scheduler for Kryo.
Chad Rosier [Fri, 12 Feb 2016 21:27:33 +0000 (21:27 +0000)]
[AArch64] Enable post-RA MI scheduler for Kryo.

This should have landed in r260686.

llvm-svn: 260739

8 years ago[WebAssembly] Fix insertion of a BLOCK in a loop header that also ends a BLOCK.
Dan Gohman [Fri, 12 Feb 2016 21:19:25 +0000 (21:19 +0000)]
[WebAssembly] Fix insertion of a BLOCK in a loop header that also ends a BLOCK.

llvm-svn: 260737

8 years agoTry to fix the build in some bots.
Rafael Espindola [Fri, 12 Feb 2016 21:17:10 +0000 (21:17 +0000)]
Try to fix the build in some bots.

llvm-svn: 260736

8 years agoIRInterpreter now recognizes expressions with constants it doesn't handle.
Sean Callanan [Fri, 12 Feb 2016 21:16:58 +0000 (21:16 +0000)]
IRInterpreter now recognizes expressions with constants it doesn't handle.

If an instruction has a constant that IRInterpreter doesn't know how to deal
with (say, an array constant, because we can't materialize it to APInt) then we
used to ignore that and only fail during expression execution.  This is annoying
because if IRInterpreter had just returned false from CanInterpret(), the JIT
would have been used.

Now the IRInterpreter checks constants as part of CanInterpret(), so this should
hopefully no longer be an issue.

llvm-svn: 260735