platform/upstream/llvm.git
9 years agoAVX-512: Implemented encoding , DAG lowering and intrinsics for Integer Truncate...
Igor Breger [Fri, 24 Jul 2015 17:24:15 +0000 (17:24 +0000)]
AVX-512: Implemented encoding , DAG lowering and intrinsics for Integer Truncate with/without saturation
Added tests for DAG lowering ,encoding and intrinsic

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

llvm-svn: 243122

9 years agoUpdate for r243115 which changed the DataLayout API on TargetMachine but
Chandler Carruth [Fri, 24 Jul 2015 17:23:09 +0000 (17:23 +0000)]
Update for r243115 which changed the DataLayout API on TargetMachine but
didn't update the gold-plugin.

llvm-svn: 243121

9 years ago[test] Attempt to fix failing test in non-darwin bots.
Argyrios Kyrtzidis [Fri, 24 Jul 2015 17:18:25 +0000 (17:18 +0000)]
[test] Attempt to fix failing test in non-darwin bots.

llvm-svn: 243120

9 years ago[code-completion] Strip outer nullability annotations when completing method implemen...
Argyrios Kyrtzidis [Fri, 24 Jul 2015 17:00:19 +0000 (17:00 +0000)]
[code-completion] Strip outer nullability annotations when completing method implementations.

The outer nullability is transferred from the declaration to the implementation so including them is redundant.
The inner ones are not transferred so they are kept to match the exact types. When we transfer the inner ones as well
adding them in the implementation will become redundant and we should strip those as well.

rdar://21737451

llvm-svn: 243119

9 years agoBind to the loopback when we are expecting a connection from 127.0.0.1 so we don...
Greg Clayton [Fri, 24 Jul 2015 16:55:00 +0000 (16:55 +0000)]
Bind to the loopback when we are expecting a connection from 127.0.0.1 so we don't set off firewall protections.

<rdar://problem/17897318>

llvm-svn: 243118

9 years agotest-release.sh: Defer test errors until the end
Hans Wennborg [Fri, 24 Jul 2015 16:16:09 +0000 (16:16 +0000)]
test-release.sh: Defer test errors until the end

This makes the script run to the end and produce tarballs even on test
failures, and then highlights any errors afterwards.

(I first tried just storing the errors in a global variable, but that
didn't work as the "test_llvmCore" function invocation is actually
running as a sub-shell.)

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

llvm-svn: 243116

9 years agoLLVM API Change: the Module always owns the DataLayout
Mehdi Amini [Fri, 24 Jul 2015 16:04:29 +0000 (16:04 +0000)]
LLVM API Change: the Module always owns the DataLayout

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 243115

9 years agoRemove access to the DataLayout in the TargetMachine
Mehdi Amini [Fri, 24 Jul 2015 16:04:22 +0000 (16:04 +0000)]
Remove access to the DataLayout in the TargetMachine

Summary:
Replace getDataLayout() with a createDataLayout() method to make
explicit that it is intended to create a DataLayout only and not
accessing it for other purpose.

This change is the last of a series of commits dedicated to have a
single DataLayout during compilation by using always the one owned
by the module.

Reviewers: echristo

Subscribers: jholewinski, llvm-commits, rafael, yaron.keren

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

(cherry picked from commit 5609fc56bca971e5a7efeaa6ca4676638eaec5ea)

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 243114

9 years agofix wrong comment; NFC
Sanjay Patel [Fri, 24 Jul 2015 16:02:14 +0000 (16:02 +0000)]
fix wrong comment; NFC

llvm-svn: 243113

9 years agoCorrecting some comments. (1) the function is named throughUsingDecl() and not throug...
Aaron Ballman [Fri, 24 Jul 2015 15:47:32 +0000 (15:47 +0000)]
Correcting some comments. (1) the function is named throughUsingDecl() and not throughUsingDeclaration(). (2) Testing shows that this does work for shadowed variables as well as shadowed functions. I could not find an example where this matcher was failing. NFC.

llvm-svn: 243111

9 years agoUpdate isl to isl-0.15-86-g595055e
Tobias Grosser [Fri, 24 Jul 2015 13:12:17 +0000 (13:12 +0000)]
Update isl to isl-0.15-86-g595055e

Besides a couple of cleanups and refactorings in isl, this change set fixes a
couple of bugs in isl, that can cause issues during code generation.

llvm-svn: 243110

9 years agoSilence a "not all control paths return a value" warning from MSVC. Should also silen...
Aaron Ballman [Fri, 24 Jul 2015 12:47:27 +0000 (12:47 +0000)]
Silence a "not all control paths return a value" warning from MSVC. Should also silence a -Wreturn-type warning. NFC intended.

llvm-svn: 243109

9 years agoVisual Studio is more permissive than other compilers; amends r243107 to fix a compil...
Aaron Ballman [Fri, 24 Jul 2015 12:44:02 +0000 (12:44 +0000)]
Visual Studio is more permissive than other compilers; amends r243107 to fix a compile error.

llvm-svn: 243108

9 years agoAdd an AST matcher, isFinal(), for testing whether a method or class declaration...
Aaron Ballman [Fri, 24 Jul 2015 12:35:41 +0000 (12:35 +0000)]
Add an AST matcher, isFinal(), for testing whether a method or class declaration are marked final.

