platform/upstream/llvm.git
8 years ago[X86][SSE] Fixed issue with memory folding of (v)cvtsd2ss intrinsics
Simon Pilgrim [Tue, 26 Jul 2016 10:41:28 +0000 (10:41 +0000)]
[X86][SSE] Fixed issue with memory folding of (v)cvtsd2ss intrinsics

Fixed typo in the intrinsic definitions of (v)cvtsd2ss with memory folding.

This was only unearthed when rL276102 started using the intrinsic again.....

llvm-svn: 276740

8 years ago[mips] MIPS64R6 compact branch support
Simon Dardis [Tue, 26 Jul 2016 10:25:07 +0000 (10:25 +0000)]
[mips] MIPS64R6 compact branch support

MIPS64R6 compact branch support. As the MIPS LLVM backend uses distinct
MachineInstrs for certain 32 and 64 bit instructions (e.g. BEQ & BEQ64) that
map to the same instruction, extend compact branch support for the
corresponding 64bit branches.

Reviewers: dsanders

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

llvm-svn: 276739

8 years agoFixed spelling in comment
Simon Pilgrim [Tue, 26 Jul 2016 09:55:31 +0000 (09:55 +0000)]
Fixed spelling in comment

llvm-svn: 276738

8 years ago[tblgen] Compare const char * with strcmp instead of creating StringRef.
Benjamin Kramer [Tue, 26 Jul 2016 09:27:51 +0000 (09:27 +0000)]
[tblgen] Compare const char * with strcmp instead of creating StringRef.

Avoids a call to strlen on both strings which always reads the entire
string. strcmp can use early exit.

llvm-svn: 276737

8 years ago[mips] sgtu, s[rl]l, sra, dnegu, neg instruction aliases
Simon Dardis [Tue, 26 Jul 2016 09:13:46 +0000 (09:13 +0000)]
[mips] sgtu, s[rl]l, sra, dnegu, neg instruction aliases

Add the instruction alias sgtu (register form only), two operand forms of
s[rl]l and sra, and missing single/two operand forms of dnegu/neg.

Reviewers: dsanders

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

llvm-svn: 276736

8 years agoFix incorrect form test in SymbolFileDWARF
Pavel Labath [Tue, 26 Jul 2016 08:16:19 +0000 (08:16 +0000)]
Fix incorrect form test in SymbolFileDWARF

Summary:
We were checking whether an attribute is in block form by getting the block data pointer, which
was not correct as the pointer be null even if the attribute is in block form. Other places in
the file already use the correct test.

To make this work, I've needed to add DW_FORM_exprlock to the list of "block" forms, which seems
correct as that is how we are parsing it.

Reviewers: clayborg

Subscribers: lldb-commits

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

llvm-svn: 276735

8 years agoFix DataExtractor::PeekData for zero length peeks
Pavel Labath [Tue, 26 Jul 2016 08:11:57 +0000 (08:11 +0000)]
Fix DataExtractor::PeekData for zero length peeks

Summary:
The function was returning the null pointer for peeks of size zero, which seems like a sensible
thing to do, but is actually pretty easy to get bitten by that if you are extracting a variable
length field which happens to be of zero length and then doing pointer arithmetic on that (which
SymbolFileDWARF does, and ended up crashing in case of empty DW_AT_location).

This changes the function to return a null pointer only when it gets queried for data which is
outside of the range of the extractor, which is more c++-y, as one can still do reasonable things
with pointers to data of size zero (think, end() iterators).

I also add a test and fix some signedness warnings in the existing data extractor tests.

Reviewers: clayborg

Subscribers: lldb-commits

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

llvm-svn: 276734

8 years ago[X86] Remove isCommutable=1 from instructions that also load. Commuting such instruct...
Craig Topper [Tue, 26 Jul 2016 08:06:18 +0000 (08:06 +0000)]
[X86] Remove isCommutable=1 from instructions that also load. Commuting such instruction isn't useful as it would unfold the load. The exception being FMA3 instructions.

llvm-svn: 276733

8 years ago[AVX512] Don't mark ADDSSZr_Int or MULSSZr_Int as commutable. The intrinsics have...
Craig Topper [Tue, 26 Jul 2016 08:06:14 +0000 (08:06 +0000)]
[AVX512] Don't mark ADDSSZr_Int or MULSSZr_Int as commutable. The intrinsics have one of their arguments indicated as passing through the high bits and we can't commute that.

llvm-svn: 276732

