platform/upstream/llvm.git
10 years agoExplicitly report runtime stack realignment in StackMap section
Philip Reames [Fri, 1 Aug 2014 18:26:27 +0000 (18:26 +0000)]
Explicitly report runtime stack realignment in StackMap section

This change adds code to explicitly mark a function which requires runtime stack realignment as not having a fixed frame size in the StackMap section. As it happens, this is not actually a functional change. The size that would be reported without the check is also "-1", but as far as I can tell, that's an accident. The code change makes this explicit.

Note: There's a separate bug in handling of stackmaps and patchpoints in functions which need dynamic frame realignment. The current code assumes that offsets can be calculated from RBP, but realigned frames must use RSP. (There's a variable gap between RBP and the spill slots.) This change set does not address that issue.

Reviewers: atrick, ributzka

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

llvm-svn: 214534

10 years agoReplace comment about ownership with std::unique_ptr.
Rafael Espindola [Fri, 1 Aug 2014 18:09:32 +0000 (18:09 +0000)]
Replace comment about ownership with std::unique_ptr.

llvm-svn: 214533

10 years ago[ASan] Support the asan_loadN/asan_storeN functions in the DLL thunk library
Ehsan Akhgari [Fri, 1 Aug 2014 18:04:53 +0000 (18:04 +0000)]
[ASan] Support the asan_loadN/asan_storeN functions in the DLL thunk library

Summary:
This is required for linking DLLs with large functions exceeding
san-instrumentation-with-call-threshold.  One such function is
vp9_fdct16x16_sse2 in libvpx.

Reviewers: timurrrr

Subscribers: llvm-commits

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

llvm-svn: 214532

10 years ago[FastISel][ARM] Do not emit stores for undef arguments.
Juergen Ributzka [Fri, 1 Aug 2014 18:04:14 +0000 (18:04 +0000)]
[FastISel][ARM] Do not emit stores for undef arguments.

This is a followup patch for r214366, which added the same behavior to the
AArch64 and X86 FastISel code. This fix reproduces the already existing
behavior of SelectionDAG in FastISel.

llvm-svn: 214531

10 years agoUse range loop.
Rafael Espindola [Fri, 1 Aug 2014 18:04:14 +0000 (18:04 +0000)]
Use range loop.

llvm-svn: 214530

10 years agoUpdate build instructions for the clang-format VS plugin
Hans Wennborg [Fri, 1 Aug 2014 17:38:53 +0000 (17:38 +0000)]
Update build instructions for the clang-format VS plugin

llvm-svn: 214529

10 years agoAdd missing breaks to AArch64InstrInfo::isGPRCopy
Renato Golin [Fri, 1 Aug 2014 17:27:31 +0000 (17:27 +0000)]
Add missing breaks to AArch64InstrInfo::isGPRCopy

llvm-svn: 214528

10 years agoAdd decorator for FreeBSD test failure - malloc() breakpoint issue
Ed Maste [Fri, 1 Aug 2014 17:04:31 +0000 (17:04 +0000)]
Add decorator for FreeBSD test failure - malloc() breakpoint issue

llvm.org/pr20476

llvm-svn: 214527

10 years agoDropping some else-after-returns. No functional changes intended.
Aaron Ballman [Fri, 1 Aug 2014 17:02:34 +0000 (17:02 +0000)]
Dropping some else-after-returns. No functional changes intended.

llvm-svn: 214526

10 years agoR600: Cleanup test
Matt Arsenault [Fri, 1 Aug 2014 17:00:29 +0000 (17:00 +0000)]
R600: Cleanup test

Remove -CHECKs, use multiple prefixes, name values,
also test the @llvm.fabs version

llvm-svn: 214525

10 years agoMake getNamedOperandIdx readonly
Matt Arsenault [Fri, 1 Aug 2014 17:00:27 +0000 (17:00 +0000)]
Make getNamedOperandIdx readonly

llvm-svn: 214524

10 years agoR600/SI: Don't display GDS bit for read2
Matt Arsenault [Fri, 1 Aug 2014 17:00:26 +0000 (17:00 +0000)]
R600/SI: Don't display GDS bit for read2

This isn't displayed for any other instructions anymore,
and isn't ever used.

llvm-svn: 214523

10 years agoFix test execution: the cmake keyword is CACHE, not CACHED
Ed Maste [Fri, 1 Aug 2014 16:57:46 +0000 (16:57 +0000)]
Fix test execution: the cmake keyword is CACHE, not CACHED

llvm-svn: 214522

10 years ago[AArch64] Fix test from r214518 in an attempt to appease buildbots.
Chad Rosier [Fri, 1 Aug 2014 15:30:41 +0000 (15:30 +0000)]
[AArch64] Fix test from r214518 in an attempt to appease buildbots.

llvm-svn: 214521

10 years agoAdd IR Mangler for more stable mangling.
Eli Bendersky [Fri, 1 Aug 2014 15:01:10 +0000 (15:01 +0000)]
Add IR Mangler for more stable mangling.

llvm-svn: 214520

