oota-llvm.git
10 years ago[PM] Wire up the Verifier for the new pass manager and connect it to the
Chandler Carruth [Mon, 20 Jan 2014 11:34:08 +0000 (11:34 +0000)]
[PM] Wire up the Verifier for the new pass manager and connect it to the
various opt verifier commandline options.

Mostly mechanical wiring of the verifier to the new pass manager.
Exercises one of the more unusual aspects of it -- a pass can be either
a module or function pass interchangably. If this is ever problematic,
we can make things more constrained, but for things like the verifier
where there is an "obvious" applicability at both levels, it seems
convenient.

This is the next-to-last piece of basic functionality left to make the
opt commandline driving of the new pass manager minimally functional for
testing and further development. There is still a lot to be done there
(notably the factoring into .def files to kill the current boilerplate
code) but it is relatively uninteresting. The only interesting bit left
for minimal functionality is supporting the registration of analyses.
I'm planning on doing that on top of the .def file switch mostly because
the boilerplate for the analyses would be significantly worse.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199646 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoARM: add tlsldo relocation
Kai Nacke [Mon, 20 Jan 2014 11:00:40 +0000 (11:00 +0000)]
ARM: add tlsldo relocation

Add support for the symbol(tlsldo) relocation. This is required in order to
solve PR18554.

Reviewed by R. Golin, A. Korobeynikov.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199644 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[CMake] llvm_process_sources: Introduce a parameter, ADDITIONAL_HEADERS.
NAKAMURA Takumi [Mon, 20 Jan 2014 10:20:23 +0000 (10:20 +0000)]
[CMake] llvm_process_sources: Introduce a parameter, ADDITIONAL_HEADERS.

ADDITIONAL_HEADERS is intended to add header files for IDEs as hint.

For example:
  add_llvm_library(LLVMSupport
    Host.cpp
    ADDITIONAL_HEADERS
      Unix/Host.inc
      Windows/Host.inc
    )

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199639 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[ARM] Do not generate Tag_DIV_use=AllowDIVExt when hardware div is non-optional:...
Artyom Skrobov [Mon, 20 Jan 2014 10:18:42 +0000 (10:18 +0000)]
[ARM] Do not generate Tag_DIV_use=AllowDIVExt when hardware div is non-optional: it should have the default value of AllowDIVIfExists

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199638 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoRevert my commit in r199620 that added sections about namespaces to the
Chandler Carruth [Mon, 20 Jan 2014 10:15:32 +0000 (10:15 +0000)]
Revert my commit in r199620 that added sections about namespaces to the
coding standards, and instead fix the existing section.

Thanks to Daniel Jasper for pointing out we already had a section
devoted to this topic. Instead of adding sections, just hack on this
section some. Also fix the example in the anonymous namespace section
below it to agree with the new advice.

As a re-cap, this switches the LLVM preferred style to never indent
namespaces. Having two approaches just led to endless (and utterly
pointless) debates about what was "small enough". This wasn't helping
anyone. The no-indent rule is easy to understand and doesn't really make
anything harder to read. Moreover, with tools like clang-format it is
considerably nicer to have simple consistent rules.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199637 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoRevert r199628: "[AArch64 NEON] Fix a bug caused by undef lane when generating VEXT."
Chandler Carruth [Mon, 20 Jan 2014 08:18:01 +0000 (08:18 +0000)]
Revert r199628: "[AArch64 NEON] Fix a bug caused by undef lane when generating VEXT."

This test fails the newly added regression tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199631 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoFix a DenseMap iterator invalidation bug causing lots of crashes when
Chandler Carruth [Mon, 20 Jan 2014 08:07:07 +0000 (08:07 +0000)]
Fix a DenseMap iterator invalidation bug causing lots of crashes when
type units were enabled. The crux of the issue is that the
addDwarfTypeUnitType routine can end up being indirectly recursive. In
this case, the reference into the dense map (TU) became invalid by the
time we popped all the way back and used it to add the DIE type
signature.

Instead, use early return in the case where we can bypass the recursive
step and creating a type unit. Then use the pointer to the new type unit
to set up the DIE type signature in the case where we have to.

I tried really hard to reduce a testcase for this, but it's really
annoying. You have to get this to be mid-recursion when the densemap
grows. Even if we got a test case for this today, it'd be very unlikely
to continue exercising this pattern.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199630 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoFix all the remaining lost-fast-math-flags bugs I've been able to find. The most...
Owen Anderson [Mon, 20 Jan 2014 07:44:53 +0000 (07:44 +0000)]
Fix all the remaining lost-fast-math-flags bugs I've been able to find.  The most important of these are cases in the generic logic for combining BinaryOperators.
This logic hadn't been updated to handle FastMathFlags, and it took me a while to detect it because it doesn't show up in a simple search for CreateFAdd.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199629 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[AArch64 NEON] Fix a bug caused by undef lane when generating VEXT.
Kevin Qin [Mon, 20 Jan 2014 07:32:26 +0000 (07:32 +0000)]
[AArch64 NEON] Fix a bug caused by undef lane when generating VEXT.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199628 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoMC: whitespace
Saleem Abdulrasool [Mon, 20 Jan 2014 04:10:11 +0000 (04:10 +0000)]
MC: whitespace

Remove hard tabs in favour of spaces.  NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199624 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[PM] Fix a contradiction in the comments noticed by Anders.
Chandler Carruth [Mon, 20 Jan 2014 02:32:02 +0000 (02:32 +0000)]
[PM] Fix a contradiction in the comments noticed by Anders.

