platform/upstream/llvm.git
9 years agoBitcode: Simplify emission of METADATA_BLOCK
Duncan P. N. Exon Smith [Mon, 12 Jan 2015 22:30:34 +0000 (22:30 +0000)]
Bitcode: Simplify emission of METADATA_BLOCK

Refactor logic so that we know up-front whether to open a block and
whether we need an MDString abbreviation.

This is almost NFC, but will start emitting `MDString` abbreviations
when the first record is not an `MDString`.

llvm-svn: 225712

9 years agoAsmParser: Use subclass API instead of MDNode wrappers, NFC
Duncan P. N. Exon Smith [Mon, 12 Jan 2015 22:27:39 +0000 (22:27 +0000)]
AsmParser: Use subclass API instead of MDNode wrappers, NFC

Use subclass API instead of the wrappers in `MDNode` in the assembly
parser.  This will make the code easier to follow once we have multiple
subclasses.

llvm-svn: 225711

9 years agoAsmParser: Factor duplicated code into ParseMDNode(), NFC
Duncan P. N. Exon Smith [Mon, 12 Jan 2015 22:26:48 +0000 (22:26 +0000)]
AsmParser: Factor duplicated code into ParseMDNode(), NFC

llvm-svn: 225710

9 years agoAsmParser: Reorder ParseMetadata() logic, NFC
Duncan P. N. Exon Smith [Mon, 12 Jan 2015 22:24:50 +0000 (22:24 +0000)]
AsmParser: Reorder ParseMetadata() logic, NFC

llvm-svn: 225709

9 years agoAsmParser: Simplify ParseMDTuple(), NFC
Duncan P. N. Exon Smith [Mon, 12 Jan 2015 22:23:04 +0000 (22:23 +0000)]
AsmParser: Simplify ParseMDTuple(), NFC

llvm-svn: 225708

9 years agoDebug Info: Implement DwarfUnit::addRegisterOffset using DwarfExpression.
Adrian Prantl [Mon, 12 Jan 2015 22:19:26 +0000 (22:19 +0000)]
Debug Info: Implement DwarfUnit::addRegisterOffset using DwarfExpression.
No functional change.

llvm-svn: 225707

9 years agoDebug info: Factor out the creation of DWARF expressions from AsmPrinter
Adrian Prantl [Mon, 12 Jan 2015 22:19:22 +0000 (22:19 +0000)]
Debug info: Factor out the creation of DWARF expressions from AsmPrinter
into a new class DwarfExpression that can be shared between AsmPrinter
and DwarfUnit.

This is the first step towards unifying the two entirely redundant
implementations of dwarf expression emission in DwarfUnit and AsmPrinter.

Almost no functional change — Testcases were updated because asm comments
that used to be on two lines now appear on the same line, which is
actually preferable.

llvm-svn: 225706

9 years ago[patch][pr19848] Produce explicit comdats in clang.
Rafael Espindola [Mon, 12 Jan 2015 22:13:53 +0000 (22:13 +0000)]
[patch][pr19848] Produce explicit comdats in clang.

The llvm IR until recently had no support for comdats. This was a problem when
targeting C++ on ELF/COFF as just using weak linkage would cause quite a bit of
dead bits to remain on the executable (unless -ffunction-sections,
-fdata-sections and --gc-sections were used).

To fix the problem, llvm's codegen will just assume that any weak or linkonce
that is not in an explicit comdat should be output in one with the same name as
the global.

This unfortunately breaks cases like pr19848 where a weak symbol is not
xpected to be part of any comdat.

Now that we have explicit comdats in the IR, we can finally get both cases
right.

This first patch just makes clang give explicit comdats to GlobalValues where
t is allowed to.

A followup patch to llvm will then stop implicitly producing comdats.

llvm-svn: 225705

9 years agoRemove CMake standalone build configuration
Greg Fitzgerald [Mon, 12 Jan 2015 21:41:10 +0000 (21:41 +0000)]
Remove CMake standalone build configuration

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

llvm-svn: 225704

9 years agoWrap to 80 columns. No behavior change.
Nico Weber [Mon, 12 Jan 2015 21:24:10 +0000 (21:24 +0000)]
Wrap to 80 columns. No behavior change.

llvm-svn: 225703

9 years agoAsmParser: ParseMDNode() => ParseMDTuple(), NFC
Duncan P. N. Exon Smith [Mon, 12 Jan 2015 21:23:11 +0000 (21:23 +0000)]
AsmParser: ParseMDNode() => ParseMDTuple(), NFC

This isn't parsing arbitrary subclasses of `MDNode`, just `MDTuple`.

llvm-svn: 225702

9 years agoDon't use a doc comment in a function body.
Nico Weber [Mon, 12 Jan 2015 21:22:27 +0000 (21:22 +0000)]
Don't use a doc comment in a function body.

llvm-svn: 225701

9 years ago80-cols; NFC
Sanjay Patel [Mon, 12 Jan 2015 21:21:28 +0000 (21:21 +0000)]
80-cols; NFC

llvm-svn: 225700