10 years agoRemove lto_codegen_set_attr.
Rafael Espindola [Fri, 1 Aug 2014 14:57:05 +0000 (14:57 +0000)]
Remove lto_codegen_set_attr.

It was never exported, so no functionality change.

llvm-svn: 214519

10 years ago[AArch64] Generate tbz/tbnz when comparing against zero.
Chad Rosier [Fri, 1 Aug 2014 14:48:56 +0000 (14:48 +0000)]
[AArch64] Generate tbz/tbnz when comparing against zero.

The tbz/tbnz checks the sign bit to convert

op w1, w1, w10
cmp w1, #0
b.lt .LBB0_0

to

op w1, w1, w10
tbnz w1, #31, .LBB0_0

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

llvm-svn: 214518

10 years ago[PowerPC] PR20280 - Slots for byval parameters are not immutable
Ulrich Weigand [Fri, 1 Aug 2014 14:35:58 +0000 (14:35 +0000)]
[PowerPC] PR20280 - Slots for byval parameters are not immutable

Found by inspection while looking at PR20280: code would mark slots
in the parameter save area where a byval parameter is passed as
"immutable".  This is not correct since code is allowed to modify
byval parameters in place in the parameter save area.

llvm-svn: 214517

10 years agoRemove some calls to std::move.
Rafael Espindola [Fri, 1 Aug 2014 14:31:55 +0000 (14:31 +0000)]
Remove some calls to std::move.

Instead of moving out the data in a ErrorOr<std::unique_ptr<Foo>>, get
a reference to it.

Thanks to David Blaikie for the suggestion.

llvm-svn: 214516

10 years ago[pr20127] Check for leading \1 in the Twine version of getNameWithPrefix.
Rafael Espindola [Fri, 1 Aug 2014 14:16:40 +0000 (14:16 +0000)]
[pr20127] Check for leading \1 in the Twine version of getNameWithPrefix.

No functionality change, but will simplify an upcoming patch that uses the
Twine version.

llvm-svn: 214515

10 years agoSimplify the code a bit with std::unique_ptr.
Rafael Espindola [Fri, 1 Aug 2014 14:11:14 +0000 (14:11 +0000)]
Simplify the code a bit with std::unique_ptr.

llvm-svn: 214514

10 years agoThe GNU-style aligned attribute has an optional expression, but the generated pretty...
Aaron Ballman [Fri, 1 Aug 2014 13:49:00 +0000 (13:49 +0000)]
The GNU-style aligned attribute has an optional expression, but the generated pretty printing logic was unaware of this. Fixed the pretty printing logic, and added a test to ensure it no longer asserts.

Added a FIXME to the code about eliding the parenthesis when pretty printing such a construct.

llvm-svn: 214513

10 years agoRevert r214497: [mips] Defer va_arg expansion to the backend.
Daniel Sanders [Fri, 1 Aug 2014 13:26:28 +0000 (13:26 +0000)]
Revert r214497: [mips] Defer va_arg expansion to the backend.

It appears that the backend does not handle all cases that were handled by clang.
In particular, it does not handle structs as used in
SingleSource/UnitTests/2003-05-07-VarArgs.

llvm-svn: 214512

10 years agoReplacing some more complex logic with a helper function call to ObjCMethod::getRetur...
Aaron Ballman [Fri, 1 Aug 2014 13:20:09 +0000 (13:20 +0000)]
Replacing some more complex logic with a helper function call to ObjCMethod::getReturnTypeSourceRange. No functional changes intended.

llvm-svn: 214511

10 years agoXcore target: Fix CXXStdlibIncludeArgs to check 'nostdinc++' flag too.
Robert Lytton [Fri, 1 Aug 2014 13:11:46 +0000 (13:11 +0000)]
Xcore target: Fix CXXStdlibIncludeArgs to check 'nostdinc++' flag too.

Summary:
There are no tests as it is dependant upon the environment variables
XCC_C_INCLUDE_PATH & XCC_CPLUS_INCLUDE_PATH  being set.

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

llvm-svn: 214510

10 years agollvm-objdump: implement printing for MachO __compact_unwind info.
Tim Northover [Fri, 1 Aug 2014 13:07:19 +0000 (13:07 +0000)]
llvm-objdump: implement printing for MachO __compact_unwind info.

llvm-svn: 214509

10 years agoclang-format: Add a space in ObjC protocols.
Daniel Jasper [Fri, 1 Aug 2014 13:03:05 +0000 (13:03 +0000)]
clang-format: Add a space in ObjC protocols.

Before:
  @interface Foo (HackStuff)<MyProtocol>

After:
  @interface Foo (HackStuff) <MyProtocol>

llvm-svn: 214508

10 years agoImproving diagnostic source ranges for the nonnull attribute. Now it highlights the...
Aaron Ballman [Fri, 1 Aug 2014 12:58:11 +0000 (12:58 +0000)]
Improving diagnostic source ranges for the nonnull attribute. Now it highlights the attribute and the faulty nonpointer type when possible.

llvm-svn: 214507

10 years agoFix a memory leak - dispose of the CXString after printing it in mangling.
Eli Bendersky [Fri, 1 Aug 2014 12:55:44 +0000 (12:55 +0000)]
Fix a memory leak - dispose of the CXString after printing it in mangling.

