platform/upstream/llvm.git
9 years ago[Msan] Fix the accept unit test to pass on FreeBSD
Viktor Kutuzov [Wed, 21 Jan 2015 09:46:21 +0000 (09:46 +0000)]
[Msan] Fix the accept unit test to pass on FreeBSD
Differential Revision: http://reviews.llvm.org/D7083

llvm-svn: 226650

9 years ago[Sanitizers] Intercept confstr() on FreeBSD
Viktor Kutuzov [Wed, 21 Jan 2015 08:56:40 +0000 (08:56 +0000)]
[Sanitizers] Intercept confstr() on FreeBSD
Committed unreviewed with permission.

llvm-svn: 226649

9 years ago[Sanitizers] Intercept opendir()
Viktor Kutuzov [Wed, 21 Jan 2015 08:54:01 +0000 (08:54 +0000)]
[Sanitizers] Intercept opendir()
Differential Revision: http://reviews.llvm.org/D6968

llvm-svn: 226648

9 years ago[x86] Remove some unnecessary and slightly confusing typecasts from some patterns...
Craig Topper [Wed, 21 Jan 2015 08:43:57 +0000 (08:43 +0000)]
[x86] Remove some unnecessary and slightly confusing typecasts from some patterns. I think it actually went i32->iPtr->i32 in some of these cases.

llvm-svn: 226647

9 years ago[X86] Convert all the i8imm used by AVX512 and MMX instructions to u8imm.
Craig Topper [Wed, 21 Jan 2015 08:43:49 +0000 (08:43 +0000)]
[X86] Convert all the i8imm used by AVX512 and MMX instructions to u8imm.

llvm-svn: 226646

9 years ago[X86] Convert all the i8imm used by SSE and AVX instructions to u8imm.
Craig Topper [Wed, 21 Jan 2015 08:15:54 +0000 (08:15 +0000)]
[X86] Convert all the i8imm used by SSE and AVX instructions to u8imm.

This makes the assembler check their size and removes a hack from the disassembler to avoid sign extending the immediate.

llvm-svn: 226645

9 years agotsan: don't unroll memory access loop in debug mode
Dmitry Vyukov [Wed, 21 Jan 2015 08:09:13 +0000 (08:09 +0000)]
tsan: don't unroll memory access loop in debug mode

MemoryAccess function consumes ~4K of stack in debug mode,
in significant part due to the unrolled loop.
And gtest gives only 4K of stack to death test
threads, which causes stack overflows in debug mode.

llvm-svn: 226644

9 years ago[ELF] Minimal implementation for ARM static linking
Greg Fitzgerald [Wed, 21 Jan 2015 07:35:48 +0000 (07:35 +0000)]
[ELF] Minimal implementation for ARM static linking

The code is able to statically link the simplest case of:

  int main() { return 0; }

* Only works with ARM code - no Thumb code, no interwork (-marm -mno-thumb-interwork)
* musl libc built with no interwork and no Thumb code

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

From: Denis Protivensky <dprotivensky@accesssoftek.com>
llvm-svn: 226643

9 years ago[x86] Add assembly parser bounds checking to the immediate value for cmpss/cmpsd...
Craig Topper [Wed, 21 Jan 2015 06:07:53 +0000 (06:07 +0000)]
[x86] Add assembly parser bounds checking to the immediate value for cmpss/cmpsd/cmpps/cmppd.

llvm-svn: 226642

9 years agotuple: Make operator<() linear instead of exponential
Duncan P. N. Exon Smith [Wed, 21 Jan 2015 02:51:17 +0000 (02:51 +0000)]
tuple: Make operator<() linear instead of exponential

Patch by Matthew Dempsky!

llvm-svn: 226641

9 years ago[PM] Replace an abuse of inheritance to override a single function with
Chandler Carruth [Wed, 21 Jan 2015 02:11:59 +0000 (02:11 +0000)]
[PM] Replace an abuse of inheritance to override a single function with
a more direct approach: a type-erased glorified function pointer. Now we
can pass a function pointer into this for the easy case and we can even
pass a lambda into it in the interesting case in the instruction
combiner.

I'll be using this shortly to simplify the interfaces to InstCombiner,
but this helps pave the way and seems like a better design for the
libcall simplifier utility.

llvm-svn: 226640

9 years ago[sanitizer] First step toward supporting 42-bit AS on aarch64
Kostya Serebryany [Wed, 21 Jan 2015 02:11:05 +0000 (02:11 +0000)]
[sanitizer] First step toward supporting 42-bit AS on aarch64

aarch64-linux kernel has configurable 39, 42 or 47 bit virtual address
space.  Most distros AFAIK use 42-bit VA right now, but there are also
39-bit VA users too.  The ppc64 handling can be used for this just fine
and support all the 3 sizes.

There are other issues, like allocator32 not really being able to support
the larger addres spaces, and hardcoded 39-bit address space size in other
macros.

Patch by Jakub Jelinek.

llvm-svn: 226639

9 years agoMuch spelling. Wow.
Nico Weber [Wed, 21 Jan 2015 02:09:16 +0000 (02:09 +0000)]
Much spelling. Wow.

llvm-svn: 226638

9 years ago[sanitizer] Fix aarch64 sanitizer build with recent glibc
Kostya Serebryany [Wed, 21 Jan 2015 02:08:42 +0000 (02:08 +0000)]
[sanitizer] Fix aarch64 sanitizer build with recent glibc