llvm-svn: 243107

9 years agollvm/test/tools/dsymutil/ARM/lit.local.cfg: Fix possibly typo, s/X86/ARM/.
NAKAMURA Takumi [Fri, 24 Jul 2015 11:55:11 +0000 (11:55 +0000)]
llvm/test/tools/dsymutil/ARM/lit.local.cfg: Fix possibly typo, s/X86/ARM/.

llvm-svn: 243106

9 years agoApparently some of the bots add .svn dirs inside the test/Driver/Inputs
Yaron Keren [Fri, 24 Jul 2015 11:01:45 +0000 (11:01 +0000)]
Apparently some of the bots add .svn dirs inside the test/Driver/Inputs
directory structure. Try to make mingw toolchain resilient to such surprises.

llvm-svn: 243105

9 years agoInitialize variable to prevent garbage values (RenderScriptRuntime)
Ewan Crawford [Fri, 24 Jul 2015 10:01:11 +0000 (10:01 +0000)]
Initialize variable to prevent garbage values (RenderScriptRuntime)

The kernels_found variable is not initialized, so if it is not assigned true on line 823, then it will be a garbage value in the branch condition on line 828. This patch initializes the variable to false.

Patch by neilparikh.

Reviewers: domipheus
Differential Revision: http://reviews.llvm.org/D11323

llvm-svn: 243104

9 years ago[ARM] - Fix lowering of shufflevectors in AArch32
Luke Cheeseman [Fri, 24 Jul 2015 09:57:05 +0000 (09:57 +0000)]
[ARM] - Fix lowering of shufflevectors in AArch32

Some shufflevectors are currently being incorrectly lowered in the AArch32
backend as the existing checks for detecting the NEON operations from the
shufflevector instruction expects the shuffle mask and the vector operands to be
of the same length.

This is not always the case as the mask may be twice as long as the operand;
here only the lower half of the shufflemask gets checked, so provided the lower
half of the shufflemask looks like a vector transpose (or even is just all -1
for undef) then the intrinsics may get incorrectly lowered into a vector
transpose (VTRN) instruction.

This patch fixes this by accommodating for both cases and adds regression tests.

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

llvm-svn: 243103

9 years agoRevert "Fix an issue where LLDB would run out of stack space ..."
Pavel Labath [Fri, 24 Jul 2015 09:52:25 +0000 (09:52 +0000)]
Revert "Fix an issue where LLDB would run out of stack space ..."

This commit introduced an infinite recursion in
ValueObjectChild::CanUpdateWithInvalidExecutionContext (because FollowParentChain also considers
the current object), which broke nearly all the tests. Ignoring the current object removes the
recursion, but two tests still time out (TestDataFormatterLibcxxList.py and
TestValueObjectRecursion.py) for some reason. Reverting for now.

llvm-svn: 243102

9 years agoTry to appease clang buildbot by forcing libstdc++ in mingw.cpp test.
Yaron Keren [Fri, 24 Jul 2015 09:31:57 +0000 (09:31 +0000)]
Try to appease clang buildbot by forcing libstdc++ in mingw.cpp test.

llvm-svn: 243101

9 years agoWhen lowering vector shifts a check is performed to see if the value to shift by
Luke Cheeseman [Fri, 24 Jul 2015 09:31:48 +0000 (09:31 +0000)]
When lowering vector shifts a check is performed to see if the value to shift by
is an immediate, in this check the value is negated and stored in and int64_t.
The value can be -2^63 yet the result cannot be stored in an int64_t and this
gives some undefined behaviour causing failures. The negation is only necessary
when the values is within a certain range and so it should not need to negate
-2^63, this patch introduces this and also a regression test.

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

llvm-svn: 243100

9 years agoImprove C++ function name handling and step-in avoid regerxp handling
Tamas Berghammer [Fri, 24 Jul 2015 08:54:22 +0000 (08:54 +0000)]
Improve C++ function name handling and step-in avoid regerxp handling

If the function is a template then the return type is part of the
function name. This CL fixes the parsing of these function names in
the case when the return type contains ':'.

The name of free functions in C++ don't have context part. Fix the
logic geting the function name without arguments out from a full
function name to handle this case.

Change the handling of step-in-avoid-regexp to match the value against
the function name without it's arguments and return value. This is
required because the default regex ("^std::") would match any template
function returning an std object.

Fifferential revision: http://reviews.llvm.org/D11461

llvm-svn: 243099

9 years agoAdd extensive tests for the mingw toolchain and remove trailing slash from Arch.
Yaron Keren [Fri, 24 Jul 2015 08:50:15 +0000 (08:50 +0000)]
Add extensive tests for the mingw toolchain and remove trailing slash from Arch.

Address Richard Smith comments: remove the trailing seperator from the Arch
variable, implement six mingw_* trees under tools/clangtest/Driver/Inputs
and merge linux and Windows tests into a universal test that uses these trees.

llvm-svn: 243098

9 years ago[clang-cl] Implement support for the /Zl flag
David Majnemer [Fri, 24 Jul 2015 06:49:13 +0000 (06:49 +0000)]
[clang-cl] Implement support for the /Zl flag