Have I mentioned that functions returning true on error and false on
success are confusing? They're more confusing when their name is
"verify". Anyways...

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199622 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[AArch64 NEON] Accept both #0.0 and #0 for comparing with floating point zero in...
Kevin Qin [Mon, 20 Jan 2014 02:14:05 +0000 (02:14 +0000)]
[AArch64 NEON] Accept both #0.0 and #0 for comparing with floating point zero in asm parser.

For FCMEQ, FCMGE, FCMGT, FCMLE and FCMLT, floating point zero will be
printed as #0.0 instead of #0. To support the history codes using #0,
we consider to let asm parser accept both #0.0 and #0.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199621 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoAdd some wording to the coding standards to say how to indent namespaces
Chandler Carruth [Mon, 20 Jan 2014 01:40:43 +0000 (01:40 +0000)]
Add some wording to the coding standards to say how to indent namespaces
(and to mention namespace ending comments). This is based on a quick
discussion on the developer mailing list where there was essentially no
objections to a simple and consistent rule. This should avoid future
debates about whether or not a namespace is "big enough" to indent. It
also matches clang-format's current behavior with LLVM source code which
hasn't really seen any opposition in code reviews that I spot checked.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199620 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoMove the retrieval of VT after all of the early exits from PerformOrCombine that...
Michael Gottesman [Sun, 19 Jan 2014 21:06:00 +0000 (21:06 +0000)]
Move the retrieval of VT after all of the early exits from PerformOrCombine that do not use VT. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199612 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[APInt] Fix nearestLogBase2 to return correct answers for very large APInt and APInt...
Michael Gottesman [Sun, 19 Jan 2014 20:33:48 +0000 (20:33 +0000)]
[APInt] Fix nearestLogBase2 to return correct answers for very large APInt and APInt with a bitwidth of 1.

I also improved the comments, added some more tests, etc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199610 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[APInt] Fixed bug where APInt(UINT32_MAX, 0) would blow up when being constructed.
Michael Gottesman [Sun, 19 Jan 2014 20:33:38 +0000 (20:33 +0000)]
[APInt] Fixed bug where APInt(UINT32_MAX, 0) would blow up when being constructed.

This was due to arithmetic overflow in the getNumBits() computation. Now we
cast BitWidth to a uint64_t so that does not occur during the computation. After
the computation is complete, the uint64_t is truncated when the function
returns.

I know that this is not something that is likely to happen, but it *IS* a valid
input and we should not blow up.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199609 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoInstCombine: Modernize a bunch of cast combines.
Benjamin Kramer [Sun, 19 Jan 2014 20:05:13 +0000 (20:05 +0000)]
InstCombine: Modernize a bunch of cast combines.