glibc recently changed ABI on aarch64-linux:
https://sourceware.org/git/?p=glibc.git;a=commit;h=5c40c3bab2fddaca8cfe12d75944d1fef8adf1a4
Instead of having unsigned short mode; unsigned short __pad1; it now has
unsigned int mode; field in ipc_perm structure.

This patch allows to build against the recent glibc and disables the
ipc_perm.mode verification for older versions of glibc.

I think it shouldn't be a big deal even for older glibcs, I couldn't find
any place which would actually care about the exact mode field, rather than
the whole structure, appart from the CHECK_SIZE_AND_OFFSET macro.

Patch by Jakub Jelinek

llvm-svn: 226637

9 years ago[asan] use MADV_NOHUGEPAGE for shadow to reduce the actual memory usage
Kostya Serebryany [Wed, 21 Jan 2015 02:05:31 +0000 (02:05 +0000)]
[asan] use MADV_NOHUGEPAGE for shadow to reduce the actual memory usage

llvm-svn: 226636

9 years agoAllow individual ValueObjects to pick their preferred display language
Enrico Granata [Wed, 21 Jan 2015 01:47:13 +0000 (01:47 +0000)]
Allow individual ValueObjects to pick their preferred display language

Most of the time, we can use context information just fine to choose a language (i.e. the language of the frame that the root object was defined in, if any); but in some cases, synthetic children may be fabricated as root frame-less entities, and then we wouldn't know any better

This patch allows (internal) synthetic child providers to set a display language on the children they generate, should they so choose

llvm-svn: 226634

9 years agoRevert "Sema: err_after_alias is unreachable, remove it"
David Majnemer [Wed, 21 Jan 2015 01:30:40 +0000 (01:30 +0000)]
Revert "Sema: err_after_alias is unreachable, remove it"

This reverts commit r226626.  err_after_alias is, in fact, reachable.

llvm-svn: 226633

9 years agoFix --start-group/end-group.
Rui Ueyama [Wed, 21 Jan 2015 01:26:43 +0000 (01:26 +0000)]
Fix --start-group/end-group.

