oota-llvm.git
13 years agoRevert "Don't check liveness of unallocatable registers."
Jakob Stoklund Olesen [Sat, 30 Jul 2011 00:57:25 +0000 (00:57 +0000)]
Revert "Don't check liveness of unallocatable registers."

The ARM target depends on CPSR liveness being tracked after register
allocation.

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

13 years agoMake my attempt to build up global deps variables actually utilize
Chandler Carruth [Fri, 29 Jul 2011 23:52:01 +0000 (23:52 +0000)]
Make my attempt to build up global deps variables actually utilize
globally scoped constructs. Also, round-trip these dependencies through
the LLVMConfig.cmake.in file thata is used by CMake-based clients of
"installed" (or built) LLVM trees.

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

13 years agoDon't check liveness of unallocatable registers.
Jakob Stoklund Olesen [Fri, 29 Jul 2011 23:36:21 +0000 (23:36 +0000)]
Don't check liveness of unallocatable registers.

This includes registers like EFLAGS and ST0-ST7. We don't check for
liveness issues in the verifier and scavenger because registers will
never be allocated from these classes.

While in SSA form, we do care about the liveness of unallocatable
unreserved registers. Liveness of EFLAGS and ST0 neds to be correct for
MachineDCE and MachineSinking.

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

13 years agoCheck for multiple defs in the machine code verifier.
Jakob Stoklund Olesen [Fri, 29 Jul 2011 23:02:48 +0000 (23:02 +0000)]
Check for multiple defs in the machine code verifier.

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

13 years agoCorrectly handle scattered operands where the bits of the operand are contiguous...
Owen Anderson [Fri, 29 Jul 2011 23:01:18 +0000 (23:01 +0000)]
Correctly handle scattered operands where the bits of the operand are contiguous, but out of order.

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

13 years agoAdd an isSSA() flag to MachineRegisterInfo.
Jakob Stoklund Olesen [Fri, 29 Jul 2011 22:51:22 +0000 (22:51 +0000)]
Add an isSSA() flag to MachineRegisterInfo.

This flag is true from isel to register allocation when the machine
function is required to be in SSA form.  The TwoAddressInstructionPass
and PHIElimination passes clear the flag.

The SSA flag wil be used by the machine code verifier to check for SSA
form, and eventually an assertion can enforce it in +Asserts builds.
This will catch the common target error of creating machine code with
multiple defs of a virtual register.

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

13 years agoUnconstify Inits
David Greene [Fri, 29 Jul 2011 22:43:06 +0000 (22:43 +0000)]
Unconstify Inits

Remove const qualifiers from Init references, per Chris' request.

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

13 years agoDo not lose branch weights when lowering SwitchInst.
Jakub Staszak [Fri, 29 Jul 2011 22:25:21 +0000 (22:25 +0000)]
Do not lose branch weights when lowering SwitchInst.

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

13 years agoEnable compact region splitting by default.
Jakob Stoklund Olesen [Fri, 29 Jul 2011 22:10:27 +0000 (22:10 +0000)]
Enable compact region splitting by default.

This helps generate better code in functions with high register
pressure.

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

13 years agoAdd support for the 'Q' constraint.
Eric Christopher [Fri, 29 Jul 2011 21:18:58 +0000 (21:18 +0000)]
Add support for the 'Q' constraint.

Fixes rdar://9866494

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

13 years agoRemove a blank line from the top.
David Greene [Fri, 29 Jul 2011 20:50:18 +0000 (20:50 +0000)]
Remove a blank line from the top.

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

13 years agohave the verifier catch gep's into opaque struct types. PR10473
Chris Lattner [Fri, 29 Jul 2011 20:32:28 +0000 (20:32 +0000)]
have the verifier catch gep's into opaque struct types.  PR10473

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

13 years agoARM SRS instruction parsing, diassembly and encoding support.
Jim Grosbach [Fri, 29 Jul 2011 20:26:09 +0000 (20:26 +0000)]
ARM SRS instruction parsing, diassembly  and encoding support.