The flag allows users to specify that they do not want the object file
to have any implicit /defaultlib directives.

This fixes PR24236.

llvm-svn: 243097

9 years ago[dsymutil] Implement support for universal mach-o object files.
Frederic Riss [Fri, 24 Jul 2015 06:41:11 +0000 (06:41 +0000)]
[dsymutil] Implement support for universal mach-o object files.

This patch allows llvm-dsymutil to read universal (aka fat) macho object
files and archives. The patch touches nearly everything in the BinaryHolder,
but it is fairly mechinical: the methods that returned MemoryBufferRefs or
ObjectFiles now return a vector of those, and the high-level access function
takes a triple argument to select the architecture.

There is no support yet for handling fat executables and thus no support for
writing fat object files.

llvm-svn: 243096

9 years ago[dsymutil] Make the triple detection more strict.
Frederic Riss [Fri, 24 Jul 2015 06:41:04 +0000 (06:41 +0000)]
[dsymutil] Make the triple detection more strict.

MachOObjectFile offers a method for detecting the correct triple, use
it instead of the previous approximation. This doesn't matter right
now, but it will become important for mach-o universal (fat) binaries.

llvm-svn: 243095

9 years ago[dsymutil] Refactor BinaryHolder internals. NFC
Frederic Riss [Fri, 24 Jul 2015 06:40:59 +0000 (06:40 +0000)]
[dsymutil] Refactor BinaryHolder internals. NFC

Call a helper that resets all the internal state of the BinaryHolder
when we change the underlying memory buffer. Makes a followup patch
a tiny bit smaller.

llvm-svn: 243094

9 years ago[AST] Perform additional canonicalization for DependentSizedArrayType
David Majnemer [Fri, 24 Jul 2015 05:54:19 +0000 (05:54 +0000)]
[AST] Perform additional canonicalization for DependentSizedArrayType

We treated DependentSizedArrayTypes with the same element type but
differing size expressions as equivalently canonical.  This would lead
to bizarre behavior during template instantiation.

This fixes PR24212.

llvm-svn: 243093

9 years agoCleanup ObjCInterfaceDecl lookup for ObjC literals
Alex Denisov [Fri, 24 Jul 2015 05:09:40 +0000 (05:09 +0000)]
Cleanup ObjCInterfaceDecl lookup for ObjC literals

llvm-svn: 243092

9 years agoHandle old style S packet correctly
Bhushan D. Attarde [Fri, 24 Jul 2015 04:06:20 +0000 (04:06 +0000)]
Handle old style S packet correctly

    SUMMARY:
    This patch fixes couple of issues:
    1. A thread tries to lock a mutex which is already locked.
    2. Updating a thread list before the stop packet is parsed so that it can get a valid thread id and allows to set the stop info correctly.

    Reviewers: clayborg
    Subscribers: mohit.bhakkad, sagar, jaydeep, lldb-commits
    Differential Revision: http://reviews.llvm.org/D11449

llvm-svn: 243091

9 years agoGenerating available_externally vtables for outline virtual functions
Piotr Padlewski [Fri, 24 Jul 2015 04:04:49 +0000 (04:04 +0000)]
Generating available_externally vtables for outline virtual functions

Generating available_externally vtables for optimizations purposes.
Unfortunatelly ItaniumABI doesn't guarantee that we will be able to
refer to virtual inline method by name.
But when we don't have any inline virtual methods, and key function is
not defined in this TU, we can generate that there will be vtable and
mark it as available_externally.

This is patch will help devirtualize better.
Differential Revision: http://reviews.llvm.org/D11441

llvm-svn: 243090

9 years agoRevert "Remove access to the DataLayout in the TargetMachine"
Mehdi Amini [Fri, 24 Jul 2015 03:36:55 +0000 (03:36 +0000)]
Revert "Remove access to the DataLayout in the TargetMachine"

This reverts commit 0f720d984f419c747709462f7476dff962c0bc41.

It breaks clang too badly, I need to prepare a proper patch for clang
first.

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 243089

9 years ago[Static Analyzer] Some tests do not turn on core checkers. Running the analyzers...
Gabor Horvath [Fri, 24 Jul 2015 03:25:13 +0000 (03:25 +0000)]
[Static Analyzer] Some tests do not turn on core checkers. Running the analyzers without the core checkers is not supported.

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

llvm-svn: 243088

9 years ago[bpf] initial support for debug_info
Alexei Starovoitov [Fri, 24 Jul 2015 03:17:08 +0000 (03:17 +0000)]
[bpf] initial support for debug_info

llvm-svn: 243087

9 years ago[llvm-reaobj] Display COFF-specific sections/tables only if the object is COFF.
Davide Italiano [Fri, 24 Jul 2015 02:14:20 +0000 (02:14 +0000)]
[llvm-reaobj] Display COFF-specific sections/tables only if the object is COFF.

Just skip them otherwise.

llvm-svn: 243086

9 years agoFix the cc1as crash when it outputs assembly
Steven Wu [Fri, 24 Jul 2015 02:12:43 +0000 (02:12 +0000)]
Fix the cc1as crash when it outputs assembly

In clang cc1as_main, when the output file type is “asm”, AsmStreamer
owns a formatted_raw_ostream which has a reference to FDOS
(raw_ostream), so AsmStreamer must be closed before FDOS is closed.