We used to manage the state whether we are in a group or not
using a counter. The counter is incremented by one if we jump from
end-group to start-group, and decremented by one if we don't.
The counter was assumed to be either zero or one, but obviously it
could be negative (if there's a group which is not repeated at all).
This is a fix for that issue.

llvm-svn: 226632

9 years agoAdding compact unwind as a source of unwind information
Jason Molenda [Wed, 21 Jan 2015 01:26:28 +0000 (01:26 +0000)]
Adding compact unwind as a source of unwind information
introduced subtle bugs in two places in
RegisterContextLLDB::GetFullUnwindPlanForFrame where
it specifically wanted to get an eh_frame unwind plan
and was using "Get CallSite UnwindPlan" as synonymous
with that.  But now we have two different types of
unwind plan that can be returned in that case, and
compact unwind won't behaves as needed.

<rdar://problem/19528559>

llvm-svn: 226631

9 years agoMS ABI: Virtual member pointer thunks should be in COMDAT groups
David Majnemer [Wed, 21 Jan 2015 01:21:31 +0000 (01:21 +0000)]
MS ABI: Virtual member pointer thunks should be in COMDAT groups

They can be emitted by multiple translation units and thus belong in a
COMDAT group.

llvm-svn: 226630

9 years agoMS ABI: Let guard variables be present in COMDATs
David Majnemer [Wed, 21 Jan 2015 01:04:30 +0000 (01:04 +0000)]
MS ABI: Let guard variables be present in COMDATs

A guard variable in a COMDAT'd function should also be in a COMDAT.

llvm-svn: 226629

9 years agoCodeGen: Compiler generated __declspec(uuid) objects should be COMDAT'd
David Majnemer [Wed, 21 Jan 2015 01:04:28 +0000 (01:04 +0000)]
CodeGen: Compiler generated __declspec(uuid) objects should be COMDAT'd

llvm-svn: 226628

9 years agoMake DIExpression::Verify() stricter by checking that the number of
Adrian Prantl [Wed, 21 Jan 2015 00:59:20 +0000 (00:59 +0000)]
Make DIExpression::Verify() stricter by checking that the number of
elements and the ordering is sane and cleanup the accessors.

llvm-svn: 226627

9 years agoSema: err_after_alias is unreachable, remove it
David Majnemer [Wed, 21 Jan 2015 00:52:17 +0000 (00:52 +0000)]
Sema: err_after_alias is unreachable, remove it

Examples this would have catched are now handled by the attribute
verification code.

llvm-svn: 226626

9 years agoFix some platform specific paths in TestSettings.py.
Zachary Turner [Wed, 21 Jan 2015 00:40:27 +0000 (00:40 +0000)]
Fix some platform specific paths in TestSettings.py.

We were referring to hardcoded paths /bin/ls and /bin/cat.  For
the purposes of this test, the actual value it's set to doesn't
matter, and it might as well be a non-existent path.  All that
matters is that the before and after values have to match, and
that trailing whitespace is stripped.  On Windows FileSpec
(correctly) converts /bin/ls to D:\bin\ls though, so the before
and after values won't match.  So this patch just correctly builds
up a valid path in a platform-agnostic manner, and verifies that
it matches before and after the set.

llvm-svn: 226625

9 years agoCorrect all typos in the initialization arguments, even if one could not
Kaelyn Takata [Wed, 21 Jan 2015 00:04:19 +0000 (00:04 +0000)]
Correct all typos in the initialization arguments, even if one could not
be corrected.

This fixes PR22250, which exposed the bug where if there's more than one
TypoExpr in the arguments, once one failed to be corrected none of the
TypoExprs after it would be handled at all thanks to an early return.

llvm-svn: 226624

9 years ago[X86][AVX] Simplified diff between AVX1 and SSE42 fp stack folding tests. NFC.
Simon Pilgrim [Wed, 21 Jan 2015 00:02:13 +0000 (00:02 +0000)]
[X86][AVX] Simplified diff between AVX1 and SSE42 fp stack folding tests. NFC.

Changed the AVX1 tests register spill tail call to return a xmm like the SSE42 version - makes doing diffs between them a lot easier without affecting the spills themselves.

llvm-svn: 226623

9 years ago[X86][SSE] Added SSE/AVX1 integer stack folding tests.
Simon Pilgrim [Tue, 20 Jan 2015 23:54:17 +0000 (23:54 +0000)]
[X86][SSE] Added SSE/AVX1 integer stack folding tests.

Some folding patterns + tests are missing (marked as TODO) - these will be added in a future patch for review.

llvm-svn: 226622

9 years ago[X86][SSE] Added SSE fp stack folding tests.
Simon Pilgrim [Tue, 20 Jan 2015 23:50:18 +0000 (23:50 +0000)]
[X86][SSE] Added SSE fp stack folding tests.

Some folding patterns + tests are missing (marked as TODO) - these will be added in a future patch for review.

llvm-svn: 226621

9 years ago[X86][AVX] Renamed AVX1 fp stack folding tests. NFC.
Simon Pilgrim [Tue, 20 Jan 2015 23:45:50 +0000 (23:45 +0000)]
[X86][AVX] Renamed AVX1 fp stack folding tests. NFC.

The SSE42 version of the AVX1 float stack folding tests will be added shortly, this renames the AVX1 file so that the files will be near each other in a directory listing to help ensure they are kept in sync.

llvm-svn: 226620

9 years ago[PM] Separate the InstCombiner from its pass.
Chandler Carruth [Tue, 20 Jan 2015 22:44:35 +0000 (22:44 +0000)]
[PM] Separate the InstCombiner from its pass.

This creates a small internal pass which runs the InstCombiner over
a function. This is the hard part of porting InstCombine to the new pass
manager, as at this point none of the code in InstCombine has access to
a Pass object any longer.

The resulting interface for the InstCombiner is pretty terrible. I'm not
planning on leaving it that way. The key thing missing is that we need
to separate the worklist from the combiner a touch more. Once that's
done, it should be possible for *any* part of LLVM to just create
a worklist with instructions, populate it, and then combine it until
empty. The pass will just be the (obvious and important) special case of
doing that for an entire function body.

For now, this is the first increment of factoring to make all of this
work.

llvm-svn: 226618

9 years agoAdd missing case statement to quiet a compiler warning.
Greg Clayton [Tue, 20 Jan 2015 22:41:14 +0000 (22:41 +0000)]
Add missing case statement to quiet a compiler warning.

llvm-svn: 226617

9 years agoDebugLocs without a scope should fail the verification.
Adrian Prantl [Tue, 20 Jan 2015 22:37:25 +0000 (22:37 +0000)]
DebugLocs without a scope should fail the verification.
Follow-up to r226588.

llvm-svn: 226616

9 years agoOnly use -target flag when target_triple is manually specified
Eric Fiselier [Tue, 20 Jan 2015 22:37:25 +0000 (22:37 +0000)]
Only use -target flag when target_triple is manually specified

llvm-svn: 226615

9 years agoXFAIL pexpect tests on Windows.
Zachary Turner [Tue, 20 Jan 2015 22:36:03 +0000 (22:36 +0000)]
XFAIL pexpect tests on Windows.

At some point we will need to either provide a pexpect equivalent
on Windows, or provide some other method of doing out-of-process
tests.

Even with a pexpect replacement, it may be worth re-evaluating
some of these tests to see if they would be better served as
in-process tests.  The larger issue of coming up with a pexpect
replacement on Windows is tracked in http://llvm.org/pr22274.

llvm-svn: 226614

9 years agoDon't pass -Wl,z,defs for now.
Rafael Espindola [Tue, 20 Jan 2015 22:08:20 +0000 (22:08 +0000)]
Don't pass -Wl,z,defs for now.

It broke the msan build.

llvm-svn: 226613

9 years agoFor llvm-objdump, hook up existing options to work when using -macho (the Mach-O...
Kevin Enderby [Tue, 20 Jan 2015 21:47:46 +0000 (21:47 +0000)]
For llvm-objdump, hook up existing options to work when using -macho (the Mach-O parser).

llvm-svn: 226612

9 years agoUse -Wl,defs when linking.
Rafael Espindola [Tue, 20 Jan 2015 21:23:15 +0000 (21:23 +0000)]
Use -Wl,defs when linking.

ELF linkers by default allow shared libraries to contain undefined references
and it is up to the dynamic linker to look for them.

On COFF and MachO, that is not the case.

This creates a situation where a .so might build on an ELF system, but the build
of the corresponding .dylib or .dll will fail.

This patch changes the cmake build to use -Wl,-z,defs when linking and updates
the dependencies so that -DBUILD_SHARED_LIBS=ON build still works.

llvm-svn: 226611

9 years ago[PM] Reformat this code with clang-format so that subsequent changes
Chandler Carruth [Tue, 20 Jan 2015 21:10:35 +0000 (21:10 +0000)]
[PM] Reformat this code with clang-format so that subsequent changes
don't get muddied up by formatting changes.

Some of these don't really seem like improvements to me, but they also
don't seem any worse and I care much more about not formatting them
manually than I do about the particular formatting. =]

llvm-svn: 226610

9 years agoLink libclang with dl if available.
Rafael Espindola [Tue, 20 Jan 2015 21:10:35 +0000 (21:10 +0000)]
Link libclang with dl if available.

This is in preparation for changing the link to use -Wl,-z,defs.

llvm-svn: 226609

9 years agoRemove unused function:
Greg Clayton [Tue, 20 Jan 2015 21:05:21 +0000 (21:05 +0000)]
Remove unused function:

lldb::pid_t
Host::LaunchApplication (const FileSpec &app_file_spec);

This had use of a function FSPathMakeRef(const UInt8*, FSRef *, ...) that was deprecated in 10.8.

Removing this fucntion since it wasn't used and was causing warnings.

llvm-svn: 226608

9 years agoUpdate the deployment target on MacOSX to be 10.8. The change is mainly to get the...
Greg Clayton [Tue, 20 Jan 2015 20:45:49 +0000 (20:45 +0000)]
Update the deployment target on MacOSX to be 10.8. The change is mainly to get the REG_ENHANCED stuff in regex.h and shouldn't affect other targets.

llvm-svn: 226607

9 years ago[Hexagon] Adding intrinsics for doubleword ALU operations.
Colin LeMahieu [Tue, 20 Jan 2015 20:45:05 +0000 (20:45 +0000)]
[Hexagon] Adding intrinsics for doubleword ALU operations.

llvm-svn: 226606

9 years agoFix crashes on missing @interface for category
Ben Langmuir [Tue, 20 Jan 2015 20:41:36 +0000 (20:41 +0000)]
Fix crashes on missing @interface for category

In a few places we didn't check that Category->getClassInterface() was
not null before using it.

llvm-svn: 226605

9 years agoAdd the test that was supposed to be included with r223162.
Kaelyn Takata [Tue, 20 Jan 2015 20:15:29 +0000 (20:15 +0000)]
Add the test that was supposed to be included with r223162.

The test case is based on the reduction from PR21679 and has to be
freestanding to work correctly, since some of the expected errors (and
some of the problems that were fixed) only occur when the end of the
file is reached.

llvm-svn: 226603

9 years ago[Hexagon] Removing unnecessary clutter in intrinsic tests.
Colin LeMahieu [Tue, 20 Jan 2015 19:46:07 +0000 (19:46 +0000)]
[Hexagon] Removing unnecessary clutter in intrinsic tests.

llvm-svn: 226602

9 years agoImplement command line options for stack probe space
Hans Wennborg [Tue, 20 Jan 2015 19:45:50 +0000 (19:45 +0000)]
Implement command line options for stack probe space

This code adds the -mstack-probe-size command line option and implements the /Gs
compiler switch for clang-cl.

This should fix http://llvm.org/bugs/show_bug.cgi?id=21896

Patch by Andrew H!

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

llvm-svn: 226601

9 years agoPrevent binary-tree deterioration in sparse switch statements.
Daniel Jasper [Tue, 20 Jan 2015 19:43:33 +0000 (19:43 +0000)]
Prevent binary-tree deterioration in sparse switch statements.

This addresses part of llvm.org/PR22262. Specifically, it prevents
considering the densities of sub-ranges that have fewer than
TLI.getMinimumJumpTableEntries() elements. Those densities won't help
jump tables.

This is not a complete solution but works around the most pressing
issue.

Review: http://reviews.llvm.org/D7070
llvm-svn: 226600

9 years ago[GC] Verify-pass void vararg functions in gc.statepoint
Ramkumar Ramachandra [Tue, 20 Jan 2015 19:42:46 +0000 (19:42 +0000)]
[GC] Verify-pass void vararg functions in gc.statepoint

With the appropriate Verifier changes, exactracting the result out of a
statepoint wrapping a vararg function crashes. However, a void vararg
function works fine: commit this first step.

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

llvm-svn: 226599

9 years agoReapply: Teach SROA how to update debug info for fragmented variables.
Adrian Prantl [Tue, 20 Jan 2015 19:42:22 +0000 (19:42 +0000)]
Reapply: Teach SROA how to update debug info for fragmented variables.
This reapplies r225379.

ChangeLog:
- The assertion that this commit previously ran into about the inability
  to handle indirect variables has since been removed and the backend
  can handle this now.
- Testcases were upgrade to the new MDLocation format.
- Instead of keeping a DebugDeclares map, we now use
  llvm::FindAllocaDbgDeclare().

Original commit message follows.

Debug info: Teach SROA how to update debug info for fragmented variables.
This allows us to generate debug info for extremely advanced code such as

 typedef struct { long int a; int b;} S;

 int foo(S s) {
   return s.b;
 }

which at -O1 on x86_64 is codegen'd into

 define i32 @foo(i64 %s.coerce0, i32 %s.coerce1) #0 {
   ret i32 %s.coerce1, !dbg !24
 }