Fix the instruction encoding for operands. Refactor mode to use explicit
instruction definitions per FIXME to be more consistent with loads/stores.
Fix disassembler accordingly. Add tests.

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

13 years agoOn mac, it seems the MC disassembler is actually using the targetinfo
Chandler Carruth [Fri, 29 Jul 2011 20:23:34 +0000 (20:23 +0000)]
On mac, it seems the MC disassembler is actually using the targetinfo
for targets that don't have an MC-ized disassembler. I'm suspicious that
this shouldn't actually be happening, but hoping to fix the CMake build
on macs first, and investigate why second.

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

13 years agoRemove unneeded const_cast.
Jakub Staszak [Fri, 29 Jul 2011 20:05:36 +0000 (20:05 +0000)]
Remove unneeded const_cast.

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

13 years agoARM CPS mode immediate is 5 bits, not 4.
Jim Grosbach [Fri, 29 Jul 2011 20:02:39 +0000 (20:02 +0000)]
ARM CPS mode immediate is 5 bits, not 4.

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

13 years agoClear DbgValues in the end.
Devang Patel [Fri, 29 Jul 2011 19:49:58 +0000 (19:49 +0000)]
Clear DbgValues in the end.

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

13 years agoAdd more constantness in BranchProbabilityInfo.
Jakub Staszak [Fri, 29 Jul 2011 19:30:00 +0000 (19:30 +0000)]
Add more constantness in BranchProbabilityInfo.

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

13 years ago[AVX] Make DagInits Unique
David Greene [Fri, 29 Jul 2011 19:07:26 +0000 (19:07 +0000)]
[AVX] Make DagInits Unique

Make sure DagInits are unique and created only once.

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

13 years ago[AVX] Make FieldInit Unique
David Greene [Fri, 29 Jul 2011 19:07:24 +0000 (19:07 +0000)]
[AVX] Make FieldInit Unique

Make sure FieldInits are unique and created only once.

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

13 years ago[AVX] Make VarListElementInit Unique
David Greene [Fri, 29 Jul 2011 19:07:23 +0000 (19:07 +0000)]
[AVX] Make VarListElementInit Unique

Make sure VarListElementInits are unique and created only once.

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

13 years ago[AVX] Make VarBitInit Unique
David Greene [Fri, 29 Jul 2011 19:07:22 +0000 (19:07 +0000)]
[AVX] Make VarBitInit Unique

Make sure VarBitInits are unique and created only once.

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

13 years ago[AVX] Make VarInit Unique
David Greene [Fri, 29 Jul 2011 19:07:21 +0000 (19:07 +0000)]
[AVX] Make VarInit Unique

Make sure VarInits are unique and created only once.

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

13 years ago[AVX] Make TernOpInit Unique
David Greene [Fri, 29 Jul 2011 19:07:20 +0000 (19:07 +0000)]
[AVX] Make TernOpInit Unique

Make sure TernOpInits are unique and created only once.  This will be
important for AVX/SIMD as many operators will be used to generate
patterns and other relevant data.

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

13 years ago[AVX] Make BinOpInit Unique
David Greene [Fri, 29 Jul 2011 19:07:19 +0000 (19:07 +0000)]
[AVX] Make BinOpInit Unique

Make sure BinOpInits are unique and created only once.  This will be
important for AVX/SIMD as many operators will be used to generate
patterns and other relevant data.

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

13 years ago[AVX] Make UnOpInit Unique
David Greene [Fri, 29 Jul 2011 19:07:18 +0000 (19:07 +0000)]
[AVX] Make UnOpInit Unique

Make sure UnOpInits are unique and created only once.  This will be
important for AVX/SIMD as many operators will be used to generate
patterns and other relevant data.

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

13 years ago[AVX] Make ListInits Unique
David Greene [Fri, 29 Jul 2011 19:07:16 +0000 (19:07 +0000)]
[AVX] Make ListInits Unique

Ensure ListInits are unique and only created once.  This will be
important for AVX as lists will be used extensively to pass generic
patterns, prefix information and other things to lower-level
pattern-generation classes.

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