9 years agoAsmParser: Remove unused version of ParseMDNodeID()
Duncan P. N. Exon Smith [Mon, 12 Jan 2015 21:14:38 +0000 (21:14 +0000)]
AsmParser: Remove unused version of ParseMDNodeID()

Merge the two versions of `ParseMDNodeID()` now that no one needs
special forward references.

llvm-svn: 225699

9 years agoAsmParser: Use normal references for metadata attachments, NFC
Duncan P. N. Exon Smith [Mon, 12 Jan 2015 21:13:09 +0000 (21:13 +0000)]
AsmParser: Use normal references for metadata attachments, NFC

Remove special parsing logic for metadata attachments.  Now that
`DebugLoc` is stored normally (since the metadata/value split), we don't
need this special forward referencing logic.

llvm-svn: 225698

9 years agoIR: Prepare for a new UniquableMDNode subclass, NFC
Duncan P. N. Exon Smith [Mon, 12 Jan 2015 20:56:33 +0000 (20:56 +0000)]
IR: Prepare for a new UniquableMDNode subclass, NFC

Add generic dispatch for the parts of `UniquableMDNode` that cast to
`MDTuple`.  This makes adding other subclasses (like PR21433's
`MDLocation`) easier.

llvm-svn: 225697

9 years agoIR: Stop erasing MDNodes from uniquing sets during teardown
Duncan P. N. Exon Smith [Mon, 12 Jan 2015 20:50:25 +0000 (20:50 +0000)]
IR: Stop erasing MDNodes from uniquing sets during teardown

