oota-llvm.git
11 years agoReturn false instead of 0.
Jakub Staszak [Sun, 17 Feb 2013 18:35:25 +0000 (18:35 +0000)]
Return false instead of 0.

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

11 years agoForce a cpu for test. It failed on atom due to different scheduling decisions.
Benjamin Kramer [Sun, 17 Feb 2013 18:26:11 +0000 (18:26 +0000)]
Force a cpu for test. It failed on atom due to different scheduling decisions.

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

11 years agoAArch64: Avoid shifts by 64, that's undefined behavior.
Benjamin Kramer [Sun, 17 Feb 2013 17:55:32 +0000 (17:55 +0000)]
AArch64: Avoid shifts by 64, that's undefined behavior.

No functionality change.

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

11 years agoAdd multithreading functions and shutdown to the C API. Patch by Moritz
Duncan Sands [Sun, 17 Feb 2013 16:35:51 +0000 (16:35 +0000)]
Add multithreading functions and shutdown to the C API.  Patch by Moritz
Maxeiner.

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

11 years agoBBVectorize: Fix an invalid reference bug
Hal Finkel [Sun, 17 Feb 2013 15:59:26 +0000 (15:59 +0000)]
BBVectorize: Fix an invalid reference bug

This fixes PR15289. This bug was introduced (recently) in r175215; collecting
all std::vector references for candidate pairs to delete at once is invalid
because subsequent lookups in the owning DenseMap could invalidate the
references.

bugpoint was able to reduce a useful test case. Unfortunately, because whether
or not this asserts depends on memory layout, this test case will sometimes
appear to produce valid output. Nevertheless, running under valgrind will
reveal the error.

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

11 years agoMake the visibility of LLVMPPCCompilationCallback work with GCC.
Benjamin Kramer [Sun, 17 Feb 2013 14:30:32 +0000 (14:30 +0000)]
Make the visibility of LLVMPPCCompilationCallback work with GCC.

GCC warns about the attribute being ignored if it occurs after void*.
There seems to be some kind of incompatibility between clang and gcc here, but
I can't fathom who's right.

void* LLVM_LIBRARY_VISIBILITY foo(); // clang: hidden, gcc: default
LLVM_LIBRARY_VISIBILITY void *bar(); // clang: hidden, gcc: hidden
void LLVM_LIBRARY_VISIBILITY qux();  // clang: hidden, gcc: hidden

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

11 years agoRemove use of reverse iterators in repairIntervalsInRange(). While they were
Cameron Zwarich [Sun, 17 Feb 2013 11:09:00 +0000 (11:09 +0000)]
Remove use of reverse iterators in repairIntervalsInRange(). While they were
arguably better than forward iterators for this use case, they are confusing and
there are some implementation problems with reverse iterators and MI bundles.

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

11 years agoUse ArrayRef instead of a reference to a SmallVectorImpl.
Cameron Zwarich [Sun, 17 Feb 2013 03:48:23 +0000 (03:48 +0000)]
Use ArrayRef instead of a reference to a SmallVectorImpl.

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

11 years agoFix a conversion from a forward iterator to a reverse iterator in
Cameron Zwarich [Sun, 17 Feb 2013 01:45:04 +0000 (01:45 +0000)]
Fix a conversion from a forward iterator to a reverse iterator in
MachineBasicBlock::SplitCriticalEdge. Since this is an iterator rather than
an instr_iterator, the isBundled() check only passes if getFirstTerminator()
returned end() and the garbage memory happens to lean that way.

Multiple successors can be present without any terminator instructions in the
case of exception handling with a fallthrough.

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

11 years agoAdd support for updating the LiveIntervals of registers used by 'exotic'
Cameron Zwarich [Sun, 17 Feb 2013 00:10:44 +0000 (00:10 +0000)]
Add support for updating the LiveIntervals of registers used by 'exotic'
terminators that actually have register uses when splitting critical edges.

This commit also introduces a method repairIntervalsInRange() on LiveIntervals,
which allows for repairing LiveIntervals in a small range after an arbitrary
target hook modifies, inserts, and removes instructions. It's pretty limited
right now, but I hope to extend it to support all of the things that are done
by the convertToThreeAddress() target hooks.

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

