platform/upstream/llvm.git
10 years agoMake lld-link symlink relative.
Shankar Easwaran [Sat, 18 Oct 2014 05:26:35 +0000 (05:26 +0000)]
Make lld-link symlink relative.

llvm-svn: 220130

10 years ago[ELF] Add Readers for all the ELF subtargets.
Shankar Easwaran [Sat, 18 Oct 2014 05:23:17 +0000 (05:23 +0000)]
[ELF] Add Readers for all the ELF subtargets.

This would permit the ELF reader to check the architecture that is being
selected by the linking process.

This patch also sorts the include files according to LLVM conventions.

llvm-svn: 220129

10 years ago[llvm-objdump] don't test timestamp dump as that is time zone dependent
Nick Kledzik [Sat, 18 Oct 2014 02:28:01 +0000 (02:28 +0000)]
[llvm-objdump] don't test timestamp dump as that is time zone dependent

llvm-svn: 220123

10 years agoPR21305: Typedefs in non-type template parameters in member data pointers.
David Blaikie [Sat, 18 Oct 2014 02:21:26 +0000 (02:21 +0000)]
PR21305: Typedefs in non-type template parameters in member data pointers.

Patch by Stephen Crane!

llvm-svn: 220122

10 years agoAdd special case for finding the in-tree ABI library.
Eric Fiselier [Sat, 18 Oct 2014 02:19:28 +0000 (02:19 +0000)]
Add special case for finding the in-tree ABI library.

When libcxx is built in-tree with libcxxabi it links against libcxxabi using
the name of the cmake target and not the actual library name. The cmake target
will not work with `find_library()`, so it needs special case handling.

llvm-svn: 220121

10 years ago[llvm-objdump] enhance test case for mach-o -private-headers
Nick Kledzik [Sat, 18 Oct 2014 01:50:55 +0000 (01:50 +0000)]
[llvm-objdump] enhance test case for mach-o -private-headers

llvm-svn: 220120

10 years ago[llvm-objdump] Fix mach-o binding decompression error
Nick Kledzik [Sat, 18 Oct 2014 01:21:02 +0000 (01:21 +0000)]
[llvm-objdump] Fix mach-o binding decompression error

llvm-svn: 220119

10 years ago[libcxx] Add support for building and testing with an ABI library not along linker...
Eric Fiselier [Sat, 18 Oct 2014 01:15:17 +0000 (01:15 +0000)]
[libcxx] Add support for building and testing with an ABI library not along linker paths

Summary:
This patch adds support for building/testing libc++ with an ABI library that the linker would not normally find.

- `CMAKE_LIBRARY_PATH` is used to specify the list of search directories.
- The ABI library is now found using `find_library` instead of assuming its along the linker's search path.
- `CMAKE_LIBRARY_PATH` is passed to our LIT config as `library_paths`.
- For each path in `library_paths` the following flags are added `-L<path> -Wl,-rpath -Wl,<path>`

Some changes in existing behavior were also added:
- `target_link_libraries` is now passed the ABI library file instead of the library name. Ex `target_link_libraries(cxx "/usr/lib/libc++abi.so")` vs `target_link_libraries(cxx "c++abi")`.
- `-Wl,-rpath -Wl,<path>` is now used on OSX to link to libc++ instead of env['DYLD_LIBRARY_PATH'] if `use_system_lib=False`.

Reviewers: mclow.lists, danalbert, EricWF

Reviewed By: EricWF

Subscribers: emaste, cfe-commits

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

llvm-svn: 220118

10 years agoHardcode the list of ELF targets here rather than using a glob.
Richard Smith [Sat, 18 Oct 2014 00:56:31 +0000 (00:56 +0000)]
Hardcode the list of ELF targets here rather than using a glob.

The code was making non-portable assumptions about the exact string returned by
the glob (possibly by the shell?); this is more robust and matches what is done
everywhere else.

llvm-svn: 220117

10 years ago[SROA] Change how SROA does vector-based promotion of allocas to handle
Chandler Carruth [Sat, 18 Oct 2014 00:44:02 +0000 (00:44 +0000)]
[SROA] Change how SROA does vector-based promotion of allocas to handle
cases where the alloca type, the load types, and the store types used
all disagree.

Previously, the only way that vector-based promotion occured was if the
alloca type was a vector type. This was one of the *very* few remaining
uses of the alloca's type to guide SROA/mem2reg left in LLVM. It turns
out it was a bad idea.

The alloca type can change very easily based on the mixture of types
loaded and stored to that alloca. We shouldn't be relying on it as
a signal for very much. Instead, the source of truth should be loads and
stores. We should canonicalize the loads and stores as much as possible
and then rely on them exclusively in SROA.

When looking and loads and stores, we may find many different candidate
vector types. This change will let SROA try all of them to find a vector
type which is a viable way to promote the entire alloca to a vector
register.

With this change, it becomes possible to do better canonicalization and
optimization of loads and stores without breaking SROA in random ways,
and that should allow fixing a core source of performance loss in hot
numerical loops such as those in Eigen.

llvm-svn: 220116

10 years ago[mach-o] keep Windows library happy.
Tim Northover [Sat, 18 Oct 2014 00:36:03 +0000 (00:36 +0000)]
[mach-o] keep Windows library happy.