8 years ago[ELF/Linkerscript] Remove special handling of TLS/NOTE/RELRO sections (patch from...
Eugene Leviant [Tue, 26 Jul 2016 07:20:40 +0000 (07:20 +0000)]
[ELF/Linkerscript] Remove special handling of TLS/NOTE/RELRO sections (patch from ruiu)

llvm-svn: 276731

8 years agoRemove obsolete XFAIL for a test that used to sometimes miscompile under
Dimitry Andric [Tue, 26 Jul 2016 06:49:14 +0000 (06:49 +0000)]
Remove obsolete XFAIL for a test that used to sometimes miscompile under
FreeBSD with gcc 4.2.1, a long time ago (see r113824).  Noticed by Pete
Cooper.

llvm-svn: 276730

8 years agoAdd support for an additional dictionary in the per-arch plists
Jason Molenda [Tue, 26 Jul 2016 06:33:07 +0000 (06:33 +0000)]
Add support for an additional dictionary in the per-arch plists
that may be embedded in the Contents/Resources subdir of a dSYM
bundle.  These allow for the specification of a build-time path
to debug-time path remapping for source files.  Files may be built
in /BuildDirectory/sources/project-100 but when the debugger is
run, they're actually found via ~sources/project-100 - this plist
allows for that remapping through the DBGBuildSourcePath and
DBGSourcePath keys.

This patch adds support for a new DBGSourcePathRemapping
dictionary in the plist where the keys are the build-time paths
and the values are the debug-time paths that they should be
remapped to.  There are instances were we have multiple possible
build-time paths that need to be included, so the dictionary was
required.

<rdar://problem/26725174>

llvm-svn: 276729

8 years agoUpdate for LLVM changes
David Majnemer [Tue, 26 Jul 2016 05:52:37 +0000 (05:52 +0000)]
Update for LLVM changes

InstSimplify has gained the ability to remove needless bitcasts which
perturbed some clang codegen tests.

llvm-svn: 276728

8 years agoReapply: [InstSimplify] Add support for bitcasts"
David Majnemer [Tue, 26 Jul 2016 05:52:29 +0000 (05:52 +0000)]
Reapply: [InstSimplify] Add support for bitcasts"

This reverts commit r276700 and reapplies r276698.
The relevant clang tests have been updated.

llvm-svn: 276727

8 years ago[OpenMP] diagnose orphaned teams construct
Kelvin Li [Tue, 26 Jul 2016 04:32:50 +0000 (04:32 +0000)]
[OpenMP] diagnose orphaned teams construct

The OpenMP spec mandates that 'a teams construct must be contained within a
target construct'. Currently, this scenario is not diagnosed. This patch is
to add check for orphaned teams construct and issue an error message.

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

llvm-svn: 276726

8 years agoPropery format doccomment in lto.h . NFC
Amaury Sechet [Tue, 26 Jul 2016 04:20:30 +0000 (04:20 +0000)]
Propery format doccomment in lto.h . NFC

llvm-svn: 276725

8 years agoLiveIntervalAnalysis: Fix handleMoveDown() problem
Matthias Braun [Tue, 26 Jul 2016 03:57:45 +0000 (03:57 +0000)]
LiveIntervalAnalysis: Fix handleMoveDown() problem

If we move a last-use register read to a later position we may skip
intermediate segments. This may require us to not only extend the
segment before the NewIdx, but also extend the segment live-in to
OldIdx.

This switches LiveIntervalTest to use AMDGPU so we can test subregister
liveness.

llvm-svn: 276724

8 years agoGlobalISel: remove redundant ';'s. NFC
Tim Northover [Tue, 26 Jul 2016 03:29:18 +0000 (03:29 +0000)]
GlobalISel: remove redundant ';'s. NFC

llvm-svn: 276723

8 years agoDynamicLoaderDarwinKernel will look in four addresses for the kernel
Jason Molenda [Tue, 26 Jul 2016 03:10:15 +0000 (03:10 +0000)]
DynamicLoaderDarwinKernel will look in four addresses for the kernel
load address on 64-bit devices; it only needs to look in three.

<rdar://problem/27061405>

llvm-svn: 276721

8 years agoAdd qualification to fix MSVC build.
Peter Collingbourne [Tue, 26 Jul 2016 02:10:56 +0000 (02:10 +0000)]
Add qualification to fix MSVC build.

llvm-svn: 276720

8 years agoCOFF: Implement /linkrepro flag.
Peter Collingbourne [Tue, 26 Jul 2016 02:00:42 +0000 (02:00 +0000)]
COFF: Implement /linkrepro flag.

This flag is implemented similarly to --reproduce in the ELF linker.

This patch implements /linkrepro by moving the cpio writer and associated
utility functions to lldCore, and using that implementation in both linkers.

One COFF-specific detail is that we store the object file from which the
resource files were created in our reproducer, rather than the resource
files themselves. This allows the reproducer to be used on non-Windows
systems for example.

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

llvm-svn: 276719

8 years ago[CMake] Updating Xcode Toolchain creation to support Xcode 7
Chris Bieneman [Tue, 26 Jul 2016 00:47:52 +0000 (00:47 +0000)]
[CMake] Updating Xcode Toolchain creation to support Xcode 7

Recent changes to Xcode have changed the structure of Xcode toolchains. This patch makes the xcode-toolchain goop construct a new-format Xcode toolchain that is compatible with Xcode 7.

The new format has a compatibility version key, so when a new format comes out we can support multiple formats in parallel.

llvm-svn: 276718

8 years agoSplit getPhdrsIndices. NFC.
Rui Ueyama [Tue, 26 Jul 2016 00:27:36 +0000 (00:27 +0000)]
Split getPhdrsIndices. NFC.

llvm-svn: 276717

8 years ago[Coverage] Do not write out coverage mappings with zero entries
Vedant Kumar [Tue, 26 Jul 2016 00:24:59 +0000 (00:24 +0000)]
[Coverage] Do not write out coverage mappings with zero entries

After r275121, we stopped mapping regions from system headers. Lambdas
declared in regions belonging to system headers started producing empty
coverage mappings, since the files corresponding to their spelling locs
were being ignored.

The coverage reader doesn't know what to do with these empty mappings.
This commit makes sure that we don't produce them and adds a test. I'll
make the reader stricter in a follow-up commit.

llvm-svn: 276716

8 years agoReplace std::find_if with plain for loop. NFC.
Rui Ueyama [Tue, 26 Jul 2016 00:21:15 +0000 (00:21 +0000)]
Replace std::find_if with plain for loop. NFC.

llvm-svn: 276715

8 years agoGVN-hoist: use a DFS numbering of instructions (PR28670)
Sebastian Pop [Tue, 26 Jul 2016 00:15:10 +0000 (00:15 +0000)]
GVN-hoist: use a DFS numbering of instructions (PR28670)

Instead of DFS numbering basic blocks we now DFS number instructions that avoids
the costly operation of which instruction comes first in a basic block.

Patch mostly written by Daniel Berlin.

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

llvm-svn: 276714

8 years agoGVN-hoist: limit hoisting depth (PR28670)
Sebastian Pop [Tue, 26 Jul 2016 00:15:08 +0000 (00:15 +0000)]
GVN-hoist: limit hoisting depth (PR28670)

This patch adds an option to specify the maximum depth in a BB at which to
consider hoisting instructions.  Hoisting instructions from a deeper level is
not profitable as it increases register pressure and compilation time.

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

llvm-svn: 276713

8 years ago[safestack] Fix stack guard live range.
Evgeniy Stepanov [Tue, 26 Jul 2016 00:05:14 +0000 (00:05 +0000)]
[safestack] Fix stack guard live range.

Stack guard slot is live throughout the function.

llvm-svn: 276712

8 years ago[CMake] Pass DYLD_LIBRARY_PATH as CMake variable instead of as envar
Chris Bieneman [Mon, 25 Jul 2016 23:48:14 +0000 (23:48 +0000)]
[CMake] Pass DYLD_LIBRARY_PATH as CMake variable instead of as envar

On OS X 10.11 System Integrity Protection prevents the DYLD environment variables from being set on system binaries. To work around this r276710 accepts DYLD_LIBRARY_PATH as a CMake variable and sets it directly on the archiver commands.

To make this work with bootstrapping we need to set DYLD_LIBRARY_PATH to the current stage's library directory and pass that into the next stage's configuration.

llvm-svn: 276711

8 years ago[CMake] Support feeding DYLD_LIBRARY_PATH into archiver calls
Chris Bieneman [Mon, 25 Jul 2016 23:46:08 +0000 (23:46 +0000)]
[CMake] Support feeding DYLD_LIBRARY_PATH into archiver calls

OS X 10.11 has a feature named System Integrity Protection. The goal of the feature is to make system binaries immutable (even as root). One part of this is that protected binaries do not receive DYLD_* environment variables because the kernel scrubs them before process launch.

This causes problems for LTO bootstrap builds on Darwin that try to use the just-built libLTO with the host ar, ranlib, or libtool.

This patch addresses two problems.

(1) The tools themselves aren't protected binaries but the shim tools installed at / are, so we need to call xcrun -find to find libtool instead of using the one CMake finds.

(2) Some build tools (ninja and make) use /bin/sh to invoke their subprocesses. Since /bin/sh is a system binary, the kernel scrubs the DYLD envars from their environment. To work around this we need to set the environment variables as part of the archiver commands, so the envars are set by the shell process instead of on the shell process.

llvm-svn: 276710

8 years agoPrint a warning if the directory passed to --test-subdir doesn't end up existing
Enrico Granata [Mon, 25 Jul 2016 23:26:24 +0000 (23:26 +0000)]
Print a warning if the directory passed to --test-subdir doesn't end up existing

llvm-svn: 276709

8 years agoDefine compatibility flag if not defined with -std=c++
Xinliang David Li [Mon, 25 Jul 2016 23:12:53 +0000 (23:12 +0000)]
Define compatibility flag if not defined with -std=c++

llvm-svn: 276708

8 years ago[lit] Don't match tool names within new PM's <> markers
Adam Nemet [Mon, 25 Jul 2016 23:09:10 +0000 (23:09 +0000)]
[lit] Don't match tool names within new PM's <> markers

For example, stop expanding 'opt' in -passes='require<opt-remark-emit>'.

llvm-svn: 276707

8 years agoSplit LinkerScript::createSections into small functions.
Rui Ueyama [Mon, 25 Jul 2016 22:51:07 +0000 (22:51 +0000)]
Split LinkerScript::createSections into small functions.

createSections function is getting longer, so it is time to split it
into small functions. The reason why the function is long is because
it has deeply nested for-loops. This patch constructs temporary data
to reduce nesting level.

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

llvm-svn: 276706

8 years agoFix parameter names.
Rui Ueyama [Mon, 25 Jul 2016 22:41:42 +0000 (22:41 +0000)]
Fix parameter names.

match() returns true of the first argument, a target string, matches
one of the second argument, a list of glob patterns. Calling the
target string, which is not a glob pattern, "Pattern" was very confusing.

llvm-svn: 276705

8 years agoMake min follow the OCL 1.0 specs
Jan Vesely [Mon, 25 Jul 2016 22:36:22 +0000 (22:36 +0000)]
Make min follow the OCL 1.0 specs

OpenCL 1.0: "Returns y if y < x, otherwise it returns x. If x *and* y
are infinite or NaN, the return values are undefined."

OpenCL 1.1+: "Returns y if y < x, otherwise it returns x. If x *or* y
are infinite or NaN, the return values are undefined."

The 1.0 version is stricter so use that one.

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 276704

8 years agoAttempt to pacify windows bots, again.
Michael Kuperstein [Mon, 25 Jul 2016 22:29:04 +0000 (22:29 +0000)]
Attempt to pacify windows bots, again.

llvm-svn: 276703

8 years agoDo not pass InputFile to reportDiscarded().
Rui Ueyama [Mon, 25 Jul 2016 22:26:28 +0000 (22:26 +0000)]
Do not pass InputFile to reportDiscarded().

Because the file from which an input section is created can be
obtained using getFile().

llvm-svn: 276702

8 years ago[ARM] Saturation instructions are DSP-only
Renato Golin [Mon, 25 Jul 2016 22:25:25 +0000 (22:25 +0000)]
[ARM] Saturation instructions are DSP-only

The saturation instructions appeared in v6T2, with DSP extensions, but they
were being accepted / generated on any, with the new introduction of the
saturation detection in the back-end. This commit restricts the usage to
DSP-enable only cores.

Fixes PR28607.

llvm-svn: 276701

8 years agoRevert "[InstSimplify] Add support for bitcasts"
David Majnemer [Mon, 25 Jul 2016 22:24:59 +0000 (22:24 +0000)]
Revert "[InstSimplify] Add support for bitcasts"

This reverts commit r276698.  Clang has tests which rely on the
optimizer :(

llvm-svn: 276700

8 years ago[InstSimplify] Add support for bitcasts
David Majnemer [Mon, 25 Jul 2016 22:04:58 +0000 (22:04 +0000)]
[InstSimplify] Add support for bitcasts

BitCasts of BitCasts can be folded away as can BitCasts which don't
change the type of the operand.

llvm-svn: 276698

8 years agoMake ConstraintKind an enum class.
Rui Ueyama [Mon, 25 Jul 2016 22:00:10 +0000 (22:00 +0000)]
Make ConstraintKind an enum class.

llvm-svn: 276697

8 years ago[Sema][ObjC] Compute the nullability of a conditional expression based
Akira Hatanaka [Mon, 25 Jul 2016 21:58:19 +0000 (21:58 +0000)]
[Sema][ObjC] Compute the nullability of a conditional expression based
on the nullabilities of its operands.

This commit is a follow-up to r276076 and enables
computeConditionalNullability to compute the merged nullability when
the operands are objective-c pointers.

rdar://problem/22074116

llvm-svn: 276696

8 years ago[LinkerScript] Refactor KEEP handling in a separate function
Davide Italiano [Mon, 25 Jul 2016 21:47:13 +0000 (21:47 +0000)]
[LinkerScript] Refactor KEEP handling in a separate function

This will grow because I have a patch to support more complex
constructs, e.g.:

KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))