with this patch we emit the following debug info for this

 TAG_formal_parameter [3]
   AT_location( 0x00000000
                0x0000000000000000 - 0x0000000000000006: rdi, piece 0x00000008, rsi, piece 0x00000004
                0x0000000000000006 - 0x0000000000000008: rdi, piece 0x00000008, rax, piece 0x00000004 )
                AT_name( "s" )
                AT_decl_file( "/Volumes/Data/llvm/_build.ninja.release/test.c" )

Thanks to chandlerc, dblaikie, and echristo for their feedback on all
previous iterations of this patch!

llvm-svn: 226598

9 years agoR600/SI: Add subtarget feature to enable VGPR spilling for all shader types
Tom Stellard [Tue, 20 Jan 2015 19:33:04 +0000 (19:33 +0000)]
R600/SI: Add subtarget feature to enable VGPR spilling for all shader types

This is disabled by default, but can be enabled with the subtarget
feature: 'vgpr-spilling'

llvm-svn: 226597

9 years agoR600/SI: Fix simple-loop.ll test
Tom Stellard [Tue, 20 Jan 2015 19:33:02 +0000 (19:33 +0000)]
R600/SI: Fix simple-loop.ll test

llvm-svn: 226596

9 years agoReverted revision 226577.
Jozef Kolek [Tue, 20 Jan 2015 19:29:28 +0000 (19:29 +0000)]
Reverted revision 226577.