Stop erasing `MDNode`s from the uniquing sets in `LLVMContextImpl`
during teardown (in particular, during
`UniquableMDNode::~UniquableMDNode()`).  Although it's currently
feasible, there isn't any clear benefit and it may not be feasible for
other subclasses (which don't explicitly store the lookup hash).

llvm-svn: 225696

9 years agoFirst crack at PowerPC 3.6 release notes
Bill Schmidt [Mon, 12 Jan 2015 20:46:43 +0000 (20:46 +0000)]
First crack at PowerPC 3.6 release notes

llvm-svn: 225695

9 years agoAdd support for character option types.
Zachary Turner [Mon, 12 Jan 2015 20:44:02 +0000 (20:44 +0000)]
Add support for character option types.

This will allow, in a subsequent patch, the addition of a global
setting that allows the user to specify a single character that
LLDB will recognize as an escape character when processing arg
strings to accomodate differences in Windows/non-Windows path
handling.

Differential Revision: http://reviews.llvm.org/D6887
Reviewed by: Jim Ingham

llvm-svn: 225694

9 years ago[LIT] Remove string decoding in gtest discovery code. lit.util.capture now does decoding.
Eric Fiselier [Mon, 12 Jan 2015 20:43:34 +0000 (20:43 +0000)]
[LIT] Remove string decoding in gtest discovery code. lit.util.capture now does decoding.

llvm-svn: 225693

9 years ago[dfsan] Export dfsan_get_label_info function with C linkage.
Peter Collingbourne [Mon, 12 Jan 2015 20:40:30 +0000 (20:40 +0000)]
[dfsan] Export dfsan_get_label_info function with C linkage.

llvm-svn: 225692

9 years ago[X86] Also create+widen FMIN/FMAX nodes for v2f32.
Ahmed Bougacha [Mon, 12 Jan 2015 20:31:30 +0000 (20:31 +0000)]
[X86] Also create+widen FMIN/FMAX nodes for v2f32.

This happens in the HINT benchmark, where the SLP-vectorizer created
v2f32 fcmp/select code.  The "correct" solution would have been to
teach the vectorizer cost model that v2f32 isn't legal (because really,
it isn't), but if we can vectorize we might as well do so.

We legalize these v2f32 FMIN/FMAX nodes by widening to v4f32 later on.
v3f32 were already widened to v4f32 by the generic unroll-and-build-vector
legalization.

rdar://15763436
Differential Revision: http://reviews.llvm.org/D6557

llvm-svn: 225691

9 years agoIR: Move creation logic to MDNodeFwdDecl, NFC
Duncan P. N. Exon Smith [Mon, 12 Jan 2015 20:21:37 +0000 (20:21 +0000)]
IR: Move creation logic to MDNodeFwdDecl, NFC

Same as with `MDTuple`, factor out a `friend MDNode` by moving creation
logic to the concrete subclass.

llvm-svn: 225690

9 years agoIR: Make MDNodeFwdDecl destructor public
Duncan P. N. Exon Smith [Mon, 12 Jan 2015 20:19:54 +0000 (20:19 +0000)]
IR: Make MDNodeFwdDecl destructor public

Now that the leak detector is gone, anyone can call this.

llvm-svn: 225689

9 years ago[Msan] Fix use of mmap(MAP_ANONYMOUS) in the unit tests on FreeBSD
Viktor Kutuzov [Mon, 12 Jan 2015 20:18:38 +0000 (20:18 +0000)]
[Msan] Fix use of mmap(MAP_ANONYMOUS) in the unit tests on FreeBSD
Differential Revision: http://reviews.llvm.org/D6929

llvm-svn: 225688

9 years ago[X86] Make SSE min/max testcases more explicit. NFC.
Ahmed Bougacha [Mon, 12 Jan 2015 20:15:47 +0000 (20:15 +0000)]
[X86] Make SSE min/max testcases more explicit. NFC.

llvm-svn: 225687

9 years ago[Msan] Fix tests reading /proc files on FreeBSD
Viktor Kutuzov [Mon, 12 Jan 2015 20:15:33 +0000 (20:15 +0000)]
[Msan] Fix tests reading /proc files on FreeBSD
Differential Revision: http://reviews.llvm.org/D6926

llvm-svn: 225686

9 years agoIR: Move creation logic down to MDTuple, NFC
Duncan P. N. Exon Smith [Mon, 12 Jan 2015 20:13:56 +0000 (20:13 +0000)]
IR: Move creation logic down to MDTuple, NFC

Move creation logic for `MDTuple`s down where it belongs.  Once there
are a few more subclasses, these functions really won't make much sense
here (the `friend` relationship was already awkward).  For now, leave
the `MDNode` versions around, but have it forward down.

llvm-svn: 225685

9 years agoreverting due to build bot failure
Nathan Sidwell [Mon, 12 Jan 2015 20:13:20 +0000 (20:13 +0000)]
reverting due to build bot failure

llvm-svn: 225684

9 years agoIR: Push storeDistinctInContext() down to UniquableMDNode, NFC
Duncan P. N. Exon Smith [Mon, 12 Jan 2015 20:11:32 +0000 (20:11 +0000)]
IR: Push storeDistinctInContext() down to UniquableMDNode, NFC

llvm-svn: 225683

9 years agoIR: Split GenericMDNode into MDTuple and UniquableMDNode
Duncan P. N. Exon Smith [Mon, 12 Jan 2015 20:09:34 +0000 (20:09 +0000)]
IR: Split GenericMDNode into MDTuple and UniquableMDNode

Split `GenericMDNode` into two classes (with more descriptive names).

  - `UniquableMDNode` will be a common subclass for `MDNode`s that are
    sometimes uniqued like constants, and sometimes 'distinct'.

    This class gets the (short-lived) RAUW support and related API.

  - `MDTuple` is the basic tuple that has always been returned by
    `MDNode::get()`.  This is as opposed to more specific nodes to be
    added soon, which have additional fields, custom assembly syntax,
    and extra semantics.

    This class gets the hash-related logic, since other sublcasses of
    `UniquableMDNode` may need to hash based on other fields.

To keep this diff from getting too big, I've added casts to `MDTuple`
that won't really scale as new subclasses of `UniquableMDNode` are
added, but I'll clean those up incrementally.

(No functionality change intended.)

llvm-svn: 225682

9 years ago[LIT] Decode string result in lit.util.capture
Eric Fiselier [Mon, 12 Jan 2015 20:09:34 +0000 (20:09 +0000)]
[LIT] Decode string result in lit.util.capture

Summary: I think this is probably a bug, but I'm putting this up for review just to be sure. I think that `lit.util.capture` should decode the resulting string in the same way `lit.util.executeCommand` does.

Reviewers: ddunbar, EricWF

Reviewed By: EricWF

Subscribers: llvm-commits

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

llvm-svn: 225681

9 years agoIR: Invert logic to simplify control flow, NFC
Duncan P. N. Exon Smith [Mon, 12 Jan 2015 19:45:44 +0000 (19:45 +0000)]
IR: Invert logic to simplify control flow, NFC

llvm-svn: 225670

9 years agoIR: Separate out decrementUnresolvedOperandCount(), NFC
Duncan P. N. Exon Smith [Mon, 12 Jan 2015 19:43:15 +0000 (19:43 +0000)]
IR: Separate out decrementUnresolvedOperandCount(), NFC

llvm-svn: 225667

9 years agoFix typo Block.h vs Blocks.h
Ben Langmuir [Mon, 12 Jan 2015 19:42:27 +0000 (19:42 +0000)]
Fix typo Block.h vs Blocks.h

Thanks for Jeremy for noticing!

llvm-svn: 225666

9 years agoIR: Prevent handleChangedOperand() recursion
Duncan P. N. Exon Smith [Mon, 12 Jan 2015 19:36:35 +0000 (19:36 +0000)]
IR: Prevent handleChangedOperand() recursion

Instead of returning early on `handleChangedOperand()` recursion
(finally identified (and test added) in r225657), prevent it upfront by
releasing operands before RAUW.

Aside from massively different program flow, there should be no
functionality change ;).

llvm-svn: 225665

9 years ago[PowerPC]To provide better compatibility with gcc I added the __bool keyword to the...
Bill Seurer [Mon, 12 Jan 2015 19:35:51 +0000 (19:35 +0000)]
[PowerPC]To provide better compatibility with gcc I added the __bool keyword to the Alitivec support in clang. __bool is functionally identical to using bool when declaring vector types. For example:

vector bool char v_bc;
vector __bool char v___bc;

clang already supported vector/__vector and pixel/__pixel but was missing __bool.

http://llvm.org/bugs/show_bug.cgi?id=19220