Thanks to kcc@ for noticing.

llvm-svn: 214506

10 years agoAllow only disassembling of M-class MSR masks that the assembler knows how to assembl...
James Molloy [Fri, 1 Aug 2014 12:42:11 +0000 (12:42 +0000)]
Allow only disassembling of M-class MSR masks that the assembler knows how to assemble back.

Note: The current code in DecodeMSRMask() rejects the unpredictable A/R MSR mask '0000' with Fail. The code in the patch follows this style and rejects unpredictable M-class MSR masks also with Fail (instead of SoftFail). If SoftFail is preferred in this case then additional changes to ARMInstPrinter (to print non-symbolic masks) and ARMAsmParser (to parse non-symbolic masks) will be needed.

Patch by Petr Pavlu!

llvm-svn: 214505

10 years agoInitializing the loop hint option token again.
Aaron Ballman [Fri, 1 Aug 2014 12:41:37 +0000 (12:41 +0000)]
Initializing the loop hint option token again.

llvm-svn: 214504

10 years agoImprove some const-correctness to remove a -Wcast-qual warning. No functional changes...
Aaron Ballman [Fri, 1 Aug 2014 12:34:58 +0000 (12:34 +0000)]
Improve some const-correctness to remove a -Wcast-qual warning. No functional changes intended.

llvm-svn: 214503

10 years agoInitializing the loop hint option token.
Aaron Ballman [Fri, 1 Aug 2014 12:20:20 +0000 (12:20 +0000)]
Initializing the loop hint option token.

llvm-svn: 214502

10 years agoUpdate the code with clang changes r214450 (FunctionProtoType::ExtProtoInfo update)
Sylvestre Ledru [Fri, 1 Aug 2014 12:19:15 +0000 (12:19 +0000)]
Update the code with clang changes r214450 (FunctionProtoType::ExtProtoInfo update)

llvm-svn: 214501

10 years ago[ARM] Make the assembler reject unpredictable pre/post-indexed ARM LDRB/LDRSB instruc...
Tilmann Scheller [Fri, 1 Aug 2014 12:08:04 +0000 (12:08 +0000)]
[ARM] Make the assembler reject unpredictable pre/post-indexed ARM LDRB/LDRSB instructions.

The ARM ARM prohibits LDRB/LDRSB instructions with writeback into the destination register. With this commit this constraint is now enforced and we stop assembling LDRH/LDRSH instructions with unpredictable behavior.

llvm-svn: 214500

10 years ago[ARM] Make the assembler reject unpredictable pre/post-indexed ARM LDRH/LDRSH instruc...
Tilmann Scheller [Fri, 1 Aug 2014 11:33:47 +0000 (11:33 +0000)]
[ARM] Make the assembler reject unpredictable pre/post-indexed ARM LDRH/LDRSH instructions.

The ARM ARM prohibits LDRH/LDRSH instructions with writeback into the source register. With this commit this constraint is now enforced and we stop assembling LDRH/LDRSH instructions with unpredictable behavior.

llvm-svn: 214499

10 years ago[ARM] Make the assembler reject unpredictable pre/post-indexed ARM LDR instructions.
Tilmann Scheller [Fri, 1 Aug 2014 11:08:51 +0000 (11:08 +0000)]
[ARM] Make the assembler reject unpredictable pre/post-indexed ARM LDR instructions.

The ARM ARM prohibits LDR instructions with writeback into the destination register. With this commit this constraint is now enforced and we stop assembling LDR instructions with unpredictable behavior.

llvm-svn: 214498

10 years ago[mips] Defer va_arg expansion to the backend.
Daniel Sanders [Fri, 1 Aug 2014 10:29:21 +0000 (10:29 +0000)]
[mips] Defer va_arg expansion to the backend.

Summary:
This patch causes clang to emit va_arg instructions to the backend instead of
expanding them into an implementation itself. The backend already implements
va_arg since this is necessary for NaCl so this patch is removing redundant
code.

Together with the llvm patch (D4556) that accounts for the effect of endianness
on the expansion of va_arg, this fixes PR19612.

Depends on D4556

Reviewers: sstankovic, dsanders

Reviewed By: dsanders

Subscribers: rnk, cfe-commits

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

llvm-svn: 214497

10 years agoSLPVectorizer: fix build problem in Release configuration
Erik Eckstein [Fri, 1 Aug 2014 09:47:38 +0000 (09:47 +0000)]
SLPVectorizer: fix build problem in Release configuration

llvm-svn: 214496

10 years ago[Mips] Replace assembler code by YAML to make the 'interpreter.test' test
Simon Atanasyan [Fri, 1 Aug 2014 09:47:21 +0000 (09:47 +0000)]
[Mips] Replace assembler code by YAML to make the 'interpreter.test' test
target independent.

llvm-svn: 214495

10 years agoSLPVectorizer: improved scheduling algorithm.
Erik Eckstein [Fri, 1 Aug 2014 09:20:42 +0000 (09:20 +0000)]
SLPVectorizer: improved scheduling algorithm.

llvm-svn: 214494