llvm-svn: 226595

9 years ago[PM] Clean up a bunch of the doxygen / API docs on the InstCombiner pass
Chandler Carruth [Tue, 20 Jan 2015 19:27:58 +0000 (19:27 +0000)]
[PM] Clean up a bunch of the doxygen / API docs on the InstCombiner pass
prior to refactoring it.

llvm-svn: 226594

9 years ago[llvm link] Destroy ConstantArrays in LLVMContext if they are not used.
Manman Ren [Tue, 20 Jan 2015 19:24:59 +0000 (19:24 +0000)]
[llvm link] Destroy ConstantArrays in LLVMContext if they are not used.

ConstantArrays constructed during linking can cause quadratic memory
explosion. An example is the ConstantArrays constructed when linking in
GlobalVariables with appending linkage.

Releasing all unused constants can cause a 20% LTO compile-time
slowdown for a large application. So this commit releases unused ConstantArrays
only.

rdar://19040716. It reduces memory footprint from 20+G to 6+G.

llvm-svn: 226592

9 years agoR600/SI: Remove stray debugging code from r226586
Tom Stellard [Tue, 20 Jan 2015 19:24:31 +0000 (19:24 +0000)]
R600/SI: Remove stray debugging code from r226586

llvm-svn: 226591

9 years agoDisable C4062 on Windows.
Zachary Turner [Tue, 20 Jan 2015 19:23:44 +0000 (19:23 +0000)]
Disable C4062 on Windows.

The use of std::future introduces an implicit dependency on the PPL
subcomponent of ConcRT.  ConcRT in general is pretty noisy with
warnings, so this patch just disables one of the noisy warnings.

llvm-svn: 226590

9 years ago[PM] Don't spend time making self moves no-ops. They're allowed to leave
Chandler Carruth [Tue, 20 Jan 2015 18:54:16 +0000 (18:54 +0000)]
[PM] Don't spend time making self moves no-ops. They're allowed to leave
the object in a moved-from state, and its simpler to write the code that
way.

llvm-svn: 226589

9 years agoAdd an assertion and prefer a crash over an infinite loop.
Adrian Prantl [Tue, 20 Jan 2015 18:03:37 +0000 (18:03 +0000)]
Add an assertion and prefer a crash over an infinite loop.

llvm-svn: 226588

9 years agoDon't remove backslashes from arguments unless the following char is recognized.
Zachary Turner [Tue, 20 Jan 2015 17:53:36 +0000 (17:53 +0000)]
Don't remove backslashes from arguments unless the following char is recognized.

This fixes file paths on Windows, as you can now write, for example,
file d:\foo\bar.txt, but does not break the case that this tokenization
logic was originally designed for, which is to allow escaping of things
like quotes and double quotes, so that all of the escapable characters
can appear in the same string together.

Reviewed by: Jim Ingham, Greg Clayton
Differential Revision: http://reviews.llvm.org/D7018

llvm-svn: 226587

9 years agoR600/SI: Use external symbols for scratch buffer
Tom Stellard [Tue, 20 Jan 2015 17:49:47 +0000 (17:49 +0000)]
R600/SI: Use external symbols for scratch buffer

We were passing the scratch buffer address to the shaders via user sgprs,
but now we use external symbols and have the driver patch the shader
using reloc information.

llvm-svn: 226586

9 years agoR600/SI: Add kill flag when copying scratch offset to a register
Tom Stellard [Tue, 20 Jan 2015 17:49:45 +0000 (17:49 +0000)]
R600/SI: Add kill flag when copying scratch offset to a register

This allows us to re-use the same register for the scratch offset
when accessing large private arrays.

llvm-svn: 226585

9 years agoR600/SI: Don't store scratch buffer frame index in MUBUF offset field
Tom Stellard [Tue, 20 Jan 2015 17:49:43 +0000 (17:49 +0000)]
R600/SI: Don't store scratch buffer frame index in MUBUF offset field

We don't have a good way of legalizing this if the frame index offset
is more than the 12-bits, which is size of MUBUF's offset field, so
now we store the frame index in the vaddr field.

llvm-svn: 226584

9 years agoR600/SI: Update SIInstrInfo:verifyInstruction() after r225662
Tom Stellard [Tue, 20 Jan 2015 17:49:41 +0000 (17:49 +0000)]
R600/SI: Update SIInstrInfo:verifyInstruction() after r225662