Let's make this a separate function.

llvm-svn: 276695

8 years ago[WebAssembly] Update for Target API (TargetRegistry::RegisterMCAsmBackend) change
David Blaikie [Mon, 25 Jul 2016 21:41:42 +0000 (21:41 +0000)]
[WebAssembly] Update for Target API (TargetRegistry::RegisterMCAsmBackend) change

llvm-svn: 276694

8 years agoRe-commit "Split LinkerScript::createSections".
Rui Ueyama [Mon, 25 Jul 2016 21:30:00 +0000 (21:30 +0000)]
Re-commit "Split LinkerScript::createSections".

Re-commit r276543 with a fix for buildbots.

llvm-svn: 276693

8 years ago[X86] Regenerate v2i256 shift legalization tests
Simon Pilgrim [Mon, 25 Jul 2016 21:14:22 +0000 (21:14 +0000)]
[X86] Regenerate v2i256 shift legalization tests

llvm-svn: 276692

8 years ago[X86] Regenerate i64 shift legalization tests
Simon Pilgrim [Mon, 25 Jul 2016 21:11:45 +0000 (21:11 +0000)]
[X86] Regenerate i64 shift legalization tests

llvm-svn: 276691

8 years agoGlobalISel: add generic casts to IRTranslator
Tim Northover [Mon, 25 Jul 2016 21:01:29 +0000 (21:01 +0000)]
GlobalISel: add generic casts to IRTranslator