10 years ago[mips][PR19612] Fix va_arg for big-endian mode.
Daniel Sanders [Fri, 1 Aug 2014 09:17:39 +0000 (09:17 +0000)]
[mips][PR19612] Fix va_arg for big-endian mode.

Summary:
Big-endian mode was not correctly adjusting the offset for types smaller
than an ABI slot.

Fixes PR19612

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: sstankovic, llvm-commits

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

llvm-svn: 214493

10 years ago[Format] Remove blank line in Dependences.h
Johannes Doerfert [Fri, 1 Aug 2014 08:44:49 +0000 (08:44 +0000)]
[Format] Remove blank line in Dependences.h

llvm-svn: 214492

10 years ago[Fix] Annotate the IslAst with broken reductions (Missing files)
Johannes Doerfert [Fri, 1 Aug 2014 08:20:26 +0000 (08:20 +0000)]
[Fix] Annotate the IslAst with broken reductions (Missing files)

  + test cases of r214489.

llvm-svn: 214491

10 years ago[Typo] Added dot at the end of a sentence.
Johannes Doerfert [Fri, 1 Aug 2014 08:18:39 +0000 (08:18 +0000)]
[Typo] Added dot at the end of a sentence.

llvm-svn: 214490

10 years agoAnnotate the IslAst with broken reductions
Johannes Doerfert [Fri, 1 Aug 2014 08:17:19 +0000 (08:17 +0000)]
Annotate the IslAst with broken reductions

  + Split all reduction dependences and map them to the causing memory accesses.
  + Print the types & base addresses of broken reductions for each "reduction
    parallel" marked loop (OpenMP style).
  + 3 test cases to show how reductions are now represented in the isl ast.

  The mapping "(ast) loops -> broken reductions" is also needed to find the
  memory accesses we need to privatize in a loop.

llvm-svn: 214489

10 years agoChange the semantics of is*Parallel
Johannes Doerfert [Fri, 1 Aug 2014 08:14:28 +0000 (08:14 +0000)]
Change the semantics of is*Parallel

  The functions isParallel, isInnermostParallel and IsOutermostParallel in
  IslAstInfo will now return true even in the presence of broken reductions.
  To compensate for this change the negated result of isReductionParallel can
  be used.

llvm-svn: 214488

10 years agoSLP Vectorizer: added statistics counter
Erik Eckstein [Fri, 1 Aug 2014 08:14:28 +0000 (08:14 +0000)]
SLP Vectorizer: added statistics counter

llvm-svn: 214487

10 years agoChange the printing of reduction types
Johannes Doerfert [Fri, 1 Aug 2014 08:13:25 +0000 (08:13 +0000)]
Change the printing of reduction types

  We use the C operator representation when applicable.

  + Update all the test cases accordingly.

llvm-svn: 214486

10 years agoSLP Vectorizer: improve canonicalize tree operands of commutitive binary operands.
Erik Eckstein [Fri, 1 Aug 2014 08:05:55 +0000 (08:05 +0000)]
SLP Vectorizer: improve canonicalize tree operands of commutitive binary operands.

This reverts r214338 (except the test file) and replaces it with a more general algorithm.

llvm-svn: 214485

10 years agoAdding ABI information to linux test results
Eric Fiselier [Fri, 1 Aug 2014 06:30:18 +0000 (06:30 +0000)]
Adding ABI information to linux test results

llvm-svn: 214484

10 years agoUpdate information about compiler used during linux tests and reformat run information.
Eric Fiselier [Fri, 1 Aug 2014 06:27:40 +0000 (06:27 +0000)]
Update information about compiler used during linux tests and reformat run information.

llvm-svn: 214483

10 years agoRevert of 214418:
Sylvestre Ledru [Fri, 1 Aug 2014 06:16:03 +0000 (06:16 +0000)]
Revert of 214418:
"Create a default symver on Linux like ELF OSes."

Fails the build under Debian with ld.gold:
/usr/bin/ld.gold: --default-symver: unknown option

llvm-svn: 214482

10 years ago[PowerPC] Generate unaligned vector loads using intrinsics instead of regular loads
Hal Finkel [Fri, 1 Aug 2014 05:20:41 +0000 (05:20 +0000)]
[PowerPC] Generate unaligned vector loads using intrinsics instead of regular loads

Altivec vector loads on PowerPC have an interesting property: They always load
from an aligned address (by rounding down the address actually provided if
necessary). In order to generate an actual unaligned load, you can generate two
load instructions, one with the original address, one offset by one vector
length, and use a special permutation to extract the bytes desired.

When this was originally implemented, I generated these two loads using regular
ISD::LOAD nodes, now marked as aligned. Unfortunately, there is a problem with
this:

The alignment of a load does not contribute to its identity, and SDNodes
are uniqued. So, imagine that we have some unaligned load, L1, that is not
aligned. The routine will create two loads, L1(aligned) and (L1+16)(aligned).
Further imagine that there had already existed a load (L1+16)(unaligned) with
the same chain operand as the load L1. When (L1+16)(aligned) is created as part
of the lowering of L1, this load *is* also the (L1+16)(unaligned) node, just
now marked as aligned (because the new alignment overwrites the old). But the
original users of (L1+16)(unaligned) now get the data intended for the
permutation yielding the data for L1, and (L1+16)(unaligned) no longer exists
to get its own permutation-based expansion. This was PR19991.