11 years agoThe transform is:
Bill Wendling [Sat, 16 Feb 2013 23:41:36 +0000 (23:41 +0000)]
The transform is:

    (or (bool?A:B),(bool?C:D)) --> (bool?(or A,C):(or B,D))

By the time the OR is visited, both the SELECTs have been visited and not
optimized and the OR itself hasn't been transformed so we do this transform in
the hopes that the new ORs will be optimized.

The transform is explicitly disabled for vector-selects until "codegen matures
to handle them better".

Patch by Muhammad Tauqir!

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

11 years agoClean up mips16 td file in preparation for massive pseudo lowering work.
Reed Kotler [Sat, 16 Feb 2013 23:39:52 +0000 (23:39 +0000)]
Clean up mips16 td file in preparation for massive pseudo lowering work.

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

11 years agoDocumentation: correct syntax (one missing comma, one extra comma)
Dmitri Gribenko [Sat, 16 Feb 2013 20:07:40 +0000 (20:07 +0000)]
Documentation: correct syntax (one missing comma, one extra comma)

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

11 years agoGCC doesn't like ++ on enums.
Benjamin Kramer [Sat, 16 Feb 2013 19:22:28 +0000 (19:22 +0000)]
GCC doesn't like ++ on enums.

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

11 years agoRemove comma at the end of enum. Still my favourite C++11 feature.
Benjamin Kramer [Sat, 16 Feb 2013 19:15:28 +0000 (19:15 +0000)]
Remove comma at the end of enum. Still my favourite C++11 feature.

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

11 years agoTypo
Renato Golin [Sat, 16 Feb 2013 19:14:59 +0000 (19:14 +0000)]
Typo

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

11 years agoTurn the enum attributes DenseSet in AttrBuilder into a set of bits.
Benjamin Kramer [Sat, 16 Feb 2013 19:13:18 +0000 (19:13 +0000)]
Turn the enum attributes DenseSet in AttrBuilder into a set of bits.

Avoids malloc and is a lot denser. We lose iteration over target independent
attributes, but that's a strange interface anyways and didn't have any users
outside of AttrBuilder.

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

11 years agoOne more try to make this look nice. I have lots of pseudo lowering
Reed Kotler [Sat, 16 Feb 2013 19:04:29 +0000 (19:04 +0000)]
One more try to make this look nice. I have lots of pseudo lowering
as well as 16/32 bit variants to do and so I want this to look nice
when I do it. I've been experimenting with this. No new test cases
are needed.

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

11 years agoReplace erase loop with std::remove_if.
Benjamin Kramer [Sat, 16 Feb 2013 17:06:38 +0000 (17:06 +0000)]
Replace erase loop with std::remove_if.

This avoids unnecessary copies. No functionality change.

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

11 years agoReplace loop with std::find.
Benjamin Kramer [Sat, 16 Feb 2013 17:06:32 +0000 (17:06 +0000)]
Replace loop with std::find.

No functionality change.

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

11 years agoLegalizeDAG.cpp doesn't need DenseMap.
Jakub Staszak [Sat, 16 Feb 2013 16:15:42 +0000 (16:15 +0000)]
LegalizeDAG.cpp doesn't need DenseMap.

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

11 years agoReduce indents in LSRInstance::NarrowSearchSpaceByCollapsingUnrolledCode method.
Jakub Staszak [Sat, 16 Feb 2013 16:08:15 +0000 (16:08 +0000)]
Reduce indents in LSRInstance::NarrowSearchSpaceByCollapsingUnrolledCode method.
No functionality change.

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

11 years ago[msvc x64] Update X86CompilationCallback_Win64.asm corresponding to r175267.
NAKAMURA Takumi [Sat, 16 Feb 2013 16:04:29 +0000 (16:04 +0000)]
[msvc x64] Update X86CompilationCallback_Win64.asm corresponding to r175267.

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

11 years agoUse const reference instead of vector object when passing an argument to
Jakub Staszak [Sat, 16 Feb 2013 15:47:26 +0000 (15:47 +0000)]
Use const reference instead of vector object when passing an argument to
updateScheduledPressure method.

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