&v[v.size()] may be invalid C++.

llvm-svn: 220115

10 years agoAppend the %itanium_abi_host_triple substitution unconditionally
Filipe Cabecinhas [Sat, 18 Oct 2014 00:05:26 +0000 (00:05 +0000)]
Append the %itanium_abi_host_triple substitution unconditionally

We will fail if it's not set, even if we don't substitute.

llvm-svn: 220114

10 years agoFixed python API event test cases.
Greg Clayton [Fri, 17 Oct 2014 23:58:27 +0000 (23:58 +0000)]
Fixed python API event test cases.

Issues were:
1 - It isn't good to have more than one listener for the process events, just supply a listener at launch instead of making a one then have the process broadcaster add a new listener
2 - run in async mode

llvm-svn: 220113

10 years agoFix makefile for debuginfo-tests execution.
Filipe Cabecinhas [Fri, 17 Oct 2014 23:50:47 +0000 (23:50 +0000)]
Fix makefile for debuginfo-tests execution.

llvm-svn: 220112

10 years agoSemaDeclCXX.cpp: UninitializedFieldVisitor: Avoid member initializers to appease...
NAKAMURA Takumi [Fri, 17 Oct 2014 23:46:34 +0000 (23:46 +0000)]
SemaDeclCXX.cpp: UninitializedFieldVisitor: Avoid member initializers to appease msc17.

llvm-svn: 220111

10 years agoR600/SI: Add global atomicrmw xchg
Aaron Watry [Fri, 17 Oct 2014 23:33:03 +0000 (23:33 +0000)]
R600/SI: Add global atomicrmw xchg

v2: Add separate offset/no-offset tests

Signed-off-by: Aaron Watry <awatry@gmail.com>
Reviewed-by: Matt Arsenault <matthew.arsenault@amd.com>
llvm-svn: 220110

10 years agoR600/SI: Add global atomicrmw xor
Aaron Watry [Fri, 17 Oct 2014 23:33:01 +0000 (23:33 +0000)]
R600/SI: Add global atomicrmw xor

v2: Add separate offset/no-offset tests

Signed-off-by: Aaron Watry <awatry@gmail.com>
Reviewed-by: Matt Arsenault <matthew.arsenault@amd.com>
llvm-svn: 220109

10 years agoR600/SI: Add global atomicrmw or
Aaron Watry [Fri, 17 Oct 2014 23:32:59 +0000 (23:32 +0000)]
R600/SI: Add global atomicrmw or

v2: Add separate offset/no-offset tests

Signed-off-by: Aaron Watry <awatry@gmail.com>
Reviewed-by: Matt Arsenault <matthew.arsenault@amd.com>
llvm-svn: 220108

10 years agoR600/SI: Add global atomicrmw min/umin
Aaron Watry [Fri, 17 Oct 2014 23:32:57 +0000 (23:32 +0000)]
R600/SI: Add global atomicrmw min/umin

v2: Add separate offset/no-offset tests

Signed-off-by: Aaron Watry <awatry@gmail.com>
Reviewed-by: Matt Arsenault <matthew.arsenault@amd.com>
llvm-svn: 220107

10 years agoR600/SI: Add global atomicrmw max/umax
Aaron Watry [Fri, 17 Oct 2014 23:32:56 +0000 (23:32 +0000)]
R600/SI: Add global atomicrmw max/umax

v2: Add separate offset/no-offset tests

Signed-off-by: Aaron Watry <awatry@gmail.com>
Reviewed-by: Matt Arsenault <matthew.arsenault@amd.com>
llvm-svn: 220106

10 years agoR600/SI: Add global atomicrmw and
Aaron Watry [Fri, 17 Oct 2014 23:32:54 +0000 (23:32 +0000)]
R600/SI: Add global atomicrmw and

v2: Add separate offset/no-offset tests

Signed-off-by: Aaron Watry <awatry@gmail.com>
Reviewed-by: Matt Arsenault <matthew.arsenault@amd.com>
llvm-svn: 220105

10 years agoR600/SI: Add global atomicrmw sub
Aaron Watry [Fri, 17 Oct 2014 23:32:52 +0000 (23:32 +0000)]
R600/SI: Add global atomicrmw sub

v2: Add separate offset/no-offset tests

Signed-off-by: Aaron Watry <awatry@gmail.com>
Reviewed-by: Matt Arsenault <matthew.arsenault@amd.com>
llvm-svn: 220104

10 years agoR600/SI: Fix/add tests for atomicrmw add
Aaron Watry [Fri, 17 Oct 2014 23:32:50 +0000 (23:32 +0000)]
R600/SI: Fix/add tests for atomicrmw add

The previous tests claimed to test constant offsets in the function name,
but the tests weren't actually testing them.

Clone the tests, and do testing of all combinations of the following:
1) with/without constant pointer offset
2) 32/64-bit addressing modes
3) Usage and non-usage of the return value from the atomicrmw

Reviewed-by: Matt Arsenault <matthew.arsenault@amd.com>
llvm-svn: 220103

10 years agoR600: Rename atomic_load global tests to atomic_add
Aaron Watry [Fri, 17 Oct 2014 23:32:49 +0000 (23:32 +0000)]
R600: Rename atomic_load global tests to atomic_add