This adds LLVM's 3 main cast instructions (inttoptr, ptrtoint, bitcast) to the
IRTranslator. The first two are direct translations (with 2 MachineInstr types
each). Since LLT discards information, a bitcast might become trivial and we
emit a COPY in those cases instead.

llvm-svn: 276690

8 years agoGlobalISel[AArch64]: support pointer types in argument lowering.
Tim Northover [Mon, 25 Jul 2016 21:01:17 +0000 (21:01 +0000)]
GlobalISel[AArch64]: support pointer types in argument lowering.

They're basically i64 for AArch64, but we'll leave them intact for stranger
targets. Also add some tests for the (very few) other cases we can handle right
now.

llvm-svn: 276689

8 years ago[PM] Port SymbolRewriter to the new PM
Michael Kuperstein [Mon, 25 Jul 2016 20:52:00 +0000 (20:52 +0000)]
[PM] Port SymbolRewriter to the new PM

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

llvm-svn: 276687

8 years agoNext step along the way to getting good error messages for bad archives.
Kevin Enderby [Mon, 25 Jul 2016 20:36:36 +0000 (20:36 +0000)]
Next step along the way to getting good error messages for bad archives.

I consulted with Lang Hames on this work, and the goal was to add a bit
of "where" in the archive the error occurred along with what the error was.