11 years agoTarget/R600/CMakeLists.txt: Prune SILowerLiteralConstants.cpp corresponding to r175354.
NAKAMURA Takumi [Sat, 16 Feb 2013 15:30:28 +0000 (15:30 +0000)]
Target/R600/CMakeLists.txt: Prune SILowerLiteralConstants.cpp corresponding to r175354.

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

11 years agoMCParser: Reject .balign with non-pow2 alignments.
Benjamin Kramer [Sat, 16 Feb 2013 15:00:16 +0000 (15:00 +0000)]
MCParser: Reject .balign with non-pow2 alignments.

GNU as rejects them and there are configure scripts in the wild that check if
the assembler rejects ".align 3" to determine whether the alignment is in bytes
or powers of two.

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

11 years agoMinor cleanups. No functionality change.
Jakub Staszak [Sat, 16 Feb 2013 13:34:26 +0000 (13:34 +0000)]
Minor cleanups. No functionality change.

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

11 years agoAdd even more constatness in MachineDominators.h.
Jakub Staszak [Sat, 16 Feb 2013 12:36:32 +0000 (12:36 +0000)]
Add even more constatness in MachineDominators.h.

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

11 years agoReplace "check:" wth "CHECK:".
Jakub Staszak [Sat, 16 Feb 2013 12:16:56 +0000 (12:16 +0000)]
Replace "check:" wth "CHECK:".
Also fix one test by changing "vpermilps" to "vpshufd".

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

11 years agoR600/SI: Add pattern to simplify i64 loading
Christian Konig [Sat, 16 Feb 2013 11:28:36 +0000 (11:28 +0000)]
R600/SI: Add pattern to simplify i64 loading

This is a candidate for the stable branch.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175356 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600/SI: nuke SReg_1 v3
Christian Konig [Sat, 16 Feb 2013 11:28:30 +0000 (11:28 +0000)]
R600/SI: nuke SReg_1 v3

It's completely unnecessary and can be replace with proper
SReg_64 handling instead.

This actually fixes a piglit test on SI.

v2: use correct register class in addRegisterClass,
    set special classes as not allocatable
v3: revert setting special classes as not allocateable

This is a candidate for the stable branch.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175355 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600/SI: cleanup literal handling v3
Christian Konig [Sat, 16 Feb 2013 11:28:22 +0000 (11:28 +0000)]
R600/SI: cleanup literal handling v3

Seems to be allot simpler, and also paves the
way for further improvements.

v2: rebased on master, use 0 in BUFFER_LOAD_FORMAT_XYZW,
    use VGPR0 in dummy EXP, avoid compiler warning, break
    after encoding the first literal.
v3: correctly use V_ADD_F32_e64

This is a candidate for the stable branch.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175354 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600/SI: replace AllReg_* with [SV]Src_* v2
Christian Konig [Sat, 16 Feb 2013 11:28:13 +0000 (11:28 +0000)]
R600/SI: replace AllReg_* with [SV]Src_* v2

Mark all the operands that can also have an immediate.

v2: SOFFSET is also an SSrc_32 operand

This is a candidate for the stable branch.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175353 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600/SI: fix VOPC encoding v2
Christian Konig [Sat, 16 Feb 2013 11:28:07 +0000 (11:28 +0000)]
R600/SI: fix VOPC encoding v2

Previously it only worked because of coincident.

v2: fix 64bit versions, use 0x80 (inline 0) instead of SGPR0
    for the unused SRC2

This is a candidate for the stable branch.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175352 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600/SI: move *_Helper definitions to SIInstrFormat.td
Christian Konig [Sat, 16 Feb 2013 11:28:02 +0000 (11:28 +0000)]
R600/SI: move *_Helper definitions to SIInstrFormat.td

This is a candidate for the stable branch.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175351 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600/SI: remove some more unused code
Christian Konig [Sat, 16 Feb 2013 11:27:56 +0000 (11:27 +0000)]
R600/SI: remove some more unused code

This is a candidate for the stable branch.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175350 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600/structurizer: improve inverting conditions
Christian Konig [Sat, 16 Feb 2013 11:27:50 +0000 (11:27 +0000)]
R600/structurizer: improve inverting conditions