13 years ago[AVX] Make CodeInit Unique
David Greene [Fri, 29 Jul 2011 19:07:15 +0000 (19:07 +0000)]
[AVX] Make CodeInit Unique

Use a StringMap to ensure CodeInits are unique and created only
once.

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

13 years ago[AVX] Make StringInit Unique
David Greene [Fri, 29 Jul 2011 19:07:14 +0000 (19:07 +0000)]
[AVX] Make StringInit Unique

Use a StringMap to ensure the StringInits are unique.  This is
especially important for AVX where we will have many smallish
strings representing instruction prefixes, suffixes and the like.

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

13 years ago[AVX] Make IntInit Unique
David Greene [Fri, 29 Jul 2011 19:07:12 +0000 (19:07 +0000)]
[AVX] Make IntInit Unique

Use a DenseMap to make sure only one IntInit of any value exists.

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

13 years ago[AVX] Make BitsInit Unique
David Greene [Fri, 29 Jul 2011 19:07:11 +0000 (19:07 +0000)]
[AVX] Make BitsInit Unique

Make BitsInit a FoldingSetNode so we can unique it.

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

13 years ago[AVX] Unique BitInit
David Greene [Fri, 29 Jul 2011 19:07:10 +0000 (19:07 +0000)]
[AVX] Unique BitInit

Keep only two copies of BitInit: one for true and one for false.

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

13 years ago[AVX] Unique UnsetInit
David Greene [Fri, 29 Jul 2011 19:07:09 +0000 (19:07 +0000)]
[AVX] Unique UnsetInit

Keep only one UnsetInit around.

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

13 years ago[AVX] Create Inits Via Factory Method
David Greene [Fri, 29 Jul 2011 19:07:07 +0000 (19:07 +0000)]
[AVX] Create Inits Via Factory Method

Replace uses of new *Init with *Init::get.  This hides the allocation
implementation so that we can unique Inits in various ways.

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

13 years ago[AVX] Constify Inits
David Greene [Fri, 29 Jul 2011 19:07:05 +0000 (19:07 +0000)]
[AVX] Constify Inits

Make references to Inits const everywhere.  This is the final step
before making them unique.

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

13 years ago[AVX] Remove non-const Iterators
David Greene [Fri, 29 Jul 2011 19:07:02 +0000 (19:07 +0000)]
[AVX] Remove non-const Iterators

Remove all non-const iterators from Init classes.  This is another
step toward constifying Inits and ultimately turning them into
FoldingSetNodes.

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

13 years ago[AVX] Remove Mutating Members from Inits
David Greene [Fri, 29 Jul 2011 19:07:00 +0000 (19:07 +0000)]
[AVX] Remove Mutating Members from Inits

Get rid of all Init members that modify internal state.  This is in
preparation for making references to Inits const.

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

13 years agoAdd ListInit::getValues
David Greene [Fri, 29 Jul 2011 19:06:59 +0000 (19:06 +0000)]
Add ListInit::getValues

Add a getValues ListInit method to return the sequence of values in
the list.

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

13 years agoAdd a std::string Wrapper for TableGen
David Greene [Fri, 29 Jul 2011 19:06:58 +0000 (19:06 +0000)]
Add a std::string Wrapper for TableGen

Create a std::string wrapper for use as a DenseMap key.  DenseMap is
not safe in generate with strings, so this wrapper indicates that only
strings guaranteed not to have certain values should be used in the
DenseMap.

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

13 years agoClean up debug info after reassociation.
Devang Patel [Fri, 29 Jul 2011 19:00:35 +0000 (19:00 +0000)]
Clean up debug info after reassociation.

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

13 years agoARM assembly parsing and encoding for RFE instruction.
Jim Grosbach [Fri, 29 Jul 2011 18:47:24 +0000 (18:47 +0000)]
ARM assembly parsing and encoding for RFE instruction.