For reference: https://gcc.gnu.org/onlinedocs/gcc-4.9.2/gcc/PowerPC-AltiVec_002fVSX-Built-in-Functions.html

http://reviews.llvm.org/D6882

llvm-svn: 225664

9 years agoR600/SI: Use RegisterOperands to specify which operands can accept immediates
Tom Stellard [Mon, 12 Jan 2015 19:33:18 +0000 (19:33 +0000)]
R600/SI: Use RegisterOperands to specify which operands can accept immediates

There are some operands which can take either immediates or registers
and we were previously using different register class to distinguish
between operands that could take immediates and those that could not.

This patch switches to using RegisterOperands which should simplify the
backend by reducing the number of register classes and also make it
easier to implement the assembler.

llvm-svn: 225662

9 years agoTarget: Allow target specific operand types
Tom Stellard [Mon, 12 Jan 2015 19:33:09 +0000 (19:33 +0000)]
Target: Allow target specific operand types

This adds two new fields to the RegisterOperand TableGen class:

string OperandNamespace = "MCOI";
string OperandType = "OPERAND_REGISTER";

These fields can be used to specify a target specific operand type,
which will be stored in the OperandType member of the MCOperandInfo
object.

This can be useful for targets that need to store some extra information
about operands that cannot be expressed using the target independent
types.  For example, in the R600 backend, there are operands which
can take either registers or immediates and it is convenient to be able
to specify this in the TableGen definitions.

llvm-svn: 225661

9 years agoGVN: propagate equalities for floating point compares
Sanjay Patel [Mon, 12 Jan 2015 19:29:48 +0000 (19:29 +0000)]
GVN: propagate equalities for floating point compares

Allow optimizations based on FP comparison values in the same way
as integers.

This resolves PR17713:
http://llvm.org/bugs/show_bug.cgi?id=17713

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

llvm-svn: 225660

9 years agoFix bogus 'method is unavailable' errors with modules
Ben Langmuir [Mon, 12 Jan 2015 19:27:00 +0000 (19:27 +0000)]
Fix bogus 'method is unavailable' errors with modules

This just tweaks the fix from r224892 (which handled PCHs) to work with
modules, where we will serialize each method individually and hence the
hasMoreThanOneDecl bit needs to be updated as we add the methods.

llvm-svn: 225659

9 years agoIR: Add test for handleChangedOperand() recursion
Duncan P. N. Exon Smith [Mon, 12 Jan 2015 19:22:04 +0000 (19:22 +0000)]
IR: Add test for handleChangedOperand() recursion

Turns out this can happen.  Remove the `FIXME` and add a testcase that
crashes without the extra logic.

llvm-svn: 225657

9 years agoIR: Separate out recalculateHash(), NFC
Duncan P. N. Exon Smith [Mon, 12 Jan 2015 19:16:34 +0000 (19:16 +0000)]
IR: Separate out recalculateHash(), NFC

llvm-svn: 225655

9 years agoIR: Separate out helper: resolveAfterOperandChange(), NFC
Duncan P. N. Exon Smith [Mon, 12 Jan 2015 19:14:15 +0000 (19:14 +0000)]
IR: Separate out helper: resolveAfterOperandChange(), NFC

llvm-svn: 225654

9 years agoIR: Use SubclassData32 directly, NFC
Duncan P. N. Exon Smith [Mon, 12 Jan 2015 19:12:37 +0000 (19:12 +0000)]
IR: Use SubclassData32 directly, NFC

Simplify some logic by accessing `SubclassData32` directly instead of
relying on API.

llvm-svn: 225653

9 years agoRegisterCoalescer: Turn some impossible conditions into asserts
Matthias Braun [Mon, 12 Jan 2015 19:10:17 +0000 (19:10 +0000)]
RegisterCoalescer: Turn some impossible conditions into asserts

This is a fixed version of reverted r225500. It fixes the too early
if() continue; of the last patch and adds a comment to the unorthodox
loop.

llvm-svn: 225652

9 years agoMore [-Werror,-Winconsistent-missing-override] fixes.
Eric Christopher [Mon, 12 Jan 2015 19:09:48 +0000 (19:09 +0000)]
More [-Werror,-Winconsistent-missing-override] fixes.

llvm-svn: 225651

9 years agoIR: Don't allow operands to become unresolved
Duncan P. N. Exon Smith [Mon, 12 Jan 2015 18:59:40 +0000 (18:59 +0000)]
IR: Don't allow operands to become unresolved

Operands shouldn't change from being resolved to unresolved during graph
construction.  Simplify the logic based on that assumption.

llvm-svn: 225649

9 years agoIR: Remove redundant comment, NFC
Duncan P. N. Exon Smith [Mon, 12 Jan 2015 18:45:32 +0000 (18:45 +0000)]
IR: Remove redundant comment, NFC

llvm-svn: 225648

9 years agoIR: Simplify code, NFC
Duncan P. N. Exon Smith [Mon, 12 Jan 2015 18:45:01 +0000 (18:45 +0000)]
IR: Simplify code, NFC

llvm-svn: 225647