Stop adding more instructions than necessary.

This is a candidate for the stable branch.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175349 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600/structurizer: improve loop handling
Christian Konig [Sat, 16 Feb 2013 11:27:45 +0000 (11:27 +0000)]
R600/structurizer: improve loop handling

Generate more than one loop if it seems to make sense.

This is a candidate for the stable branch.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175348 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600/structurizer: improve finding condition values
Christian Konig [Sat, 16 Feb 2013 11:27:40 +0000 (11:27 +0000)]
R600/structurizer: improve finding condition values

Using the new NearestCommonDominator class.

This is a candidate for the stable branch.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175347 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600/structurizer: improve PHI value finding
Christian Konig [Sat, 16 Feb 2013 11:27:35 +0000 (11:27 +0000)]
R600/structurizer: improve PHI value finding

Using the new NearestCommonDominator class.

This is a candidate for the stable branch.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175346 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600/structurizer: add class to find the Nearest Common Dominator
Christian Konig [Sat, 16 Feb 2013 11:27:29 +0000 (11:27 +0000)]
R600/structurizer: add class to find the Nearest Common Dominator

This is a candidate for the stable branch.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175345 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd some constantness in Machine Dominators.
Jakub Staszak [Sat, 16 Feb 2013 11:08:16 +0000 (11:08 +0000)]
Add some constantness in Machine Dominators.

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

11 years agoRemove trailing spaces.
Jakub Staszak [Sat, 16 Feb 2013 11:02:28 +0000 (11:02 +0000)]
Remove trailing spaces.

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

11 years agoUse a different scheme to chose 16/32 variants. This scheme is more
Reed Kotler [Sat, 16 Feb 2013 09:47:57 +0000 (09:47 +0000)]
Use a different scheme to chose 16/32 variants. This scheme is more
consistent with how BuildMI works. No new tests needed. All should work
the same as before.

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

11 years ago[ELF] Add STN_UNDEF.
Michael J. Spencer [Sat, 16 Feb 2013 01:56:36 +0000 (01:56 +0000)]
[ELF] Add STN_UNDEF.

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

11 years agoReinitialize the ivars in the subtarget so that they can be reset with the new features.
Bill Wendling [Sat, 16 Feb 2013 01:36:26 +0000 (01:36 +0000)]
Reinitialize the ivars in the subtarget so that they can be reset with the new features.

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

11 years ago[ms-inline asm] Do not omit the frame pointer if we have ms-inline assembly.
Chad Rosier [Sat, 16 Feb 2013 01:25:28 +0000 (01:25 +0000)]
[ms-inline asm] Do not omit the frame pointer if we have ms-inline assembly.

If the frame pointer is omitted, and any stack changes occur in the inline
assembly, e.g.: "pusha", then any C local variable or C argument references
will be incorrect.

I pass no judgement on anyone who would do such a thing. ;)
rdar://13218191

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

11 years agoDerive ELF section type from the name in some cases where GNU as does
Joerg Sonnenberger [Sat, 16 Feb 2013 00:32:53 +0000 (00:32 +0000)]
Derive ELF section type from the name in some cases where GNU as does
so.

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

11 years ago[mips] Remove SDNPWantParent from the list of SDNodeProperties.
Akira Hatanaka [Sat, 16 Feb 2013 00:14:37 +0000 (00:14 +0000)]
[mips] Remove SDNPWantParent from the list of SDNodeProperties.

No functionality change intended.

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

11 years agoPacify -Wnon-virtual-dtor
Matt Beaumont-Gay [Fri, 15 Feb 2013 23:51:59 +0000 (23:51 +0000)]
Pacify -Wnon-virtual-dtor

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

11 years agoTemporary revert of 175320.
Bill Wendling [Fri, 15 Feb 2013 23:22:32 +0000 (23:22 +0000)]
Temporary revert of 175320.

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

11 years agoReinitialize the ivars in the subtarget.
Bill Wendling [Fri, 15 Feb 2013 23:18:01 +0000 (23:18 +0000)]
Reinitialize the ivars in the subtarget.

When we're recalculating the feature set of the subtarget, we need to have the
ivars in their initial state.

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