So this step changes ArchiveMemberHeader into a class with a pointer
to the archive header and the parent archive.  Which allows the methods
in the ArchiveMemberHeader to determine which member the header is
for to include that information in the error message.

For this first step the "where" is just the offset to the member in the
archive.  The next step will be a new method on ArchiveMemberHeader
to get the full name, if possible, to be use in the error message.  Which
will now be possible as ArchiveMemberHeader contains a pointer to
the Archive with its string table and its size, etc. so the full name can
be determined from the header if it is valid.

Also this change adds the missing checks the archive header is actually
contained in the buffer and is not truncated, as well as if the terminating
characters are correct in the header.

And changes one error message in Archive::Child::getNext() where the
name or offset to member is now added.

llvm-svn: 276686

8 years agoFix r276671 to not use a defaulted move constructor.
Jordan Rose [Mon, 25 Jul 2016 20:34:25 +0000 (20:34 +0000)]
Fix r276671 to not use a defaulted move constructor.

MSVC won't provide the body of this move constructor and assignment
operator, possibly because the copy constructor is banned. Just write
it manually.

llvm-svn: 276685

8 years ago[Clang-rename] Remove custom version, fix extra space in error message.
Eugene Zelenko [Mon, 25 Jul 2016 20:30:13 +0000 (20:30 +0000)]
[Clang-rename] Remove custom version, fix extra space in error message.

Also fixed some Include What You Use Warnings.

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

llvm-svn: 276684

8 years agoRevert "Enable cross-compilation across architectures on android"
Chris Bieneman [Mon, 25 Jul 2016 20:25:38 +0000 (20:25 +0000)]
Revert "Enable cross-compilation across architectures on android"

This reverts commit r276333.