Also make them vector-aware.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199608 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoInstCombine: Hoist 3 copies of AddOne/SubOne into a header.
Benjamin Kramer [Sun, 19 Jan 2014 16:56:10 +0000 (16:56 +0000)]
InstCombine: Hoist 3 copies of AddOne/SubOne into a header.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199605 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoInstCombine: Replace a hand-rolled version of isKnownToBeAPowerOfTwo with the real...
Benjamin Kramer [Sun, 19 Jan 2014 16:48:41 +0000 (16:48 +0000)]
InstCombine: Replace a hand-rolled version of isKnownToBeAPowerOfTwo with the real thing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199604 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoInstCombine: Teach most integer add/sub/mul/div combines how to deal with vectors.
Benjamin Kramer [Sun, 19 Jan 2014 15:24:22 +0000 (15:24 +0000)]
InstCombine: Teach most integer add/sub/mul/div combines how to deal with vectors.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199602 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoInstCombine: Refactor fmul/fdiv combines to handle vectors.
Benjamin Kramer [Sun, 19 Jan 2014 13:36:27 +0000 (13:36 +0000)]
InstCombine: Refactor fmul/fdiv combines to handle vectors.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199598 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[CMake] Introduce new scheme of LLVM_TOOLS_BINARY_DIR and LLVM_LIBRARY_DIR
NAKAMURA Takumi [Sun, 19 Jan 2014 12:52:10 +0000 (12:52 +0000)]
[CMake] Introduce new scheme of LLVM_TOOLS_BINARY_DIR and LLVM_LIBRARY_DIR

  In LLVM build tree, they points corresponding INTDIR.

  In Clang standalone tree, they points external dir (llvm-config's --bindir and --libdir).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199595 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[CMake] Add comments in llvm/CMakeLists.txt.
NAKAMURA Takumi [Sun, 19 Jan 2014 12:47:26 +0000 (12:47 +0000)]
[CMake] Add comments in llvm/CMakeLists.txt.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199594 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[CMake] Deprecate LLVM_TOOLS_BINARY_DIR.
NAKAMURA Takumi [Sun, 19 Jan 2014 12:47:22 +0000 (12:47 +0000)]
[CMake] Deprecate LLVM_TOOLS_BINARY_DIR.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199593 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[CMake] Prune deprecate usage of CMAKE_RUNTIME_OUTPUT_DIRECTORY.
NAKAMURA Takumi [Sun, 19 Jan 2014 12:47:18 +0000 (12:47 +0000)]
[CMake] Prune deprecate usage of CMAKE_RUNTIME_OUTPUT_DIRECTORY.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199592 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoFix a really nasty SROA bug with how we handled out-of-bounds memcpy
Chandler Carruth [Sun, 19 Jan 2014 12:16:54 +0000 (12:16 +0000)]
Fix a really nasty SROA bug with how we handled out-of-bounds memcpy
intrinsics.

Reported on the list by Evan with a couple of attempts to fix, but it
took a while to dig down to the root cause. There are two overlapping
bugs here, both centering around the circumstance of discovering
a memcpy operand which is known to be completely outside the bounds of
the alloca.

First, we need to kill the *other* side of the memcpy if it was added to
this alloca. Otherwise we'll factor it into our slicing and try to
rewrite it even though we know for a fact that it is dead. This is made
more tricky because we can visit the sides in either order. So we have
to both kill the other side and skip instructions marked as dead. The
latter really should be goodness in every case, but here is a matter of
correctness.

Second, we need to actually remove the *uses* of the alloca by the
memcpy when queuing it for later deletion. Otherwise it may still be
using the alloca when we go to promote it (if the rewrite re-uses the
existing alloca instruction). Do this by factoring out the
use-clobbering used when for nixing a Phi argument and re-using it
across the operands of a to-be-deleted instruction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199590 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoARM ELF: ensure that the tag types are corrected
Saleem Abdulrasool [Sun, 19 Jan 2014 08:25:41 +0000 (08:25 +0000)]
ARM ELF: ensure that the tag types are corrected

Ensure that the tag types are reflected on a replacement.  This is particularly
important for the compatibility tag which has multiple representations where the
last definition wins.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199577 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoARM: update build attributes for ABI r2.09
Saleem Abdulrasool [Sun, 19 Jan 2014 08:25:35 +0000 (08:25 +0000)]
ARM: update build attributes for ABI r2.09

Update names for the names as per the current ABI errata.  Mark deprecated tags
as such.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199576 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoMove ARM build attributes into Support
Saleem Abdulrasool [Sun, 19 Jan 2014 08:25:27 +0000 (08:25 +0000)]
Move ARM build attributes into Support

This moves the ARM build attributes definitions and support routines into the
Support library.  The support routines simply permit the conversion of the value
to and from a string representation.

The movement is prompted in order to permit access to the constants and string
representations from readobj in order to facilitate decoding of the attributes
section.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199575 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoARM IAS: remove unnecessary special case
Saleem Abdulrasool [Sun, 19 Jan 2014 08:25:19 +0000 (08:25 +0000)]
ARM IAS: remove unnecessary special case

Tag_nodefaults is even and greater than 32 and thus does not need the special
check to fall into the correct category.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199574 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoLoopVectorizer: A reduction that has multiple uses of the reduction value is not
Arnold Schwaighofer [Sun, 19 Jan 2014 03:18:31 +0000 (03:18 +0000)]
LoopVectorizer: A reduction that has multiple uses of the reduction value is not
a reduction.

Really. Under certain circumstances (the use list of an instruction has to be
set up right - hence the extra pass in the test case) we would not recognize
when a value in a potential reduction cycle was used multiple times by the
reduction cycle.

Fixes PR18526.
radar://15851149

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199570 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[PM] Make the verifier work independently of any pass manager.
Chandler Carruth [Sun, 19 Jan 2014 02:22:18 +0000 (02:22 +0000)]
[PM] Make the verifier work independently of any pass manager.

This makes the 'verifyFunction' and 'verifyModule' functions totally
independent operations on the LLVM IR. It also cleans up their API a bit
by lifting the abort behavior into their clients and just using an
optional raw_ostream parameter to control printing.

The implementation of the verifier is now just an InstVisitor with no
multiple inheritance. It also is significantly more const-correct, and
hides the const violations internally. The two layers that force us to
break const correctness are building a DomTree and dispatching through
the InstVisitor.

A new VerifierPass is used to implement the legacy pass manager
interface in terms of the other pieces.

The error messages produced may be slightly different now, and we may
have slightly different short circuiting behavior with different usage
models of the verifier, but generally everything works equivalently and
this unblocks wiring the verifier up to the new pass manager.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199569 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoAdd a const lookup routine to get a BlockAddress constant if there is
Chandler Carruth [Sun, 19 Jan 2014 02:13:50 +0000 (02:13 +0000)]
Add a const lookup routine to get a BlockAddress constant if there is
one, but not create one. This is useful in the verifier when we want to
query the constant if it exists but not create one. To be used in an
upcoming commit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199568 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoSupport AddrSpaceCast in ConstantExpr::getAsInstruction.
Eli Bendersky [Sat, 18 Jan 2014 22:54:33 +0000 (22:54 +0000)]
Support AddrSpaceCast in ConstantExpr::getAsInstruction.

It's handled similarly to the other casts. CastInst::Create already knows how
to handle it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199565 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoDon't refuse to transform constexpr(call(arg, ...)) to call(constexpr(arg), ...)...
Nick Lewycky [Sat, 18 Jan 2014 22:47:12 +0000 (22:47 +0000)]
Don't refuse to transform constexpr(call(arg, ...)) to call(constexpr(arg), ...)) just because the function has multiple return values even if their return types are the same. Patch by Eduard Burtescu!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199564 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoARM: Let the assembler reject v5 instructions in v4 mode.
Benjamin Kramer [Sat, 18 Jan 2014 19:03:19 +0000 (19:03 +0000)]
ARM: Let the assembler reject v5 instructions in v4 mode.

PR18524.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199559 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[CMake] Add llvm-tblgen to dependencies of check-llvm.
NAKAMURA Takumi [Sat, 18 Jan 2014 19:01:08 +0000 (19:01 +0000)]
[CMake] Add llvm-tblgen to dependencies of check-llvm.

llvm-tblgen is not built when external LLVM_TABLEGEN is specified.
Even then, llvm-tblgen should be built for testing tblgen itself.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199558 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoInstCombine: Make the (fmul X, -1.0) -> (fsub -0.0, X) transform handle vectors too.
Benjamin Kramer [Sat, 18 Jan 2014 16:43:14 +0000 (16:43 +0000)]
InstCombine: Make the (fmul X, -1.0) -> (fsub -0.0, X) transform handle vectors too.

PR18532.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199553 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoUpgrade ConstantFP's negative zero and infinity getters to handle vector types.
Benjamin Kramer [Sat, 18 Jan 2014 16:43:06 +0000 (16:43 +0000)]
Upgrade ConstantFP's negative zero and infinity getters to handle vector types.

Will be used soon.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199552 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agotypo
Adrian Prantl [Sat, 18 Jan 2014 02:12:10 +0000 (02:12 +0000)]
typo

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199537 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoDebug info (LTO): Move the creation of accessibility flags to
Adrian Prantl [Sat, 18 Jan 2014 02:12:00 +0000 (02:12 +0000)]
Debug info (LTO): Move the creation of accessibility flags to
getOrCreateSubprogramDIE to avoid attributes being added twice when DIEs
are merged.

rdar://problem/15842330.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199536 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoFix more instances of dropped fast math flags when optimizing FADD instructions....
Owen Anderson [Sat, 18 Jan 2014 00:48:14 +0000 (00:48 +0000)]
Fix more instances of dropped fast math flags when optimizing FADD instructions.  All found by inspection (aka grep).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199528 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoAdd an inalloca flag to allocas
Reid Kleckner [Fri, 17 Jan 2014 23:58:17 +0000 (23:58 +0000)]
Add an inalloca flag to allocas

Summary:
The only current use of this flag is to mark the alloca as dynamic, even
if its in the entry block.  The stack adjustment for the alloca can
never be folded into the prologue because the call may clear it and it
has to be allocated at the top of the stack.

Reviewers: majnemer

CC: llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D2571

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199525 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoMC: Add some missing include guards
Justin Bogner [Fri, 17 Jan 2014 22:39:45 +0000 (22:39 +0000)]
MC: Add some missing include guards

Patch by Daniel Reynaud!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199523 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoUpdate LangRef to emphasize the difference between "coldcc" and "preserve_mostcc".
Juergen Ributzka [Fri, 17 Jan 2014 22:24:35 +0000 (22:24 +0000)]
Update LangRef to emphasize the difference between "coldcc" and "preserve_mostcc".

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199521 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago80-column.
Rui Ueyama [Fri, 17 Jan 2014 22:11:27 +0000 (22:11 +0000)]
80-column.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199519 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agollvm-objdump/COFF: Print ordinal base number.
Rui Ueyama [Fri, 17 Jan 2014 22:02:24 +0000 (22:02 +0000)]
llvm-objdump/COFF: Print ordinal base number.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199518 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoAdd two new calling conventions for runtime calls
Juergen Ributzka [Fri, 17 Jan 2014 19:47:03 +0000 (19:47 +0000)]
Add two new calling conventions for runtime calls

This patch adds two new target-independent calling conventions for runtime
calls - PreserveMost and PreserveAll.
The target-specific implementation for X86-64 is defined as following:
  - Arguments are passed as for the default C calling convention
  - The same applies for the return value(s)
  - PreserveMost preserves all GPRs - except R11
  - PreserveAll preserves all GPRs and all XMMs/YMMs - except R11

Reviewed by Lang and Philip

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199508 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[mips][msa] Correct pattern for LSA
Daniel Sanders [Fri, 17 Jan 2014 15:40:05 +0000 (15:40 +0000)]
[mips][msa] Correct pattern for LSA

Summary:
$rs and $rt were the wrong way round in the .td and the testcase wasn't
strict enough to detect the mistake.

Reviewers: matheusalmeida

Reviewed By: matheusalmeida

Differential Revision: http://llvm-reviews.chandlerc.com/D2554

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199498 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[mips] Split IIIdiv int II_DIV, II_DIVU, II_DDIV, and II_DDIVU
Daniel Sanders [Fri, 17 Jan 2014 14:48:06 +0000 (14:48 +0000)]
[mips] Split IIIdiv int II_DIV, II_DIVU, II_DDIV, and II_DDIVU

No functional change since the InstrItinData's were duplicated

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199497 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[mips][sched] Split IIImul and IIImult into subclasses.
Daniel Sanders [Fri, 17 Jan 2014 14:32:41 +0000 (14:32 +0000)]
[mips][sched] Split IIImul and IIImult into subclasses.

IIImul -> II_MUL
IIImult -> II_MULT, II_MULTU, II_MADD, II_MADDU, II_MSUB, II_MSUBU, II_DMULT, II_DMULTU

No functional change since the InstrItinData's have been duplicated.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199495 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[mips][sched] Split IIHiLo into II_MFHI_MFLO and II_MTHI_MTLO
Daniel Sanders [Fri, 17 Jan 2014 14:17:34 +0000 (14:17 +0000)]
[mips][sched] Split IIHiLo into II_MFHI_MFLO and II_MTHI_MTLO

No functional change since the InstrItinData's have been duplicated.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199493 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoAdd MLA alias for ARMv4 support.
Renato Golin [Fri, 17 Jan 2014 13:53:08 +0000 (13:53 +0000)]
Add MLA alias for ARMv4 support.

Fix MLA defs to use register class GPRnopc.
Add encoding tests for multiply instructions.
(Alias for MUL/SMLAL/UMLAL added by r199026.)

Patch by Zhaoshi.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199491 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[PM] [cleanup] Rename some of the Verifier's members, re-arrange them,
Chandler Carruth [Fri, 17 Jan 2014 11:09:34 +0000 (11:09 +0000)]
[PM] [cleanup] Rename some of the Verifier's members, re-arrange them,
and tweak comments prior to more invasive surgery. Also clean up some
other non-doxygen comments, and run clang-format over the parts that are
going to change dramatically in subsequent commits so that those don't
get cluttered with formatting changes.

No functionality changed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199489 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[asan] extend asan-coverage (still experimental).
Kostya Serebryany [Fri, 17 Jan 2014 11:00:30 +0000 (11:00 +0000)]
[asan] extend asan-coverage (still experimental).
 - add a mode for collecting per-block coverage (-asan-coverage=2).
   So far the implementation is naive (all blocks are instrumented),
   the performance overhead on top of asan could be as high as 30%.
 - Make sure the one-time calls to __sanitizer_cov are moved to function buttom,
   which in turn required to copy the original debug info into the call insn.

Here is the performance data on SPEC 2006
(train data, comparing asan with asan-coverage={0,1,2}):

                             asan+cov0     asan+cov1      diff 0-1    asan+cov2       diff 0-2      diff 1-2
       400.perlbench,        65.60,        65.80,         1.00,        76.20,         1.16,         1.16
           401.bzip2,        65.10,        65.50,         1.01,        75.90,         1.17,         1.16
             403.gcc,         1.64,         1.69,         1.03,         2.04,         1.24,         1.21
             429.mcf,        21.90,        22.60,         1.03,        23.20,         1.06,         1.03
           445.gobmk,       166.00,       169.00,         1.02,       205.00,         1.23,         1.21
           456.hmmer,        88.30,        87.90,         1.00,        91.00,         1.03,         1.04
           458.sjeng,       210.00,       222.00,         1.06,       258.00,         1.23,         1.16
      462.libquantum,         1.73,         1.75,         1.01,         2.11,         1.22,         1.21
         464.h264ref,       147.00,       152.00,         1.03,       160.00,         1.09,         1.05
         471.omnetpp,       115.00,       116.00,         1.01,       140.00,         1.22,         1.21
           473.astar,       133.00,       131.00,         0.98,       142.00,         1.07,         1.08
       483.xalancbmk,       118.00,       120.00,         1.02,       154.00,         1.31,         1.28
            433.milc,        19.80,        20.00,         1.01,        20.10,         1.02,         1.01
            444.namd,        16.20,        16.20,         1.00,        17.60,         1.09,         1.09
          447.dealII,        41.80,        42.20,         1.01,        43.50,         1.04,         1.03
          450.soplex,         7.51,         7.82,         1.04,         8.25,         1.10,         1.05
          453.povray,        14.00,        14.40,         1.03,        15.80,         1.13,         1.10
             470.lbm,        33.30,        34.10,         1.02,        34.10,         1.02,         1.00
         482.sphinx3,        12.40,        12.30,         0.99,        13.00,         1.05,         1.06

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199488 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[PM] Remove the preverifier and directly compute the DominatorTree for
Chandler Carruth [Fri, 17 Jan 2014 10:56:02 +0000 (10:56 +0000)]
[PM] Remove the preverifier and directly compute the DominatorTree for
the verifier after ensuring the CFG is at least usefully formed.

This fixes a number of problems:
1) The PreVerifier was missing the controls the Verifier provides over
   *how* an invalid module is handled -- it just aborted the program!
   Now it uses the same logic as the Verifier which is significantly
   more library-friendly.