The function name now matches what it's actually testing.

Signed-off-by: Aaron Watry <awatry@gmail.com>
Reviewed-by: Matt Arsenault <matthew.arsenault@amd.com>
llvm-svn: 220102

10 years ago[msan] Fix handling of byval arguments with large alignment.
Evgeniy Stepanov [Fri, 17 Oct 2014 23:29:44 +0000 (23:29 +0000)]
[msan] Fix handling of byval arguments with large alignment.

MSan param-tls slots are 8-byte aligned. This change clips
alignment of memcpy into param-tls to 8.

llvm-svn: 220101

10 years agoMake the registerEHFrame function do nothing,
Sean Callanan [Fri, 17 Oct 2014 23:02:41 +0000 (23:02 +0000)]
Make the registerEHFrame function do nothing,
because the default implementation isn't meant
to run against a target process.

<rdar://problem/16639561>

llvm-svn: 220100

10 years agoCheck for dynamic alloca's when selecting lifetime intrinsics.
Pete Cooper [Fri, 17 Oct 2014 22:59:33 +0000 (22:59 +0000)]
Check for dynamic alloca's when selecting lifetime intrinsics.

TL;DR: Indexing maps with [] creates missing entries.

The long version:

When selecting lifetime intrinsics, we index the *static* alloca map with the AllocaInst we find for that lifetime.  Trouble is, we don't first check to see if this is a dynamic alloca.

On the attached example, this causes a dynamic alloca to create an entry in the static map, and returns 0 (the default) as the frame index for that lifetime.  0 was used for the frame index of the stack protector, which given that it now has a lifetime, is coloured, and merged with other stack slots.

PEI would later trigger an assert because it expects the stack protector to not be dead.

This fix ensures that we only get frame indices for static allocas, ie, those in the map.  Dynamic ones are effectively dropped, which is suboptimal, but at least isn't completely broken.

rdar://problem/18672951

llvm-svn: 220099

10 years agoFix typo in comment.
Nick Lewycky [Fri, 17 Oct 2014 22:45:44 +0000 (22:45 +0000)]
Fix typo in comment.

llvm-svn: 220098

10 years ago[ASan] Improve blacklisting of global variables.
Alexey Samsonov [Fri, 17 Oct 2014 22:37:33 +0000 (22:37 +0000)]
[ASan] Improve blacklisting of global variables.

This commit changes the way we blacklist global variables in ASan.
Now the global is excluded from instrumentation (either regular
bounds checking, or initialization-order checking) if:

1) Global is explicitly blacklisted by its mangled name.
This part is left unchanged.

2) SourceLocation of a global is in blacklisted source file.
This changes the old behavior, where instead of looking at the
SourceLocation of a variable we simply considered llvm::Module
identifier. This was wrong, as identifier may not correspond to
the file name, and we incorrectly disabled instrumentation
for globals coming from #include'd files.

3) Global is blacklisted by type.
Now we build the type of a global variable using Clang machinery
(QualType::getAsString()), instead of llvm::StructType::getName().

After this commit, the active users of ASan blacklist files
may have to revisit them (this is a backwards-incompatible change).

llvm-svn: 220097

10 years ago[PECOFF] Emit x64 delay-import wrapper function
Rui Ueyama [Fri, 17 Oct 2014 22:03:54 +0000 (22:03 +0000)]
[PECOFF] Emit x64 delay-import wrapper function

Previously we supported x86 only. This patch is to support x64.

The array of pointers to delay-loaded functions points the
DLL delay loading function at start-up. When a function is called
for the first time, the delay loading function gets called and
then rewrite the function pointer array.

llvm-svn: 220096

10 years agoDo not delete the class, or else multiple tests that try to rely on lldbinline will...
Enrico Granata [Fri, 17 Oct 2014 21:50:42 +0000 (21:50 +0000)]
Do not delete the class, or else multiple tests that try to rely on lldbinline will fail

llvm-svn: 220095

10 years ago[PowerPC] Disable +vsx RUN line for fma.ll due to inconsistency on other builders
Bill Schmidt [Fri, 17 Oct 2014 21:32:22 +0000 (21:32 +0000)]
[PowerPC] Disable +vsx RUN line for fma.ll due to inconsistency on other builders

llvm-svn: 220094

10 years agoRevert "TRE: make TRE a bit more aggressive"
Rafael Espindola [Fri, 17 Oct 2014 21:25:48 +0000 (21:25 +0000)]
Revert "TRE: make TRE a bit more aggressive"

This reverts commit r219899.

This also updates byval-tail-call.ll to make it clear what was breaking.
Adding r219899 again will cause the load/store to disappear.

llvm-svn: 220093

10 years ago[PowerPC] Change assert to better form
Bill Schmidt [Fri, 17 Oct 2014 21:19:59 +0000 (21:19 +0000)]
[PowerPC] Change assert to better form

llvm-svn: 220092

10 years agoR600/SI: Remove redundant setting of instruction bits
Matt Arsenault [Fri, 17 Oct 2014 21:13:11 +0000 (21:13 +0000)]
R600/SI: Remove redundant setting of instruction bits

These are all set on the instruction base classes.

llvm-svn: 220091