A second potential problem has to do with the MMOs on these loads, which can be
used by AA during instruction scheduling to break chain-based dependencies. If
the new "aligned" loads get the MMO from the original unaligned load, this does
not represent the fact that it will load data from below the original address.
Normally, this would not matter, but this load might be combined with another
load pair for a previous vector, and then the dependency on the otherwise-
ignored lower bytes can matter.

To fix both problems, instead of generating the necessary loads using regular
ISD::LOAD instructions, ppc_altivec_lvx intrinsics are used instead. These are
provided with MMOs with a conservative address range.

Unfortunately, I no longer have a failing test case (since PR19991 was
reported, other changes in CodeGen have forced this bug back into hiding it
again). Nevertheless, this should fix the underlying problem.

llvm-svn: 214481

10 years agoChange the encoding of the Triple string exchanged across GDB-RSP
Matthew Gardiner [Fri, 1 Aug 2014 05:12:23 +0000 (05:12 +0000)]
Change the encoding of the Triple string exchanged across GDB-RSP
and update documentation to suit, as suggested by Jason Molenda and
discussed in:

http://lists.cs.uiuc.edu/pipermail/lldb-commits/Week-of-Mon-20140721/011978.html

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

llvm-svn: 214480

10 years agoThis patch implements transform for pattern "(A & ~B) ^ (~A) -> ~(A & B)".
Suyog Sarda [Fri, 1 Aug 2014 05:07:20 +0000 (05:07 +0000)]
This patch implements transform for pattern "(A & ~B) ^ (~A) -> ~(A & B)".

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

llvm-svn: 214479

10 years agoThis patch implements transform for pattern "(A | B) & ((~A) ^ B) -> (A & B)".
Suyog Sarda [Fri, 1 Aug 2014 04:59:26 +0000 (04:59 +0000)]
This patch implements transform for pattern "(A | B) & ((~A) ^ B) -> (A & B)".

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

llvm-svn: 214478

10 years agoThis patch implements transform for pattern "( A & (~B)) | (A ^ B) -> (A ^ B)"
Suyog Sarda [Fri, 1 Aug 2014 04:50:31 +0000 (04:50 +0000)]
This patch implements transform for pattern "( A & (~B)) | (A ^ B) -> (A ^ B)"

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

llvm-svn: 214477

10 years agoThis patch implements transform for pattern "(A & B) | ((~A) ^ B) -> (~A ^ B)".
Suyog Sarda [Fri, 1 Aug 2014 04:41:43 +0000 (04:41 +0000)]
This patch implements transform for pattern "(A & B) | ((~A) ^ B) -> (~A ^ B)".
Patch Credit to Ankit Jain !

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

llvm-svn: 214476

10 years agoR600/SI: Fix build warning
Tom Stellard [Fri, 1 Aug 2014 02:05:57 +0000 (02:05 +0000)]
R600/SI: Fix build warning

llvm-svn: 214475

10 years agoUpdate linux test results file
Eric Fiselier [Fri, 1 Aug 2014 01:59:09 +0000 (01:59 +0000)]
Update linux test results file

llvm-svn: 214474

10 years ago[modules] Remove IRGen special case for emitting implicit special members if
Richard Smith [Fri, 1 Aug 2014 01:56:39 +0000 (01:56 +0000)]
[modules] Remove IRGen special case for emitting implicit special members if
they're somehow missing a body. Looks like this was left behind when the loop
was generalized, and it's not been problematic before because without modules,
a used, implicit special member function declaration must be a definition.

This was resulting in us trying to emit a constructor declaration rather than
a definition, and producing a constructor missing its member initializers.

llvm-svn: 214473

10 years agoAdd comments to debug info testing case.
Manman Ren [Fri, 1 Aug 2014 01:47:13 +0000 (01:47 +0000)]
Add comments to debug info testing case.

llvm-svn: 214472

10 years agoRemove this pointer that is converted to bool. In well-defined contexts, the
Richard Trieu [Fri, 1 Aug 2014 01:42:01 +0000 (01:42 +0000)]
Remove this pointer that is converted to bool.  In well-defined contexts, the
this pointer is always non-null.  If the this pointer is null, it is undefined
and the compiler may optimize it away by assuming it is non-null.  The null
checks are pushed into the callers.

llvm-svn: 214471

10 years ago[FastISel][AArch64] Fix the immediate versions of the {s|u}{add|sub}.with.overflow...
Juergen Ributzka [Fri, 1 Aug 2014 01:25:55 +0000 (01:25 +0000)]
[FastISel][AArch64] Fix the immediate versions of the {s|u}{add|sub}.with.overflow intrinsics.

ADDS and SUBS cannot encode negative immediates or immediates larger than 12bit.
This fix checks if the immediate version can be used under this constraints and
if we can convert ADDS to SUBS or vice versa to support negative immediates.

Also update the test cases to test the immediate versions.