11 years agoSuppress a GCC -Wunused-variable warning in -Asserts builds
Matt Beaumont-Gay [Fri, 15 Feb 2013 23:12:33 +0000 (23:12 +0000)]
Suppress a GCC -Wunused-variable warning in -Asserts builds

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

11 years agoc[ms-inline asm] It's possible to have a SizeDirective rewrite and an
Chad Rosier [Fri, 15 Feb 2013 22:54:16 +0000 (22:54 +0000)]
c[ms-inline asm] It's possible to have a SizeDirective rewrite and an
Input/Output rewrite to the same location.  Make sure the SizeDirective rewrite
is performed first.  This also ensure the sort algorithm is stable.

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

11 years agoIf bundle alignment is enabled, do not add data to a fragment with instructions
Derek Schuff [Fri, 15 Feb 2013 22:50:52 +0000 (22:50 +0000)]
If bundle alignment is enabled, do not add data to a fragment with instructions

With bundle alignment, instructions all get their own MCFragments
(unless they are in a bundle-locked group). For instructions with
fixups, this is an MCDataFragment. Emitting actual data (e.g. for
.long) attempts to re-use MCDataFragments, which we don't want int
this case since it leads to fragments which exceed the bundle size.
So, don't reuse them in this case.
Also adds a test and fixes some formatting.

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

11 years agoSupport changing the subtarget features in ARM.
Bill Wendling [Fri, 15 Feb 2013 22:41:25 +0000 (22:41 +0000)]
Support changing the subtarget features in ARM.

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

11 years agoUse the 'target-features' and 'target-cpu' attributes to reset the subtarget features.
Bill Wendling [Fri, 15 Feb 2013 22:31:27 +0000 (22:31 +0000)]
Use the 'target-features' and 'target-cpu' attributes to reset the subtarget features.