9 years agoIR: Make temporary nodes distinct
Duncan P. N. Exon Smith [Mon, 12 Jan 2015 18:41:26 +0000 (18:41 +0000)]
IR: Make temporary nodes distinct

Change the return of `MDNode::isDistinct()` for `MDNode::getTemporary()`
to `true`.  They aren't uniqued.

llvm-svn: 225646

9 years agoUpdate comment.
Rui Ueyama [Mon, 12 Jan 2015 18:32:24 +0000 (18:32 +0000)]
Update comment.

llvm-svn: 225645

9 years agoAdd r224985 back with two fixes.
Rafael Espindola [Mon, 12 Jan 2015 18:13:07 +0000 (18:13 +0000)]
Add r224985 back with two fixes.

One is that AArch64 has additional restrictions on when local relocations can
be used. We have to take those into consideration when deciding to put a L
symbol in the symbol table or not.

The other is that ld64 requires the relocations to cstring to use linker
visible symbols on AArch64.

Thanks to Michael Zolotukhin for testing this!

Remove doesSectionRequireSymbols.

In an assembly expression like

bar:
.long L0 + 1

the intended semantics is that bar will contain a pointer one byte past L0.

In sections that are merged by content (strings, 4 byte constants, etc), a
single position in the section doesn't give the linker enough information.
For example, it would not be able to tell a relocation must point to the
end of a string, since that would look just like the start of the next.

The solution used in ELF to use relocation with symbols if there is a non-zero
addend.

In MachO before this patch we would just keep all symbols in some sections.

This would miss some cases (only cstrings on x86_64 were implemented) and was
inefficient since most relocations have an addend of 0 and can be represented
without the symbol.

This patch implements the non-zero addend logic for MachO too.

llvm-svn: 225644

9 years agoIR: Simplify replaceOperandWith(), NFC
Duncan P. N. Exon Smith [Mon, 12 Jan 2015 18:01:45 +0000 (18:01 +0000)]
IR: Simplify replaceOperandWith(), NFC

This will call `handleChangedOperand()` less frequently, but in that
case (i.e., `isStoredDistinctInContext()`) it has identical logic to
here.

llvm-svn: 225643

9 years agoIR: Remove redundant calls to MDNode::setHash(), NFC
Duncan P. N. Exon Smith [Mon, 12 Jan 2015 17:57:38 +0000 (17:57 +0000)]
IR: Remove redundant calls to MDNode::setHash(), NFC

`storeDistinctInContext()` already calls `setHash(0)`.

llvm-svn: 225642

9 years ago[ASan] Move the shadow on Windows 32-bit from 0x20000000 to 0x40000000
Timur Iskhodzhanov [Mon, 12 Jan 2015 17:38:58 +0000 (17:38 +0000)]
[ASan] Move the shadow on Windows 32-bit from 0x20000000 to 0x40000000

llvm-svn: 225641

9 years ago[SimplifyLibCalls] Factor out fortified libcall handling.
Ahmed Bougacha [Mon, 12 Jan 2015 17:22:43 +0000 (17:22 +0000)]
[SimplifyLibCalls] Factor out fortified libcall handling.

This lets us remove CGP duplicate.

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

llvm-svn: 225640

9 years ago[SimplifyLibCalls] Factor out str/mem libcall optimizations.
Ahmed Bougacha [Mon, 12 Jan 2015 17:20:06 +0000 (17:20 +0000)]
[SimplifyLibCalls] Factor out str/mem libcall optimizations.

Put them in a separate function, so we can reuse them to further
simplify fortified libcalls as well.

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

llvm-svn: 225639

9 years ago[SimplifyLibCalls] Factor out signature checks for fortifiable libcalls.
Ahmed Bougacha [Mon, 12 Jan 2015 17:18:19 +0000 (17:18 +0000)]
[SimplifyLibCalls] Factor out signature checks for fortifiable libcalls.

The checks are the same for fortified counterparts to the libcalls, so
we might as well do them in a single place.

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

llvm-svn: 225638

9 years ago[asan] Fix uninit in coverage.
Evgeniy Stepanov [Mon, 12 Jan 2015 17:13:20 +0000 (17:13 +0000)]
[asan] Fix uninit in coverage.

pc_fd was not initialized to (-1) on some code paths, resulting in the program
erroneously closing stdin when reinitializing coverage.

llvm-svn: 225637

9 years ago[asan] Pass activation options in the android test runner.
Evgeniy Stepanov [Mon, 12 Jan 2015 17:10:05 +0000 (17:10 +0000)]
[asan] Pass activation options in the android test runner.

llvm-svn: 225636

9 years agoFix two extra semicolon warnings
Ehsan Akhgari [Mon, 12 Jan 2015 17:03:02 +0000 (17:03 +0000)]
Fix two extra semicolon warnings

Reviewers: timurrrr

Subscribers: llvm-commits

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

llvm-svn: 225635

9 years agoFix vexing parse in test.
Eric Fiselier [Mon, 12 Jan 2015 15:56:41 +0000 (15:56 +0000)]
Fix vexing parse in test.

llvm-svn: 225633