llvm-svn: 214470

10 years ago[PowerPC] Recognize consecutive memory accesses from intrinsics
Hal Finkel [Fri, 1 Aug 2014 01:02:01 +0000 (01:02 +0000)]
[PowerPC] Recognize consecutive memory accesses from intrinsics

When generating unaligned vector loads, we need to search for other loads or
stores nearby offset by one vector width. If we find one, then we know that we
can safely generate another aligned load at that address. Otherwise, we must
generate the next load using an offset of the vector width minus one byte (so
we don't read off the end of the allocation if the base unaligned address
happened to be aligned at runtime). We had previously done this using only
other vector loads and stores, but did not consider the PowerPC-specific vector
load/store intrinsics. Now we'll also consider vector intrinsics. By itself,
this change is a feature enhancement, but is a necessary step toward fixing the
underlying problem behind PR19991.

llvm-svn: 214469

10 years agoMS inline asm: Fix null SMLoc when 'ptr' is missing after dword & co
Reid Kleckner [Fri, 1 Aug 2014 00:59:22 +0000 (00:59 +0000)]
MS inline asm: Fix null SMLoc when 'ptr' is missing after dword & co

This improves the diagnostics from the regular assembler, but more
importantly it fixes an assertion when parsing inline assembly.  Test
landing in Clang.

llvm-svn: 214468

10 years agoR600/SI: Do abs/neg folding with ComplexPatterns
Tom Stellard [Fri, 1 Aug 2014 00:32:39 +0000 (00:32 +0000)]
R600/SI: Do abs/neg folding with ComplexPatterns

Abs/neg folding has moved out of foldOperands and into the instruction
selection phase using complex patterns.  As a consequence of this
change, we now prefer to select the 64-bit encoding for most
instructions and the modifier operands have been dropped from
integer VOP3 instructions.

llvm-svn: 214467

10 years agoTableGen: Allow AddedComplexity values to be negative
Tom Stellard [Fri, 1 Aug 2014 00:32:36 +0000 (00:32 +0000)]
TableGen: Allow AddedComplexity values to be negative

This is useful for cases when stand-alone patterns are preferred to the
patterns included in the instruction definitions.  Instead of requiring
that stand-alone patterns set a larger AddedComplexity value, which
can be confusing to new developers, the allows us to reduce the
complexity of the included patterns to achieve the same result.

There will be test cases for this added to the R600 backend in a
future commit.

llvm-svn: 214466

10 years agoR600/SI: Simplify and fix handling of VOP2 in SIInstrInfo::legalizeOperands
Tom Stellard [Fri, 1 Aug 2014 00:32:35 +0000 (00:32 +0000)]
R600/SI: Simplify and fix handling of VOP2 in SIInstrInfo::legalizeOperands

We were incorrectly assuming that all VOP2 instructions can read SGPRs
in Src0, but this is not true for instructions that read carry-in from
VCC.

The old logic has been replaced with new logic which checks the defined
register classes of the VOP2 instruction to determine whether or not to
legalize the operands.

llvm-svn: 214465

10 years agoR600/SI: Fold immediates when shrinking instructions
Tom Stellard [Fri, 1 Aug 2014 00:32:33 +0000 (00:32 +0000)]
R600/SI: Fold immediates when shrinking instructions

This will prevent us from using extra MOV instructions once we prefer
selecting 64-bit instructions.

llvm-svn: 214464

10 years agoR600/SI: Fix incorrect commute operation in shrink instructions pass
Tom Stellard [Fri, 1 Aug 2014 00:32:28 +0000 (00:32 +0000)]
R600/SI: Fix incorrect commute operation in shrink instructions pass

We were commuting the instruction by still shrinking it using the
original opcode.

NOTE: This is a candidate for the 3.5 branch.
llvm-svn: 214463

10 years agoclang-format vs plugin: claim support for VS 14 CTP too
Hans Wennborg [Fri, 1 Aug 2014 00:02:24 +0000 (00:02 +0000)]
clang-format vs plugin: claim support for VS 14 CTP too

llvm-svn: 214461

10 years agoAdd support for the X86 secure guard extensions instructions in assembler (SGX).
Kevin Enderby [Thu, 31 Jul 2014 23:57:38 +0000 (23:57 +0000)]
Add support for the X86 secure guard extensions instructions in assembler (SGX).

This allows assembling the two new instructions, encls and enclu for the
SKX processor model.

Note the diffs are a bigger than what might think, but to fit the new
MRM_CF and MRM_D7 in things in the right places things had to be
renumbered and shuffled down causing a bit more diffs.

rdar://16228228

llvm-svn: 214460

10 years agoFix buildbot: work around missing GCC C++11 feature.
Richard Smith [Thu, 31 Jul 2014 23:52:38 +0000 (23:52 +0000)]
Fix buildbot: work around missing GCC C++11 feature.

llvm-svn: 214459

10 years ago[modules] Maintain an AST invariant across module load/save: if any declaration
Richard Smith [Thu, 31 Jul 2014 23:46:44 +0000 (23:46 +0000)]
[modules] Maintain an AST invariant across module load/save: if any declaration
of a function has a resolved exception specification, then all declarations of
the function do.

