platform/upstream/llvm.git
9 years ago[YAML] Make Node's destructor non-virtual.
Benjamin Kramer [Wed, 20 May 2015 15:38:29 +0000 (15:38 +0000)]
[YAML] Make Node's destructor non-virtual.

Nodes aren't supposed to be destroyed polymorphically. Also make all subclasses
final to avoid non-virtual dtor warnings.

llvm-svn: 237801

9 years agoAdd diagnostic for unsigned integer comparisions
Tobias Grosser [Wed, 20 May 2015 15:37:11 +0000 (15:37 +0000)]
Add diagnostic for unsigned integer comparisions

llvm-svn: 237800

9 years agoMC: Use MCSymbol in MachObjectWriter, NFC
Duncan P. N. Exon Smith [Wed, 20 May 2015 15:16:14 +0000 (15:16 +0000)]
MC: Use MCSymbol in MachObjectWriter, NFC

Replace uses of `MCSymbolData` with `MCSymbol` where both are needed, so
we can remove the backpointer.

llvm-svn: 237799

9 years agoMC: Use MCSymbol in MCObjectWriter::isWeak(), NFC
Duncan P. N. Exon Smith [Wed, 20 May 2015 15:10:03 +0000 (15:10 +0000)]
MC: Use MCSymbol in MCObjectWriter::isWeak(), NFC

Continue to prefer `MCSymbol` when we need both.

llvm-svn: 237798

9 years agoGet Triple::getARMCPUForArch() to use TargetParser
Renato Golin [Wed, 20 May 2015 15:05:07 +0000 (15:05 +0000)]
Get Triple::getARMCPUForArch() to use TargetParser

First ARMTargetParser FIXME, conservatively changing the way we parse CPUs
in the back-end. Still not perfect, with a lot of special cases, but moving
towards a more generic solution.

Moving all logic to the target parser made some unwritten assumptions
about architectures in Clang to break. I've added a lot of architectures
required by Clang, and default to CPUs that Clang believes it should
(and I agree).

I've also added a lot of unit tests, with the correct CPU for each
architecture, and Clang seems to be working correctly, too.

It also became clear that using "unsigned ID" as the argument for the get
methods makes it hard to know what ID, so I also changed the argument names
to match the enum type names.

llvm-svn: 237797

9 years agoDrop redundant condition
Tobias Grosser [Wed, 20 May 2015 15:04:27 +0000 (15:04 +0000)]
Drop redundant condition

This condition was accidentally introduced in r211875.

llvm-svn: 237796

9 years agoUnit tests for the getSwappedBytes(double) fix from r237673.
Pawel Bylica [Wed, 20 May 2015 14:57:43 +0000 (14:57 +0000)]
Unit tests for the getSwappedBytes(double) fix from r237673.

llvm-svn: 237795

9 years agoSilencing a -Wsign-compare warning; NFC.
Aaron Ballman [Wed, 20 May 2015 14:53:50 +0000 (14:53 +0000)]
Silencing a -Wsign-compare warning; NFC.

llvm-svn: 237794

9 years agoAVX-512: fixed algorithm of building vectors of i1 elements
Elena Demikhovsky [Wed, 20 May 2015 14:32:03 +0000 (14:32 +0000)]
AVX-512: fixed algorithm of building vectors of i1 elements
fixed extract-insert i1 element,
load i1, zextload i1 should be with "and $1, %reg" to prevent loading garbage.
added a bunch of new tests.

llvm-svn: 237793

9 years agoRevert r237789 - [mips] The naming convention for private labels is ABI dependant.
Daniel Sanders [Wed, 20 May 2015 14:18:59 +0000 (14:18 +0000)]
Revert r237789 - [mips] The naming convention for private labels is  ABI dependant.

It works, but I've noticed that I missed several callers of createMCAsmInfo()
and many don't have a TargetMachine to provide.

llvm-svn: 237792

9 years ago[ARM] Add needed symbols during dynamic executable linking
Denis Protivensky [Wed, 20 May 2015 13:39:33 +0000 (13:39 +0000)]
[ARM] Add needed symbols during dynamic executable linking

These include _GLOBAL_OFFSET_TABLE_ and _DYNAMIC.

llvm-svn: 237791

9 years ago[mips] Fix ehframe-indirect.ll test.
Daniel Sanders [Wed, 20 May 2015 13:19:19 +0000 (13:19 +0000)]
[mips] Fix ehframe-indirect.ll test.

Summary:
-check-prefix replaces the default CHECK prefix rather than adding to it and
must be explicitly re-added.

Also added the N32 cases.

Reviewers: petarj

Reviewed By: petarj

Subscribers: tberghammer, llvm-commits

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

llvm-svn: 237790

9 years ago[mips] The naming convention for private labels is ABI dependant.
Daniel Sanders [Wed, 20 May 2015 13:16:42 +0000 (13:16 +0000)]
[mips] The naming convention for private labels is ABI dependant.

Summary:
For N32/N64, private labels begin with '.L' but for O32 they begin with '$'.

MCAsmInfo now has an initializer function which can be used to provide information from the TargetMachine to control the assembly syntax.

Reviewers: vkalintiris

Reviewed By: vkalintiris

Subscribers: jfb, sandeep, llvm-commits, rafael

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

