platform/upstream/llvm.git
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 OndrÌŒ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

9 years agoDon't rely on the default constructor default constructing a begin and
Chandler Carruth [Sun, 11 Jan 2015 01:43:06 +0000 (01:43 +0000)]
Don't rely on the default constructor default constructing a begin and
end iterator for iterator_range<>. I removed this constructor because
for some iterators (notably pointers) it left begin and end
uninitialized. It also is an usual constraint that an iterator default
constructs to a valid end iterator such that the pair of them for
a valid range. In the three places where this was used in Clang,
explicitly build the empty range from the iterators and comment on why
default constructed iterators make sense here.

llvm-svn: 225594

9 years ago[x86] Remove some windows line endings that snuck into the tests here.
Chandler Carruth [Sun, 11 Jan 2015 01:36:20 +0000 (01:36 +0000)]
[x86] Remove some windows line endings that snuck into the tests here.

Folks on Windows, remember to set up your subversion to strip these when
submitting...

llvm-svn: 225593

9 years ago[ADT] Remove the unused default constructor for iterator_range.
Chandler Carruth [Sun, 11 Jan 2015 01:16:26 +0000 (01:16 +0000)]
[ADT] Remove the unused default constructor for iterator_range.

This default constructor is a bit weird. It left the range in an invalid
state. That might be reasonable so that you can construct a local
iterator range and assign to it based on some logic to compute the range
you want. If folks would like to support that use case, I can add it
back, but in 238-odd usages none have actually wanted to do this. ;]

llvm-svn: 225592

9 years agoFix PR22179.
Sanjoy Das [Sat, 10 Jan 2015 23:41:24 +0000 (23:41 +0000)]
Fix PR22179.