We should probably improve the AST representation to make this implicit (perhaps
only store the exception specification on the canonical declaration), but this
fixes things for now.

The testcase for this (which used to assert) also exposes the actual bug I was
trying to reduce here: we sometimes fail to emit the body of an imported
special member function definition. Fix for that to follow.

llvm-svn: 214458

10 years agoX86 MC: Don't crash on empty memory operand parens
Reid Kleckner [Thu, 31 Jul 2014 23:26:35 +0000 (23:26 +0000)]
X86 MC: Don't crash on empty memory operand parens

Instead, create an absolute memory operand.

Fixes PR20504.

llvm-svn: 214457

10 years agoX86 MC: Reject invalid segment registers before a memory operand colon
Reid Kleckner [Thu, 31 Jul 2014 23:03:22 +0000 (23:03 +0000)]
X86 MC: Reject invalid segment registers before a memory operand colon

Previously we would execute unreachable during object emission.

llvm-svn: 214456

10 years agoWhite space fix.
Louis Gerbarg [Thu, 31 Jul 2014 22:57:46 +0000 (22:57 +0000)]
White space fix.

llvm-svn: 214455

10 years agoChange lit.cfg to allow whitespace before comments
Eric Fiselier [Thu, 31 Jul 2014 22:56:52 +0000 (22:56 +0000)]
Change lit.cfg to allow whitespace before comments

llvm-svn: 214454

10 years ago[PECOFF] Fix section header.
Rui Ueyama [Thu, 31 Jul 2014 22:40:35 +0000 (22:40 +0000)]
[PECOFF] Fix section header.

The PE/COFF spec says that SizeOfRawData field in the section
header must be a multiple of FileAlignment from the optional
header. LLD emits 512 as FileAlignment, so it must have been
a multiple of 512.

LLD did not follow that. It emitted the actual section size
without the last padding as the SizeOfRawData. Although it's
not correct as per the spec, the Windows loader doesn't seem
to actually bother to check that. Executables created by LLD
worked fine.

However, tools dealing with executalbe files may expect it
to be the correct value, and one instance of it is mt.exe
tool distributed as a part of Windows SDK.

If CMake is invoked with "-E vs_link_exe" option, it silently
run mt.exe to embed a resource file to the resulting file.
And mt.exe sometimes breaks an input file if it's section
header does not follow the standard. That caused a misterous
error that CMake with Ninja occasionally produces a broken
executable.

This patch fixes the section header to make mt.exe and
other tools happy.

llvm-svn: 214453

10 years agoMake classof in MemSDNode consistent with MemIntrinsicSDNode
Hal Finkel [Thu, 31 Jul 2014 22:31:33 +0000 (22:31 +0000)]
Make classof in MemSDNode consistent with MemIntrinsicSDNode

If INTRINSIC_W_CHAIN and INTRINSIC_VOID are MemIntrinsicSDNodes, and a
MemIntrinsicSDNode is a MemSDNode, then INTRINSIC_W_CHAIN and INTRINSIC_VOID
must be MemSDNodes too.

Noticed by inspection.

llvm-svn: 214452

10 years agoR600: Modernize work item intrinsics test
Jan Vesely [Thu, 31 Jul 2014 22:11:03 +0000 (22:11 +0000)]
R600: Modernize work item intrinsics test

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Matt Arsenault <Matthew.Arsenault@amd.com>
llvm-svn: 214451

10 years agoFactor out exception specification information from
Richard Smith [Thu, 31 Jul 2014 21:57:55 +0000 (21:57 +0000)]
Factor out exception specification information from
FunctionProtoType::ExtProtoInfo. Most of the users of these fields don't care
about the other ExtProtoInfo bits and just want to talk about the exception
specification.

llvm-svn: 214450

10 years agoMake sure no loads resulting from load->switch DAGCombine are marked invariant
Louis Gerbarg [Thu, 31 Jul 2014 21:45:05 +0000 (21:45 +0000)]
Make sure no loads resulting from load->switch DAGCombine are marked invariant

Currently when DAGCombine converts loads feeding a switch into a switch of
addresses feeding a load the new load inherits the isInvariant flag of the left
side. This is incorrect since invariant loads can be reordered in cases where it
is illegal to reoarder normal loads.

This patch adds an isInvariant parameter to getExtLoad() and updates all call
sites to pass in the data if they have it or false if they don't. It also
changes the DAGCombine to use that data to make the right decision when
creating the new load.

llvm-svn: 214449

10 years ago[Refactor] Remove unecessary check and function
Johannes Doerfert [Thu, 31 Jul 2014 21:34:32 +0000 (21:34 +0000)]
[Refactor] Remove unecessary check and function

  + Perform the parallelism check on the innermost loop only once.
  + Inline the markOpenmpParallel function.
  + Rename all IslAstUserPayload * into Payload to make it consistent.

llvm-svn: 214448

10 years ago[Refactor] Use nicer print callback function in IslAst
Johannes Doerfert [Thu, 31 Jul 2014 21:33:49 +0000 (21:33 +0000)]
[Refactor] Use nicer print callback function in IslAst