Now that we have our own custom register operand types, we need
to handle them in the verifiier.

llvm-svn: 226583

9 years agoSilencing a -Wunused-variable warning in non-asserts builds; NFC.
Aaron Ballman [Tue, 20 Jan 2015 17:10:45 +0000 (17:10 +0000)]
Silencing a -Wunused-variable warning in non-asserts builds; NFC.

llvm-svn: 226581

9 years agoFix use after free.
Rafael Espindola [Tue, 20 Jan 2015 17:08:27 +0000 (17:08 +0000)]
Fix use after free.

This fixes running a few tests (including test/elf/Mips/e-flags-merge-1.test)
under asan.

llvm-svn: 226580

9 years agoRevert "IR: Specify underlying type instead of r226570, NFC"
Duncan P. N. Exon Smith [Tue, 20 Jan 2015 17:04:56 +0000 (17:04 +0000)]
Revert "IR: Specify underlying type instead of r226570, NFC"

This reverts commit r226571.  GCC really doesn't like it [1].

[1]: http://bb.pgr.jp/builders/cmake-llvm-x86_64-linux/builds/20260

llvm-svn: 226579

9 years agoPatch fixes PR21932 crash on invalid code. Using
Fariborz Jahanian [Tue, 20 Jan 2015 16:53:34 +0000 (16:53 +0000)]
Patch fixes PR21932 crash on invalid code. Using
property-dot syntax on 'super' with no super
class. Patch by Jason Haslam.

llvm-svn: 226578

9 years ago[mips][microMIPS] MicroMIPS 16-bit unconditional branch instruction B
Jozef Kolek [Tue, 20 Jan 2015 16:45:27 +0000 (16:45 +0000)]
[mips][microMIPS] MicroMIPS 16-bit unconditional branch instruction B

Implement microMIPS 16-bit unconditional branch instruction B.

Implemented 16-bit microMIPS unconditional instruction has real name B16, and
B is an alias which expands to either B16 or BEQ according to the rules:
b 256 --> b16 256 # R_MICROMIPS_PC10_S1
b 12256 --> beq $zero, $zero, 12256 # R_MICROMIPS_PC16_S1
b label --> beq $zero, $zero, label # R_MICROMIPS_PC16_S1

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

llvm-svn: 226577

9 years agoPrint compiler path during configuration and pass more flags to the linker
Eric Fiselier [Tue, 20 Jan 2015 16:26:48 +0000 (16:26 +0000)]
Print compiler path during configuration and pass more flags to the linker

llvm-svn: 226576

9 years agoAddress danalbert's post-commit review comments on D7019 and small fixes.
Eric Fiselier [Tue, 20 Jan 2015 16:14:18 +0000 (16:14 +0000)]
Address danalbert's post-commit review comments on D7019 and small fixes.

This patch addresses some comments on http://reviews.llvm.org/D7019.

- Move compiler.py to test/libcxx from test/libcxx/test.
- Make CXXCompiler.target None by default.
- Use `{}` instead of `dict()` to initialize an empty dict.
- Pass the -fsanitize options to both the compile and link commands.

llvm-svn: 226575

9 years ago[mips] Add registers and ALL check prefix to octeon test case.
Kai Nacke [Tue, 20 Jan 2015 16:14:02 +0000 (16:14 +0000)]
[mips] Add registers and ALL check prefix to octeon test case.

No functional change.

Reviewed by D. Sanders

llvm-svn: 226574

9 years ago[mips] Add octeon branch instructions bbit0/bbit032/bbit1/bbit132
Kai Nacke [Tue, 20 Jan 2015 16:10:51 +0000 (16:10 +0000)]
[mips] Add octeon branch instructions bbit0/bbit032/bbit1/bbit132

This commits adds the octeon branch instructions bbit0/bbit032/bbit1/bbit132.
It also includes patterns for instruction selection and test cases.

Reviewed by D. Sanders

llvm-svn: 226573

9 years agoELF: Handle sh_addralign being set to zero
Will Newton [Tue, 20 Jan 2015 16:10:04 +0000 (16:10 +0000)]
ELF: Handle sh_addralign being set to zero

sh_addralign of zero is equivalent to sh_addralign of one, meaning
no alignment specified. Avoid calculating Log2 or modulus when
sh_addralign is zero as the results will not be useful.

llvm-svn: 226572

9 years agoIR: Specify underlying type instead of r226570, NFC
Duncan P. N. Exon Smith [Tue, 20 Jan 2015 16:03:09 +0000 (16:03 +0000)]
IR: Specify underlying type instead of r226570, NFC

llvm-svn: 226571

9 years agoIR: Store StorageType as an unsigned bitfield
Duncan P. N. Exon Smith [Tue, 20 Jan 2015 15:51:14 +0000 (15:51 +0000)]
IR: Store StorageType as an unsigned bitfield

Use `unsigned` instead of `StorageType` for the bitfield to prevent MSVC
from treating the top bit of the bitfield as a sign bit.

llvm-svn: 226570

9 years ago[msan] Optimize -msan-check-constant-shadow.
Evgeniy Stepanov [Tue, 20 Jan 2015 15:21:35 +0000 (15:21 +0000)]
[msan] Optimize -msan-check-constant-shadow.

The new code does not create new basic blocks in the case when shadow is a
compile-time constant; it generates either an unconditional __msan_warning
call or nothing instead.

llvm-svn: 226569