Fill in the missing fixed bits and the register operand bits of the instruction
encoding. Refactor the definition to make the mode explicit, which is
consistent with how loads and stores are normally represented and makes
parsing much easier. Add parsing aliases for pseudo-instruction variants.
Update the disassembler for the new representations. Add tests for parsing and
encoding.

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

13 years agoThird time's the charm for implementing tied operand decoding properly.
Owen Anderson [Fri, 29 Jul 2011 18:28:52 +0000 (18:28 +0000)]
Third time's the charm for implementing tied operand decoding properly.

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

13 years agoDon't look at $PWD in GetCurrentDirectory.
Nick Lewycky [Fri, 29 Jul 2011 18:26:59 +0000 (18:26 +0000)]
Don't look at $PWD in GetCurrentDirectory.

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

13 years agoARM SRS and RFE instructions are not code-gen only.
Jim Grosbach [Fri, 29 Jul 2011 17:51:39 +0000 (17:51 +0000)]
ARM SRS and RFE instructions are not code-gen only.

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

13 years agoARM range checking for mode on CPS instruction.
Jim Grosbach [Fri, 29 Jul 2011 17:42:17 +0000 (17:42 +0000)]
ARM range checking for mode on CPS instruction.

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

13 years agoARM update tests for CPS instruction.
Jim Grosbach [Fri, 29 Jul 2011 17:39:27 +0000 (17:39 +0000)]
ARM update tests for CPS instruction.

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

13 years agoUpdate FIXME.
Jim Grosbach [Fri, 29 Jul 2011 17:36:04 +0000 (17:36 +0000)]
Update FIXME.

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

13 years agoTweak comment.
Jim Grosbach [Fri, 29 Jul 2011 17:33:29 +0000 (17:33 +0000)]
Tweak comment.

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

13 years agoFix a case where, when trying to track tied operands, we'd accidentally overwrite...
Owen Anderson [Fri, 29 Jul 2011 17:32:03 +0000 (17:32 +0000)]
Fix a case where, when trying to track tied operands, we'd accidentally overwrite our mapping.

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

13 years agoSwitch the CMake edis build over to add_llvm_library_dependencies
Douglas Gregor [Fri, 29 Jul 2011 15:41:39 +0000 (15:41 +0000)]
Switch the CMake edis build over to add_llvm_library_dependencies

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