We were incorrectly inferring nsw for certain SCEVs. We can be more
aggressive here (see Richard Smith's comment on
http://llvm.org/bugs/show_bug.cgi?id=22179) but this change just
focuses on correctness.

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

llvm-svn: 225591

9 years agoRevert r225500, it leads to infinite loops.
Joerg Sonnenberger [Sat, 10 Jan 2015 21:49:36 +0000 (21:49 +0000)]
Revert r225500, it leads to infinite loops.

llvm-svn: 225590

9 years ago[X86][SSE] Improved (v)insertps shuffle matching
Simon Pilgrim [Sat, 10 Jan 2015 19:45:33 +0000 (19:45 +0000)]
[X86][SSE] Improved (v)insertps shuffle matching

In the current code we only attempt to match against insertps if we have exactly one element from the second input vector, irrespective of how much of the shuffle result is zeroable.

This patch checks to see if there is a single non-zeroable element from either input that requires insertion. It also supports matching of cases where only one of the inputs need to be referenced.

We also split insertps shuffle matching off into a new lowerVectorShuffleAsInsertPS function.

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

llvm-svn: 225589

9 years ago.gitignore: add some rules for tagging programs
Ramkumar Ramachandra [Sat, 10 Jan 2015 19:11:29 +0000 (19:11 +0000)]
.gitignore: add some rules for tagging programs

Often, we miss committing new files, and 'arc diff' is supposed to warn
us about this. Unfortunately, because of the spurious output of the
command (due to unignored untracked files), we tend to ignore it and
lose information.

llvm-svn: 225588

9 years agofix pr18645. Correct logic concerning 'T &&' deduction against lvalues.
Nathan Sidwell [Sat, 10 Jan 2015 18:16:25 +0000 (18:16 +0000)]
fix pr18645. Correct logic concerning 'T &&' deduction against lvalues.

llvm-svn: 225587

9 years agoSema: The asm constraint '+&m' isn't valid, reject it
David Majnemer [Sat, 10 Jan 2015 10:43:19 +0000 (10:43 +0000)]
Sema: The asm constraint '+&m' isn't valid, reject it

Don't permit '+&m' to make it to CodeGen, it's invalid.

llvm-svn: 225586

9 years agoAdd RegisterNumber.cpp.
Jason Molenda [Sat, 10 Jan 2015 10:39:27 +0000 (10:39 +0000)]
Add RegisterNumber.cpp.

llvm-svn: 225585

9 years ago[PowerPC] Mark zext of a small scalar load as free
Hal Finkel [Sat, 10 Jan 2015 08:21:59 +0000 (08:21 +0000)]
[PowerPC] Mark zext of a small scalar load as free

This initial implementation of PPCTargetLowering::isZExtFree marks as free
zexts of small scalar loads (that are not sign-extending). This callback is
used by SelectionDAGBuilder's RegsForValue::getCopyToRegs, and thus to
determine whether a zext or an anyext is used to lower illegally-typed PHIs.
Because later truncates of zero-extended values are nops, this allows for the
elimination of later unnecessary truncations.

Fixes the initial complaint associated with PR22120.

llvm-svn: 225584

9 years agoRemove some whitespace.
Justin Hibbits [Sat, 10 Jan 2015 07:50:31 +0000 (07:50 +0000)]
Remove some whitespace.

llvm-svn: 225583

9 years agoCheck assert before the instruction that uses the assumption checked.
Tobias Grosser [Sat, 10 Jan 2015 07:40:39 +0000 (07:40 +0000)]
Check assert before the instruction that uses the assumption checked.

I did not find a good test case, as the assert should generally hold in Polly.

llvm-svn: 225582

9 years agoAdd a new warning, -Wself-move, to Clang.
Richard Trieu [Sat, 10 Jan 2015 06:04:18 +0000 (06:04 +0000)]
Add a new warning, -Wself-move, to Clang.

-Wself-move is similiar to -Wself-assign.  This warning is triggered when
a value is attempted to be moved to itself.  See r221008 for a bug that
would have been caught with this warning.

llvm-svn: 225581

9 years agoConvertUTFTest: fix misleading empty line
Dmitri Gribenko [Sat, 10 Jan 2015 05:03:29 +0000 (05:03 +0000)]
ConvertUTFTest: fix misleading empty line

llvm-svn: 225580

9 years agoForgot to include RegisterNumber.h in prev commit.
Jason Molenda [Sat, 10 Jan 2015 04:20:14 +0000 (04:20 +0000)]
Forgot to include RegisterNumber.h in prev commit.

llvm-svn: 225579

9 years agoHoist the RegisterNumber class out of RegisterContextLLDB and make
Jason Molenda [Sat, 10 Jan 2015 04:01:03 +0000 (04:01 +0000)]
Hoist the RegisterNumber class out of RegisterContextLLDB and make
it more generally available.

Add checks to UnwindAssembly_x86::AugmentUnwindPlanFromCallSite() so
that it won't try to augment an UnwindPlan that already describes
the function epilogue.

Add a test case for backtracing out of _sigtramp on Darwin systems.
This could probably be adapted to test the same thing on linux/bsd but
the function names of sigtramp and kill are probably platform
specific and I'm not sure what they should be.

llvm-svn: 225578

9 years agotests: fix previous commit
Saleem Abdulrasool [Sat, 10 Jan 2015 02:53:25 +0000 (02:53 +0000)]
tests: fix previous commit

The previous commit accidentally missed changes to the test output checking,
resulting in an errant failure.

llvm-svn: 225577

9 years agotest: merge ARM relocations test
Saleem Abdulrasool [Sat, 10 Jan 2015 02:48:29 +0000 (02:48 +0000)]
test: merge ARM relocations test

There is a fair number of relocations that are part of the AAELF specification.
Simply merge the tests into a single test file, otherwise, we will end up with
far too many test files to test each relocation type.  NFC.

llvm-svn: 225576

9 years agotests: convert a couple of ARM relocation tests to readobj
Saleem Abdulrasool [Sat, 10 Jan 2015 02:48:25 +0000 (02:48 +0000)]
tests: convert a couple of ARM relocation tests to readobj

These tests are checking the relocation generation.  Use the readobj output as
it is much easier to follow when glancing over the tests.

llvm-svn: 225575

9 years agoDon't fail if parent directory name contains a '+' character
Greg Fitzgerald [Sat, 10 Jan 2015 02:34:26 +0000 (02:34 +0000)]
Don't fail if parent directory name contains a '+' character

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

llvm-svn: 225574

9 years agoFully fix Bug #22115.
Justin Hibbits [Sat, 10 Jan 2015 01:57:21 +0000 (01:57 +0000)]
Fully fix Bug #22115.

Summary:
In the previous commit, the register was saved, but space was not allocated.
This resulted in the parameter save area potentially clobbering r30, leading to
nasty results.

Test Plan: Tests updated

Reviewers: hfinkel

Subscribers: llvm-commits

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

llvm-svn: 225573

9 years agoAdd C++ breakpoint tests where names are partially specified to ensure we don't regre...
Greg Clayton [Sat, 10 Jan 2015 01:35:02 +0000 (01:35 +0000)]
Add C++ breakpoint tests where names are partially specified to ensure we don't regress on this again.

Top of tree never regressed, but we have internal branches that we constantly merge and we need to make sure we don't regress.

<rdar://problem/19429907>

llvm-svn: 225572

9 years agoFix temporary lifetime extension from an initializer using braced "functional"
Richard Smith [Sat, 10 Jan 2015 01:28:13 +0000 (01:28 +0000)]
Fix temporary lifetime extension from an initializer using braced "functional"
cast notation T{...} when T is a reference type.

llvm-svn: 225571

9 years agoDon't emit implicit template instantiations eagerly (PR21718)
Hans Wennborg [Sat, 10 Jan 2015 01:19:48 +0000 (01:19 +0000)]
Don't emit implicit template instantiations eagerly (PR21718)

Their linkage can change if they are later explicitly instantiated. We would
previously emit such functions eagerly (as opposed to lazily on first use) if
they have a 'dllexport' or 'used' attribute, and fail an assert when hitting the
explicit instantiation.

This is achieved by replacing the old CodeGenModule::MayDeferGeneration() method
with two new ones: MustBeEmitted() and MayBeEmittedEagerly().

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

llvm-svn: 225570

9 years agoFix undefined behavior (shift of negative value) in RuntimeDyldMachOAArch64::encodeAd...
Alexey Samsonov [Sat, 10 Jan 2015 00:46:38 +0000 (00:46 +0000)]
Fix undefined behavior (shift of negative value) in RuntimeDyldMachOAArch64::encodeAddend.

Test Plan: regression test suite with/without UBSan.

Reviewers: lhames, ributzka

Subscribers: aemerson, llvm-commits

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

llvm-svn: 225568

9 years agoRespect the fact that the result object claims it doesn't want to be interactive...
Greg Clayton [Sat, 10 Jan 2015 00:42:12 +0000 (00:42 +0000)]
Respect the fact that the result object claims it doesn't want to be interactive by not forwarding STDIN to the python invocation when it isn't desired.

This fixes an issue of running "script" commands via SBDebugger::HandleCommand(...) and SBCommandInterpreter::HandleCommand(...) deadlocking Xcode.

<rdar://problem/18075038>

llvm-svn: 225567

9 years ago[PowerPC] Readjust the loop unrolling threshold
Hal Finkel [Sat, 10 Jan 2015 00:31:10 +0000 (00:31 +0000)]
[PowerPC] Readjust the loop unrolling threshold

Now that the way that the partial unrolling threshold for small loops is used
to compute the unrolling factor as been corrected, a slightly smaller threshold
is preferable. This is expected; other targets may need to re-tune as well.

llvm-svn: 225566

9 years ago[LoopUnroll] Fix the partial unrolling threshold for small loop sizes
Hal Finkel [Sat, 10 Jan 2015 00:30:55 +0000 (00:30 +0000)]
[LoopUnroll] Fix the partial unrolling threshold for small loop sizes

When we compute the size of a loop, we include the branch on the backedge and
the comparison feeding the conditional branch. Under normal circumstances,
these don't get replicated with the rest of the loop body when we unroll. This
led to the somewhat surprising behavior that really small loops would not get
unrolled enough -- they could be unrolled more and the resulting loop would be
below the threshold, because we were assuming they'd take
(LoopSize * UnrollingFactor) instructions after unrolling, instead of
(((LoopSize-2) * UnrollingFactor)+2) instructions. This fixes that computation.

llvm-svn: 225565

9 years ago[TestInferiorAssert] Differentiate DWARF and DSYM tests with suffixes.
Siva Chandra [Sat, 10 Jan 2015 00:25:23 +0000 (00:25 +0000)]
[TestInferiorAssert] Differentiate DWARF and DSYM tests with suffixes.

Reviewers: vharron, clayborg

Reviewed By: clayborg

Subscribers: lldb-commits

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

llvm-svn: 225564

9 years agoSupport Newlib as libc++'s C library [cstdio part, part 2]
Jonathan Roelofs [Sat, 10 Jan 2015 00:08:00 +0000 (00:08 +0000)]
Support Newlib as libc++'s C library [cstdio part, part 2]

Wrappers for clearerr, feof, ferror (which newlib implements as macros).

http://reviews.llvm.org/D5420

llvm-svn: 225563

9 years agoUse the DiagnosticHandler to print diagnostics when reading bitcode.
Rafael Espindola [Sat, 10 Jan 2015 00:07:30 +0000 (00:07 +0000)]
Use the DiagnosticHandler to print diagnostics when reading bitcode.

The bitcode reading interface used std::error_code to report an error to the
callers and it is the callers job to print diagnostics.

This is not ideal for error handling or diagnostic reporting:

* For error handling, all that the callers care about is 3 possibilities:
  * It worked
  * The bitcode file is corrupted/invalid.
  * The file is not bitcode at all.

* For diagnostic, it is user friendly to include far more information
  about the invalid case so the user can find out what is wrong with the
  bitcode file. This comes up, for example, when a developer introduces a
  bug while extending the format.

The compromise we had was to have a lot of error codes.

With this patch we use the DiagnosticHandler to communicate with the
human and std::error_code to communicate with the caller.

This allows us to have far fewer error codes and adds the infrastructure to
print better diagnostics. This is so because the diagnostics are printed when
he issue is found. The code that detected the problem in alive in the stack and
can pass down as much context as needed. As an example the patch updates
test/Bitcode/invalid.ll.

Using a DiagnosticHandler also moves the fatal/non-fatal error decision to the
caller. A simple one like llvm-dis can just use fatal errors. The gold plugin
needs a bit more complex treatment because of being passed non-bitcode files. An
hypothetical interactive tool would make all bitcode errors non-fatal.

llvm-svn: 225562

9 years agoRemove unnecessary/incorrect XFAIL after the revert of 225000
David Blaikie [Fri, 9 Jan 2015 23:38:45 +0000 (23:38 +0000)]
Remove unnecessary/incorrect XFAIL after the revert of 225000

llvm-svn: 225561

9 years agoRevert "Reapply debug info changes now that more precise column information is availa...
David Blaikie [Fri, 9 Jan 2015 23:27:12 +0000 (23:27 +0000)]
Revert "Reapply debug info changes now that more precise column information is available."

While the clang patch is reverted pending investigation/fixes.

This reverts commit r225001.

llvm-svn: 225560

9 years agoclang-format: [Java] Support formatting qualified annotations.
Nico Weber [Fri, 9 Jan 2015 23:25:06 +0000 (23:25 +0000)]
clang-format: [Java] Support formatting qualified annotations.

llvm-svn: 225559

9 years agoFix UBSan error reports in ValueMapCallbackVH and AssertingVH<T> empty/tombstone...
Alexey Samsonov [Fri, 9 Jan 2015 23:17:25 +0000 (23:17 +0000)]
Fix UBSan error reports in ValueMapCallbackVH and AssertingVH<T> empty/tombstone keys generation.

Summary:
One more attempt to fix UBSan reports: make sure DenseMapInfo::getEmptyKey()
and DenseMapInfo::getTombstoneKey() doesn't do any upcasts/downcasts to/from Value*.

Test Plan: check-llvm test suite with/without UBSan bootstrap

Reviewers: chandlerc, dexonsmith

Subscribers: llvm-commits, majnemer

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

llvm-svn: 225558

9 years agoDisable Go bindings test under UBSan.
Alexey Samsonov [Fri, 9 Jan 2015 23:17:23 +0000 (23:17 +0000)]
Disable Go bindings test under UBSan.

llvm-svn: 225557

9 years agoRemove AsanInterceptsSignal in favor of (equivalent) IsDeadlySignal.
Alexey Samsonov [Fri, 9 Jan 2015 23:03:31 +0000 (23:03 +0000)]
Remove AsanInterceptsSignal in favor of (equivalent) IsDeadlySignal.

llvm-svn: 225556

9 years agoRevert "DebugInfo: Generalize debug info location handling" and related commits
David Blaikie [Fri, 9 Jan 2015 23:00:28 +0000 (23:00 +0000)]
Revert "DebugInfo: Generalize debug info location handling" and related commits

This reverts commit r225000, r225021, r225083, r225086, r225090.

The root change (r225000) still has several issues where it's caused
calls to be emitted without debug locations. This causes assertion
failures if/when those calls are inlined.

I'll work up some test cases and fixes before recommitting this.

llvm-svn: 225555