10 years ago[PowerPC] Change liveness testing in VSX FMA mutation pass
Bill Schmidt [Fri, 17 Oct 2014 21:02:44 +0000 (21:02 +0000)]
[PowerPC] Change liveness testing in VSX FMA mutation pass

With VSX enabled, LLVM crashes when compiling
test/CodeGen/PowerPC/fma.ll.  I traced this to the liveness test
that's revised in this patch. The interval test is designed to only
work for virtual registers, but in this case the AddendSrcReg is
physical. Since there is already a walk of the MIs between the
AddendMI and the FMA, I added a check for def/kill of the AddendSrcReg
in that loop.  At Hal Finkel's request, I converted the liveness test
to an assert restricted to virtual registers.

I've changed the fma.ll test to have VSX and non-VSX variants so we
can test both kinds of multiply-adds.

llvm-svn: 220090

10 years agofix -fsanitize-address-field-padding for the cases with virtual base classes
Kostya Serebryany [Fri, 17 Oct 2014 21:02:13 +0000 (21:02 +0000)]
fix -fsanitize-address-field-padding for the cases with virtual base classes

Summary: Correctly compute the non-virtual size of a class.

Test Plan: Build SPEC 2016 with -fsanitize-address-field-padding

Reviewers: rsmith

Reviewed By: rsmith

Subscribers: cfe-commits

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

llvm-svn: 220089

10 years agoFix the rest of PR21289: a pack expansion that we can't expand yet makes a
Richard Smith [Fri, 17 Oct 2014 20:56:14 +0000 (20:56 +0000)]
Fix the rest of PR21289: a pack expansion that we can't expand yet makes a
template specialization type dependent, even if it has no dependent template
arguments. I've filed a corresponding bug against the C++ standard.

llvm-svn: 220088

10 years agoAdd support for initializer lists on field initializers for -Wuninitialized
Richard Trieu [Fri, 17 Oct 2014 20:56:10 +0000 (20:56 +0000)]
Add support for initializer lists on field initializers for -Wuninitialized

llvm-svn: 220087

10 years agoTry to fix parse-progname.c test on Darwin
Hans Wennborg [Fri, 17 Oct 2014 20:55:54 +0000 (20:55 +0000)]
Try to fix parse-progname.c test on Darwin

llvm-svn: 220086

10 years agoDon't forget to substitute into the qualifier when instantiating the definition
Richard Smith [Fri, 17 Oct 2014 20:37:29 +0000 (20:37 +0000)]
Don't forget to substitute into the qualifier when instantiating the definition
of a member function of a class template that is defined outside the template.
This substitution can actually fail in some weird cases.

llvm-svn: 220085

10 years agoDisable ccache for go tests.
Peter Collingbourne [Fri, 17 Oct 2014 18:32:36 +0000 (18:32 +0000)]
Disable ccache for go tests.

Should fix llvm-clang-lld-x86_64-debian-fast bot.

llvm-svn: 220071

10 years agoFixed the expression parser to handle cases where
Sean Callanan [Fri, 17 Oct 2014 18:16:04 +0000 (18:16 +0000)]
Fixed the expression parser to handle cases where
GetValueForVariableExpressionPath returns NULL and
doesn't set an error.

<rdar://problem/18682916>

llvm-svn: 220070

10 years agoMove test/CodeGen/sections.c to CodeGenCXX/sections.cpp
Hans Wennborg [Fri, 17 Oct 2014 18:13:21 +0000 (18:13 +0000)]
Move test/CodeGen/sections.c to CodeGenCXX/sections.cpp

The test was running with -xc++. Seems it wants to be a C++ file.

llvm-svn: 220069

10 years agoFix typo
Matt Arsenault [Fri, 17 Oct 2014 18:02:31 +0000 (18:02 +0000)]
Fix typo

llvm-svn: 220068

10 years agoR600/SI: Also check for FPImm literal constants
Matt Arsenault [Fri, 17 Oct 2014 18:00:50 +0000 (18:00 +0000)]
R600/SI: Also check for FPImm literal constants

llvm-svn: 220067

10 years agoR600/SI: Allow commuting with source modifiers
Matt Arsenault [Fri, 17 Oct 2014 18:00:48 +0000 (18:00 +0000)]
R600/SI: Allow commuting with source modifiers

llvm-svn: 220066

10 years agoR600/SI: Simplify code with hasModifiersSet
Matt Arsenault [Fri, 17 Oct 2014 18:00:45 +0000 (18:00 +0000)]
R600/SI: Simplify code with hasModifiersSet

llvm-svn: 220065

10 years agoR600/SI: Fix general commuting breaking src mods
Matt Arsenault [Fri, 17 Oct 2014 18:00:43 +0000 (18:00 +0000)]
R600/SI: Fix general commuting breaking src mods

The generic code trying to use findCommutedOpIndices won't
understand that it needs to swap the modifier operands also,
so it should fail if they are set.

llvm-svn: 220064

10 years agoR600/SI: Cleanup code with ChangeToFPImmediate
Matt Arsenault [Fri, 17 Oct 2014 18:00:41 +0000 (18:00 +0000)]
R600/SI: Cleanup code with ChangeToFPImmediate

llvm-svn: 220063

10 years agoR600/SI: Allow comuting fp immediates
Matt Arsenault [Fri, 17 Oct 2014 18:00:39 +0000 (18:00 +0000)]
R600/SI: Allow comuting fp immediates