llvm-svn: 243085

9 years agoHandle resolvable branches in complete loop unroll heuristic.
Michael Zolotukhin [Fri, 24 Jul 2015 01:53:04 +0000 (01:53 +0000)]
Handle resolvable branches in complete loop unroll heuristic.

Summary:
Resolving a branch allows us to ignore blocks that won't be executed, and thus make our estimate more accurate.
This patch is intended to be applied after D10205 (though it could be applied independently).

Reviewers: chandlerc

Subscribers: llvm-commits

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

llvm-svn: 243084

9 years agoRemove access to the DataLayout in the TargetMachine
Mehdi Amini [Fri, 24 Jul 2015 01:44:39 +0000 (01:44 +0000)]
Remove access to the DataLayout in the TargetMachine

Summary:
Replace getDataLayout() with a createDataLayout() method to make
explicit that it is intended to create a DataLayout only and not
accessing it for other purpose.

This change is the last of a series of commits dedicated to have a
single DataLayout during compilation by using always the one owned
by the module.

Reviewers: echristo

Subscribers: jholewinski, llvm-commits, rafael, yaron.keren

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

(cherry picked from commit 5609fc56bca971e5a7efeaa6ca4676638eaec5ea)

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 243083

9 years agobuild: fix small typo in cmake doxygen build
Saleem Abdulrasool [Fri, 24 Jul 2015 01:14:25 +0000 (01:14 +0000)]
build: fix small typo in cmake doxygen build

A search word spelled as "searhc" in the LLVM_DOXYGEN_SEARCHENGINE_URL cmake
variable docstring.

Patch by Daniel Otero!

llvm-svn: 243082

9 years agoMIRParser/LLVMBuild.txt: Add MC for MCRegisterInfo::getDwarfRegNum().
NAKAMURA Takumi [Fri, 24 Jul 2015 01:12:36 +0000 (01:12 +0000)]
MIRParser/LLVMBuild.txt: Add MC for MCRegisterInfo::getDwarfRegNum().

llvm-svn: 243081

9 years agoReorder alphabetically.
NAKAMURA Takumi [Fri, 24 Jul 2015 01:12:28 +0000 (01:12 +0000)]
Reorder alphabetically.

llvm-svn: 243080

9 years agoClean up function attributes on PPC fast-isel tests.
Eric Christopher [Fri, 24 Jul 2015 01:07:50 +0000 (01:07 +0000)]
Clean up function attributes on PPC fast-isel tests.

llvm-svn: 243079

9 years ago[libFuzzer] allow users to supply their own implementation of rand
Kostya Serebryany [Fri, 24 Jul 2015 01:06:40 +0000 (01:06 +0000)]
[libFuzzer] allow users to supply their own implementation of rand

llvm-svn: 243078

9 years agoFix an issue where LLDB would run out of stack space trying to decide if a deeply...
Enrico Granata [Fri, 24 Jul 2015 00:57:19 +0000 (00:57 +0000)]
Fix an issue where LLDB would run out of stack space trying to decide if a deeply nested child can be updated in the face of an invalid execution context

The issue is that a child can't really ask the root object, since this decision could actually hinge on whether a dynamic and/or synthetic value is present
To do this, make values vote lazily for whether they are willing to allow this, so that we can navigate up the chain without recursively invoking ourselves

Tentative fix for rdar://21949558

llvm-svn: 243077

9 years ago[RewriteStatepointsForGC] Fix release build warning
Philip Reames [Fri, 24 Jul 2015 00:42:55 +0000 (00:42 +0000)]
[RewriteStatepointsForGC] Fix release build warning

llvm-svn: 243076

9 years agoAdd missing underlines for a docs section. NFC
Jonathan Roelofs [Fri, 24 Jul 2015 00:29:50 +0000 (00:29 +0000)]
Add missing underlines for a docs section. NFC

llvm-svn: 243075

9 years agoAdd UNUSED_IF_ASSERT_DISABLED and apply it.
Bruce Mitchener [Fri, 24 Jul 2015 00:23:29 +0000 (00:23 +0000)]
Add UNUSED_IF_ASSERT_DISABLED and apply it.

Summary:
This replaces (void)x; usages where they x was subsequently
involved in an assertion with this macro to make the
intent more clear.

Reviewers: clayborg

Subscribers: lldb-commits

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

llvm-svn: 243074

9 years agounwind: Fix libc++abi and libgcc build.
Logan Chien [Fri, 24 Jul 2015 00:16:48 +0000 (00:16 +0000)]
unwind: Fix libc++abi and libgcc build.

To build libc++abi without libunwind, we should make sure that all
function calls to _Unwind_{Get,Set}{GR,IP}() are inlined as function
calls to _Unwind_VRS_{Get,Set}().  Otherwise, libc++abi.so will fail to
link since libgcc does not provide these symbol at all.

This commit fixes the problem by providing both the inlined version and
exported version.

llvm-svn: 243073

9 years agoFix Mac OS X build, debugserver version handling.
Bruce Mitchener [Fri, 24 Jul 2015 00:13:45 +0000 (00:13 +0000)]
Fix Mac OS X build, debugserver version handling.