9 years agoFix help test cases after r226068
Ed Maste [Tue, 20 Jan 2015 15:13:01 +0000 (15:13 +0000)]
Fix help test cases after r226068

From: Ilia K <ki.stfu@gmail.com>
Differential Revision: http://reviews.llvm.org/D7066

llvm-svn: 226568

9 years ago[MIPS64] Make __clear_cache more optimal
Petar Jovanovic [Tue, 20 Jan 2015 15:04:19 +0000 (15:04 +0000)]
[MIPS64] Make __clear_cache more optimal

Use synci implementation of clear_cache for short address ranges.
For long address ranges, make a kernel call.

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

llvm-svn: 226567

9 years ago[asan] Allow changing verbosity in activation flags.
Evgeniy Stepanov [Tue, 20 Jan 2015 13:21:20 +0000 (13:21 +0000)]
[asan] Allow changing verbosity in activation flags.

This change removes some debug output in asan_flags.cc that
was reading the verbosity level before all the flags were parsed.

llvm-svn: 226566

9 years ago[MSan][LLVM][MIPS] Shadow and Origin offsets for MIPS
Mohit K. Bhakkad [Tue, 20 Jan 2015 13:05:42 +0000 (13:05 +0000)]
[MSan][LLVM][MIPS] Shadow and Origin offsets for MIPS

Reviewers: kcc, samsonov, petarj, eugenis

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

llvm-svn: 226565

9 years agoclang-format: Fix AlwaysBreakBeforeMultilineStrings with ColumnLimit=0
Daniel Jasper [Tue, 20 Jan 2015 12:59:20 +0000 (12:59 +0000)]
clang-format: Fix AlwaysBreakBeforeMultilineStrings with ColumnLimit=0

Before:
  const char *x =
      "hello llvm";

After:
  const char *x = "hello llvm";

This fixes llvm.org/PR22245.
Patch by Bill Meltsner, thank you!

llvm-svn: 226564

9 years ago[asan] Warn if unsupported flags are used at activation.
Evgeniy Stepanov [Tue, 20 Jan 2015 12:19:14 +0000 (12:19 +0000)]
[asan] Warn if unsupported flags are used at activation.

llvm-svn: 226563

9 years ago[x86] Add some mayLoad/hasSideEffects flags. Remove one that was already covered...
Craig Topper [Tue, 20 Jan 2015 12:15:30 +0000 (12:15 +0000)]
[x86] Add some mayLoad/hasSideEffects flags. Remove one that was already covered by a pattern.

llvm-svn: 226562

9 years agoRe-apply "r226548 - Introduce SPIR calling conventions" reverted in r226558.
Alexander Kornienko [Tue, 20 Jan 2015 11:20:41 +0000 (11:20 +0000)]
Re-apply "r226548 - Introduce SPIR calling conventions" reverted in r226558.

The test was fixed after a discussion with the revision author: the check
pattern was made more flexible as the "%call" part is not what we actually want
to check strictly there.

The original patch description:
===
Introduce SPIR calling conventions.

This implements Section 3.7 from the SPIR 1.2 spec:

    SPIR kernels should use "spir_kernel" calling convention.
    Non-kernel functions use "spir_func" calling convention. All
    other calling conventions are disallowed.

The patch works only for OpenCL source. Any other uses will need
to ensure that kernels are assigned the spir_kernel calling
convention correctly.
===

llvm-svn: 226561

9 years ago[PM] Port LoopInfo to the new pass manager, adding both a LoopAnalysis
Chandler Carruth [Tue, 20 Jan 2015 10:58:50 +0000 (10:58 +0000)]
[PM] Port LoopInfo to the new pass manager, adding both a LoopAnalysis
pass and a LoopPrinterPass with the expected associated wiring.

I've added a RUN line to the only test case (!!!) we have that actually
prints loops. Everything seems to be working.

This is somewhat exciting as this is the first analysis using another
analysis to go in for the new pass manager. =D I also believe it is the
last analysis necessary for porting instcombine, but of course I may yet
discover more.

llvm-svn: 226560

9 years ago[PM] Make the LoopInfoBase and LoopInfo objects movable so that they can
Chandler Carruth [Tue, 20 Jan 2015 10:58:38 +0000 (10:58 +0000)]
[PM] Make the LoopInfoBase and LoopInfo objects movable so that they can
be used as results in the new pass manager.

llvm-svn: 226559

9 years agoReverting r226548 as one of the tests fails in some configurations.
Alexander Kornienko [Tue, 20 Jan 2015 10:55:33 +0000 (10:55 +0000)]
Reverting r226548 as one of the tests fails in some configurations.

Here's the fail log from our internal setup:
===
  .../tools/clang/clang -cc1 -internal-isystem .../tools/clang/staging/include -nostdsysteminc .../tools/clang/test/CodeGenOpenCL/spir-calling-conv.cl -triple spir-unknown-unknown -emit-llvm -o -
  FileCheck .../tools/clang/test/CodeGenOpenCL/spir-calling-conv.cl
.../tools/clang/test/CodeGenOpenCL/spir-calling-conv.cl:11:12: error: expected string not found in input
 // CHECK: %call = tail call spir_func i32 @get_dummy_id(i32 0)
           ^
<stdin>:6:52: note: scanning from here
define spir_kernel void @foo(i32 addrspace(1)* %A) #0 {
                                                   ^
<stdin>:7:2: note: possible intended match here
 %1 = tail call spir_func i32 @get_dummy_id(i32 0) #2
 ^