llvm-svn: 220062

10 years agoR600/SI: Use early return instead of checking condition twice
Matt Arsenault [Fri, 17 Oct 2014 18:00:37 +0000 (18:00 +0000)]
R600/SI: Use early return instead of checking condition twice

Any commutable instruction will have at least src1.

llvm-svn: 220061

10 years agoRename TemplateArgument::getTypeForDecl to getParamTypeForDecl for clarity
David Blaikie [Fri, 17 Oct 2014 18:00:12 +0000 (18:00 +0000)]
Rename TemplateArgument::getTypeForDecl to getParamTypeForDecl for clarity

Code review feedback from Richard Smith on r219900.

llvm-svn: 220060

10 years agoMake a general helper function on the AST context to retrieve a type by identifier...
Enrico Granata [Fri, 17 Oct 2014 17:56:59 +0000 (17:56 +0000)]
Make a general helper function on the AST context to retrieve a type by identifier in the fashion needed by data formatters

llvm-svn: 220059

10 years agoWe also need to catch OSError here.
Peter Collingbourne [Fri, 17 Oct 2014 17:46:46 +0000 (17:46 +0000)]
We also need to catch OSError here.

llvm-svn: 220058

10 years agoR600/SI: Use complex pattern for MUBUF load patterns.
Matt Arsenault [Fri, 17 Oct 2014 17:43:00 +0000 (17:43 +0000)]
R600/SI: Use complex pattern for MUBUF load patterns.

This eliminates a use of the SI_ADDR64_RSRC pseudo

llvm-svn: 220057

10 years agoR600/SI: Remove SI_BUFFER_RSRC pseudo
Matt Arsenault [Fri, 17 Oct 2014 17:42:56 +0000 (17:42 +0000)]
R600/SI: Remove SI_BUFFER_RSRC pseudo

Just use REG_SEQUENCE directly, so there are fewer
instructions to need to deal with later.

llvm-svn: 220056

10 years ago[Stackmaps] Enable invoking the patchpoint intrinsic.
Juergen Ributzka [Fri, 17 Oct 2014 17:39:00 +0000 (17:39 +0000)]
[Stackmaps] Enable invoking the patchpoint intrinsic.

Patch by Kevin Modzelewski
Reviewers: atrick, ributzka
Reviewed By: ributzka
Subscribers: llvm-commits, reames

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

llvm-svn: 220055

10 years ago[X86] Fix missed selection of non-temporal store of zero vector.
Andrea Di Biagio [Fri, 17 Oct 2014 17:27:06 +0000 (17:27 +0000)]
[X86] Fix missed selection of non-temporal store of zero vector.

When the input to a store instruction was a zero vector, the backend
always selected a normal vector store regardless of the non-temporal
hint. This is fixed by this patch.

This fixes PR19370.

llvm-svn: 220054

10 years agoSema: address post-commit review comment
Saleem Abdulrasool [Fri, 17 Oct 2014 17:20:33 +0000 (17:20 +0000)]
Sema: address post-commit review comment

Hoist the IgnoreParens so that we ignore it around attributes as well in order
to future-proof the code.  Addresses Richard's comments for SVN r219974.

llvm-svn: 220053

10 years agoDriver: support detecting driver mode when clang has a version suffix without dash...
Hans Wennborg [Fri, 17 Oct 2014 17:07:59 +0000 (17:07 +0000)]
Driver: support detecting driver mode when clang has a version suffix without dash (PR21094)

Clang would previously not get into C++ mode when invoked as 'clang++3.6'
(though clang++-3.6 would work).

I found the previous loop logic in this function confusing; hopefully this
makes it a little clearer.

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

llvm-svn: 220052

10 years ago[AArch64] Fix a silent codegen fault in BUILD_VECTOR lowering.
James Molloy [Fri, 17 Oct 2014 17:06:31 +0000 (17:06 +0000)]
[AArch64] Fix a silent codegen fault in BUILD_VECTOR lowering.

We should be talking about the number of source elements, not the number of destination elements, given we know at this point that the source and dest element numbers are not the same.

While we're at it, avoid writing to std::vector::end()...

Bug found with random testing and a lot of coffee.

llvm-svn: 220051

10 years agoAdd an .arcconfig for libc++abi.
Dan Albert [Fri, 17 Oct 2014 16:48:56 +0000 (16:48 +0000)]
Add an .arcconfig for libc++abi.

llvm-svn: 220050

10 years ago[libcxxabi] Document the standalone build's requirements on llvm-config and llvm...
Eric Fiselier [Fri, 17 Oct 2014 16:32:06 +0000 (16:32 +0000)]
[libcxxabi] Document the standalone build's requirements on llvm-config and llvm sources.

The current documentation does not explain that the standalone build requires
the LLVM sources. This patch updates the documentation to reflect this
requirement and explains how to manually specify the location of the required
files.

llvm-svn: 220049

10 years agoDon't crash if find_executable return None.
Rafael Espindola [Fri, 17 Oct 2014 16:07:43 +0000 (16:07 +0000)]
Don't crash if find_executable return None.

This was crashing when trying to run the tests on Windows.

llvm-svn: 220048