2) The DominatorTree used previously could have been cached and not
   updated due to bugs in prior passes and we would silently use the
   stale tree. This could cause dominance errors to not be as quickly
   diagnosed.
3) We can now (in the next patch) pull the functionality of the verifier
   apart from the pass infrastructure so that you can verify IR without
   having any form of pass manager. This in turn frees the code to share
   logic between old and new pass manager variants.

Along the way I fixed at least one annoying bug -- the state for
'Broken' wasn't being cleared from run to run causing all functions
visited after the first broken function to be marked as broken
regardless of whether *they* were a problem. Fortunately, I don't really
know much of a way to observe this peculiarity.

In case folks are worried about the runtime cost, its negligible.
I looked at running the entire regression test suite (which should be
a relatively good use of the verifier) before and after but was unable
to even measure the time spent on the verifier and there was no
regresion from before to after. I checked both with debug builds and
optimized builds.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199487 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[AArch64 NEON] Expand vector for UDIV/SDIV/UREM/SREM/FREM as neon doesn't support...
Kevin Qin [Fri, 17 Jan 2014 09:54:30 +0000 (09:54 +0000)]
[AArch64 NEON] Expand vector for UDIV/SDIV/UREM/SREM/FREM as neon doesn't support these operations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199485 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoAdd the test for libstdc++ versions newer than 4.6 so we don't
Chandler Carruth [Fri, 17 Jan 2014 09:47:55 +0000 (09:47 +0000)]
Add the test for libstdc++ versions newer than 4.6 so we don't
accidentally pick that up while using Clang and run into subtle bugs
down the road related to C++11 features not fully implemented in that
version of the standard library.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199484 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoSwitch a few instructions to use RI instead I so they don't require REX_W to be expli...
Craig Topper [Fri, 17 Jan 2014 08:16:57 +0000 (08:16 +0000)]
Switch a few instructions to use RI instead I so they don't require REX_W to be explicitly specified.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199479 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoAdd OpSize16 flags to 32-bit CRC32 instructions so they can be encoded correctly...
Craig Topper [Fri, 17 Jan 2014 08:01:20 +0000 (08:01 +0000)]
Add OpSize16 flags to 32-bit CRC32 instructions so they can be encoded correctly in 16-bit mode.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199478 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoTeach x86 asm parser to handle 'opaque ptr' in Intel syntax.
Craig Topper [Fri, 17 Jan 2014 07:44:10 +0000 (07:44 +0000)]
Teach x86 asm parser to handle 'opaque ptr' in Intel syntax.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199477 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoTeach X86 asm parser to understand 'ZMMWORD PTR' in Intel syntax.
Craig Topper [Fri, 17 Jan 2014 07:37:39 +0000 (07:37 +0000)]
Teach X86 asm parser to understand 'ZMMWORD PTR' in Intel syntax.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199476 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoFix intel syntax for 64-bit version of FXSAVE/FXRSTOR to use '64' suffix instead...
Craig Topper [Fri, 17 Jan 2014 07:25:39 +0000 (07:25 +0000)]
Fix intel syntax for 64-bit version of FXSAVE/FXRSTOR to use '64' suffix instead of 'q'

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199474 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoVEX_PREFIX_66 doesn't need to set the hasOpSize flag since VEX instructions don't...
Craig Topper [Fri, 17 Jan 2014 07:11:45 +0000 (07:11 +0000)]
VEX_PREFIX_66 doesn't need to set the hasOpSize flag since VEX instructions don't use the size fields it controls.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199470 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoReplace duplicated code with a existing helper function.
Craig Topper [Fri, 17 Jan 2014 06:42:38 +0000 (06:42 +0000)]
Replace duplicated code with a existing helper function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199468 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[AArch64]Fix the problem can't select f16_to_f32 and f32_to_f16.
Hao Liu [Fri, 17 Jan 2014 06:23:30 +0000 (06:23 +0000)]
[AArch64]Fix the problem can't select f16_to_f32 and f32_to_f16.
Also add copy support for FPR16.
Also add a missing test case file belongs to commit r197361.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199463 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[AArch64 NEON] Custom lower conversion between vector integer and vector floating...
Kevin Qin [Fri, 17 Jan 2014 05:52:35 +0000 (05:52 +0000)]
[AArch64 NEON] Custom lower conversion between vector integer and vector floating point if element bit-width doesn't match.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199462 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[AArch64]Fix the problem can't select concat_vectors of two v1i32 types.
Hao Liu [Fri, 17 Jan 2014 05:44:46 +0000 (05:44 +0000)]
[AArch64]Fix the problem can't select concat_vectors of two v1i32 types.
Also fix the problem can't select scalar_to_vector from f32 to v2f32/v4f32.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199461 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoFix bad variable syntax in r199413
Bob Wilson [Fri, 17 Jan 2014 00:40:39 +0000 (00:40 +0000)]
Fix bad variable syntax in r199413

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199447 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoUse LLVM_EXPLICIT instead of a function pointer as bool.
Rafael Espindola [Thu, 16 Jan 2014 23:37:23 +0000 (23:37 +0000)]
Use LLVM_EXPLICIT instead of a function pointer as bool.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199437 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoChange inalloca rules to make it only apply to the last parameter
Reid Kleckner [Thu, 16 Jan 2014 22:59:24 +0000 (22:59 +0000)]
Change inalloca rules to make it only apply to the last parameter