9 years ago[mips] Explain why we need to always clobber for MIPS inline asm. NFC.
Toma Tabacu [Mon, 12 Jan 2015 14:41:30 +0000 (14:41 +0000)]
[mips] Explain why we need to always clobber  for MIPS inline asm. NFC.

llvm-svn: 225632

9 years ago[ASan] Handle SIGBUS on Linux.
Jay Foad [Mon, 12 Jan 2015 13:46:37 +0000 (13:46 +0000)]
[ASan] Handle SIGBUS on Linux.

Summary:
On Linux in some situations we can get SIGBUS instead of SIGSEGV on
stack overflow, so asan should handle SIGBUS as well as SIGSEGV.

https://code.google.com/p/address-sanitizer/issues/detail?id=369

Reviewers: samsonov, glider

Reviewed By: glider

Subscribers: glider, llvm-commits

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

llvm-svn: 225630

9 years agoMake LoopConvert work with containers that are used like arrays.
Daniel Jasper [Mon, 12 Jan 2015 13:17:56 +0000 (13:17 +0000)]
Make LoopConvert work with containers that are used like arrays.

llvm-svn: 225629

9 years agoFix assertion in BreakableBlockComment (http://llvm.org/PR21916).
Alexander Kornienko [Mon, 12 Jan 2015 13:11:12 +0000 (13:11 +0000)]
Fix assertion in BreakableBlockComment (llvm.org/PR21916).

Reviewers: djasper

Reviewed By: djasper

Subscribers: klimek, cfe-commits

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

llvm-svn: 225628

9 years ago[mips][microMIPS] Implement BEQZ16 and BNEZ16 instructions
Jozef Kolek [Mon, 12 Jan 2015 12:03:34 +0000 (12:03 +0000)]
[mips][microMIPS] Implement BEQZ16 and BNEZ16 instructions

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

llvm-svn: 225627

9 years agoSuppress clang/test/Driver/rewrite-map-in-diagnostics.c on win32 for now. This doesn...
NAKAMURA Takumi [Mon, 12 Jan 2015 11:39:04 +0000 (11:39 +0000)]
Suppress clang/test/Driver/rewrite-map-in-diagnostics.c on win32 for now. This doesn't fail on "env clang". Investigating.

llvm-svn: 225626

9 years agoclang-format: Improve format of lambdas in ctor initializers.
Daniel Jasper [Mon, 12 Jan 2015 10:23:24 +0000 (10:23 +0000)]
clang-format: Improve format of lambdas in ctor initializers.

Before:
  Constructor()
      : Constructor([] { // comment
        int i;
      }) {}

After:
  Constructor()
      : Constructor([] { // comment
          int i;
        }) {}

llvm-svn: 225625

9 years agoRename RefersToCapturedVariable to RefersToEnclosingVariableOrCapture, NFC
Alexey Bataev [Mon, 12 Jan 2015 10:17:46 +0000 (10:17 +0000)]
Rename RefersToCapturedVariable to RefersToEnclosingVariableOrCapture, NFC

llvm-svn: 225624

9 years agoclang-format: Fix formatting of inline asm.
Daniel Jasper [Mon, 12 Jan 2015 10:14:56 +0000 (10:14 +0000)]
clang-format: Fix formatting of inline asm.

Specifically, adjust the leading "__asm {" and trailing "}" while still
leaving the assembly inside it alone.

This fixes llvm.org/PR22190.

llvm-svn: 225623

9 years agoParse: Get rid of cxx_exceptspec_end, use EOF instead
David Majnemer [Mon, 12 Jan 2015 09:16:57 +0000 (09:16 +0000)]
Parse: Get rid of cxx_exceptspec_end, use EOF instead

Similar to r225619, use a special EOF token to mark the end of the
exception specification instead of cxx_exceptspec_end.  Use the current
scope as the marker.

llvm-svn: 225622

9 years agoPut this test's input in the Inputs directory where it belongs, rather than
Richard Smith [Mon, 12 Jan 2015 08:50:47 +0000 (08:50 +0000)]
Put this test's input in the Inputs directory where it belongs, rather than
reusing a file from a different test directory.

llvm-svn: 225621

9 years agoParse: Just a small tidy-up in ParseLexedMethodDeclaration
David Majnemer [Mon, 12 Jan 2015 06:51:15 +0000 (06:51 +0000)]
Parse: Just a small tidy-up in ParseLexedMethodDeclaration

No functional change intended, just tidy up the parse flow.

llvm-svn: 225620

9 years agoParse: Get rid of tok::cxx_defaultarg_end, use EOF instead
David Majnemer [Mon, 12 Jan 2015 05:17:40 +0000 (05:17 +0000)]
Parse: Get rid of tok::cxx_defaultarg_end, use EOF instead

I added setEofData/getEofData to solve this sort of problem back in
r224505.  Use the Param's decl to tell us if this is *our* EOF token.

llvm-svn: 225619

9 years agoAdd a new utility script that helps update very simple regression tests.
Chandler Carruth [Mon, 12 Jan 2015 04:43:18 +0000 (04:43 +0000)]
Add a new utility script that helps update very simple regression tests.

This script is currently specific to x86 and limited to use with very
small regression or feature tests using 'llc' and 'FileCheck' in
a reasonably canonical way. It is in no way general purpose or robust at
this point. However, it works quite well for simple examples. Here is
the intended workflow:

- Make a change that requires updating N test files and M functions'
  assertions within those files.
- Stash the change.
- Update those N test files' RUN-lines to look "canonical"[1].
- Refresh the FileCheck lines for either the entire file or select
  functions by running this script.
  - The script will parse the RUN lines and run the 'llc' binary you
    give it according to each line, collecting the asm.
  - It will then annotate each function with the appropriate FileCheck
    comments to check every instruction from the start of the first
    basic block to the last return.
  - There will be numerous cases where the script either fails to remove
    the old lines, or inserts checks which need to be manually editted,
    but the manual edits tend to be deletions or replacements of
    registers with FileCheck variables which are fast manual edits.
  - A common pattern is to have the script insert complete checking of
    every instruction, and then edit it down to only check the relevant
    ones.
  - Be careful to do all of these cleanups though! The script is
    designed to make transferring and formatting the asm output of llc
    into a test case fast, it is *not* designed to be authoratitive
    about what constitutes a good test!
- Commit the nice fresh baseline of checks.
- Unstash your change and rebuild llc.
- Re-run script to regenerate the FileCheck annotations
  - Remember to re-cleanup these annotations!!!
- Check the diff to make sure this is sane, checking the things you
  expected it to, and check that the newly updated tests actually pass.
- Profit!

Also, I'm *terrible* at writing Python, and frankly I didn't spend a lot
of time making this script beautiful or well engineered. But it's useful
to me and may be useful to others so I thought I'd send it out.

http://reviews.llvm.org/D5546

llvm-svn: 225618

9 years ago[PowerPC] Fix calls to non-function objects
Hal Finkel [Mon, 12 Jan 2015 04:34:47 +0000 (04:34 +0000)]
[PowerPC] Fix calls to non-function objects

Looking at r225438 inspired me to see how the PowerPC backend handled the
situation (calling a bitcasted TLS global), and it turns out we also produced
an error (cannot select ...). What it means to "call" something that is not a
function is implementation and platform specific, but in the name of doing
something (besides crashing), this makes sure we do what GCC does (treat all
such calls as calls through a function pointer -- meaning that the pointer is
assumed, as is the convention on PPC, to point to a function descriptor
structure holding the actual code address along with the function's TOC pointer
and environment pointer). As GCC does, we now do the same for calling regular
(non-TLS) non-function globals too.

I'm not sure whether this is the most useful way to define the behavior, but at
least we won't be alone.

llvm-svn: 225617

9 years agoParse: It's cleaner to handle cxx_defaultarg_end in SkipUntil directly
David Majnemer [Mon, 12 Jan 2015 03:36:37 +0000 (03:36 +0000)]
Parse: It's cleaner to handle cxx_defaultarg_end in SkipUntil directly

llvm-svn: 225616

9 years agoParse: Don't let BalancedDelimiterTracker consume cxx_defaultarg_end
David Majnemer [Mon, 12 Jan 2015 03:14:18 +0000 (03:14 +0000)]
Parse: Don't let BalancedDelimiterTracker consume cxx_defaultarg_end

It is not correct to let it consume the cxx_defaultarg_end token.  I'm
starting to wonder if it makes more sense to stop SkipUntil from
consuming such tokens.

llvm-svn: 225615

9 years agoDriver: include rewrite maps in the diagnostics
Saleem Abdulrasool [Mon, 12 Jan 2015 02:33:09 +0000 (02:33 +0000)]
Driver: include rewrite maps in the diagnostics

The rewrite map files are not copied, and so cannot be tracked as temporary
files.  Add them explicitly to the list of files that we request from the user
to be attached to bug reports.

llvm-svn: 225614

9 years agoParse: Don't parse beyond the end of the synthetic default argument tok
David Majnemer [Mon, 12 Jan 2015 02:28:16 +0000 (02:28 +0000)]
Parse: Don't parse beyond the end of the synthetic default argument tok

Recovery from malformed lambda introducers would find us consuming the
synthetic default argument token, which is bad.  Instead, stop right
before that token.

llvm-svn: 225613

9 years ago[X86][SSE] Minor fix to VPBLENDW AVX2 commutation.
Simon Pilgrim [Sun, 11 Jan 2015 22:08:01 +0000 (22:08 +0000)]
[X86][SSE] Minor fix to VPBLENDW AVX2 commutation.

D6015 / rL221313 enabled commutation for SSE immediate blend instructions, but due to a typo the AVX2 VPBLENDW ymm instructions weren't flagged as commutative along with the others in the tables, but were still being commuted in code and tested for.

llvm-svn: 225612

9 years agoFix for lldb-platform linking error on OSX/CMake
Vince Harron [Sun, 11 Jan 2015 18:38:25 +0000 (18:38 +0000)]
Fix for lldb-platform linking error on OSX/CMake

Tested on Linux and OSX

Submitted for Bob Campbell

llvm-svn: 225611

9 years agoAdd FreeBSD support for __clear_cache.
Roman Divacky [Sun, 11 Jan 2015 18:21:11 +0000 (18:21 +0000)]
Add FreeBSD support for __clear_cache.

llvm-svn: 225610

9 years agoOne more #include request in the test suite from Walter Brown
Marshall Clow [Sun, 11 Jan 2015 18:07:06 +0000 (18:07 +0000)]
One more #include request in the test suite from Walter Brown

llvm-svn: 225609

9 years agoFix silly mistake in release notes for Mips.
Daniel Sanders [Sun, 11 Jan 2015 10:48:20 +0000 (10:48 +0000)]
Fix silly mistake in release notes for Mips.

llvm-svn: 225608

9 years agoAdded release notes for the Mips target.
Daniel Sanders [Sun, 11 Jan 2015 10:34:52 +0000 (10:34 +0000)]
Added release notes for the Mips target.

llvm-svn: 225607

9 years agoBasic: Numeric constraints are multidigit
David Majnemer [Sun, 11 Jan 2015 10:22:41 +0000 (10:22 +0000)]
Basic: Numeric constraints are multidigit

Clang would treat the digits in an "11m" input constraint separately as
if it was handling constraint 1 twice instead of constraint 11.

llvm-svn: 225606

9 years agoBasic: [asmSymbolicName] follows the same rule as numbers in asm inputs
David Majnemer [Sun, 11 Jan 2015 09:57:13 +0000 (09:57 +0000)]
Basic: [asmSymbolicName] follows the same rule as numbers in asm inputs

Input constraints like "0" and "[foo]" should be treated the same when
it comes to their corresponding output constraint.

This fixes PR21850.

llvm-svn: 225605

9 years agoGot C++ unit tests running on Linux again
Vince Harron [Sun, 11 Jan 2015 09:42:12 +0000 (09:42 +0000)]
Got C++ unit tests running on Linux again

llvm-svn: 225604

9 years agoBasic: The asm constraint '#m' isn't valid, reject it
David Majnemer [Sun, 11 Jan 2015 09:39:03 +0000 (09:39 +0000)]
Basic: The asm constraint '#m' isn't valid, reject it

llvm-svn: 225603

9 years agoCodeGen: Simplify consecutive '%' modifiers
David Majnemer [Sun, 11 Jan 2015 09:13:56 +0000 (09:13 +0000)]
CodeGen: Simplify consecutive '%' modifiers

LLVM the consecutive '%' modifiers are redundant, skip them.

llvm-svn: 225602

9 years agoCodeGen: Simplify consecutive '&' modifiers
David Majnemer [Sun, 11 Jan 2015 09:09:01 +0000 (09:09 +0000)]
CodeGen: Simplify consecutive '&' modifiers

LLVM the consecutive '&' modifiers are redundant, skip them.

llvm-svn: 225601

9 years agoBasic: The asm constraint '+#r' isn't valid, reject it
David Majnemer [Sun, 11 Jan 2015 08:52:38 +0000 (08:52 +0000)]
Basic: The asm constraint '+#r' isn't valid, reject it

llvm-svn: 225600

9 years agoRevert most of r225597
David Majnemer [Sun, 11 Jan 2015 07:29:51 +0000 (07:29 +0000)]
Revert most of r225597

We can't rely on a DataLayout enlightened constant folder.

llvm-svn: 225599

9 years agoChange a couple more template parameter names from 'T' to '_Tp', etc. Thanks to Ondř...
Marshall Clow [Sun, 11 Jan 2015 06:15:59 +0000 (06:15 +0000)]
Change a couple more template parameter names from 'T' to '_Tp', etc. Thanks to Ondřej Majerech for the patch, but I did a bit more.

llvm-svn: 225598

9 years agoX86: Properly decode shuffle masks when the constant pool type is weird
David Majnemer [Sun, 11 Jan 2015 05:08:57 +0000 (05:08 +0000)]
X86: Properly decode shuffle masks when the constant pool type is weird

It's possible for the constant pool entry for the shuffle mask to come
from a completely different operation.  This occurs when Constants have
the same bit pattern but have different types.

Make DecodePSHUFBMask tolerant of types which, after a bitcast, are
appropriately sized vector types.

This fixes PR22188.

llvm-svn: 225597

9 years agoX86: teach X86TargetLowering about L,M,O constraints
Saleem Abdulrasool [Sun, 11 Jan 2015 04:39:24 +0000 (04:39 +0000)]
X86: teach X86TargetLowering about L,M,O constraints

Teach the ISelLowering for X86 about the L,M,O target specific constraints.
Although, for the moment, clang performs constraint validation and prevents
passing along inline asm which may have immediate constant constraints violated,
the backend should be able to cope with the invalid inline asm a bit better.

llvm-svn: 225596

9 years agoARM: add support for segment base relocations (SBREL)
Saleem Abdulrasool [Sun, 11 Jan 2015 04:39:18 +0000 (04:39 +0000)]
ARM: add support for segment base relocations (SBREL)

This adds support for parsing and emitting the SBREL relocation variant for the
ARM target.  Handling this relocation variant is necessary for supporting the
full ARM ELF specification.  Addresses PR22128.

llvm-svn: 225595