10 years ago[PowerPC] Enable use of lxvw4x/stxvw4x in VSX code generation
Bill Schmidt [Fri, 17 Oct 2014 15:13:38 +0000 (15:13 +0000)]
[PowerPC] Enable use of lxvw4x/stxvw4x in VSX code generation

Currently the VSX support enables use of lxvd2x and stxvd2x for 2x64
types, but does not yet use lxvw4x and stxvw4x for 4x32 types.  This
patch adds that support.

As with lxvd2x/stxvd2x, this involves straightforward overriding of
the patterns normally recognized for lvx/stvx, with preference given
to the VSX patterns when VSX is enabled.

In addition, the logic for permitting misaligned memory accesses is
modified so that v4r32 and v4i32 are treated the same as v2f64 and
v2i64 when VSX is enabled.  Finally, the DAG generation for unaligned
loads is changed to just use a normal LOAD (which will become lxvw4x)
on P8 and later hardware, where unaligned loads are preferred over
lvsl/lvx/lvx/vperm.

A number of tests now generate the VSX loads/stores instead of
lvx/stvx, so this patch adds VSX variants to those tests.  I've also
added <4 x float> tests to the vsx.ll test case, and created a
vsx-p8.ll test case to be used for testing code generation for the
P8Vector feature.  For now, that simply tests the unaligned load/store
behavior.

This has been tested along with a temporary patch to enable the VSX
and P8Vector features, with no new regressions encountered with or
without the temporary patch applied.

llvm-svn: 220047

10 years agoMips: Only set divrem i64 to custom on 64bit
Jan Vesely [Fri, 17 Oct 2014 14:45:28 +0000 (14:45 +0000)]
Mips: Only set divrem i64 to custom on 64bit

Reviewed-by: Daniel Sanders <daniel.sanders@imgtec.com>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 220046

10 years agoR600: Add EG to FMA test
Jan Vesely [Fri, 17 Oct 2014 14:45:27 +0000 (14:45 +0000)]
R600: Add EG to FMA test

Reviewed-by: Tom Stellard <tom@stellard.net>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 220045

10 years agoSelectionDAG: Add sext_inreg optimizations
Jan Vesely [Fri, 17 Oct 2014 14:45:25 +0000 (14:45 +0000)]
SelectionDAG: Add sext_inreg optimizations

v2: use dyn_cast
    fixup comments
v3: use cast

Reviewed-by: Matt Arsenault <arsenm2@gmail.com>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 220044

10 years agoclang-format: Prefer breaking before trailing return arrows.
Daniel Jasper [Fri, 17 Oct 2014 14:37:40 +0000 (14:37 +0000)]
clang-format: Prefer breaking before trailing return arrows.

Before:
  auto SomeFunction(
      A aaaaaaaaaaaaaaaaaaaaa) const -> decltype(f(aaaaaaaaaaaaaaaaaaaaa)) {}

After:
  auto SomeFunction(A aaaaaaaaaaaaaaaaaaaaa) const
      -> decltype(f(aaaaaaaaaaaaaaaaaaaaa)) {}

llvm-svn: 220043

10 years ago[mips] Add support for COP1's Branch-On-Cond-Likely instructions
Vasileios Kalintiris [Fri, 17 Oct 2014 14:08:28 +0000 (14:08 +0000)]
[mips] Add support for COP1's Branch-On-Cond-Likely instructions

Summary: Depends on D5782

Reviewers: dsanders

Subscribers: llvm-commits

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

llvm-svn: 220042

10 years agoclang-format: [Java] Don't break immediately after "throws".
Daniel Jasper [Fri, 17 Oct 2014 13:36:14 +0000 (13:36 +0000)]
clang-format: [Java] Don't break immediately after "throws".

Before:
  public void doSooooooooooooooooooooooooooomething() throws
      LooooooooooooooooooooooooooooongException {}

After:
  public void doSooooooooooooooooooooooooooomething()
      throws LooooooooooooooooooooooooooooongException {}

llvm-svn: 220041

10 years ago[CMake] check-lld: Prune llvm-mc. It is unused.
NAKAMURA Takumi [Fri, 17 Oct 2014 12:55:58 +0000 (12:55 +0000)]
[CMake] check-lld: Prune llvm-mc. It is unused.

llvm-svn: 220040

10 years agolld/lib/Core/Error.cpp: Appease g++-4.7, corresponding to LLVM r210687.
NAKAMURA Takumi [Fri, 17 Oct 2014 12:55:49 +0000 (12:55 +0000)]
lld/lib/Core/Error.cpp: Appease g++-4.7, corresponding to LLVM r210687.

llvm-svn: 220039

10 years agoRevert r219977, "Re-commit r217995 and follow-up patches (r217997, r218011, r218053...
NAKAMURA Takumi [Fri, 17 Oct 2014 12:48:37 +0000 (12:48 +0000)]
Revert r219977, "Re-commit r217995 and follow-up patches (r217997, r218011, r218053). These were"

It broke some builders. I guess it'd be reproducible with --vg.

  Failing Tests (3):
      Clang :: CXX/except/except.spec/p1.cpp
      Clang :: SemaTemplate/instantiate-exception-spec-cxx11.cpp
      Clang :: SemaTemplate/instantiate-exception-spec.cpp