This makes things a lot easier, because we can now talk about the
"argument allocation", which allocates all the memory for the call in
one shot.

The only functional change is to the verifier for a feature that hasn't
shipped yet.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199434 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[opt][PassInfo] Allow opt to run passes that need target machine.
Quentin Colombet [Thu, 16 Jan 2014 21:44:34 +0000 (21:44 +0000)]
[opt][PassInfo] Allow opt to run passes that need target machine.

When registering a pass, a pass can now specify a second construct that takes as
argument a pointer to TargetMachine.
The PassInfo class has been updated to reflect that possibility.
If such a constructor exists opt will use it instead of the default constructor
when instantiating the pass.

Since such IR passes are supposed to be rare, no specific support has been
added to this commit to allow an easy registration of such a pass.
In other words, for such pass, the initialization function has to be
hand-written (see CodeGenPrepare for instance).

Now, codegenprepare can be tested using opt:
opt -codegenprepare -mtriple=mytriple input.ll

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199430 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoLTO: document LTO_API_VERSION for each API
Duncan P. N. Exon Smith [Thu, 16 Jan 2014 21:37:17 +0000 (21:37 +0000)]
LTO: document LTO_API_VERSION for each API

Adding a doxygen comment for each bit of API to indicate at which
LTO_API_VERSION each was available, manually gleaned from successive
git-blames.  A few notes:

- LTO_API_VERSION was set to 3 at its introduction.
- I've indicated all the API introduced before LTO_API_VERSION was
  around as available "prior to LTO_API_VERSION=3".
- A number of API changes neglected to bump LTO_API_VERSION.  These I've
  indicated as available at the *next* bump of LTO_API_VERSION.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199429 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoFix two cases where we could lose fast math flags when optimizing FADD expressions.
Owen Anderson [Thu, 16 Jan 2014 21:26:02 +0000 (21:26 +0000)]
Fix two cases where we could lose fast math flags when optimizing FADD expressions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199427 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoFix an instance where we would drop fast math flags when performing an fdiv to recipr...
Owen Anderson [Thu, 16 Jan 2014 21:07:52 +0000 (21:07 +0000)]
Fix an instance where we would drop fast math flags when performing an fdiv to reciprocal multiply transformation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199425 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoFix a bug in InstCombine where we failed to preserve fast math flags when optimizing...
Owen Anderson [Thu, 16 Jan 2014 20:59:41 +0000 (20:59 +0000)]
Fix a bug in InstCombine where we failed to preserve fast math flags when optimizing an FMUL expression.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199424 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoFix style issues.
Rui Ueyama [Thu, 16 Jan 2014 20:57:55 +0000 (20:57 +0000)]
Fix style issues.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199423 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agollvm-objdump/COFF: Print DLL name in the export table header.
Rui Ueyama [Thu, 16 Jan 2014 20:50:34 +0000 (20:50 +0000)]
llvm-objdump/COFF: Print DLL name in the export table header.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199422 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoTeach InstCombine that (fmul X, -1.0) can be simplified to (fneg X), which LLVM expre...
Owen Anderson [Thu, 16 Jan 2014 20:36:42 +0000 (20:36 +0000)]
Teach InstCombine that (fmul X, -1.0) can be simplified to (fneg X), which LLVM expresses as (fsub -0.0, X).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199420 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoUse static instead of anonymous namespace.
Rui Ueyama [Thu, 16 Jan 2014 20:30:36 +0000 (20:30 +0000)]
Use static instead of anonymous namespace.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199419 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoReduce nesting.
Rui Ueyama [Thu, 16 Jan 2014 20:22:55 +0000 (20:22 +0000)]
Reduce nesting.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199418 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoUse the current local variable naming style.
Rui Ueyama [Thu, 16 Jan 2014 20:11:48 +0000 (20:11 +0000)]
Use the current local variable naming style.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199417 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoPass the --enable-libcpp configure option for cross builds, too.
Bob Wilson [Thu, 16 Jan 2014 19:35:01 +0000 (19:35 +0000)]
Pass the --enable-libcpp configure option for cross builds, too.