Summary:
No longer rely on cmake to set DEBUGSERVER_VERSION_STR,
but now generate the _vers.c file like xcode does
and include the generated file into the build on Mac OS X.

This fixes the cmake Mac OS X build after an earlier change
by Jason Molenda.

Reviewers: clayborg, jasonmolenda

Subscribers: lldb-commits

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

llvm-svn: 243072

9 years ago[RewriteStatepointsForGC] Use a worklist algorithm for first part of base pointer...
Philip Reames [Fri, 24 Jul 2015 00:02:11 +0000 (00:02 +0000)]
[RewriteStatepointsForGC] Use a worklist algorithm for first part of base pointer algorithm [NFC]

The new code should hopefully be equivalent to the old code; it just uses a worklist to track instructions which need to visited rather than iterating over all instructions visited each time. This should be faster, but the primary benefit is that the purpose should be more clear and the diff of adding another instruction type (forthcoming) much more obvious.

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

llvm-svn: 243071

9 years agotest commit, only added one space
Lawrence Hu [Thu, 23 Jul 2015 23:55:28 +0000 (23:55 +0000)]
test commit, only added one space

llvm-svn: 243070

9 years agoFix the equal-vector-size rule for reinterpret_casts in C++
John McCall [Thu, 23 Jul 2015 23:54:07 +0000 (23:54 +0000)]
Fix the equal-vector-size rule for reinterpret_casts in C++
to consider the storage size of the vector instead of its
sizeof.  In other words, ban <3 x int> to <4 x int> casts,
which produced invalid IR anyway.

Also, attempt to be a little more rigorous, or at least
explicit, about when enums are allowed in these casts.

rdar://21901132

llvm-svn: 243069

9 years agoInstrProf: Fix a typo in the test for r243066
Justin Bogner [Thu, 23 Jul 2015 23:34:26 +0000 (23:34 +0000)]
InstrProf: Fix a typo in the test for r243066

llvm-svn: 243068

9 years agoDisable mutex error checking so it doesn't create problems with the multi-threaded...
Greg Clayton [Thu, 23 Jul 2015 23:32:08 +0000 (23:32 +0000)]
Disable mutex error checking so it doesn't create problems with the multi-threaded test case. The error would cause an assertion that could cause lldb to crash when unlocking a mutex returned an error because it was in use.

llvm-svn: 243067

9 years agoInstrProf: Don't extend coverage regions into the catch keyword
Justin Bogner [Thu, 23 Jul 2015 23:24:21 +0000 (23:24 +0000)]
InstrProf: Don't extend coverage regions into the catch keyword

The catch keyword isn't really part of a region, so it's fairly
meaningless to extend into it. This was usually harmless, but it could
crash when catch blocks involved macros in strange ways.

llvm-svn: 243066

9 years ago[NaryReassociate] remove redundant code
Jingyue Wu [Thu, 23 Jul 2015 23:13:37 +0000 (23:13 +0000)]
[NaryReassociate] remove redundant code

This check is already done by findClosestMatchingDominator.

llvm-svn: 243065

9 years agoMIR Serialization: Serialize the '.cfi_offset' CFI instruction.
Alex Lorenz [Thu, 23 Jul 2015 23:09:07 +0000 (23:09 +0000)]
MIR Serialization: Serialize the '.cfi_offset' CFI instruction.

Reviewers: Duncan P. N. Exon Smith
llvm-svn: 243062

9 years agoFix -Wextra-semi.
Rui Ueyama [Thu, 23 Jul 2015 23:03:55 +0000 (23:03 +0000)]
Fix -Wextra-semi.

Patch from Eugene.Zelenko!

llvm-svn: 243060

9 years agoWebAssembly: test that valid -mcpu flags are accepted.
JF Bastien [Thu, 23 Jul 2015 23:00:04 +0000 (23:00 +0000)]
WebAssembly: test that valid -mcpu flags are accepted.

Summary: AArch64 has a similar test.

Subscribers: sunfish, aemerson, llvm-commits, jfb

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

llvm-svn: 243058

9 years agofix crash in machine trace metrics due to processing dbg_value instructions (PR24199)
Sanjay Patel [Thu, 23 Jul 2015 22:56:53 +0000 (22:56 +0000)]
fix crash in machine trace metrics due to processing dbg_value instructions (PR24199)