If two functions require different features (e.g., `-mno-sse' vs. `-msse') then
we want to honor that, especially during LTO. We can do that by resetting the
subtarget's features depending upon the 'target-feature' attribute.

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

11 years ago[ms-inline asm] Adjust the EndLoc to account for the ']'.
Chad Rosier [Fri, 15 Feb 2013 21:58:13 +0000 (21:58 +0000)]
[ms-inline asm] Adjust the EndLoc to account for the ']'.

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

11 years agoForgot to 'svn add' the LoopVectorizer tests for the new parallel loop metadata,...
Pekka Jaaskelainen [Fri, 15 Feb 2013 21:50:19 +0000 (21:50 +0000)]
Forgot to 'svn add' the LoopVectorizer tests for the new parallel loop metadata, sorry.

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

11 years ago[mips] Clean up class MipsCCInfo.
Akira Hatanaka [Fri, 15 Feb 2013 21:45:11 +0000 (21:45 +0000)]
[mips] Clean up class MipsCCInfo.

No functionality change intended.

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

11 years agocapitalize SCEV to match the current naming convention
Sebastian Pop [Fri, 15 Feb 2013 21:26:36 +0000 (21:26 +0000)]
capitalize SCEV to match the current naming convention

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

11 years ago[mips] Split SelectAddr, which was used to match address patterns, into two
Akira Hatanaka [Fri, 15 Feb 2013 21:20:45 +0000 (21:20 +0000)]
[mips] Split SelectAddr, which was used to match address patterns, into two
functions. Set AddedComplexity to determine the order in which patterns are
matched.

This simplifies selection of floating point loads/stores.

No functionality change intended.

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

11 years agoRemove a final dependency on the form field in tablegen; which is a remnant
Reed Kotler [Fri, 15 Feb 2013 21:05:58 +0000 (21:05 +0000)]
Remove a final dependency on the form field in tablegen; which is a remnant
of the old jit and which we don't intend to support in mips16 or micromips.
This dependency is for the testing of whether an instruction is a pseudo.

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

11 years agoadd ScevApplyRewriter
Sebastian Pop [Fri, 15 Feb 2013 20:55:36 +0000 (20:55 +0000)]
add ScevApplyRewriter

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

11 years agoadd SCEVParameterRewriter
Sebastian Pop [Fri, 15 Feb 2013 20:55:33 +0000 (20:55 +0000)]
add SCEVParameterRewriter

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

11 years agoAsmParser: Reformat the MS asm parser to reduce nesting.
Benjamin Kramer [Fri, 15 Feb 2013 20:37:21 +0000 (20:37 +0000)]
AsmParser: Reformat the MS asm parser to reduce nesting.

While there postpone register name printing after uniquing.
No intended functionality change.

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

11 years agoenable SDISel sincos optimization for GNU environments
Paul Redmond [Fri, 15 Feb 2013 18:45:18 +0000 (18:45 +0000)]
enable SDISel sincos optimization for GNU environments

- add sincos to runtime library if target triple environment is GNU
- added canCombineSinCosLibcall() which checks that sincos is in the RTL and
  if the environment is GNU then unsafe fpmath is enabled (required to
  preserve errno)
- extended sincos-opt lit test

Reviewed by: Hal Finkel

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

11 years agoHexagon: Set appropriate TSFlags to the loads/stores with global address to
Jyotsna Verma [Fri, 15 Feb 2013 17:52:07 +0000 (17:52 +0000)]
Hexagon: Set appropriate TSFlags to the loads/stores with global address to
support constant extension.

This patch doesn't introduce any functionality changes.

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

11 years agoBBVectorize: Call a DAG and DAG instead of a tree
Hal Finkel [Fri, 15 Feb 2013 17:20:54 +0000 (17:20 +0000)]
BBVectorize: Call a DAG and DAG instead of a tree

Several functions and variable names used the term 'tree' to refer
to what is actually a DAG. Correcting this mistake will, hopefully,
prevent confusion in the future.

No functionality change intended.

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

11 years agoFix refactoring mistake in "Teach InstCombine to work with smaller legal types..."
Arnaud A. de Grandmaison [Fri, 15 Feb 2013 15:18:17 +0000 (15:18 +0000)]
Fix refactoring mistake in "Teach InstCombine to work with smaller legal types..."

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

11 years agoTeach InstCombine to work with smaller legal types in icmp (shl %v, C1), C2
Arnaud A. de Grandmaison [Fri, 15 Feb 2013 14:35:47 +0000 (14:35 +0000)]
Teach InstCombine to work with smaller legal types in icmp (shl %v, C1), C2

It enables to work with a smaller constant, which is target friendly for those which can compare to immediates.
It also avoids inserting a shift in favor of a trunc, which can be free on some targets.

This used to work until LLVM-3.1, but regressed with the 3.2 release.

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

11 years agoAArch64: add branch fixup pass.
Tim Northover [Fri, 15 Feb 2013 14:32:20 +0000 (14:32 +0000)]
AArch64: add branch fixup pass.

This is essentially a stripped-down version of the ConstandIslands pass (which
always had these two functions), providing just the features necessary for
correctness.

In particular there needs to be a way to resolve the situation where a
conditional branch's destination block ends up out of range.

This issue crops up when self-hosting for AArch64.

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

11 years agoGive these callbacks hidden visibility. It is better to not export them more
Rafael Espindola [Fri, 15 Feb 2013 14:15:59 +0000 (14:15 +0000)]
Give these callbacks hidden visibility. It is better to not export them more
than we need to and some ELF linkers complain about directly accessing symbols
with default visibility.

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

11 years agoDon't make assumptions about the mangling of static functions in extern "C"
Rafael Espindola [Fri, 15 Feb 2013 14:08:43 +0000 (14:08 +0000)]
Don't make assumptions about the mangling of static functions in extern "C"
blocks. We still don't have consensus if we should try to change clang or
the standard, but llvm should work with compilers that implement the current
standard and mangle those functions.

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

11 years ago[asan] support long double on 64-bit. See https://code.google.com/p/address-sanitizer...
Kostya Serebryany [Fri, 15 Feb 2013 12:46:06 +0000 (12:46 +0000)]
[asan] support long double on 64-bit. See https://code.google.com/p/address-sanitizer/issues/detail?id=151

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

11 years agoMake helpers static. Add missing include so LLVMInitializeObjCARCOpts gets C linkage.
Benjamin Kramer [Fri, 15 Feb 2013 12:30:38 +0000 (12:30 +0000)]
Make helpers static. Add missing include so LLVMInitializeObjCARCOpts gets C linkage.

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

11 years agoAArch64: remove ConstantIsland pass & put literals in separate section.
Tim Northover [Fri, 15 Feb 2013 09:33:43 +0000 (09:33 +0000)]
AArch64: remove ConstantIsland pass & put literals in separate section.

This implements the review suggestion to simplify the AArch64 backend. If we
later discover that we *really* need the extra complexity of the
ConstantIslands pass for performance reasons it can be resurrected.

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

11 years agoAArch64: refactor frame handling to use movz/movk for overlarge offsets.
Tim Northover [Fri, 15 Feb 2013 09:33:26 +0000 (09:33 +0000)]
AArch64: refactor frame handling to use movz/movk for overlarge offsets.

In the near future litpools will be in a different section, which means that
any access to them is at least two instructions. This makes the case for a
movz/movk pair (if total offset <= 32-bits) even more compelling.

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

11 years agoclang-formatize llvm-symbolizer code
Alexey Samsonov [Fri, 15 Feb 2013 08:54:47 +0000 (08:54 +0000)]
clang-formatize llvm-symbolizer code

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

11 years agoSimplify the 'operator<' for the attribute object.
Bill Wendling [Fri, 15 Feb 2013 05:25:26 +0000 (05:25 +0000)]
Simplify the 'operator<' for the attribute object.

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

11 years agoBBVectorize: Cap the number of candidate pairs in each instruction group
Hal Finkel [Fri, 15 Feb 2013 04:28:42 +0000 (04:28 +0000)]
BBVectorize: Cap the number of candidate pairs in each instruction group

For some basic blocks, it is possible to generate many candidate pairs for
relatively few pairable instructions. When many (tens of thousands) of these pairs
are generated for a single instruction group, the time taken to generate and
rank the different vectorization plans can become quite large. As a result, we now
cap the number of candidate pairs within each instruction group. This is done by
closing out the group once the threshold is reached (set now at 3000 pairs).

Although this will limit the overall compile-time impact, this may not be the best
way to achieve this result. It might be better, for example, to prune excessive
candidate pairs after the fact the prevent the generation of short, but highly-connected
groups. We can experiment with this in the future.

This change reduces the overall compile-time slowdown of the csa.ll test case in
PR15222 to ~5x. If 5x is still considered too large, a lower limit can be
used as the default.

This represents a functionality change, but only for very large inputs
(thus, there is no regression test).

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

11 years agoRevert "Simplify the attributes '<' comparison function."
Anna Zaks [Fri, 15 Feb 2013 04:15:55 +0000 (04:15 +0000)]
Revert "Simplify the attributes '<' comparison function."

This reverts commit 82c101153fe7b35bce48781fab038e1b8f31a7bd.

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

11 years agoRevert "Fix testcase for attribute ordering."
Anna Zaks [Fri, 15 Feb 2013 04:15:53 +0000 (04:15 +0000)]
Revert "Fix testcase for attribute ordering."

This reverts commit 58f20a3cbfca7384fe5e25e095f18572736a4792.

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

11 years agoRevert "Fix testcase for attribute ordering."
Anna Zaks [Fri, 15 Feb 2013 04:15:50 +0000 (04:15 +0000)]
Revert "Fix testcase for attribute ordering."

This reverts commit 997c6516ca161073a1d516ebca7c0ca7722f64e2.

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

11 years agoFix testcase for attribute ordering.
Bill Wendling [Fri, 15 Feb 2013 01:04:46 +0000 (01:04 +0000)]
Fix testcase for attribute ordering.

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

11 years agoFix minor mips16 issues in directives for function prologue. Probably this does
Reed Kotler [Fri, 15 Feb 2013 01:04:38 +0000 (01:04 +0000)]
Fix minor mips16 issues in directives for function prologue. Probably this does
not matter but makes it more gcc compatible which avoids possible subtle
problems. Also, turned back on a disabled check in helloworld.ll.

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

11 years agoFix testcase for attribute ordering.
Bill Wendling [Fri, 15 Feb 2013 00:58:25 +0000 (00:58 +0000)]
Fix testcase for attribute ordering.

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

11 years agoSimplify the attributes '<' comparison function.
Bill Wendling [Fri, 15 Feb 2013 00:55:08 +0000 (00:55 +0000)]
Simplify the attributes '<' comparison function.

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

11 years ago[mips] Disallow moving load/store instructions past volatile instructions.
Akira Hatanaka [Thu, 14 Feb 2013 23:54:40 +0000 (23:54 +0000)]
[mips] Disallow moving load/store instructions past volatile instructions.

Unfortunately, I wasn't able to create a test case that demonstrates the
problem I was trying to fix with this patch.

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

11 years ago[mips] Replace usage of SmallSet with BitVector, which is used to keep track of
Akira Hatanaka [Thu, 14 Feb 2013 23:40:57 +0000 (23:40 +0000)]
[mips] Replace usage of SmallSet with BitVector, which is used to keep track of
defined and used registers. Also add a few helper functions to simplify the
code.

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

11 years ago[mips] Fix comments and coding style violations. Declare functions to be const.
Akira Hatanaka [Thu, 14 Feb 2013 23:20:15 +0000 (23:20 +0000)]
[mips] Fix comments and coding style violations. Declare functions to be const.

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

11 years agoThe ARM NEON vector compare instructions take three arguments. However, the
Joel Jones [Thu, 14 Feb 2013 23:18:40 +0000 (23:18 +0000)]
The ARM NEON vector compare instructions take three arguments. However, the
assembler should also accept a two arg form, as the docuemntation specifies that
the first (destination) register is optional.

This patch uses TwoOperandAliasConstraint to add the two argument form.

It also fixes an 80-column formatting problem in:
  test/MC/ARM/neon-bitwise-encoding

<rdar://problem/12909419> Clang rejects ARM NEON assembly instructions

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

11 years agoThe operand listing is very much outdated.
Eli Bendersky [Thu, 14 Feb 2013 23:17:03 +0000 (23:17 +0000)]
The operand listing is very much outdated.

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

11 years ago[mips] Simplify code in function Filler::findDelayInstr.
Akira Hatanaka [Thu, 14 Feb 2013 23:11:24 +0000 (23:11 +0000)]
[mips] Simplify code in function Filler::findDelayInstr.

1. Define and use function terminateSearch.
2. Use MachineBasicBlock::iterator instead of MachineBasicBlock::instr_iterator.
3. Delete the line which checks whether an instruction is a pseudo.

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

11 years agoMark getRawBits const.
Preston Gurd [Thu, 14 Feb 2013 22:49:29 +0000 (22:49 +0000)]
Mark getRawBits const.

Patch by Tyler Nowicki.

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

11 years agoBBVectorize: Remove the remaining instances of std::multimap
Hal Finkel [Thu, 14 Feb 2013 22:38:04 +0000 (22:38 +0000)]
BBVectorize: Remove the remaining instances of std::multimap

All instances of std::multimap have now been replaced by
DenseMap<K, std::vector<V> >, and this yields a speedup of 5% on the
csa.ll test case from PR15222.

No functionality change intended.

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

11 years agoBBVectorize: Don't store candidate pairs in a std::multimap
Hal Finkel [Thu, 14 Feb 2013 22:37:09 +0000 (22:37 +0000)]
BBVectorize: Don't store candidate pairs in a std::multimap

This is another commit on the road to removing std::multimap from
BBVectorize. This gives an ~1% speedup on the csa.ll test case
in PR15222.

No functionality change intended.

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

11 years agoSimplify code. Remove "else after return".
Jakub Staszak [Thu, 14 Feb 2013 21:50:09 +0000 (21:50 +0000)]
Simplify code. Remove "else after return".

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

11 years agoUpdate comment.
Chad Rosier [Thu, 14 Feb 2013 20:44:07 +0000 (20:44 +0000)]
Update comment.

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

11 years agoHexagon: Change insn class to support instruction encoding.
Jyotsna Verma [Thu, 14 Feb 2013 19:57:17 +0000 (19:57 +0000)]
Hexagon: Change insn class to support instruction encoding.
This patch doesn't introduce any functionality changes.
It adds some new fields to the Hexagon instruction classes and
changes their layout to support instruction encoding.

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