<rdar://problem/15831288>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199413 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoTweak the MCExternalSymbolizer to print references to C string literals
Kevin Enderby [Thu, 16 Jan 2014 18:43:56 +0000 (18:43 +0000)]
Tweak the MCExternalSymbolizer to print references to C string literals
with raw_ostream's write_escaped() method.

For example darwin's otool(1) program that uses the llvm
disassembler now produces disassembly like this:

leaq 0x7b(%rip), %rdi ## literal pool for: "%f\ntoto\n"

and not print the new lines which messes up the output.

rdar://15145300

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199407 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agollvm-symbolizer: make mangled name heuristic apply to all symbols
Ed Maste [Thu, 16 Jan 2014 17:25:12 +0000 (17:25 +0000)]
llvm-symbolizer: make mangled name heuristic apply to all symbols

PR: http://llvm.org/pr18431
Review: http://llvm-reviews.chandlerc.com/D2552

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199404 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[mips][sched] Removed IIXfer. No instructions use it.
Daniel Sanders [Thu, 16 Jan 2014 17:23:08 +0000 (17:23 +0000)]
[mips][sched] Removed IIXfer. No instructions use it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199403 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[mips][sched] Put AND, OR, XOR, MOVT_I, and MOVF_I in the same itinerary class as...
Daniel Sanders [Thu, 16 Jan 2014 17:13:57 +0000 (17:13 +0000)]
[mips][sched] Put AND, OR, XOR, MOVT_I, and MOVF_I in the same itinerary class as their non-microMIPS counterparts.

No functional change since both classes have the same InstrItinData definition.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199402 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoAdd an emitRawComment function and use it to simplify some uses of EmitRawText.
Rafael Espindola [Thu, 16 Jan 2014 16:28:37 +0000 (16:28 +0000)]
Add an emitRawComment function and use it to simplify some uses of EmitRawText.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199397 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[mips][sched] Split IIseb into II_SEB and II_SEH
Daniel Sanders [Thu, 16 Jan 2014 16:19:38 +0000 (16:19 +0000)]
[mips][sched] Split IIseb into II_SEB and II_SEH

No functional change since there are no InstrItinData's.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199396 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[mips][sched] Split IILogic into II_AND, II_OR, II_XOR, II_ANDI, II_ORI, II_XORI
Daniel Sanders [Thu, 16 Jan 2014 15:57:05 +0000 (15:57 +0000)]
[mips][sched] Split IILogic into II_AND, II_OR, II_XOR, II_ANDI, II_ORI, II_XORI

This is necessary because the classes are shared between all implementations.

No functional change since the InstrItinData's have been duplicated.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199394 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoMove the xscale build attribute test to the proper place and remove the old one.
Amara Emerson [Thu, 16 Jan 2014 15:11:54 +0000 (15:11 +0000)]
Move the xscale build attribute test to the proper place and remove the old one.

The encoding of build attributes is already tested in CodeGen/ARM/build-attributes-encoding.s

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199393 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[mips][sched] Split IIArith in preparation for the first scheduler targeting a specif...
Daniel Sanders [Thu, 16 Jan 2014 14:27:20 +0000 (14:27 +0000)]
[mips][sched] Split IIArith in preparation for the first scheduler targeting a specific MIPS CPU.

IIArith -> II_ADD, II_ADDU, II_AND, II_CL[ZO], II_DADDIU, II_DADDU,
  II_DROTR, II_DROTR32, II_DROTRV, II_DSLL, II_DSLL32, II_DSLLV,
  II_DSR[AL], II_DSR[AL]32, II_DSR[AL]V, II_DSUBU, II_LUI, II_MOV[ZFNT],
  II_NOR, II_OR, II_RDHWR, II_ROTR, II_ROTRV, II_SLL, II_SLLV, II_SR[AL],
  II_SR[AL]V, II_SUBU, II_XOR