The test in PR24199 ( https://llvm.org/bugs/show_bug.cgi?id=24199 ) crashes because machine
trace metrics was not ignoring dbg_value instructions when calculating data dependencies.

The machine-combiner pass asks machine trace metrics to calculate an instruction trace,
does some reassociations, and calls MachineInstr::eraseFromParentAndMarkDBGValuesForRemoval()
along with MachineTraceMetrics::invalidate(). The dbg_value instructions have their operands
invalidated, but the instructions are not expected to be deleted.

On a subsequent loop iteration of the machine-combiner pass, machine trace metrics would be
called again and die while accessing the invalid debug instructions.

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

llvm-svn: 243057

9 years ago[RewriteStatepointsForGC] Rename PhiState to reflect that it's associated w/more...
Philip Reames [Thu, 23 Jul 2015 22:49:14 +0000 (22:49 +0000)]
[RewriteStatepointsForGC] Rename PhiState to reflect that it's associated w/more than just PHIs

Today, Select instructions also have associated PhiStates.  In the near future, so will ExtractElement and SuffleVector.

llvm-svn: 243056

9 years ago[sanitizer] Fix double definition of a function.
Evgeniy Stepanov [Thu, 23 Jul 2015 22:37:39 +0000 (22:37 +0000)]
[sanitizer] Fix double definition of a function.

llvm-svn: 243055

9 years ago[RewriteStatepointsForGC] Use idomatic mechanisms for debug tracing [NFC]
Philip Reames [Thu, 23 Jul 2015 22:25:26 +0000 (22:25 +0000)]
[RewriteStatepointsForGC] Use idomatic mechanisms for debug tracing [NFC]

Deleting much of the code using trace-rewrite-statepoints and use idiomatic DEBUG statements instead.  This includes adding operator<< to a helper class.

llvm-svn: 243054

9 years agoSeveral improvements to the Either<T,U> type
Enrico Granata [Thu, 23 Jul 2015 22:17:39 +0000 (22:17 +0000)]
Several improvements to the Either<T,U> type

llvm-svn: 243053

9 years ago[ARM] Register (existing) ARMLoadStoreOpt pass with LLVM pass manager.
David Gross [Thu, 23 Jul 2015 22:12:46 +0000 (22:12 +0000)]
[ARM] Register (existing) ARMLoadStoreOpt pass with LLVM pass manager.

Summary: Among other things, this allows -print-after-all/-print-before-all to dump IR around this pass.

Subscribers: aemerson, llvm-commits, rengolin

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

llvm-svn: 243052

9 years ago[sanitizer] Implement logging to syslog.
Evgeniy Stepanov [Thu, 23 Jul 2015 22:05:20 +0000 (22:05 +0000)]
[sanitizer] Implement logging to syslog.

Previously, Android target had a logic of duplicating all sanitizer
output to logcat. This change extends it to all posix platforms via
the use of syslog, controlled by log_to_syslog flag. Enabled by
default on Android, off everywhere else.

A bit of cmake magic is required to allow Printf() to call a libc
function. I'm adding a stub implementation to support no-libc builds
like dfsan and safestack.

This is a second attempt. I believe I've fixed all the issues that
prompted the revert: Mac build, and all kinds of non-CMake builds
(there are 3 of those).

llvm-svn: 243051

9 years agoMoving tests in to X86 directory.
Colin LeMahieu [Thu, 23 Jul 2015 21:55:26 +0000 (21:55 +0000)]
Moving tests in to X86 directory.

llvm-svn: 243049

9 years agoAdd documentation for the objc_boxable attribute
Alex Denisov [Thu, 23 Jul 2015 21:53:13 +0000 (21:53 +0000)]
Add documentation for the objc_boxable attribute

llvm-svn: 243048

9 years agoTest commit.
David Gross [Thu, 23 Jul 2015 21:46:09 +0000 (21:46 +0000)]
Test commit.

llvm-svn: 243046

9 years ago[RewriteStatepointsForGC] Simplify code around meet of PhiStates [NFC]
Philip Reames [Thu, 23 Jul 2015 21:41:27 +0000 (21:41 +0000)]
[RewriteStatepointsForGC] Simplify code around meet of PhiStates [NFC]

We don't need to pass in the map from BDV to PhiStates; we can instead handle that externally and let the MeetPhiStates helper class just meet PhiStates.

llvm-svn: 243045

9 years agoUsing an input object file instead of trying to generate an object file.
Colin LeMahieu [Thu, 23 Jul 2015 21:40:19 +0000 (21:40 +0000)]
Using an input object file instead of trying to generate an object file.

llvm-svn: 243044

9 years agoSpecifying a test triple.
Colin LeMahieu [Thu, 23 Jul 2015 21:24:52 +0000 (21:24 +0000)]
Specifying a test triple.

llvm-svn: 243042

9 years ago[llvm-objdump] Add -D and --disassemble-all flags that attempt disassembly on all...
Colin LeMahieu [Thu, 23 Jul 2015 20:58:49 +0000 (20:58 +0000)]
[llvm-objdump] Add -D and --disassemble-all flags that attempt disassembly on all sections instead of just text sections.

llvm-svn: 243041

9 years ago[Scalarizer] Fix potential for stale data in Scattered across invocations
Matt Wala [Thu, 23 Jul 2015 20:53:46 +0000 (20:53 +0000)]
[Scalarizer] Fix potential for stale data in Scattered across invocations

Summary:
Scalarizer has two data structures that hold information about changes
to the function, Gathered and Scattered. These are cleared in finish()
at the end of runOnFunction() if finish() detects any changes to the
function.

However, finish() was checking for changes by only checking if
Gathered was non-empty. The function visitStore() only modifies
Scattered without touching Gathered. As a result, Scattered could have
ended up having stale data if Scalarizer only scalarized store
instructions. Since the data in Scattered is used during the execution
of the pass, this introduced dangling pointer errors.

The fix is to check whether both Scattered and Gathered are empty
before deciding what to do in finish(). This also fixes a problem
where the Function can be modified although the pass returns false.

Reviewers: rnk

Subscribers: rnk, srhines, llvm-commits

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

llvm-svn: 243040

9 years agoSema: Avoid a stack overflow on large CFGs
Duncan P. N. Exon Smith [Thu, 23 Jul 2015 20:15:50 +0000 (20:15 +0000)]
Sema: Avoid a stack overflow on large CFGs

Large CFGs cause `checkForFunctionCall()` to overflow its stack.  Break
the recursion by manually managing the call stack instead.

Patch by Vedant Kumar!

llvm-svn: 243039

9 years agoSema: Split out helper from checkForFunctionCall(), NFC
Duncan P. N. Exon Smith [Thu, 23 Jul 2015 20:11:47 +0000 (20:11 +0000)]
Sema: Split out helper from checkForFunctionCall(), NFC

Split out `hasRecursiveCallInPath()` from `checkForFunctionCall()` to
flatten nesting and clarify the code.  This also simplifies a follow-up
patch that refactors the other logic in `checkForFunctionCall()`.

Patch by Vedant Kumar!

llvm-svn: 243038

9 years agoAdd LICM test cases
Michael Kruse [Thu, 23 Jul 2015 20:05:11 +0000 (20:05 +0000)]
Add LICM test cases

These test cases check whether Polly still gives the same results if
LICM runs before.  Currently, it does not and therefore these cases are
expected fails.

llvm-svn: 243037

9 years agoAlways execute polly::CodePreparation before Polly
Michael Kruse [Thu, 23 Jul 2015 20:00:20 +0000 (20:00 +0000)]
Always execute polly::CodePreparation before Polly

ScopDetection does not allow scops to begin with the entry block, were
allocas are added at code generation.

llvm-svn: 243036

9 years agoMost thread plans don't handle eStopReasonInstrumentation stop reasons,
Jim Ingham [Thu, 23 Jul 2015 19:55:02 +0000 (19:55 +0000)]
Most thread plans don't handle eStopReasonInstrumentation stop reasons,
but that wasn't added to the list of reasons they don't explain.  That
would mean we keep stepping after hitting the AsanDie breakpoint rather
than stopping when the Asan event occurred.

<rdar://problem/21925479>

llvm-svn: 243035

9 years agoX86: Use dyn_cast instead of isa+cast, NFC
Duncan P. N. Exon Smith [Thu, 23 Jul 2015 19:27:07 +0000 (19:27 +0000)]
X86: Use dyn_cast instead of isa+cast, NFC

llvm-svn: 243034

9 years agoThis patch eanble register coalescing to coalesce the following:
Weiming Zhao [Thu, 23 Jul 2015 19:24:53 +0000 (19:24 +0000)]
This patch eanble register coalescing to coalesce the following:

  %vreg2<def> = MOVi32imm 1; GPR32:%vreg2
  %W1<def> = COPY %vreg2; GPR32:%vreg2
into:
  %W1<def> = MOVi32imm 1
Patched by Lawrence Hu (lawrence@codeaurora.org)

llvm-svn: 243033

9 years agoPatch out a fatal assertion in OpenMP runtime until preconditions are met
Jonathan Peyton [Thu, 23 Jul 2015 18:58:37 +0000 (18:58 +0000)]
Patch out a fatal assertion in OpenMP runtime until preconditions are met

Compiling simple testcase with g++ and linking it to the LLVM OpenMP runtime
compiled in debug mode trips an assertion that produces a fatal error. When
the assertion is skipped, the program runs successfully to completion and
produces the same answer as the sequential code. Intel will restore the
assertion with a patch that fixes the issues that cause it to trip.

Patch by John Mellor-Crummey

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

llvm-svn: 243032

9 years ago[libFuzzer] dump long running units to disk
Kostya Serebryany [Thu, 23 Jul 2015 18:37:22 +0000 (18:37 +0000)]
[libFuzzer] dump long running units to disk

llvm-svn: 243031

9 years agoDetect and throw on a class of bad regexes that we mistakenly accepted before. Thanks...
Marshall Clow [Thu, 23 Jul 2015 18:27:51 +0000 (18:27 +0000)]
Detect and throw on a class of bad regexes that we mistakenly accepted before. Thanks to Trevor Smigiel for the report

llvm-svn: 243030

9 years agoUpdating the documentation for the hasAttr AST matcher, which behaves somewhat differ...
Aaron Ballman [Thu, 23 Jul 2015 17:54:59 +0000 (17:54 +0000)]
Updating the documentation for the hasAttr AST matcher, which behaves somewhat differently when used within clang-query. Fixes PR24217.

llvm-svn: 243029

9 years agomisc-unused-parameters: Fix bug where the check was looking at
Daniel Jasper [Thu, 23 Jul 2015 17:26:36 +0000 (17:26 +0000)]
misc-unused-parameters: Fix bug where the check was looking at
ParmVarDecls of function types.

llvm-svn: 243026

9 years ago[Compiler-RT] Remove dependency on libgcc_s/eh
Renato Golin [Thu, 23 Jul 2015 17:24:41 +0000 (17:24 +0000)]
[Compiler-RT] Remove dependency on libgcc_s/eh

Currently, for --rtlib=compiler-rt on GNU systems, we're assuming
that one has libgcc_s and libgcc_eh as low-level libraries, which
when used in conjunction with -lunwind or -lc++abi, breaks that
assumption.

My original fix was wrong, and this patch reverts it to prepare for
a new flag to choose the unwinder/C++ libraries. For the time being,
people can use "-lgcc_s -lgcc_eh" or "-lunwind -lc++abi" or any
combination they need explicitly.

llvm-svn: 243025

9 years agoRemoved redundant alias checks generated during run time.
Johannes Doerfert [Thu, 23 Jul 2015 17:04:54 +0000 (17:04 +0000)]
Removed redundant alias checks generated during run time.

  As specified in PR23888, run-time alias check generation is expensive
  in terms of compile-time. This reduces the compile time by computing
  minimal/maximal access only once for each base pointer

Contributed-by: Pratik Bhatu <cs12b1010@iith.ac.in>
llvm-svn: 243024

9 years agoisl: Translate brisebarre to use UNIX line endings
Tobias Grosser [Thu, 23 Jul 2015 15:35:45 +0000 (15:35 +0000)]
isl: Translate brisebarre to use UNIX line endings

A similar patch will be upstreamed to ISL. We commit this ahead of time to
unblock people that are annoyed the permanent diffs we see in git.

llvm-svn: 243020

9 years agoSpeed up NativeProcessLinux::GetLoadedModuleFileSpec
Pavel Labath [Thu, 23 Jul 2015 14:47:33 +0000 (14:47 +0000)]
Speed up NativeProcessLinux::GetLoadedModuleFileSpec

Summary:
GetLoadedModuleFileSpec was reading /proc/pid/maps character by character, which was very slow,
since we do that for every shared library, which android tends to have a lot. Switching to
ProcFileReader saves us about 0.4 seconds in attach time.

Reviewers: tberghammer

Subscribers: tberghammer, danalbert, lldb-commits

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

llvm-svn: 243019

9 years agoAdd missing files for objc_boxable feature.
Alex Denisov [Thu, 23 Jul 2015 14:45:41 +0000 (14:45 +0000)]
Add missing files for objc_boxable feature.

Original patch [r240761] is missing all new files because of committer's mistake.

llvm-svn: 243018

9 years ago[CMake] Fix libomp_check_linker_flag function
Jonathan Peyton [Thu, 23 Jul 2015 14:41:35 +0000 (14:41 +0000)]
[CMake] Fix libomp_check_linker_flag function

libomp_check_linker_flag rewrites src_to_link.c and CMakeLists.txt in build
directory for test project, but cmake does not rebuild the project. The root
cause is that on some filesystems (ext3, reiserfs) timestamp resoultion is 1
second. So cmake does not rebuild test project if check takes less than 1 second.
This patch puts each test in its own directory to avoid the timestamp problem.

Patch by Chris Bergstrom

http://lists.cs.uiuc.edu/pipermail/openmp-dev/2015-July/000817.html

llvm-svn: 243017

9 years agoNFC. Explicitly specify attributes in BasicAA/cs-cs.ll test.
Igor Laevsky [Thu, 23 Jul 2015 14:31:18 +0000 (14:31 +0000)]
NFC. Explicitly specify attributes in BasicAA/cs-cs.ll test.
This will simplify verifying correctness for a changes which modify attributes.

llvm-svn: 243016

9 years agoDelete dead code.
Rafael Espindola [Thu, 23 Jul 2015 13:42:16 +0000 (13:42 +0000)]
Delete dead code.

llvm-svn: 243015

9 years agoUse the getSymbol with an explicit symbol table. NFC.
Rafael Espindola [Thu, 23 Jul 2015 13:41:25 +0000 (13:41 +0000)]
Use the getSymbol with an explicit symbol table. NFC.

llvm-svn: 243014

9 years ago[NativeProcessLinux] Fix a couple of warnings
Pavel Labath [Thu, 23 Jul 2015 13:07:37 +0000 (13:07 +0000)]
[NativeProcessLinux] Fix a couple of warnings

llvm-svn: 243013

9 years agoUse helper function. NFC.
Rafael Espindola [Thu, 23 Jul 2015 12:51:44 +0000 (12:51 +0000)]
Use helper function. NFC.

llvm-svn: 243012

9 years agoAdd a version of getSymbol with an explicit symbol table. Use it. NFC.
Rafael Espindola [Thu, 23 Jul 2015 12:49:40 +0000 (12:49 +0000)]
Add a version of getSymbol with an explicit symbol table. Use it. NFC.

llvm-svn: 243011

9 years ago[X86] Allow load folding into PUSH instructions
Michael Kuperstein [Thu, 23 Jul 2015 12:23:45 +0000 (12:23 +0000)]
[X86] Allow load folding into PUSH instructions

Adds pushes to the folding tables.
This also required a fix to the TD definition, since the memory forms of
the push instructions did not have the right mayLoad/mayStore flags.

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

llvm-svn: 243010

9 years ago[X86][AVX512F] Add FP scalar intrinsics
Asaf Badouh [Thu, 23 Jul 2015 12:13:32 +0000 (12:13 +0000)]
[X86][AVX512F] Add FP scalar intrinsics
intrinsics for: add/sub/mul/div/min/max in their FP scalar versions

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

llvm-svn: 243009