As I commented in the review (https://reviews.llvm.org/D22415), this change isn't needed because CMAKE_C_FLAGS is implicitly added by CMake to the command line for all C source files.

With this patch enabled CMAKE_C_FLAGS is duplicated on all C sources, and applied to ASM sources, which is not ideal.

I sent an email about this to llvm-commits on the commit thread. I suspect the problem the patch author was actually seeing is that CMAKE_C_FLAGS isn't applied to ASM files, and the builtins library has quite a few of those. The correct solution there is to specify CMAKE_ASM_FLAGS with whatever flags need to be passed to the compiler when compiling ASM files.

If there are other problems with flag propagation, please let me know.

llvm-svn: 276683

8 years agoAMDGPU: Remove read_workdim intrinsic
Jan Vesely [Mon, 25 Jul 2016 20:17:02 +0000 (20:17 +0000)]
AMDGPU: Remove read_workdim intrinsic

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

llvm-svn: 276682

8 years agoScalarizer: Support scalarizing intrinsics
Matt Arsenault [Mon, 25 Jul 2016 20:02:54 +0000 (20:02 +0000)]
Scalarizer: Support scalarizing intrinsics

llvm-svn: 276681

8 years agoAMDGPU: Make skip threshold an option
Matt Arsenault [Mon, 25 Jul 2016 19:48:29 +0000 (19:48 +0000)]
AMDGPU: Make skip threshold an option

llvm-svn: 276680

8 years agoAMDGPU: Fix missing verify-machineinstrs in control flow test
Matt Arsenault [Mon, 25 Jul 2016 19:39:06 +0000 (19:39 +0000)]
AMDGPU: Fix missing verify-machineinstrs in control flow test

llvm-svn: 276679

8 years agoLiveIntervals: Return index from replaceMachineInstrInMaps
Matt Arsenault [Mon, 25 Jul 2016 19:39:04 +0000 (19:39 +0000)]
LiveIntervals: Return index from replaceMachineInstrInMaps

Fixes weird asymmetry with insertion

llvm-svn: 276678

8 years agoMachineVerifier: Fix printing nonsense for physical registers
Matt Arsenault [Mon, 25 Jul 2016 19:39:01 +0000 (19:39 +0000)]
MachineVerifier: Fix printing nonsense for physical registers

llvm-svn: 276677

8 years agoFix invalid iterator use in safestack coloring.
Evgeniy Stepanov [Mon, 25 Jul 2016 19:25:40 +0000 (19:25 +0000)]
Fix invalid iterator use in safestack coloring.

llvm-svn: 276676

8 years agoAMDGPU: Delete dead code
Matt Arsenault [Mon, 25 Jul 2016 19:06:25 +0000 (19:06 +0000)]
AMDGPU: Delete dead code

llvm-svn: 276675

8 years ago[CMake] Cleaning up some CMake warnings
Chris Bieneman [Mon, 25 Jul 2016 18:54:30 +0000 (18:54 +0000)]
[CMake] Cleaning up some CMake warnings

In Bootstrap builds Clang logs some warnings. These are caused because Clang passes CLANG_STAGE and BOOTSTRAP_DEFAULT_PASSTHROUGH into the next stage's configuration.

BOOTSTRAP_DEFAULT_PASSTHROUGH shouldn't be passed, so it is renamed to _BOOTSTRAP_DEFAULT_PASSTHROUGH, to prevent passthrough.

CLANG_STAGE should be passed, so I've changed the code to log it if it is set outside the if(CLANG_ENABLE_BOOTSTRAP) block. This makes the variable always used, so the warning goes away.

llvm-svn: 276674

8 years ago[PGO] Fix profile mismatch in COMDAT function with pre-inliner
Rong Xu [Mon, 25 Jul 2016 18:45:37 +0000 (18:45 +0000)]
[PGO] Fix profile mismatch in COMDAT function with pre-inliner

Pre-instrumentation inline (pre-inliner) greatly improves the IR
instrumentation code performance, among other benefits. One issue of the
pre-inliner is it can introduce CFG-mismatch for COMDAT functions. This
is due to the fact that the same COMDAT function may have different early
inline decisions across different modules -- that means different copies
of COMDAT functions will have different CFG checksum.

In this patch, we propose a partially renaming the COMDAT group and its
member function/variable so we have different profile counter for each
version. We will post-fix the COMDAT function and the group name with its
FunctionHash.

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

llvm-svn: 276673

8 years agoAttempt to pacify windows bots.
Michael Kuperstein [Mon, 25 Jul 2016 18:39:08 +0000 (18:39 +0000)]
Attempt to pacify windows bots.

llvm-svn: 276672

8 years agoStringSwitch cannot be copied (take 2).
Jordan Rose [Mon, 25 Jul 2016 18:34:51 +0000 (18:34 +0000)]
StringSwitch cannot be copied (take 2).

This prevents StringSwitch from being used with 'auto', which is
important because the inferred type is StringSwitch rather than the
result type. This is a problem because StringSwitch stores addresses
of temporary values rather than copying or moving the value into its
own storage.

This is a compromise that still allows wrapping StringSwitch in other
temporary structures, which (unlike StringSwitch) may be non-trivial
to set up and therefore want to at least be movable. (For an example,
see QueryParser.cpp in clang-tools-extra.)

Changing this uncovered the bug in PassBuilder, also in this patch.
Clang doesn't seem to have any occurrences of the issue.

Re-commit of r276652.

llvm-svn: 276671

8 years agoRevert NewGVN N^2 behavior patch
Daniel Berlin [Mon, 25 Jul 2016 18:19:49 +0000 (18:19 +0000)]
Revert NewGVN N^2 behavior patch

llvm-svn: 276670

8 years agoAdd a modulemap for LLVMDebugInfoMsf.
Zachary Turner [Mon, 25 Jul 2016 18:18:59 +0000 (18:18 +0000)]
Add a modulemap for LLVMDebugInfoMsf.

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

llvm-svn: 276669

8 years agoDon't use iplist in SymbolRewriter. NFC.
Michael Kuperstein [Mon, 25 Jul 2016 18:10:54 +0000 (18:10 +0000)]
Don't use iplist in SymbolRewriter. NFC.

There didn't appear to be a good reason to use iplist in this case, a regular
list of unique_ptr works just as well.
Change made in preparation to a new PM port (since iplist is not moveable).

llvm-svn: 276668

8 years agocmake: When adding lit testsuites, ignore Output directories
Justin Bogner [Mon, 25 Jul 2016 18:07:14 +0000 (18:07 +0000)]
cmake: When adding lit testsuites, ignore Output directories

With in-tree builds we can get Output directories scattered among our
tests. Recursing into those to find tests doesn't make sense.

Thanks to nlewycky for noticing this!

llvm-svn: 276667

8 years ago[X86][SSE] Added 2048-bit vector comparison tests
Simon Pilgrim [Mon, 25 Jul 2016 17:56:01 +0000 (17:56 +0000)]
[X86][SSE] Added 2048-bit vector comparison tests

Upper limit of what can be held in a <32 x i8> result

llvm-svn: 276666

8 years agoNFC: Make a few asserts in GVNHoist do the same thing, but cheaper.
Daniel Berlin [Mon, 25 Jul 2016 17:36:14 +0000 (17:36 +0000)]
NFC: Make a few asserts in GVNHoist do the same thing, but cheaper.

llvm-svn: 276662

8 years agoRevert "StringSwitch cannot be copied or moved."
Jordan Rose [Mon, 25 Jul 2016 17:28:33 +0000 (17:28 +0000)]
Revert "StringSwitch cannot be copied or moved."

This reverts commit r276652. The clang-query tool is currently
relying on this behavior. I'll try again later.

llvm-svn: 276661

8 years ago[ELF] Fix bug in test case
Eugene Leviant [Mon, 25 Jul 2016 17:24:56 +0000 (17:24 +0000)]
[ELF] Fix bug in test case

llvm-svn: 276659

8 years agoFix N^2 instruction ordering comparisons in GVNHoist.
Daniel Berlin [Mon, 25 Jul 2016 17:24:27 +0000 (17:24 +0000)]
Fix N^2 instruction ordering comparisons in GVNHoist.
This fixes GVNHoist's portion of PR28670.

llvm-svn: 276658

8 years agoNFC: Refactor GVNHoist class so not everything is public
Daniel Berlin [Mon, 25 Jul 2016 17:24:22 +0000 (17:24 +0000)]
NFC: Refactor GVNHoist class so not everything is public

llvm-svn: 276657

8 years ago[cc1as] Add MCTargetOptions argument to createAsmBackend
Joel Jones [Mon, 25 Jul 2016 17:18:44 +0000 (17:18 +0000)]
[cc1as] Add MCTargetOptions argument to createAsmBackend

Allow an assembler backend to get ABI options. This is to match the changes
to http://reviews.llvm.org/D16213.

Tested with "make check-clang"

Patch by: Joel Jones

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

llvm-svn: 276655

8 years agoMC] Provide an MCTargetOptions to implementors of MCAsmBackendCtorTy, NFC
Joel Jones [Mon, 25 Jul 2016 17:18:28 +0000 (17:18 +0000)]
MC] Provide an MCTargetOptions to implementors of MCAsmBackendCtorTy, NFC