llvm-svn: 214447

10 years agoLoop hint pragmas sometimes do not contain an identifier option (such as #pragma...
Aaron Ballman [Thu, 31 Jul 2014 21:24:32 +0000 (21:24 +0000)]
Loop hint pragmas sometimes do not contain an identifier option (such as #pragma unroll(4)). Check explicitly that the token we stored was an identifier.

Amends r214432

llvm-svn: 214446

10 years agoImprove the remark generated for -Rpass-missed.
Tyler Nowicki [Thu, 31 Jul 2014 21:22:22 +0000 (21:22 +0000)]
Improve the remark generated for -Rpass-missed.

The current remark is ambiguous and makes it sounds like explicitly specifying vectorization will allow the loop to be vectorized. This is not the case. The improved remark directs the user to -Rpass-analysis=loop-vectorize to determine the cause of the pass-miss.

Reviewed by Arnold Schwaighofer`

llvm-svn: 214445

10 years agoRevert "Remove MCObjectDisassembler.cpp as it is untested and unused." as it is appar...
Eric Christopher [Thu, 31 Jul 2014 21:18:38 +0000 (21:18 +0000)]
Revert "Remove MCObjectDisassembler.cpp as it is untested and unused." as it is apparently used, but the build didn't return errors weirdly.

This reverts commits 214437 and 214438.

llvm-svn: 214444

10 years agoMake CMake choose the target architecture according to the build.
Zachary Turner [Thu, 31 Jul 2014 21:07:41 +0000 (21:07 +0000)]
Make CMake choose the target architecture according to the build.

Previously, CMake was invoking the test runner and not specifying
what architecture to use when building test executables.  The
Makefiles for the test executables then had logic to choose x64
by default.  This doesn't work on Windows because the test compiler
would then try to link against the 64-bit MSVCRT and not find them
since only the 32-bit MSVCRT was in the path.

This patch addresses this by figuring out, at CMake time, whether
or not you are building LLDB with a 64 or 32-bit toolchain.  Then,
it explicitly passes this value to the test runner, causing the
test runner to build tests whose architecture matches that of LLDB
itself.  This can still be overridden by setting the CMake variable
LLDB_TEST_EXECUTABLE_ARCH=(x64|x86)

llvm-svn: 214443

10 years agoMake Android's ctype_base::mask unsigned.
Dan Albert [Thu, 31 Jul 2014 21:04:08 +0000 (21:04 +0000)]
Make Android's ctype_base::mask unsigned.

Keeping the regex code sane is much easier if we match the other
platforms and use an unsigned mask.

llvm-svn: 214442

10 years agoRemove shell-globbing from all test makefiles.
Zachary Turner [Thu, 31 Jul 2014 21:03:11 +0000 (21:03 +0000)]
Remove shell-globbing from all test makefiles.

llvm-svn: 214441

10 years agoImprove the remark generated when a variable that is used outside the loop is not...
Tyler Nowicki [Thu, 31 Jul 2014 21:02:40 +0000 (21:02 +0000)]
Improve the remark generated when a variable that is used outside the loop is not a reduction or induction variable.

Reviewed by Arnold Schwaighofer

llvm-svn: 214440

10 years agoReplaces a few pointers with references in llvm-nm.cpp.
Rafael Espindola [Thu, 31 Jul 2014 21:00:10 +0000 (21:00 +0000)]
Replaces a few pointers with references in llvm-nm.cpp.

This opens the way for a few std::uinque_ptr cleanups.

llvm-svn: 214439

10 years agoFixing CMake problems with MCObjectDisassembler.cpp not existing.
Aaron Ballman [Thu, 31 Jul 2014 20:48:54 +0000 (20:48 +0000)]
Fixing CMake problems with MCObjectDisassembler.cpp not existing.

llvm-svn: 214438

10 years agoRemove MCObjectDisassembler.cpp as it is untested and unused.
Eric Christopher [Thu, 31 Jul 2014 20:44:46 +0000 (20:44 +0000)]
Remove MCObjectDisassembler.cpp as it is untested and unused.

llvm-svn: 214437

10 years agoImplemented a diagnostic to handle multiple, distinct ownership_return attributes...
Aaron Ballman [Thu, 31 Jul 2014 20:44:26 +0000 (20:44 +0000)]
Implemented a diagnostic to handle multiple, distinct ownership_return attributes on the same declaration. This removes a FIXME from the code.

llvm-svn: 214436

10 years agomsbuild integration: remove duplicated lines and BOM from 2014 integration (PR20341)
Hans Wennborg [Thu, 31 Jul 2014 20:33:22 +0000 (20:33 +0000)]
msbuild integration: remove duplicated lines and BOM from 2014 integration (PR20341)

llvm-svn: 214435

10 years agoDWOHolder takes ownership of the argument constructor, use std::unique_ptr.
Rafael Espindola [Thu, 31 Jul 2014 20:26:42 +0000 (20:26 +0000)]
DWOHolder takes ownership of the argument constructor, use std::unique_ptr.

Thanks to David Blaikie for noticing it.

llvm-svn: 214434