No functional change since the InstrItinData's have been duplicated.

This is necessary because the classes are shared between all schedulers.

Once this patch series is committed there will be an InstrItinClass for
each mnemonic with minimal grouping. This does increase the size of the
itinerary tables for each MIPS scheduler but we have a few options for dealing
with that later. These options include reducing the number of classes once
we see the best way to simplify them, or by extending tablegen to be able
to compress the table by eliminating duplicates entries, etc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199391 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[mips] Correct itin class for MULT_MM and MULTu_MM to IIImult.
Daniel Sanders [Thu, 16 Jan 2014 14:02:48 +0000 (14:02 +0000)]
[mips] Correct itin class for MULT_MM and MULTu_MM to IIImult.

This matches the itin class used by the non-microMIPS equivalents of these
instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199389 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[mips] IIImult should have an InstrItinData in the generic scheduler. Used the same...
Daniel Sanders [Thu, 16 Jan 2014 13:45:53 +0000 (13:45 +0000)]
[mips] IIImult should have an InstrItinData in the generic scheduler. Used the same one as for IIImul.

Affects:
  DMULT, DMULTu, MADD, MADD_MM, MADDU, MADDU_MM, MSUB, MSUB_MM, MSUBU,
  MSUBU_MM, MULT, MULTu

Does not affect MULT_MM, MULTu_MM since they are currently miscategorised
as IIImul.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199381 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoReMat: fix overly cavalier attitude to sub-register indices
Tim Northover [Thu, 16 Jan 2014 12:29:55 +0000 (12:29 +0000)]
ReMat: fix overly cavalier attitude to sub-register indices

There are two attempted optimisations in reMaterializeTrivialDef, trying to
avoid promoting the size of a register too much when rematerializing.
Unfortunately, both appear to be flawed. First, we see if the original register
would have worked, but this is inadequate. Consider:

    v1 = SOMETHING (v1 is QQ)
    v2:Q0 = COPY v1:Q1 (v1, v2 are QQ)
    ...
    uses of v2

In this case even though v2 *could* be used directly as the output of
SOMETHING, this would set the wrong bits of the QQ register involved. The
correct rematerialization must be:

    v2:Q0_Q1 = SOMETHING (v2 promoted to QQQ)
    ...
    uses of v2:Q1_Q2

For the second optimisation, if the correct remat is "v2:idx = SOMETHING" then
we can't necessarily expect v2 itself to be valid for SOMETHING, but we do try
to hunt for a class between v1 and v2 that works. Unfortunately, this is also
wrong:

    v1 = SOMETHING (v1 is QQ)
    v2:Q0_Q1 = COPY v1 (v1 is QQ, v2 is QQQ)
    ...
    uses of v2 as a QQQ

The canonical rematerialization here is "v2:Q0_Q1 = SOMETHING". However current
logic would decide that v2 could be a QQ (no interest is taken in later uses).

This patch, therefore, always accepts the widened register class without trying
to be clever. Generally there is no penalty to this (e.g. in the common GR32 <
GR64 case, expanding the width doesn't matter because it's not like you were
going to do anything else with the high bits of a GR32 register). It can
increase register pressure in cases like the ARM VFP regs though (multiple
non-overlapping but equivalent subregisters). This situation can be
spotted by the fact that both source and destination in the
not-quite-coalesced pair have a sub-register index and
rematerialisation is skipped in that situation.

Unfortunately, no in-tree targets actually expose this as far as I can tell
(there are so few isAsCheapAsAMove instructions for it to trigger on) so I've
been unable to produce a test. It was exposed in our ARM64 SPEC tests though,
and I will be adding a test there that we should be able to contribute
soon(TM).

rdar://problem/15775279

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199376 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[asan] Remove -fsanitize-address-zero-base-shadow command line
Evgeniy Stepanov [Thu, 16 Jan 2014 10:19:12 +0000 (10:19 +0000)]
[asan] Remove -fsanitize-address-zero-base-shadow command line
flag from clang, and disable zero-base shadow support on all platforms
where it is not the default behavior.

- It is completely unused, as far as we know.
- It is ABI-incompatible with non-zero-base shadow, which means all
objects in a process must be built with the same setting. Failing to
do so results in a segmentation fault at runtime.
- It introduces a backward dependency of compiler-rt on user code,
which is uncommon and complicates testing.

This is the LLVM part of a larger change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199371 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoFor ARM, fix assertuib failures for some ld/st 3/4 instruction with wirteback.
Jiangning Liu [Thu, 16 Jan 2014 09:16:13 +0000 (09:16 +0000)]
For ARM, fix assertuib failures for some ld/st 3/4 instruction with wirteback.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199369 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoAVX-512: fixed a compare pattern
Elena Demikhovsky [Thu, 16 Jan 2014 08:45:54 +0000 (08:45 +0000)]
AVX-512: fixed a compare pattern

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199366 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoCopy segment register when optimizing to MOV8ao8/MOV16ao16/MOV32ao32.
Craig Topper [Thu, 16 Jan 2014 07:57:45 +0000 (07:57 +0000)]
Copy segment register when optimizing to MOV8ao8/MOV16ao16/MOV32ao32.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199365 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoAllow x86 mov instructions to/from memory with absolute address to be encoded and...
Craig Topper [Thu, 16 Jan 2014 07:36:58 +0000 (07:36 +0000)]
Allow x86 mov instructions to/from memory with absolute address to be encoded and disassembled with a segment override prefix. Fixes PR16962.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199364 91177308-0d34-0410-b5e6-96231b3b80d8