===

Here's a failure on a public CI server:
http://lab.llvm.org:8080/green/job/clang-stage2-configure-Rlto_check/1183/

llvm-svn: 226558

9 years agoELF: Support detection of relocation errors during processing
Will Newton [Tue, 20 Jan 2015 10:37:40 +0000 (10:37 +0000)]
ELF: Support detection of relocation errors during processing

At the moment errors in relocation processing such as out of range
values are not detected or at best trapped by asserts which will not
be present in release builds. This patch adds support for checking
error return values from applyRelocation() calls and printing an
appropriate error message. It also adds support for printing multiple
errors rather than just the first one.

llvm-svn: 226557

9 years ago[PM] Fix a moderately scary typo in the deleted copy constructor
Chandler Carruth [Tue, 20 Jan 2015 10:20:52 +0000 (10:20 +0000)]
[PM] Fix a moderately scary typo in the deleted copy constructor
I noticed when adding move semantics to LoopInfo.

Hopefully not relevant, but still scary. =]

llvm-svn: 226556

9 years ago[PM] Use range-based for and auto to clean up some of the LoopInfo code.
Chandler Carruth [Tue, 20 Jan 2015 10:02:49 +0000 (10:02 +0000)]
[PM] Use range-based for and auto to clean up some of the LoopInfo code.

No functionality changed.

llvm-svn: 226555

9 years ago[Msan] Fix the readlink unit test to pass on FreeBSD
Viktor Kutuzov [Tue, 20 Jan 2015 09:57:28 +0000 (09:57 +0000)]
[Msan] Fix the readlink unit test to pass on FreeBSD
Differential Revision: http://reviews.llvm.org/D7052

llvm-svn: 226554

9 years ago[clang-tidy] Make ClangTidyOptionsProvider::getOptions return by value.
Alexander Kornienko [Tue, 20 Jan 2015 09:48:51 +0000 (09:48 +0000)]
[clang-tidy] Make ClangTidyOptionsProvider::getOptions return by value.

Returning by reference limits possible implementations and doesn't bring any
benefits as all callers make copies of the returned value anyway.

llvm-svn: 226553

9 years agoTest commit, no changes.
Pavel Labath [Tue, 20 Jan 2015 09:47:57 +0000 (09:47 +0000)]
Test commit, no changes.

llvm-svn: 226552

9 years agoFactor out a splitSwitchCase() function so that it can be reused.
Daniel Jasper [Tue, 20 Jan 2015 08:57:44 +0000 (08:57 +0000)]
Factor out a splitSwitchCase() function so that it can be reused.

This is in preparation for a fix to llvm.org/PR22262. One of the ideas
here is to first find a good jump table range first and then split
before and after it. Thereby, we don't need to use the
split-based-on-density heuristic at all, which can make the "binary
tree" deteriorate in various cases.

Also some minor cleanups.

No functional changes.

llvm-svn: 226551

9 years ago[PM] Move the LoopInfo analysis pointer into the InstCombiner class
Chandler Carruth [Tue, 20 Jan 2015 08:35:24 +0000 (08:35 +0000)]
[PM] Move the LoopInfo analysis pointer into the InstCombiner class
along with the other analyses.

The most obvious reason why is because eventually I need to separate out
the pass layer from the rest of the instcombiner. However, it is also
probably a compile time win as every query through the pass manager
layer is pretty slow these days.

llvm-svn: 226550

9 years ago[OPENMP] Fixed DSA processing for predetermined shared variables.
Alexey Bataev [Tue, 20 Jan 2015 07:03:46 +0000 (07:03 +0000)]
[OPENMP] Fixed DSA processing for predetermined shared variables.
This patch allows to use predetermined shared variables in private clauses in
parallel or tasks regions.

llvm-svn: 226549

9 years agoIntroduce SPIR calling conventions.
Sameer Sahasrabuddhe [Tue, 20 Jan 2015 06:44:32 +0000 (06:44 +0000)]
Introduce SPIR calling conventions.

This implements Section 3.7 from the SPIR 1.2 spec:

    SPIR kernels should use "spir_kernel" calling convention.
    Non-kernel functions use "spir_func" calling convention. All
    other calling conventions are disallowed.

The patch works only for OpenCL source. Any other uses will need
to ensure that kernels are assigned the spir_kernel calling
convention correctly.

llvm-svn: 226548

9 years agoFix Operandreorder logic in SLPVectorizer to generate longer vectorizable chain.
Karthik Bhat [Tue, 20 Jan 2015 06:11:00 +0000 (06:11 +0000)]
Fix Operandreorder logic in SLPVectorizer to generate longer vectorizable chain.
This patch fixes 2 issues in reorderInputsAccordingToOpcode
1) AllSameOpcodeLeft and AllSameOpcodeRight was being calculated incorrectly resulting in code not being vectorized in few cases.
2) Adds logic to reorder operands if we get longer chain of consecutive loads enabling vectorization. Handled the same for cases were we have AltOpcode.
Thanks Michael for inputs and review.
Review: http://reviews.llvm.org/D6677

llvm-svn: 226547

9 years agoBitcode: Don't create comdats when autoupgrading macho bitcode
David Majnemer [Tue, 20 Jan 2015 05:58:07 +0000 (05:58 +0000)]
Bitcode: Don't create comdats when autoupgrading macho bitcode

Don't infer COMDAT groups from older bitcode if the target is macho,
it doesn't have COMDATs.

llvm-svn: 226546