llvm-svn: 220038

10 years agoAdd explicit triple to clang/test/CodeGen/sanitize-address-field-padding.cpp, for...
NAKAMURA Takumi [Fri, 17 Oct 2014 12:48:01 +0000 (12:48 +0000)]
Add explicit triple to clang/test/CodeGen/sanitize-address-field-padding.cpp, for now. It's incompatible to ms mangling.

llvm-svn: 220037

10 years ago[mips] Add support for COP0's Branch-On-Cond-Likely instructions
Vasileios Kalintiris [Fri, 17 Oct 2014 12:38:35 +0000 (12:38 +0000)]
[mips] Add support for COP0's Branch-On-Cond-Likely instructions

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: llvm-commits

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

llvm-svn: 220036

10 years ago[DSE] Remove no-data-layout-only type-based overlap checking
Hal Finkel [Fri, 17 Oct 2014 11:56:00 +0000 (11:56 +0000)]
[DSE] Remove no-data-layout-only type-based overlap checking

DSE's overlap checking contained special logic, used only when no DataLayout
was available, which inferred a complete overwrite when the pointee types were
equal. This logic seems fine for regular loads/stores, but does not work for
memcpy and friends. Instead of fixing this, I'm just removing it.
Philosophically, transformations should not contain enhanced behavior used only
when data layout is lacking (data layout should be strictly additive), and
maintaining these rarely-tested code paths seems not worthwhile at this stage.

Credit to Aliaksei Zasenka for the bug report and the diagnosis. The test case
(slightly reduced from that provided by Aliaksei) replaces the original
contents of test/Transforms/DeadStoreElimination/no-targetdata.ll -- a few
other tests have been updated to have a data layout.

llvm-svn: 220035

10 years agocomplex long double support for PowerPC
Joerg Sonnenberger [Fri, 17 Oct 2014 11:51:19 +0000 (11:51 +0000)]
complex long double support for PowerPC

llvm-svn: 220034

10 years agoOptimize Type::isStructureOrClassType() by reusing RT->getDecl().
Yaron Keren [Fri, 17 Oct 2014 11:44:44 +0000 (11:44 +0000)]
Optimize Type::isStructureOrClassType() by reusing RT->getDecl().

RecordType->getDecl() which maps to TagType::getDecl() is not a simple
accessor but a loop on redecls in getInterestingTagDecl.

isStructureOrClassType() was calling getDecl() three times performing
three times the work actually required. It is optimized by calling
RT->getDecl() once and reusing the result three times.

llvm-svn: 220033

10 years agoD5775: The new test case was missing from the preceding commit.
Artyom Skrobov [Fri, 17 Oct 2014 10:25:09 +0000 (10:25 +0000)]
D5775: The new test case was missing from the preceding commit.

llvm-svn: 220032

10 years agoD5775: Fix of assertion failure in case of non-POD unions with bitfields. Patch by...
Artyom Skrobov [Fri, 17 Oct 2014 10:22:03 +0000 (10:22 +0000)]
D5775: Fix of assertion failure in case of non-POD unions with bitfields. Patch by Evgeny Astigeevich!

llvm-svn: 220031

10 years agoUser c-tor name to fix the sanitizer test
Renato Golin [Fri, 17 Oct 2014 10:09:25 +0000 (10:09 +0000)]
User c-tor name to fix the sanitizer test

llvm-svn: 220030

10 years agoTrying to fix failing Clang sanitizer test on ARM bots
Renato Golin [Fri, 17 Oct 2014 09:40:21 +0000 (09:40 +0000)]
Trying to fix failing Clang sanitizer test on ARM bots

llvm-svn: 220029

10 years agoTowards PR21289: don't lose track of unexpanded parameter packs with
Richard Smith [Fri, 17 Oct 2014 02:46:42 +0000 (02:46 +0000)]
Towards PR21289: don't lose track of unexpanded parameter packs with
non-dependent types, in CXXScalarValueInitExprs and in the
nested-name-specifier or template arguments of a DeclRefExpr in particular.

llvm-svn: 220028

10 years agoFix bashism in build.sh.
Peter Collingbourne [Fri, 17 Oct 2014 02:20:40 +0000 (02:20 +0000)]
Fix bashism in build.sh.

llvm-svn: 220027

10 years agoBreak out of the command word parsing loop if we hit
Jason Molenda [Fri, 17 Oct 2014 02:10:33 +0000 (02:10 +0000)]
Break out of the command word parsing loop if we hit
an invalid combination of words; don't accidentally
continue trying to parse the command line.
clang static analysis fixit.

llvm-svn: 220026

10 years agoAdd #if 0 around unreachable block of code to suppress warnings.
Jason Molenda [Fri, 17 Oct 2014 01:56:57 +0000 (01:56 +0000)]
Add #if 0 around unreachable block of code to suppress warnings.
clang warnings.

llvm-svn: 220025

10 years agoAdd null-checks around getter/setter before using them.
Jason Molenda [Fri, 17 Oct 2014 01:55:08 +0000 (01:55 +0000)]
Add null-checks around getter/setter before using them.
clang static analyzer fixit.

llvm-svn: 220024

10 years agoRemove incorrect usage of JoinedOrSeparate.
Richard Smith [Fri, 17 Oct 2014 01:52:48 +0000 (01:52 +0000)]
Remove incorrect usage of JoinedOrSeparate.