13 years agoAvoid undefined behaviour if somehow NUM_GRAPHS equals 2^32 (or
Duncan Sands [Fri, 29 Jul 2011 07:50:02 +0000 (07:50 +0000)]
Avoid undefined behaviour if somehow NUM_GRAPHS equals 2^32 (or
whatever the size of unsigned is), though this can't actually
occur for any integer value of NUM_NODES.

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

13 years agoTeach Path::GetCurrentDirectory to use $PWD, to support users who like to do
Nick Lewycky [Fri, 29 Jul 2011 04:42:39 +0000 (04:42 +0000)]
Teach Path::GetCurrentDirectory to use $PWD, to support users who like to do
screwy things by setting PWD != getcwd(). For example, some developers I know
will use this to control the value in gcc's DW_AT_comp_dir value in debug
output. With this patch, that trick will now work on clang too.

The only other effect of this change is that the static analysis will now
respect $PWD when reporting the directory of the files in its HTML output. I
think that's fine.

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

13 years agoFix a lot of typos, improve (but not necessarily fix) grammaros and reflow some
Nick Lewycky [Fri, 29 Jul 2011 03:49:23 +0000 (03:49 +0000)]
Fix a lot of typos, improve (but not necessarily fix) grammaros and reflow some
lines. No functionality change.

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

13 years agoMisc optimizer+codegen work for 'cmpxchg' and 'atomicrmw'. They appear to be
Eli Friedman [Fri, 29 Jul 2011 03:05:32 +0000 (03:05 +0000)]
Misc optimizer+codegen work for 'cmpxchg' and 'atomicrmw'.  They appear to be
working on x86 (at least for trivial testcases); other architectures will
need more work so that they actually emit the appropriate instructions for
orderings stricter than 'monotonic'. (As far as I can tell, the ARM, PPC,
Mips, and Alpha backends need such changes.)

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

13 years agoRemove incEdgeWeight and decEdgeWeight. Set edge weight directly to avoid
Jakub Staszak [Fri, 29 Jul 2011 02:36:53 +0000 (02:36 +0000)]
Remove incEdgeWeight and decEdgeWeight. Set edge weight directly to avoid
rounding errors.

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

13 years agoFix the MCDisassembler dependencies. These were just absurdly wrong.
Chandler Carruth [Fri, 29 Jul 2011 02:12:59 +0000 (02:12 +0000)]
Fix the MCDisassembler dependencies. These were just absurdly wrong.

First off, only depend on the actual MC-ized disassemblers in the
targets, not all of the libraries those in turn depend on.

Second off, only depend on those MC-ized disassemblers for targets we're
building.

This should fix builds of fewer than all targets.

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

13 years agoFix two tests that I crashed in the previous commits. The mask elts
Bruno Cardoso Lopes [Fri, 29 Jul 2011 02:05:28 +0000 (02:05 +0000)]
Fix two tests that I crashed in the previous commits. The mask elts
on the second half must be reindexed.

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

13 years agoMatch VPERMIL masks more strictly and update the target specific mask
Bruno Cardoso Lopes [Fri, 29 Jul 2011 01:31:15 +0000 (01:31 +0000)]
Match VPERMIL masks more strictly and update the target specific mask
generation to always catch the weird cases.

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

13 years agoAdd DecodeShuffle shuffle support for VPERMIPD variantes
Bruno Cardoso Lopes [Fri, 29 Jul 2011 01:31:11 +0000 (01:31 +0000)]
Add DecodeShuffle shuffle support for VPERMIPD variantes

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

13 years agoAdd v8i32 and v4i64 vpermil patterns
Bruno Cardoso Lopes [Fri, 29 Jul 2011 01:31:07 +0000 (01:31 +0000)]
Add v8i32 and v4i64 vpermil patterns

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

13 years agoFix a bug while generating target specific VPERMIL masks: skip
Bruno Cardoso Lopes [Fri, 29 Jul 2011 01:31:04 +0000 (01:31 +0000)]
Fix a bug while generating target specific VPERMIL masks: skip
undef mask elements. This fixes PR10529.

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

13 years agoEnable usage of SSE4 extracts and inserts in their 128-bit AVX forms.
Bruno Cardoso Lopes [Fri, 29 Jul 2011 01:31:02 +0000 (01:31 +0000)]
Enable usage of SSE4 extracts and inserts in their 128-bit AVX forms.
Also tidy up code a bit.

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

13 years agoCleanup PALIGNR handling and remove the old palign pattern fragment.
Bruno Cardoso Lopes [Fri, 29 Jul 2011 01:30:59 +0000 (01:30 +0000)]
Cleanup PALIGNR handling and remove the old palign pattern fragment.
Also make PALIGNR masks to don't match 256-bits, which isn't supported
It's also a step to solve PR10489

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

13 years agoUse the pointer type size.
Bill Wendling [Fri, 29 Jul 2011 01:15:29 +0000 (01:15 +0000)]
Use the pointer type size.

With this, we can now compile a simple EH program.

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

13 years agoAnd now something that compiles...
Bill Wendling [Fri, 29 Jul 2011 01:11:33 +0000 (01:11 +0000)]
And now something that compiles...

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

13 years agoMake sure to sext or trunc the result from the register.
Bill Wendling [Fri, 29 Jul 2011 01:11:14 +0000 (01:11 +0000)]
Make sure to sext or trunc the result from the register.

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

13 years agoTransfer implicit operands in NEONMoveFixPass.
Jakob Stoklund Olesen [Fri, 29 Jul 2011 00:27:35 +0000 (00:27 +0000)]
Transfer implicit operands in NEONMoveFixPass.

Later passes /are/ using this information when running the register
scavenger.

This fixes the second problem in PR10520.

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

13 years agoAdd -verify-arm-pseudo-expand.
Jakob Stoklund Olesen [Fri, 29 Jul 2011 00:27:32 +0000 (00:27 +0000)]
Add -verify-arm-pseudo-expand.

This hidden llc option runs the machine code verifier after expanding
ARM pseudo-instructions, but before if-conversion.

The machine code verifier is much better at pointing out liveness errors
that can trip up the register scavenger.

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

13 years agoMake sure to correctly clear the exact/nuw/nsw flags off of shifts when they are...
Eli Friedman [Fri, 29 Jul 2011 00:18:19 +0000 (00:18 +0000)]
Make sure to correctly clear the exact/nuw/nsw flags off of shifts when they are combined together. <rdar://problem/9859829>

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

13 years agoRewrite the CMake build to use explicit dependencies between libraries,
Chandler Carruth [Fri, 29 Jul 2011 00:14:25 +0000 (00:14 +0000)]
Rewrite the CMake build to use explicit dependencies between libraries,
specified in the same file that the library itself is created. This is
more idiomatic for CMake builds, and also allows us to correctly specify
dependencies that are missed due to bugs in the GenLibDeps perl script,
or change from compiler to compiler. On Linux, this returns CMake to
a place where it can relably rebuild several targets of LLVM.

I have tried not to change the dependencies from the ones in the current
auto-generated file. The only places I've really diverged are in places
where I was seeing link failures, and added a dependency. The goal of
this patch is not to start changing the dependencies, merely to move
them into the correct location, and an explicit form that we can control
and change when necessary.

This also removes a serialization point in the build because we don't
have to scan all the libraries before we begin building various tools.
We no longer have a step of the build that regenerates a file inside the
source tree. A few other associated cleanups fall out of this.

This isn't really finished yet though. After talking to dgregor he urged
switching to a single CMake macro to construct libraries with both
sources and dependencies in the arguments. Migrating from the two macros
to that style will be a follow-up patch.

Also, llvm-config is still generated with GenLibDeps.pl, which means it
still has slightly buggy dependencies. The internal CMake
'llvm-config-like' macro uses the correct explicitly specified
dependencies however. A future patch will switch llvm-config generation
(when using CMake) to be based on these deps as well.

This may well break Windows. I'm getting a machine set up now to dig
into any failures there. If anyone can chime in with problems they see
or ideas of how to solve them for Windows, much appreciated.

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

13 years agoRemove extra semicolon.
Jakub Staszak [Fri, 29 Jul 2011 00:05:35 +0000 (00:05 +0000)]
Remove extra semicolon.

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

13 years agoEnhance the fixed-length decoder emitter to support tied operands.
Owen Anderson [Thu, 28 Jul 2011 23:56:20 +0000 (23:56 +0000)]
Enhance the fixed-length decoder emitter to support tied operands.

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

13 years agoVisit the landingpad instruction.
Bill Wendling [Thu, 28 Jul 2011 23:44:58 +0000 (23:44 +0000)]
Visit the landingpad instruction.

This generates the correct SDNodes for the landingpad instruction. It makes an
assumption that the result of the landingpad instruction has at least two
values. And that the first value is a pointer to the exception object and the
second value is the "selector."

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

13 years agoAdd the AddLandingPadInfo function.
Bill Wendling [Thu, 28 Jul 2011 23:42:57 +0000 (23:42 +0000)]
Add the AddLandingPadInfo function.

AddLandingPadInfo takes a landingpad instruction and grabs all of the
information from it that it needs for EH table generation.

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

13 years agoChange LBH_TAKEN_WEIGHT to 124 (from 128). Right now, sum of
Jakub Staszak [Thu, 28 Jul 2011 23:42:08 +0000 (23:42 +0000)]
Change LBH_TAKEN_WEIGHT to 124 (from 128). Right now, sum of
LBH_TAKEN_WEIGHT + LBH_NONTAKEN_WEIGHT = 128 which in _most_ cases reduce
number of rounding errors.

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

13 years agoPLD and PLI are not predicable in ARM mode.
Jim Grosbach [Thu, 28 Jul 2011 23:22:41 +0000 (23:22 +0000)]
PLD and PLI are not predicable in ARM mode.

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

13 years agoCBZ/CBNZ are Thumb2 only. No need for ARM mode tests for them.
Jim Grosbach [Thu, 28 Jul 2011 21:59:38 +0000 (21:59 +0000)]
CBZ/CBNZ are Thumb2 only. No need for ARM mode tests for them.

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

13 years agoARM assembly parsing and encoding for BLX (immediate).
Jim Grosbach [Thu, 28 Jul 2011 21:57:55 +0000 (21:57 +0000)]
ARM assembly parsing and encoding for BLX (immediate).

Add parsing support for BLX (immediate). Since the register operand version is
predicated and the label operand version is not, we have to use some special
handling to get the operand list right for matching.

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

13 years agoEnhance the fixed-length decoder emitter to support parsing scattered fields.
Owen Anderson [Thu, 28 Jul 2011 21:54:31 +0000 (21:54 +0000)]
Enhance the fixed-length decoder emitter to support parsing scattered fields.

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

13 years agoLangRef and basic memory-representation/reading/writing for 'cmpxchg' and
Eli Friedman [Thu, 28 Jul 2011 21:48:00 +0000 (21:48 +0000)]
LangRef and basic memory-representation/reading/writing for 'cmpxchg' and
'atomicrmw' instructions, which allow representing all the current atomic
rmw intrinsics.

The allowed operands for these instructions are heavily restricted at the
moment; we can probably loosen it a bit, but supporting general
first-class types (where it makes sense) might get a bit complicated,
given how SelectionDAG works.

As an initial cut, these operations do not support specifying an alignment,
but it would be possible to add if we think it's useful. Specifying an
alignment lower than the natural alignment would be essentially
impossible to support on anything other than x86, but specifying a greater
alignment would be possible.  I can't think of any useful optimizations which
would use that information, but maybe someone else has ideas.

Optimizer/codegen support coming soon.

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

13 years agoIf run with -debug give more information about Cyclic Probability.
Jakub Staszak [Thu, 28 Jul 2011 21:46:58 +0000 (21:46 +0000)]
If run with -debug give more information about Cyclic Probability.

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

13 years agoHeuristics are in descending priority now. If we use one of them, skip the rest.
Jakub Staszak [Thu, 28 Jul 2011 21:45:07 +0000 (21:45 +0000)]
Heuristics are in descending priority now. If we use one of them, skip the rest.

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

13 years agoHandle REG_SEQUENCE with implicitly defined operands.
Jakob Stoklund Olesen [Thu, 28 Jul 2011 21:38:51 +0000 (21:38 +0000)]
Handle REG_SEQUENCE with implicitly defined operands.

Code like that would only be produced by bugpoint, but we should still
handle it correctly.

When a register is defined by a REG_SEQUENCE of undefs, the register
itself is undef. Previously, we would create a register with uses but no
defs.

Fixes part of PR10520.

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

13 years agoRemove obsolete FIXME reference in comment.
Jim Grosbach [Thu, 28 Jul 2011 21:37:05 +0000 (21:37 +0000)]
Remove obsolete FIXME reference in comment.

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

13 years agoARM assembly parsing and encoding for BFC and BFI.
Jim Grosbach [Thu, 28 Jul 2011 21:34:26 +0000 (21:34 +0000)]
ARM assembly parsing and encoding for BFC and BFI.

Add parsing support that handles converting the lsb+width source into the
odd way we represent the instruction (an inverted bitfield mask).

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

13 years agoAdd InEdges (edges from header to the loop) in Loop Branch Heuristics, so
Jakub Staszak [Thu, 28 Jul 2011 21:33:46 +0000 (21:33 +0000)]
Add InEdges (edges from header to the loop) in Loop Branch Heuristics, so
there is no frequency difference whether condition is in the header or in
the latch.

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

13 years agoUse ArrayRef instead of requiring an std::vector.
Bill Wendling [Thu, 28 Jul 2011 21:25:33 +0000 (21:25 +0000)]
Use ArrayRef instead of requiring an std::vector.

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

13 years agoThe personality function should be a Function* and not just a Value*.
Bill Wendling [Thu, 28 Jul 2011 21:14:13 +0000 (21:14 +0000)]
The personality function should be a Function* and not just a Value*.

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

13 years agoFix Clang attribute reader tblgen output for a corresponding fix on the Clang side
Douglas Gregor [Thu, 28 Jul 2011 20:55:16 +0000 (20:55 +0000)]
Fix Clang attribute reader tblgen output for a corresponding fix on the Clang side

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

13 years agoReverse order of RS_Split live ranges under -compact-regions.
Jakob Stoklund Olesen [Thu, 28 Jul 2011 20:48:23 +0000 (20:48 +0000)]
Reverse order of RS_Split live ranges under -compact-regions.

There are two conflicting strategies in play:

- Under high register pressure, we want to assign large live ranges
  first. Smaller live ranges are easier to place afterwards.

- Live range splitting is guided by interference, so splitting should be
  deferred until interference is as realistic as possible.

With the recent changes to the live range stages, and with compact
regions enabled, it is less traumatic to split a live range too early.
If some of the split products were too big, they can often be split
again.

By reversing the RS_Split order, we get this queue order:

1. Normal live ranges, large to small.
2. RS_Split live ranges, large to small.

The large-to-small order improves RAGreedy's puzzle solving skills under
high register pressure. It may cause a bit more iterated splitting, but
we handle that better now.

With this change, -compact-regions is mostly an improvement on SPEC.

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

13 years agoInitial code to convert ResumeInsts into calls to _Unwind_Resume.
Bill Wendling [Thu, 28 Jul 2011 20:48:05 +0000 (20:48 +0000)]
Initial code to convert ResumeInsts into calls to _Unwind_Resume.

This should be the only code necessary for DWARF EH prepare.

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

13 years agoFix stupid mistake from commit 136381.
Jakub Staszak [Thu, 28 Jul 2011 20:17:18 +0000 (20:17 +0000)]
Fix stupid mistake from commit 136381.

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

13 years agoSpeed up BlockFrequencyInfo a little bit.
Jakub Staszak [Thu, 28 Jul 2011 20:09:31 +0000 (20:09 +0000)]
Speed up BlockFrequencyInfo a little bit.

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

13 years agoAdd fixme.
Jim Grosbach [Thu, 28 Jul 2011 19:46:12 +0000 (19:46 +0000)]
Add fixme.

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

13 years agoUse version 402 for the GCDA files when compiling for Apple.
Bill Wendling [Thu, 28 Jul 2011 18:12:20 +0000 (18:12 +0000)]
Use version 402 for the GCDA files when compiling for Apple.

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

13 years agoUpdate comments.
Owen Anderson [Thu, 28 Jul 2011 17:56:55 +0000 (17:56 +0000)]
Update comments.

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

13 years agoFill in some encoding information for STRD instructions.
Owen Anderson [Thu, 28 Jul 2011 17:53:25 +0000 (17:53 +0000)]
Fill in some encoding information for STRD instructions.

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

13 years agoRevert r136295. It broke nightly testers because some parts of codegen weren't aware...
Owen Anderson [Thu, 28 Jul 2011 17:18:57 +0000 (17:18 +0000)]
Revert r136295.  It broke nightly testers because some parts of codegen weren't aware of the changes to operand ordering.  I hope to revive this sometime in the future, but it's not strictly necessary for now.

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

13 years agoARM parsing and encoding for ADR.
Jim Grosbach [Thu, 28 Jul 2011 16:33:54 +0000 (16:33 +0000)]
ARM parsing and encoding for ADR.

The label does not have a '#' prefix. Add parsing and encoding tests.

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

13 years agoUpdate ARM tests for parsing and encoding of WFE, WFI and YIELD.
Jim Grosbach [Thu, 28 Jul 2011 16:00:41 +0000 (16:00 +0000)]
Update ARM tests for parsing and encoding of WFE, WFI and YIELD.

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