Some targets, notably AArch64 for ILP32, have different relocation encodings
based upon the ABI. This is an enabling change, so a future patch can use the
ABIName from MCTargetOptions to chose which relocations to use. Tested using
check-llvm.

The corresponding change to clang is in: http://reviews.llvm.org/D16538

Patch by: Joel Jones

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

llvm-svn: 276654

8 years agoSupport '#pragma once' in headers when using PCH
Sunil Srivastava [Mon, 25 Jul 2016 17:17:06 +0000 (17:17 +0000)]
Support '#pragma once' in headers when using PCH

The '#pragma once' directive was erroneously ignored when encountered
in the header-file specified in generate-PCH-mode. This resulted in
compile-time errors in some cases with legal code, and also a misleading
warning being produced.

Patch by Warren Ristow!

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

llvm-svn: 276653

8 years agoStringSwitch cannot be copied or moved.
Jordan Rose [Mon, 25 Jul 2016 17:08:24 +0000 (17:08 +0000)]
StringSwitch cannot be copied or moved.

...but most importantly, it cannot be used well with 'auto', because
the inferred type is StringSwitch rather than the result type. This
is a problem because StringSwitch stores addresses of temporary
values rather than copying or moving the value into its own storage.

Changing this uncovered the bug in PassBuilder, also in this patch.
Clang doesn't seem to have any occurrences of the issue.

llvm-svn: 276652

8 years agoRevert "MPITypeMismatchCheck for Clang-Tidy"
Alexander Kornienko [Mon, 25 Jul 2016 17:08:18 +0000 (17:08 +0000)]
Revert "MPITypeMismatchCheck for Clang-Tidy"

This reverts commit r276640. Breaks multiple buildbots.

llvm-svn: 276651

8 years agoRevert "Remove trailing spaces."
Alexander Kornienko [Mon, 25 Jul 2016 17:08:10 +0000 (17:08 +0000)]
Revert "Remove trailing spaces."

This reverts commit r276641. Breaks multiple buildbots.

llvm-svn: 276650

8 years agoRemove trailing whitespaces.
Rui Ueyama [Mon, 25 Jul 2016 16:51:52 +0000 (16:51 +0000)]
Remove trailing whitespaces.

llvm-svn: 276649

8 years agoAVX-512: Fixed [US]INT_TO_FP selection for i1 vectors.
Elena Demikhovsky [Mon, 25 Jul 2016 16:51:00 +0000 (16:51 +0000)]
AVX-512: Fixed [US]INT_TO_FP selection for i1 vectors.
It failed with assertion before this patch.

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

llvm-svn: 276648

8 years ago[Myriad]: better compatibility with vendor source
Douglas Katzman [Mon, 25 Jul 2016 16:36:02 +0000 (16:36 +0000)]
[Myriad]: better compatibility with vendor source

- Accept ma{2100,2150,2150} for -mcpu
- Define more preprocessor macros
- Don't append "le/" to little-endian lib dirs

llvm-svn: 276646

8 years agoGPGPU: Load GPU kernels
Tobias Grosser [Mon, 25 Jul 2016 16:31:21 +0000 (16:31 +0000)]
GPGPU: Load GPU kernels

We embed the PTX code into the host IR as a global variable and compile it
at run-time into a GPU kernel.

llvm-svn: 276645