llvm-svn: 220023

10 years agoA << operation would be undefined for a bit-selecting
Jason Molenda [Fri, 17 Oct 2014 01:52:30 +0000 (01:52 +0000)]
A << operation would be undefined for a bit-selecting
function because of a '1u' making it a 32-bit value
when it really needed to be a 64-bit value.  Trivial to fix
once I figured out what was going on.
clang static analzyer fixit.

llvm-svn: 220022

10 years agoAdd back commits r219835 and a fixed version of r219829.
Rafael Espindola [Fri, 17 Oct 2014 01:48:58 +0000 (01:48 +0000)]
Add back commits r219835 and a fixed version of r219829.

The only difference from r219829 is using

getOrCreateSectionSymbol(*ELFSec)

instead of

GetOrCreateSymbol(ELFSec->getSectionName())

in ELFObjectWriter which causes us to use the correct section symbol even if
we have multiple sections with the same name.

Original messages:

r219829:
Correctly handle references to section symbols.

When processing assembly like

.long .text

we were creating a new undefined symbol .text. GAS on the other hand would
handle that as a reference to the .text section.

This patch implements that by creating the section symbols earlier so that
they are visible during asm parsing.

The patch also updates llvm-readobj to print the symbol number in the relocation
dump so that the test can differentiate between two sections with the same name.

r219835:
Allow forward references to section symbols.

llvm-svn: 220021

10 years agoPR21215: Support -fmodule-map-file being specified multiple times. Support
Richard Smith [Fri, 17 Oct 2014 01:42:53 +0000 (01:42 +0000)]
PR21215: Support -fmodule-map-file being specified multiple times. Support
loading multiple module map files from the same directory.

llvm-svn: 220020

10 years ago[PPC] Adjust some PowerPC tests to account for presence/absence of VSX
Bill Schmidt [Fri, 17 Oct 2014 01:41:22 +0000 (01:41 +0000)]
[PPC] Adjust some PowerPC tests to account for presence/absence of VSX

Patch by Bill Seurer; committed on his behalf.

These test cases generate slightly different code sequences when VSX
is activated and thus fail. The update turns off VSX explicitly for
the existing checks and then adds a second set of checks for most of
them that test the VSX instruction output.

llvm-svn: 220019

10 years agoRemove always-true part of a conditional expression.
Jason Molenda [Fri, 17 Oct 2014 01:38:10 +0000 (01:38 +0000)]
Remove always-true part of a conditional expression.
clang warning.

llvm-svn: 220018

10 years agoPut #if 0 blocks around three sections of code that are intentionally
Jason Molenda [Fri, 17 Oct 2014 01:36:20 +0000 (01:36 +0000)]
Put #if 0 blocks around three sections of code that are intentionally
unreachable so we don't get warnings about them.

Completely initialize a structure instead of leaving some of its fields
potentially indeterminate (although in reality they would all be set
before use -- but the compiler warning doesn't know that).

clang warning.

llvm-svn: 220017

10 years agoAdd a test that would have found the bug in r219829.
Rafael Espindola [Fri, 17 Oct 2014 01:34:23 +0000 (01:34 +0000)]
Add a test that would have found the bug in r219829.

llvm-svn: 220016

10 years agoARM: Fix a bug which was causing convergence failure in constant-island pass.
Akira Hatanaka [Fri, 17 Oct 2014 01:31:47 +0000 (01:31 +0000)]
ARM: Fix a bug which was causing convergence failure in constant-island pass.

The bug is in ARMConstantIslands::createNewWater where the upper bound of the
new water split point is computed:

// This could point off the end of the block if we've already got constant
// pool entries following this block; only the last one is in the water list.
// Back past any possible branches (allow for a conditional and a maximally
// long unconditional).
if (BaseInsertOffset + 8 >= UserBBI.postOffset()) {
  BaseInsertOffset = UserBBI.postOffset() - UPad - 8;
  DEBUG(dbgs() << format("Move inside block: %#x\n", BaseInsertOffset));
}

The split point is supposed to be somewhere between the machine instruction that
loads from the constant pool entry and the end of the basic block, before branch
instructions. The code above is fine if the basic block is large enough and
there are a sufficient number of instructions following the machine instruction.
However, if the machine instruction is near the end of the basic block,
BaseInsertOffset can point to the machine instruction or another instruction
that precedes it, and this can lead to convergence failure.

This commit fixes this bug by ensuring BaseInsertOffset is larger than the
offset of the instruction following the constant-loading instruction.

rdar://problem/18581150

llvm-svn: 220015

10 years agoSwitch to range-based for loop. No functionality change.
Richard Smith [Fri, 17 Oct 2014 01:26:52 +0000 (01:26 +0000)]
Switch to range-based for loop. No functionality change.

llvm-svn: 220014

10 years ago[asan] the run-time part of intra-object-overflow detector (-fsanitize-address-field...
Kostya Serebryany [Fri, 17 Oct 2014 01:22:37 +0000 (01:22 +0000)]
[asan] the run-time part of intra-object-overflow detector (-fsanitize-address-field-padding=1). Note that all of this is still experimental; don't use unless you are brave.

llvm-svn: 220013