llvm-svn: 237789

9 years ago[OPENMP] Fix codegen for ordered loop directives.
Alexey Bataev [Wed, 20 May 2015 13:12:48 +0000 (13:12 +0000)]
[OPENMP] Fix codegen for ordered loop directives.

loops with ordered clause must be generated the same way as dynamic loops, but with static scheduleing.

llvm-svn: 237788

9 years ago[MSVC] Handle out-of-line definition of static data member correctly (fix for http...
Alexey Bataev [Wed, 20 May 2015 11:57:02 +0000 (11:57 +0000)]
[MSVC] Handle out-of-line definition of static data member correctly (fix for llvm.org/PR21164), by Alexey Frolov

There are 3 cases of defining static const member:

initialized inside the class, not defined outside the class.
initialized inside the class, defined outside the class.
not initialized inside the class, defined outside the class.
Revision r213304 was supposed to fix the linkage problem of case (1), but mistakenly it made case (2) behave the same.
As a result, out-of-line definition of static data member is not handled correctly.
Proposed patch distinguishes between cases (1) and (2) and allows to properly emit static const members under –fms-compatibility option.

This fixes http://llvm.org/PR21164.
Differential Revision: http://reviews.llvm.org/D9850

llvm-svn: 237787

9 years ago[StatepointLowering] Support of the gc.relocates for invoke statepoints.
Igor Laevsky [Wed, 20 May 2015 11:37:25 +0000 (11:37 +0000)]
[StatepointLowering] Support of the gc.relocates for invoke statepoints.

This change implements support for lowering of the gc.relocates tied to the invoke statepoint.
This is acomplished by storing frame indices of the lowered values in "StatepointRelocatedValues" map inside FunctionLoweringInfo instead of storing them in per-basic block structure StatepointLowering.
After this change StatepointLowering is used only during "LowerStatepoint" call and it is not necessary to store it as a field in SelectionDAGBuilder anymore.

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

llvm-svn: 237786

9 years agoUse base-pointer address space when creating new access functions
Tobias Grosser [Wed, 20 May 2015 11:02:12 +0000 (11:02 +0000)]
Use base-pointer address space when creating new access functions

llvm-svn: 237785

9 years agoAllow skipping imports in the module visitor.
Manuel Klimek [Wed, 20 May 2015 10:29:23 +0000 (10:29 +0000)]
Allow skipping imports in the module visitor.

Skip imports when we know that we do not need to visit any imports
because we've already deserialized the redecls from a module.

llvm-svn: 237782

9 years agoFix handling of hijacked events in synchronous mode
Ilia K [Wed, 20 May 2015 10:15:47 +0000 (10:15 +0000)]
Fix handling of hijacked events in synchronous mode

Summary:
This patch includes the following changes:
* Fix Target::Launch to handle hijacked event in synchronous mode
* Improve MiStartupOptionsTestCase tests to expect *stopped (MI)
* Add SBProcess::GetStopEventForStopID
* Add ProcessModID::SetStopEventForLastNaturalStopID/GetStopEventForStopID
* Add const qualifier to ProcessModID::GetLastNaturalStopID
* Add SBProcess::GetStopEventForStopID
* Don't broadcast hijacked event in Target::Launch
* Add CMICmnLLDBDebugger::CheckIfNeedToRebroadcastStopEvent/RebroadcastStopEvent

Test Plan: ./dotest.py -v --executable $BUILDDIR/bin/lldb tools/lldb-mi/startup_options/

Reviewers: zturner, jingham, clayborg, abidh

Reviewed By: clayborg

Subscribers: abidh, zturner, lldb-commits, clayborg, jingham

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

llvm-svn: 237781

9 years ago[mips] [IAS] Factor out .set nomacro warning. NFC.
Toma Tabacu [Wed, 20 May 2015 08:54:45 +0000 (08:54 +0000)]
[mips] [IAS] Factor out .set nomacro warning. NFC.

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: llvm-commits

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

llvm-svn: 237780

9 years agoAdd printing and testing to ScopArrayInfo
Tobias Grosser [Wed, 20 May 2015 08:05:31 +0000 (08:05 +0000)]
Add printing and testing to ScopArrayInfo

Being here, we extend the interface to return the element type and not a pointer
to the element type. We also provide a function to get the size (in bytes) of
the elements stored in this array.

We currently still store the element size as an innermost dimension in
ScopArrayInfo, which is somehow inconsistent and should be addressed in future
patches.

llvm-svn: 237779

9 years ago[X86] Add _mm256_set_m128 and its 5 variants.
Michael Kuperstein [Wed, 20 May 2015 07:46:52 +0000 (07:46 +0000)]
[X86] Add _mm256_set_m128 and its 5 variants.

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

llvm-svn: 237778

9 years agoFix CGRecordLayouts description to say it maps clang types not llvm types
Yaron Keren [Wed, 20 May 2015 07:15:28 +0000 (07:15 +0000)]
Fix CGRecordLayouts description to say it maps clang types not llvm types
and de-duplicate data fields names from comments according to the coding
standard.

llvm-svn: 237776

9 years ago[TableGen] Make some variable names consistent with their type names and just general...
Craig Topper [Wed, 20 May 2015 05:40:13 +0000 (05:40 +0000)]
[TableGen] Make some variable names consistent with their type names and just generally consistent across all of the overloads.

llvm-svn: 237775

9 years ago[TableGen] Fix a memory leak.
Craig Topper [Wed, 20 May 2015 05:40:09 +0000 (05:40 +0000)]
[TableGen] Fix a memory leak.

llvm-svn: 237774

9 years ago[TableGen] Don't override convertValue for some of the Init types when it does the...
Craig Topper [Wed, 20 May 2015 05:40:06 +0000 (05:40 +0000)]
[TableGen] Don't override convertValue for some of the Init types when it does the same thing as the base class implementation.

llvm-svn: 237773

9 years ago[X86] Implement the local-exec TLS model for Windows targets
David Majnemer [Wed, 20 May 2015 04:45:26 +0000 (04:45 +0000)]
[X86] Implement the local-exec TLS model for Windows targets

We know that _tls_index is zero for local-exec TLS variables because
they are always defined in the executable.

llvm-svn: 237772

9 years ago[clang-cl] Map /GA to -ftls-model=local-exec
David Majnemer [Wed, 20 May 2015 04:39:56 +0000 (04:39 +0000)]
[clang-cl] Map /GA to -ftls-model=local-exec

The /GA switch informs the compiler that it may assume that all TLS
access refers to the executable's index: 0.

llvm-svn: 237771

9 years agoMC: Use MCSymbol in most of ELFObjectWriter, NFC
Duncan P. N. Exon Smith [Wed, 20 May 2015 04:39:01 +0000 (04:39 +0000)]
MC: Use MCSymbol in most of ELFObjectWriter, NFC

Stop using MCSymbolData where we also need MCSymbol.

llvm-svn: 237770

9 years ago[OPENMP] -fopenmp enables OpenMP support (fix for http://llvm.org/PR23492)
Alexey Bataev [Wed, 20 May 2015 04:24:19 +0000 (04:24 +0000)]
[OPENMP] -fopenmp enables OpenMP support (fix for llvm.org/PR23492)

-fopenmp turns on OpenMP support and links libiomp5 as OpenMP library. Also there is -fopenmp={libiomp5|libgomp} option that allows to override effect of -fopenmp and link libgomp library (if -fopenmp=libgomp is specified).
Differential Revision: http://reviews.llvm.org/D9736

llvm-svn: 237769

9 years agoFix for aggregate copying of variable length arrays.
Alexey Bataev [Wed, 20 May 2015 03:46:04 +0000 (03:46 +0000)]
Fix for aggregate copying of variable length arrays.

Patch fixes codegen for aggregate copying of VLAs. Currently method CodeGenFunction::EmitAggregateCopy() does not support copying of VLAs. Patch checks if the size of the type is 0, then checks if the type is actually a variable-length array. Then it calculates total length for this array and calculates total size of the array in bytes:

<total number of elements in array> * aligned_sizeof(ElementType) (if copy assignment is requested).
If simple copying is requested, size is calculated like:

<total number of elements in array> * aligned_sizeof(ElementType) - aligned_sizeof(ElementType) + sizeof(ElementType).
memcpy() is used with this calculated size of the VLA.
Differential Revision: http://reviews.llvm.org/D9851

llvm-svn: 237768

9 years agoFix building and testing libc++ with GCC.
Eric Fiselier [Wed, 20 May 2015 03:15:01 +0000 (03:15 +0000)]
Fix building and testing libc++ with GCC.

The changes in src/exception.cpp and cmake/Modules/HandleLibCXXABI.cmake fix a
bug when building libc++ with GCC. Because GCC does not support __has_include
we need to explicitly tell it that we are building against libc++abi via the
preprocessor definition `LIBCXX_BUILDING_LIBCXXABI`.

The changes in include/ratio are to work around CWG defect
1712 (constexpr variable template declarations). GCC 4.8 and before has not
adopted the resolution to this defect.

The changes in include/exception work around an issue where is_final is used
without it being defined in type_traits.

llvm-svn: 237767

9 years agoSupport: Introduce LLVM_FALLTHROUGH macro.
Peter Collingbourne [Wed, 20 May 2015 02:44:14 +0000 (02:44 +0000)]
Support: Introduce LLVM_FALLTHROUGH macro.

llvm-svn: 237766

9 years agoAdd a GCStrategy for CoreCLR
Swaroop Sridhar [Wed, 20 May 2015 01:07:23 +0000 (01:07 +0000)]
Add a GCStrategy for CoreCLR

This change adds a new GC strategy for supporting the CoreCLR runtime.

This strategy is currently identical to Statepoint-example GC,
but is necessary for several upcoming changes specific to CoreCLR, such as:

1. Base-pointers not explicitly reported for interior pointers
2. Different format for stack-map encoding
3. Location of Safe-point polls: polls are only needed before loop-back edges and before tail-calls (not needed at function-entry)
4. Runtime specific handshake between calls to managed/unmanaged functions.

llvm-svn: 237753

9 years ago[GDBRemoteCommunicationClient] Increase timeout for qfProcessInfo packet.
Siva Chandra [Wed, 20 May 2015 00:30:31 +0000 (00:30 +0000)]
[GDBRemoteCommunicationClient] Increase timeout for qfProcessInfo packet.

Summary:
The test in TestPlatformCommand which runs "platform process list" has
been timing out for Android when running running dosep.py with
LLDB_TEST_THREADS=8. This patch increases the packet timeout to a large
value of 1min to accommodate the long time required for a response for
the qfProcessInfo packet on Android.

Test Plan: LLDB_TEST_THREADS=8 ./dosep.py on Android.

Reviewers: chaoren

Reviewed By: chaoren

Subscribers: tberghammer, lldb-commits

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

llvm-svn: 237752

9 years ago[bpf] fix build
Alexei Starovoitov [Wed, 20 May 2015 00:20:26 +0000 (00:20 +0000)]
[bpf] fix build

llvm-svn: 237751

9 years agoMC: Take MCSymbol in MachObjectWriter::getSymbolAddress(), NFC
Duncan P. N. Exon Smith [Wed, 20 May 2015 00:02:39 +0000 (00:02 +0000)]
MC: Take MCSymbol in MachObjectWriter::getSymbolAddress(), NFC

Pass through an `MCSymbol` instead of an `MCSymbolData` so we can get
rid of the back pointer.

llvm-svn: 237750

9 years agoMC: Use MCSymbol in MCAsmLayout::getSymbolOffset(), NFC
Duncan P. N. Exon Smith [Tue, 19 May 2015 23:53:20 +0000 (23:53 +0000)]
MC: Use MCSymbol in MCAsmLayout::getSymbolOffset(), NFC

Continue to canonicalize on MCSymbol instead of MCSymbolData when both
are needed.

llvm-svn: 237749

9 years agoFactor out LTO detection to common configuration.
Peter Collingbourne [Tue, 19 May 2015 23:50:13 +0000 (23:50 +0000)]
Factor out LTO detection to common configuration.

This will allow us to test other sanitizers with LTO.

llvm-svn: 237747

9 years agoCFI: Remove <utility> include.
Peter Collingbourne [Tue, 19 May 2015 23:50:11 +0000 (23:50 +0000)]
CFI: Remove <utility> include.

It is unused, and causes a test failure on Darwin.

llvm-svn: 237746

9 years agoFix race condition in thread test.
Eric Fiselier [Tue, 19 May 2015 23:41:04 +0000 (23:41 +0000)]
Fix race condition in thread test.

llvm-svn: 237745

9 years ago[PlaceSafepoints] Stop special casing some intrinsics
Philip Reames [Tue, 19 May 2015 23:40:11 +0000 (23:40 +0000)]
[PlaceSafepoints] Stop special casing some intrinsics

We were special casing a handful of intrinsics as not needing a safepoint before them.  After running into another valid case - memset - I took a closer look and realized that almost no intrinsics need to have a safepoint poll before them.  Restructure the code to make that apparent so that we stop hitting these bugs.  The only intrinsics which need a safepoint poll before them are ones which can run arbitrary code.

llvm-svn: 237744

9 years agoTry to fix the build with MSVC 2015 by disabling sized deallocation
Reid Kleckner [Tue, 19 May 2015 23:28:23 +0000 (23:28 +0000)]
Try to fix the build with MSVC 2015 by disabling sized deallocation

I can't actually test this properly because uninstalling MSVC 2015 CTP 6
and reinstalling the 2015 RC takes hours. I can only verify that this
doesn't mess up MSVC 2013 and 2015 CTP 6 builds, which is what I've
done.

Should fix PR23513.

llvm-svn: 237743

9 years agoRemove trailing slash from dumping directory FileSpec.
Chaoren Lin [Tue, 19 May 2015 23:11:58 +0000 (23:11 +0000)]
Remove trailing slash from dumping directory FileSpec.

Reviewers: domipheus, ovyalov

Reviewed By: ovyalov

Subscribers: lldb-commits

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

llvm-svn: 237741

9 years agoAddress @danalberts comments on r237700
Eric Fiselier [Tue, 19 May 2015 23:10:32 +0000 (23:10 +0000)]
Address @danalberts comments on r237700

llvm-svn: 237740

9 years agoRevert r237539: "Reapply r237520 with another fix for infinite looping"
Hans Wennborg [Tue, 19 May 2015 23:06:30 +0000 (23:06 +0000)]
Revert r237539: "Reapply r237520 with another fix for infinite looping"

This caused PR23583.

llvm-svn: 237739

9 years agoFix uninitialized values and bad enum conversions found by UBSAN.
Eric Fiselier [Tue, 19 May 2015 23:03:57 +0000 (23:03 +0000)]
Fix uninitialized values and bad enum conversions found by UBSAN.

llvm-svn: 237738

9 years agoRename internal trait that used non-reserved name.
Eric Fiselier [Tue, 19 May 2015 22:27:18 +0000 (22:27 +0000)]
Rename internal trait that used non-reserved name.

llvm-svn: 237737

9 years agoRemove a stale comment
Philip Reames [Tue, 19 May 2015 22:26:33 +0000 (22:26 +0000)]
Remove a stale comment

The todo was implemented a while ago; I just forgot to remove the comment.

llvm-svn: 237736

9 years ago[lib/Fuzzer] change the meaning of -timeout flag: now timeout is applied to every...
Kostya Serebryany [Tue, 19 May 2015 22:12:57 +0000 (22:12 +0000)]
[lib/Fuzzer] change the meaning of -timeout flag: now timeout is applied to every unit of work separately

llvm-svn: 237735

9 years agoAdd a comment line that was accidentally dropped in r236671.
Akira Hatanaka [Tue, 19 May 2015 21:59:11 +0000 (21:59 +0000)]
Add a comment line that was accidentally dropped in r236671.

llvm-svn: 237734

9 years ago[DWARF parser] Make DWARF parser more robust against missing compile/type units.
Alexey Samsonov [Tue, 19 May 2015 21:54:32 +0000 (21:54 +0000)]
[DWARF parser] Make DWARF parser more robust against missing compile/type units.

DWARF standard claims that each compilation/type unit header in
.debug_info/.debug_types section must be followed by corresponding
compile/type unit DIE, possibly with its children. Two situations
are possible:

 * compile/type unit DIE is missing because DWARF producer failed to
   emit it.
 * DWARF parser failed to parse unit DIE correctly, for instance if it
   contains some unsupported attributes (see r237721, for instance).

In either of these cases, the library, and the tools that use it
(llvm-dwarfdump, llvm-symbolizer) should not crash. Insert appropriate
checks to protect against this.

llvm-svn: 237733

9 years ago[opaque pointer type] Provide a convenience function for creating direct CallInsts...
David Blaikie [Tue, 19 May 2015 21:47:12 +0000 (21:47 +0000)]
[opaque pointer type] Provide a convenience function for creating direct CallInsts to Functions in IRBuilder

Might need a similar convenience in CallInst's ctor too, but we'll
see/will add it when it becomes useful.

llvm-svn: 237731

9 years agoRevert r237708 (MIR serialization) - incremental buildbots became unstable.
Alex Lorenz [Tue, 19 May 2015 21:41:28 +0000 (21:41 +0000)]
Revert r237708 (MIR serialization) - incremental buildbots became unstable.

The incremental buildbots entered a pass-fail cycle where during the fail
cycle one of the tests from this commit fails for an unknown reason. I
have reverted this commit and will investigate the cause of this problem.

llvm-svn: 237730

9 years ago[opaque pointer type] Pass the explicit call type when creating calls from LazyRuntim...
David Blaikie [Tue, 19 May 2015 21:31:34 +0000 (21:31 +0000)]
[opaque pointer type] Pass the explicit call type when creating calls from LazyRuntimeFunctions

The implicit conversion was causing issues for a helper being added that
would take an llvm::Function rather than an llvm::Value to make the
CallInst. Since we'll eventually need to specify the type of the call
explicitly anyway, fix these up to avoid the future ambiguity.

llvm-svn: 237729

9 years ago[opaque pointer type] Provide the ability to pass an explicit type when creating...
David Blaikie [Tue, 19 May 2015 21:31:18 +0000 (21:31 +0000)]
[opaque pointer type] Provide the ability to pass an explicit type when creating a CallInst through IRBuilder

A use for this will be added to Clang shortly. I haven't hit the
specific cases I want to cleanup in LLVM just yet.

A utility that avoids the need for this in direct calls to
llvm::Functions will be added too - since in that case the type can be
retrieved from the llvm::Function directly.

llvm-svn: 237728

9 years agoMakefile fix for testsuite -- Follow up to r237618
Jonathan Peyton [Tue, 19 May 2015 21:28:33 +0000 (21:28 +0000)]
Makefile fix for testsuite -- Follow up to r237618

This changes INCLUDE_PATH to C_INCLUDE_PATH and misspelled CLASH to SLASH

Patch by Sunita Chandrasekaran

llvm-svn: 237727

9 years agoMachineInstr: Remove unused parameter.
Matthias Braun [Tue, 19 May 2015 21:22:20 +0000 (21:22 +0000)]
MachineInstr: Remove unused parameter.

llvm-svn: 237726

9 years ago[ASan/Win] Add DLL thunk for new coverage hook
Reid Kleckner [Tue, 19 May 2015 21:02:23 +0000 (21:02 +0000)]
[ASan/Win] Add DLL thunk for new coverage hook

Should fix dll_host.cc test failing on bots.

llvm-svn: 237725

9 years ago[Speculation] NFC: more header comments
Jingyue Wu [Tue, 19 May 2015 20:52:45 +0000 (20:52 +0000)]
[Speculation] NFC: more header comments

explaining how it differs from SpeculativeExecuteBB in SimplifyCFG.

llvm-svn: 237724

9 years agoFix MIR testcase committed in r237708 - remove target triple.
Alex Lorenz [Tue, 19 May 2015 20:51:48 +0000 (20:51 +0000)]
Fix MIR testcase committed in r237708 - remove target triple.

Remove the target specific triple and datalayout from the
llvm IR in the MIR testcase file.

llvm-svn: 237723

9 years agoRemove unnecessary cast. NFC
Pete Cooper [Tue, 19 May 2015 20:50:14 +0000 (20:50 +0000)]
Remove unnecessary cast.  NFC

llvm-svn: 237722

9 years ago[DWARF parser] Add basic support for DWZ DWARF multifile extensions.
Alexey Samsonov [Tue, 19 May 2015 20:29:28 +0000 (20:29 +0000)]
[DWARF parser] Add basic support for DWZ DWARF multifile extensions.

This change implements basic support for DWARF alternate sections
proposal: http://www.dwarfstd.org/ShowIssue.php?issue=120604.1&type=open

LLVM tools now understand new forms: DW_FORM_GNU_ref_alt and
DW_FORM_GNU_strp_alt, which are used as references to .debug_info and
.debug_str sections respectively, stored in a separate file, and
possibly shared between different executables / shared objects.

llvm-dwarfdump and llvm-symbolizer don't yet know how to access this
alternate debug file (usually pointed by .gnu_debugaltlink section),
but they can at lease properly parse and dump regular files, which
refer to it.

This change should fix crashes of llvm-dwarfdump and llvm-symbolizer on
files produced by running "dwz" tool. Such files are already installed
on some modern Linux distributions.

llvm-svn: 237721

9 years agoDereferenceable, dereferenceable_or_null metadata for loads
Sanjoy Das [Tue, 19 May 2015 20:10:19 +0000 (20:10 +0000)]
Dereferenceable, dereferenceable_or_null metadata for loads

Summary:
Introduce dereferenceable, dereferenceable_or_null metadata for loads
with the same semantic as corresponding attributes.

This patch depends on http://reviews.llvm.org/D9253

Patch by Artur Pilipenko!

Reviewers: hfinkel, sanjoy, reames

Reviewed By: sanjoy, reames

Subscribers: llvm-commits

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

llvm-svn: 237720

9 years agouse 'auto *' for pointers; clearer usage, no deep copying
Sanjay Patel [Tue, 19 May 2015 20:10:16 +0000 (20:10 +0000)]
use 'auto *' for pointers; clearer usage, no deep copying

llvm-svn: 237719

9 years agoRevert r237609 for now.
Richard Smith [Tue, 19 May 2015 19:58:11 +0000 (19:58 +0000)]
Revert r237609 for now.

glibc's headers use __need_* macros to selectively export parts of themselves
to each other. This requires us to enter those files repeatedly when building
a glibc module.

This can be unreverted once we have a better mechanism to deal with that
non-modular aspect of glibc (possibly some way to mark a header as "textual if
this macro is defined").

llvm-svn: 237718

9 years agoRemove unused MCExpr.h include from MCELF.h. NFC
Pete Cooper [Tue, 19 May 2015 19:20:02 +0000 (19:20 +0000)]
Remove unused MCExpr.h include from MCELF.h.  NFC

llvm-svn: 237717

9 years agotidy up
Sanjay Patel [Tue, 19 May 2015 19:10:57 +0000 (19:10 +0000)]
tidy up

1. remove duplicate local variable
2. add local variable with name to match comment
3. remove useless comment

llvm-svn: 237715

9 years agoA previous patch made it so that ValueObjects could update themselves even in the...
Enrico Granata [Tue, 19 May 2015 18:53:13 +0000 (18:53 +0000)]
A previous patch made it so that ValueObjects could update themselves even in the face of an invalid execution context (which was required for the dynamic and synthetic values of const objects)

It turns out, child values also need similar provisions

This patch simplifies things a bit allowing ValueObject subclasses to just declare whether they can accept an invalid context at update time, and letting the update machinery in the EvaluationPoint to the rest
Also, this lets ValueObjectChild proclaim that its parent chooses whether such blank-slate updates are possible

llvm-svn: 237714

9 years agoFix 'CFG graph' typo. NFC
Jonathan Roelofs [Tue, 19 May 2015 18:51:56 +0000 (18:51 +0000)]
Fix 'CFG graph' typo. NFC

Patch by Jon Eyolfson!

llvm-svn: 237713

9 years agoFix llc path in MIR testcases committed in r237708.
Alex Lorenz [Tue, 19 May 2015 18:45:41 +0000 (18:45 +0000)]
Fix llc path in MIR testcases committed in r237708.

I've committed testcases with local llc path by mistake.

llvm-svn: 237712

9 years agouse range-based for-loop
Sanjay Patel [Tue, 19 May 2015 18:24:33 +0000 (18:24 +0000)]
use range-based for-loop

llvm-svn: 237711

9 years agoRemove unused MCRelocationInfo.h include from MCDisassembler.h. NFC
Pete Cooper [Tue, 19 May 2015 18:18:49 +0000 (18:18 +0000)]
Remove unused MCRelocationInfo.h include from MCDisassembler.h.  NFC

llvm-svn: 237710

9 years agoChange a reachable unreachable to a fatal error.
Filipe Cabecinhas [Tue, 19 May 2015 18:18:10 +0000 (18:18 +0000)]
Change a reachable unreachable to a fatal error.

Summary:
Also tagged a FIXME comment, and added information about why it breaks.

Bug found using AFL fuzz.

Reviewers: rafael, craig.topper

Subscribers: llvm-commits

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

llvm-svn: 237709

9 years agoMIR Serialization: print and parse LLVM IR using MIR format.
Alex Lorenz [Tue, 19 May 2015 18:17:39 +0000 (18:17 +0000)]
MIR Serialization: print and parse LLVM IR using MIR format.

This commit is the initial commit for the MIR serialization project.
It creates a new library under CodeGen called 'MIR'. This new
library adds a new machine function pass that prints out the LLVM IR
using the MIR format. This pass is then added as a last pass when a
'stop-after' option is used in llc. The new library adds the initial
functionality for parsing of MIR files as well. This commit also
extends the llc tool so that it can recognize and parse MIR input files.

Reviewers: Duncan P. N. Exon Smith, Matthias Braun, Philip Reames

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

llvm-svn: 237708

9 years agoRemove unused MachineLocation.h include from MCAsmInfo.h. NFC
Pete Cooper [Tue, 19 May 2015 17:59:09 +0000 (17:59 +0000)]
Remove unused MachineLocation.h include from MCAsmInfo.h.  NFC

llvm-svn: 237707

9 years agoRegisterCoalescer: Improve a comment.
Matthias Braun [Tue, 19 May 2015 17:52:32 +0000 (17:52 +0000)]
RegisterCoalescer: Improve a comment.

Explain the relation of the example to the variables in the code,
explain what bad behaviour the code avoids in this case.

llvm-svn: 237706

9 years agouse range-based for loop
Sanjay Patel [Tue, 19 May 2015 17:49:14 +0000 (17:49 +0000)]
use range-based for loop

llvm-svn: 237705

9 years agoclang-format: Add space in function pointers with SpaceBeforeParens=Always
Anders Waldenborg [Tue, 19 May 2015 16:54:26 +0000 (16:54 +0000)]
clang-format: Add space in function pointers with SpaceBeforeParens=Always

"void (*my_function)(void)" should become "void (*my_function) (void)" when
SpaceBeforeParens is set to 'Always'

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

llvm-svn: 237704

9 years ago[RewriteStatepointsForGC] Fix up naming in "relocationViaAlloca" and run it through...
Igor Laevsky [Tue, 19 May 2015 16:29:43 +0000 (16:29 +0000)]
[RewriteStatepointsForGC] Fix up naming in "relocationViaAlloca" and run it through clang-format.

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

llvm-svn: 237703

9 years agoRemove the InstructionSimplifierPass immediately after InstructionCombiningPass.
Wei Mi [Tue, 19 May 2015 16:09:11 +0000 (16:09 +0000)]
Remove the InstructionSimplifierPass immediately after InstructionCombiningPass.

InstructionCombiningPass was added after LoopUnrollPass in r237395. Because
InstructionCombiningPass is strictly more powerful than InstructionSimplifierPass,
remove the unnecessary InstructionSimplifierPass.

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

llvm-svn: 237702

9 years ago[RewriteStatepointsForGC] For some values (like gep's and bitcasts) it's cheaper...
Igor Laevsky [Tue, 19 May 2015 15:59:05 +0000 (15:59 +0000)]
[RewriteStatepointsForGC] For some values (like gep's and bitcasts) it's cheaper to clone them after statepoint than to emit proper relocates for them. This change implements this logic. There is alredy similar optimization in CodeGenPrepare, but doing so during RewriteStatepointsForGC allows to capture more opprtunities such as relocates in loops and longer instruction chains.

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

llvm-svn: 237701

9 years agoAdd compiler flag test support to LIT. Fix new/delete tests on apple-clang.
Eric Fiselier [Tue, 19 May 2015 15:15:53 +0000 (15:15 +0000)]
Add compiler flag test support to LIT. Fix new/delete tests on apple-clang.

llvm-svn: 237700

9 years agoImplement LWG2433: uninitialized_copy()/etc. should tolerate overloaded operator&
Marshall Clow [Tue, 19 May 2015 15:01:48 +0000 (15:01 +0000)]
Implement LWG2433: uninitialized_copy()/etc. should tolerate overloaded operator&

llvm-svn: 237699

9 years ago[X86] Add _mm_broadcastsd_pd intrinsic
Michael Kuperstein [Tue, 19 May 2015 14:49:14 +0000 (14:49 +0000)]
[X86] Add _mm_broadcastsd_pd intrinsic

_mm_broadcastsd_pd is basically an alias for _mm_movedup_pd, however the alias is only available from AVX2 forward.

llvm-svn: 237698

9 years ago[mips][microMIPSr6] Implement NOR, OR, ORI, XOR and XORI instructions
Zoran Jovanovic [Tue, 19 May 2015 14:12:55 +0000 (14:12 +0000)]
[mips][microMIPSr6] Implement NOR, OR, ORI, XOR and XORI instructions
Differential Revision: http://reviews.llvm.org/D8800

llvm-svn: 237697

9 years ago[mips][microMIPSr6] Implement AND and ANDI instructions
Zoran Jovanovic [Tue, 19 May 2015 13:32:31 +0000 (13:32 +0000)]
[mips][microMIPSr6] Implement AND and ANDI instructions
Differential Revision: http://reviews.llvm.org/D8772

llvm-svn: 237696

9 years agoRangify for loop in Cleanup(), NFC.
Yaron Keren [Tue, 19 May 2015 13:32:19 +0000 (13:32 +0000)]
Rangify for loop in Cleanup(), NFC.

llvm-svn: 237695

9 years agoPrevent Cleanup() from running more than once.
Yaron Keren [Tue, 19 May 2015 13:31:25 +0000 (13:31 +0000)]
Prevent Cleanup() from running more than once.

llvm-svn: 237694

9 years ago[X86] Added _mm256_bslli_epi128 and _mm256_bsrli_epi128.
Michael Kuperstein [Tue, 19 May 2015 13:05:46 +0000 (13:05 +0000)]
[X86] Added _mm256_bslli_epi128 and _mm256_bsrli_epi128.

These two intrinsics are alternative names for _mm256_slli_si256 and _mm256_srli_si256, respectively.

llvm-svn: 237693

9 years agoUse cat and not type Under MSYS, same as Cygwin.
Yaron Keren [Tue, 19 May 2015 12:59:23 +0000 (12:59 +0000)]
Use cat and not type Under MSYS, same as Cygwin.
type means something else under the MSYS shell.

Patch by Tzafrir Poupko!

llvm-svn: 237692

9 years ago[OPENMP] Fixed codegen for copying/initialization of array variables/parameters.
Alexey Bataev [Tue, 19 May 2015 12:31:28 +0000 (12:31 +0000)]
[OPENMP] Fixed codegen for copying/initialization of array variables/parameters.
This modification generates proper copyin/initialization sequences for array variables/parameters. Before they were considered as pointers, not arrays.

llvm-svn: 237691

9 years agoclang-format: Improve *-detection.
Daniel Jasper [Tue, 19 May 2015 12:29:27 +0000 (12:29 +0000)]
clang-format: Improve *-detection.

Before:
  S << a *(10);

After:
  S << a * (10);

This fixes llvm.org/PR16500.

llvm-svn: 237690

9 years ago[mips] Correct and improve special-case shuffle instructions.
Daniel Sanders [Tue, 19 May 2015 12:24:52 +0000 (12:24 +0000)]
[mips] Correct and improve special-case shuffle instructions.

Summary:
The documentation writes vectors highest-index first whereas LLVM-IR writes
them lowest-index first. As a result, instructions defined in terms of
left_half() and right_half() had the halves reversed.

In addition to correcting them, they have been improved to allow shuffles
that use the same operand twice or in reverse order. For example, ilvev
used to accept masks of the form:
  <0, n, 2, n+2, 4, n+4, ...>
but now accepts:
  <0, 0, 2, 2, 4, 4, ...>
  <n, n, n+2, n+2, n+4, n+4, ...>
  <0, n, 2, n+2, 4, n+4, ...>
  <n, 0, n+2, 2, n+4, 4, ...>

One further improvement is that splati.[bhwd] is now the preferred instruction
for splat-like operations. The other special shuffles are no longer used
for splats. This lead to the discovery that <0, 0, ...> would not cause
splati.[hwd] to be selected and this has also been fixed.

This fixes the enc-3des test from the test-suite on Mips64r6 with MSA.

Reviewers: vkalintiris

Reviewed By: vkalintiris

Subscribers: llvm-commits

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

llvm-svn: 237689

9 years agoclang-format: Improve for-loop formatting.
Daniel Jasper [Tue, 19 May 2015 11:51:39 +0000 (11:51 +0000)]
clang-format: Improve for-loop formatting.

Before:
  for (SmallVectorImpl<TemplateIdAnnotationn *>::iterator I =
           Container.begin(),
                                                          E = Container.end();
       I != E; ++I)

After:
  for (SmallVectorImpl<TemplateIdAnnotationn *>::iterator
           I = Container.begin(),
           E = Container.end();
       I != E; ++I)

This fixes llvm.org/PR23544.

llvm-svn: 237688

9 years agoAs r237678 was reverted, this is no longer needed.
Yaron Keren [Tue, 19 May 2015 11:46:27 +0000 (11:46 +0000)]
As r237678 was reverted, this is no longer needed.

llvm-svn: 237687

9 years agoclang-format: Support #include_next
Daniel Jasper [Tue, 19 May 2015 11:22:29 +0000 (11:22 +0000)]
clang-format: Support #include_next

Before:
  #include_next < test.h >

After:
  #include_next <test.h>

This fixes llvm.org/PR23500

llvm-svn: 237686

9 years ago[mips][microMIPSr6] Implement DIV, DIVU, MOD and MODU instructions
Zoran Jovanovic [Tue, 19 May 2015 11:21:37 +0000 (11:21 +0000)]
[mips][microMIPSr6] Implement DIV, DIVU, MOD and MODU instructions
Differential Revision: http://reviews.llvm.org/D8769

llvm-svn: 237685

9 years agoclang-format: Correctly detect casts to qualified types.
Daniel Jasper [Tue, 19 May 2015 11:18:39 +0000 (11:18 +0000)]
clang-format: Correctly detect casts to qualified types.

Before:
  ns::E f() { return (ns::E) - 1; }

After:
  ns::E f() { return (ns::E)-1; }

This fixes llvm.org/PR23503.

llvm-svn: 237684

9 years agoFix Visual C++ errors C2784, C2780, C2782 after r237678.
Yaron Keren [Tue, 19 May 2015 11:18:10 +0000 (11:18 +0000)]
Fix Visual C++ errors C2784, C2780, C2782 after r237678.
It does not like std::min(unsigned, uint32_t).

llvm-svn: 237683