8 years agoRemove useless pass from the pipeline in test/Analysis/Dominators/2007-01-14-BreakCri...
Wei Mi [Mon, 25 Jul 2016 16:27:34 +0000 (16:27 +0000)]
Remove useless pass from the pipeline in test/Analysis/Dominators/2007-01-14-BreakCritEdges.ll.

llvm-svn: 276644

8 years ago[ELF/LinkerScript] Use correct section name in a test.
Davide Italiano [Mon, 25 Jul 2016 16:10:40 +0000 (16:10 +0000)]
[ELF/LinkerScript] Use correct section name in a test.

llvm-svn: 276642

8 years agoRemove trailing spaces.
Alexander Kornienko [Mon, 25 Jul 2016 15:43:22 +0000 (15:43 +0000)]
Remove trailing spaces.

llvm-svn: 276641

8 years agoMPITypeMismatchCheck for Clang-Tidy
Alexander Kornienko [Mon, 25 Jul 2016 15:43:14 +0000 (15:43 +0000)]
MPITypeMismatchCheck for Clang-Tidy

Summary:
This check verifies if buffer type and MPI (Message Passing Interface)
datatype pairs match. All MPI datatypes defined by the MPI standard (3.1)
are verified by this check. User defined typedefs, custom MPI datatypes and
null pointer constants are skipped, in the course of verification.

Instructions on how to apply the check can be found at: https://github.com/0ax1/MPI-Checker/tree/master/examples

Reviewers: alexfh

Subscribers: cfe-commits

Projects: #clang-tools-extra

Patch by Alexander Droste!

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

llvm-svn: 276640

8 years agoMPI-Checker: move MPIFunctionClassifier.h
Alexander Kornienko [Mon, 25 Jul 2016 15:27:16 +0000 (15:27 +0000)]
MPI-Checker: move  MPIFunctionClassifier.h

Summary:
This patch moves the MPIFunctionClassifier header to `clang/include/clang/StaticAnalyzer/Checkers`,
in order to make it accessible in other parts of the architecture.

Reviewers: dcoughlin, zaks.anna

Subscribers: alexfh, cfe-commits

Patch by Alexander Droste!

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

llvm-svn: 276639

8 years ago[Hexagon] Add target feature to generate long calls
Krzysztof Parzyszek [Mon, 25 Jul 2016 14:42:11 +0000 (14:42 +0000)]
[Hexagon] Add target feature to generate long calls

llvm-svn: 276638

8 years ago[GSoC] Add PolyhedralInfo pass - new interface to polly analysis
Johannes Doerfert [Mon, 25 Jul 2016 12:48:45 +0000 (12:48 +0000)]
[GSoC] Add PolyhedralInfo pass - new interface to polly analysis

  Adding a new pass PolyhedralInfo. This pass will be the interface to Polly.
  Initially, we will provide the following interface:
    - #IsParallel(Loop *L) - return a bool depending on whether the loop is
                             parallel or not for the given program order.

Patch by Utpal Bora <cs14mtech11017@iith.ac.in>

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

llvm-svn: 276637

8 years agoGPGPU: Emit data-transfer code
Tobias Grosser [Mon, 25 Jul 2016 12:47:39 +0000 (12:47 +0000)]
GPGPU: Emit data-transfer code

Also factor out getArraySize() to avoid code dupliciation and reorder some
function arguments to indicate the direction into which data is transferred.

llvm-svn: 276636

8 years agoGPGPU: Complete code to allocate and free device arrays
Tobias Grosser [Mon, 25 Jul 2016 12:47:33 +0000 (12:47 +0000)]
GPGPU: Complete code to allocate and free device arrays

At the beginning of each SCoP, we allocate device arrays for all arrays
used on the GPU and we free such arrays after the SCoP has been executed.

llvm-svn: 276635

8 years agoGPURuntime: Add missing debug output
Tobias Grosser [Mon, 25 Jul 2016 12:47:28 +0000 (12:47 +0000)]
GPURuntime: Add missing debug output

llvm-svn: 276634

8 years agoGPURuntime: Fix typo in docu
Tobias Grosser [Mon, 25 Jul 2016 12:47:25 +0000 (12:47 +0000)]
GPURuntime: Fix typo in docu

llvm-svn: 276633

8 years agoGPURuntime: Drop polly_cleanupGPGPUResources
Tobias Grosser [Mon, 25 Jul 2016 12:47:22 +0000 (12:47 +0000)]
GPURuntime: Drop polly_cleanupGPGPUResources

This function is currently unused and won't be used in this form again. Instead
of freeing many unrelated items at the same time, we will instead explicitly
call free function from the host-IR we generate for each object we want to free.
These specific free functions will be added together with the corresponding
host-IR generation code.

llvm-svn: 276632

8 years ago[GSoC] Do not process SCoPs with infeasible runtime context
Johannes Doerfert [Mon, 25 Jul 2016 12:40:59 +0000 (12:40 +0000)]
[GSoC] Do not process SCoPs with infeasible runtime context

  Do not process SCoPs with infeasible runtime context in the new
  ScopInfoWrapperPass. Do not compute dependences for such SCoPs in the new
  DependenceInfoWrapperPass.

Patch by Utpal Bora <cs14mtech11017@iith.ac.in>

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

llvm-svn: 276631