oota-llvm.git
13 years agoInstcombile optimization: extractelement(cast) -> cast(extractelement)
Nadav Rotem [Thu, 31 Mar 2011 22:57:29 +0000 (22:57 +0000)]
Instcombile optimization: extractelement(cast) -> cast(extractelement)

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

13 years agoFix ARM tests to be register allocator independent.
Jakob Stoklund Olesen [Thu, 31 Mar 2011 22:14:03 +0000 (22:14 +0000)]
Fix ARM tests to be register allocator independent.

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

13 years agoInstCombine: APFloat can't perform arithmetic on PPC double doubles, don't even try.
Benjamin Kramer [Thu, 31 Mar 2011 21:35:49 +0000 (21:35 +0000)]
InstCombine: APFloat can't perform arithmetic on PPC double doubles, don't even try.

Thanks Eli!

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

13 years agoAdd a test case for a malformed LDC/LDC2 instructions with PUDW = 0b0000, which
Johnny Chen [Thu, 31 Mar 2011 20:54:30 +0000 (20:54 +0000)]
Add a test case for a malformed LDC/LDC2 instructions with PUDW = 0b0000, which
amounts to an UNDEFINED instruction.

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

13 years agoDistribute (A + B) * C to (A * C) + (B * C) to make use of NEON multiplier
Evan Cheng [Thu, 31 Mar 2011 19:38:48 +0000 (19:38 +0000)]
Distribute (A + B) * C to (A * C) + (B * C) to make use of NEON multiplier
accumulator forwarding:
vadd d3, d0, d1
vmul d3, d3, d2
=>
vmul d3, d0, d2
vmla d3, d1, d2

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

13 years agoFix single word and unsigned byte data transfer instruction encodings so that
Johnny Chen [Thu, 31 Mar 2011 19:28:35 +0000 (19:28 +0000)]
Fix single word and unsigned byte data transfer instruction encodings so that
Inst{4} = 0.

rdar://problem/9213022

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

13 years agoFix Mips, Sparc, and XCore tests that were dependent on register allocation.
Jakob Stoklund Olesen [Thu, 31 Mar 2011 18:42:43 +0000 (18:42 +0000)]
Fix Mips, Sparc, and XCore tests that were dependent on register allocation.

Add an extra run with -regalloc=basic to keep them honest.

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

13 years agoAdded support for FP conditional move instructions and fixed bugs in handling of...
Akira Hatanaka [Thu, 31 Mar 2011 18:26:17 +0000 (18:26 +0000)]
Added support for FP conditional move instructions and fixed bugs in handling of FP comparisons.

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

13 years agoPick better examples. "fpext float 3.1415 to double" won't parse because 3.1415
Nick Lewycky [Thu, 31 Mar 2011 18:20:19 +0000 (18:20 +0000)]
Pick better examples. "fpext float 3.1415 to double" won't parse because 3.1415
isn't an exact float. Also "fpext float 1.0 to float" is invalid IR because
it's not performing an extension.

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

13 years agoDon't completely eliminate identity copies that also modify super register liveness.
Jakob Stoklund Olesen [Thu, 31 Mar 2011 17:55:25 +0000 (17:55 +0000)]
Don't completely eliminate identity copies that also modify super register liveness.

Turn them into noop KILL instructions instead. This lets the scavenger know when
super-registers are killed and defined.

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

13 years agoAdd BLXi to the instruction table for disassembly purpose.
Johnny Chen [Thu, 31 Mar 2011 17:53:50 +0000 (17:53 +0000)]
Add BLXi to the instruction table for disassembly purpose.
A8.6.23 BLX (immediate)

rdar://problem/9212921

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

13 years agoAllow kill flags on two-address instructions. They are harmless.
Jakob Stoklund Olesen [Thu, 31 Mar 2011 17:52:41 +0000 (17:52 +0000)]
Allow kill flags on two-address instructions. They are harmless.

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

13 years agoMark all uses as <undef> when joining a copy.
Jakob Stoklund Olesen [Thu, 31 Mar 2011 17:23:25 +0000 (17:23 +0000)]
Mark all uses as <undef> when joining a copy.

This way, shrinkToUses() will ignore the instruction that is about to be
deleted, and we avoid leaving invalid live ranges that SplitKit doesn't like.

Fix a misunderstanding in MachineVerifier about <def,undef> operands. The
<undef> flag is valid on def operands where it has the same meaning as <undef>
on a use operand. It only applies to sub-register defines which also read the
full register.

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

13 years agoRemove stray empty test file.
Daniel Dunbar [Thu, 31 Mar 2011 17:01:56 +0000 (17:01 +0000)]
Remove stray empty test file.

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

13 years agoRemove dead code.
Devang Patel [Thu, 31 Mar 2011 16:53:49 +0000 (16:53 +0000)]
Remove dead code.

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

13 years agoRevert r128632 again, until I figure out what break the tests
Bruno Cardoso Lopes [Thu, 31 Mar 2011 15:54:36 +0000 (15:54 +0000)]
Revert r128632 again, until I figure out what break the tests

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

13 years agoFix bug found by valgrind.
Jakob Stoklund Olesen [Thu, 31 Mar 2011 15:14:11 +0000 (15:14 +0000)]
Fix bug found by valgrind.

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

13 years agoAdd XCore intrinsics for initializing / starting / synchronizing threads.
Richard Osborne [Thu, 31 Mar 2011 15:13:13 +0000 (15:13 +0000)]
Add XCore intrinsics for initializing / starting / synchronizing threads.

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

13 years agoReapply r128585 without generating a lib depedency cycle. An updated log:
Bruno Cardoso Lopes [Thu, 31 Mar 2011 14:52:28 +0000 (14:52 +0000)]
Reapply r128585 without generating a lib depedency cycle. An updated log:

- Implement asm parsing support for LDRT, LDRBT, STRT, STRBT and
  {STR,LDC}{2}_{PRE,POST} fixing the encoding wherever is possible.
- Move all instructions which use am2offset without a pattern to use
  addrmode2.
- Add a new encoding bit to describe the index mode used and teach
  printAddrMode2Operand to check by the addressing mode which index
  mode to print.
- Testcases

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

13 years agoFix whitespace.
Michael J. Spencer [Thu, 31 Mar 2011 13:06:39 +0000 (13:06 +0000)]
Fix whitespace.

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

13 years agoSwitch FileRemover from PathV1 to V2.
Michael J. Spencer [Thu, 31 Mar 2011 13:04:19 +0000 (13:04 +0000)]
Switch FileRemover from PathV1 to V2.

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

13 years agolib/CodeGen/LiveIntervalAnalysis.cpp: [PR9590] Don't use std::pow(float,float) here.
NAKAMURA Takumi [Thu, 31 Mar 2011 12:11:33 +0000 (12:11 +0000)]
lib/CodeGen/LiveIntervalAnalysis.cpp: [PR9590] Don't use std::pow(float,float) here.

We don't expect the real "powf()" on some hosts (and powf() would be available on other hosts).
For consistency, std::pow(double,double) may be called instead.
Or, precision issue might attack us, to see unstable regalloc and stack coloring.

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

13 years agoInstCombine: Fix transform to use the swapped predicate.
Benjamin Kramer [Thu, 31 Mar 2011 10:46:03 +0000 (10:46 +0000)]
InstCombine: Fix transform to use the swapped predicate.

Thanks Frits!

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

13 years agoInstCombine: fold fcmp (fneg x), (fneg y) -> fcmp x, y
Benjamin Kramer [Thu, 31 Mar 2011 10:12:22 +0000 (10:12 +0000)]
InstCombine: fold fcmp (fneg x), (fneg y) -> fcmp x, y

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

13 years agoInstCombine: fold fcmp pred (fneg x), C -> fcmp swap(pred) x, -C
Benjamin Kramer [Thu, 31 Mar 2011 10:12:15 +0000 (10:12 +0000)]
InstCombine: fold fcmp pred (fneg x), C -> fcmp swap(pred) x, -C

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

13 years agoInstCombine: Shrink "fcmp (fpext x), C" to "fcmp x, C" if C can be losslessly convert...
Benjamin Kramer [Thu, 31 Mar 2011 10:12:07 +0000 (10:12 +0000)]
InstCombine: Shrink "fcmp (fpext x), C" to "fcmp x, C" if C can be losslessly converted to the type of x.

Fixes PR9592.

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

13 years agoInstCombine: fold fcmp (fpext x), (fpext y) -> fcmp x, y.
Benjamin Kramer [Thu, 31 Mar 2011 10:11:58 +0000 (10:11 +0000)]
InstCombine: fold fcmp (fpext x), (fpext y) -> fcmp x, y.

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

13 years agoWill not compile without the spec!
Duncan Sands [Thu, 31 Mar 2011 10:03:32 +0000 (10:03 +0000)]
Will not compile without the spec!

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

13 years agoStrip trailing whitespace.
Duncan Sands [Thu, 31 Mar 2011 09:58:51 +0000 (09:58 +0000)]
Strip trailing whitespace.

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

13 years agoTestcase for r128619 (PR9571).
Bill Wendling [Thu, 31 Mar 2011 08:13:57 +0000 (08:13 +0000)]
Testcase for r128619 (PR9571).

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

13 years agoPick a conservative register class when creating a small live range for remat.
Jakob Stoklund Olesen [Thu, 31 Mar 2011 03:54:44 +0000 (03:54 +0000)]
Pick a conservative register class when creating a small live range for remat.

The rematerialized instruction may require a more constrained register class
than the register being spilled. In the test case, the spilled register has been
inflated to the DPR register class, but we are rematerializing a load of the
ssub_0 sub-register which only exists for DPR_VFP2 registers.

The register class is reinflated after spilling, so the conservative choice is
only temporary.

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

13 years agoRevert "- Implement asm parsing support for LDRT, LDRBT, STRT, STRBT and"
Matt Beaumont-Gay [Thu, 31 Mar 2011 00:39:16 +0000 (00:39 +0000)]
Revert "- Implement asm parsing support for LDRT, LDRBT, STRT, STRBT and"

This revision introduced a dependency cycle, as nlewycky mentioned by email.

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

13 years agoFix typo in generated HTML.
Nick Lewycky [Thu, 31 Mar 2011 00:23:57 +0000 (00:23 +0000)]
Fix typo in generated HTML.

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

13 years agoUse intrinsics for Neon vmull operations. Radar 9208957.
Bob Wilson [Thu, 31 Mar 2011 00:09:35 +0000 (00:09 +0000)]
Use intrinsics for Neon vmull operations.  Radar 9208957.

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

13 years agoSomehow we managed to forget to encode the lane index for a large swathe of NEON...
Owen Anderson [Wed, 30 Mar 2011 23:45:29 +0000 (23:45 +0000)]
Somehow we managed to forget to encode the lane index for a large swathe of NEON instructions.  With this fix, the entire test-suite passes with the Thumb integrated assembler.

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

13 years agoDon't try to create zero-sized stack objects.
Evan Cheng [Wed, 30 Mar 2011 23:44:13 +0000 (23:44 +0000)]
Don't try to create zero-sized stack objects.

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

13 years ago- Implement asm parsing support for LDRT, LDRBT, STRT, STRBT and
Bruno Cardoso Lopes [Wed, 30 Mar 2011 23:32:32 +0000 (23:32 +0000)]
- Implement asm parsing support for LDRT, LDRBT, STRT, STRBT and
  {STR,LDC}{2}_PRE.
- Fixed the encoding in some places.
- Some of those instructions were using am2offset and now use addrmode2.
Codegen isn't affected, instructions which use SelectAddrMode2Offset were not
touched.
- Teach printAddrMode2Operand to check by the addressing mode which index
mode to print.
- This is a work in progress, more work to come. The idea is to change places
which use am2offset to use addrmode2 instead, as to unify assembly parser.
- Add testcases for assembly parser

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

13 years agoAdd a ARM-specific SD node for VBSL so that forms with a constant first operand
Cameron Zwarich [Wed, 30 Mar 2011 23:01:21 +0000 (23:01 +0000)]
Add a ARM-specific SD node for VBSL so that forms with a constant first operand
can be recognized. This fixes <rdar://problem/9183078>.

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

13 years agoTidy up. Whitespace and 80-columns.
Jim Grosbach [Wed, 30 Mar 2011 22:38:13 +0000 (22:38 +0000)]
Tidy up. Whitespace and 80-columns.

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

13 years ago* The DSE code that tested for overlapping needed to take into account the fact
Bill Wendling [Wed, 30 Mar 2011 21:37:19 +0000 (21:37 +0000)]
* The DSE code that tested for overlapping needed to take into account the fact
  that one of the numbers is signed while the other is unsigned. This could lead
  to a wrong result when the signed was promoted to an unsigned int.

* Add the data layout line to the testcase so that it will test the appropriate
  thing.

Patch by David Terei!

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

13 years agofixed typo
Akira Hatanaka [Wed, 30 Mar 2011 21:15:35 +0000 (21:15 +0000)]
fixed typo

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

13 years agoDon't add the same analysis implementation pair twice.
Jakob Stoklund Olesen [Wed, 30 Mar 2011 18:32:53 +0000 (18:32 +0000)]
Don't add the same analysis implementation pair twice.

Prevent infinite growth of the list.

Patch by José Fonseca!

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

13 years agoReset StringMap's NumTombstones on clears and rehashes.
Jakob Stoklund Olesen [Wed, 30 Mar 2011 18:32:51 +0000 (18:32 +0000)]
Reset StringMap's NumTombstones on clears and rehashes.

StringMap was not properly updating NumTombstones after a clear or rehash.

This was not fatal until now because the table was growing faster than
NumTombstones could, but with the previous change of preventing infinite
growth of the table the invariant (NumItems + NumTombstones <= NumBuckets)
stopped being observed, causing infinite loops in certain situations.

Patch by José Fonseca!

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

13 years agoPrevent infinite growth of SmallPtrSet instances.
Jakob Stoklund Olesen [Wed, 30 Mar 2011 18:32:48 +0000 (18:32 +0000)]
Prevent infinite growth of SmallPtrSet instances.

Rehash but don't grow when full of tombstones.

Patch by José Fonseca!

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

13 years agoPrevent infinite growth of SmallMap instances.
Jakob Stoklund Olesen [Wed, 30 Mar 2011 18:32:44 +0000 (18:32 +0000)]
Prevent infinite growth of SmallMap instances.

Rehash but don't grow when full of tombstones.

Patch by José Fonseca!

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

13 years agoPrevent infinite growth of the DenseMap.
Jakob Stoklund Olesen [Wed, 30 Mar 2011 18:32:41 +0000 (18:32 +0000)]
Prevent infinite growth of the DenseMap.

When the hash function uses object pointers all free entries eventually
become tombstones as they are used at least once, regardless of the size.

DenseMap cannot function with zero empty keys, so it double size to get
get ridof the tombstones.

However DenseMap never shrinks automatically unless it is cleared, so
the net result is that certain tables grow infinitely.

The solution is to make a fresh copy of the table without tombstones
instead of doubling size, by simply calling grow with the current size.

Patch by José Fonseca!

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

13 years agoFix evil VirtRegRewriter bug.
Jakob Stoklund Olesen [Wed, 30 Mar 2011 18:14:07 +0000 (18:14 +0000)]
Fix evil VirtRegRewriter bug.

The rewriter can keep track of multiple stack slots in the same register if they
happen to have the same value. When an instruction modifies a stack slot by
defining a register that is mapped to a stack slot, other stack slots in that
register are no longer valid.

This is a very rare problem, and I don't have a simple test case. I get the
impression that VirtRegRewriter knows it is about to be deleted, inventing a
last opaque problem.

<rdar://problem/9204040>

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

13 years agoTeach VirtRegRewriter about the new virtual register numbers. No functional change.
Jakob Stoklund Olesen [Wed, 30 Mar 2011 18:14:04 +0000 (18:14 +0000)]
Teach VirtRegRewriter about the new virtual register numbers. No functional change.

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

13 years agoAvoid turning a floating point division with a constant power of two into a denormal...
Benjamin Kramer [Wed, 30 Mar 2011 17:02:54 +0000 (17:02 +0000)]
Avoid turning a floating point division with a constant power of two into a denormal multiplication.

Some platforms may treat denormals as zero, on other platforms multiplication
with a subnormal is slower than dividing by a normal.

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

13 years agoInstCombine: If the divisor of an fdiv has an exact inverse, turn it into an fmul.
Benjamin Kramer [Wed, 30 Mar 2011 15:42:35 +0000 (15:42 +0000)]
InstCombine: If the divisor of an fdiv has an exact inverse, turn it into an fmul.

Fixes PR9587.

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

13 years agoAdd APFloat::getExactInverse.
Benjamin Kramer [Wed, 30 Mar 2011 15:42:27 +0000 (15:42 +0000)]
Add APFloat::getExactInverse.

The idea is, that if an ieee 754 float is divided by a power of two, we can
turn the division into a cheaper multiplication. This function sees if we can
get an exact multiplicative inverse for a divisor and returns it if possible.

This is the hard part of PR9587.

I tested many inputs against llvm-gcc's frotend implementation of this
optimization and didn't find any difference. However, floating point is the
land of weird edge cases, so any review would be appreciated.

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

13 years agoFix more zero length memset warnings.
Jay Foad [Wed, 30 Mar 2011 15:31:02 +0000 (15:31 +0000)]
Fix more zero length memset warnings.

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

13 years agoAdd a comment on PHINode::Create().
Jay Foad [Wed, 30 Mar 2011 13:29:06 +0000 (13:29 +0000)]
Add a comment on PHINode::Create().

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

13 years agoRemove PHINode::reserveOperandSpace(). Instead, add a parameter to
Jay Foad [Wed, 30 Mar 2011 11:28:46 +0000 (11:28 +0000)]
Remove PHINode::reserveOperandSpace(). Instead, add a parameter to
PHINode::Create() giving the (known or expected) number of operands.

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

13 years ago(Almost) always call reserveOperandSpace() on newly created PHINodes.
Jay Foad [Wed, 30 Mar 2011 11:19:20 +0000 (11:19 +0000)]
(Almost) always call reserveOperandSpace() on newly created PHINodes.

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

13 years agoRevert a minor comment change inadvertently included with r128502.
Bob Wilson [Wed, 30 Mar 2011 05:26:51 +0000 (05:26 +0000)]
Revert a minor comment change inadvertently included with r128502.

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

13 years agoTreat clones the same as their origin.
Jakob Stoklund Olesen [Wed, 30 Mar 2011 02:52:39 +0000 (02:52 +0000)]
Treat clones the same as their origin.

When DCE clones a live range because it separates into connected components,
make sure that the clones enter the same register allocator stage as the
register they were cloned from.

For instance, clones may be split even when they where created during spilling.
Other registers created during spilling are not candidates for splitting or even
(re-)spilling.

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

13 years agoRemove dead code.
Bill Wendling [Wed, 30 Mar 2011 01:03:48 +0000 (01:03 +0000)]
Remove dead code.

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

13 years agoAdd a test case for thumb stc2 instruction.
Johnny Chen [Wed, 30 Mar 2011 01:02:06 +0000 (01:02 +0000)]
Add a test case for thumb stc2 instruction.

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

13 years agoClangSAEmClangSACheckersEmitter, emit info about groups.
Argyrios Kyrtzidis [Wed, 30 Mar 2011 00:22:00 +0000 (00:22 +0000)]
ClangSAEmClangSACheckersEmitter, emit info about groups.

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

13 years agoSet the unnamed_addr only when we're creating a new GV in the dest module.
Bill Wendling [Tue, 29 Mar 2011 23:31:06 +0000 (23:31 +0000)]
Set the unnamed_addr only when we're creating a new GV in the dest module.

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

13 years agoRevert r128501. It caused test failures.
Bill Wendling [Tue, 29 Mar 2011 23:28:02 +0000 (23:28 +0000)]
Revert r128501. It caused test failures.

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

13 years agoTidy up. 80 columns and trailing whitespace.
Jim Grosbach [Tue, 29 Mar 2011 23:20:22 +0000 (23:20 +0000)]
Tidy up. 80 columns and trailing whitespace.

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

13 years agoUpdate CMake link dependency.
Francois Pichet [Tue, 29 Mar 2011 23:18:51 +0000 (23:18 +0000)]
Update CMake link dependency.

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

13 years agoAdd intrinsics @llvm.arm.neon.vmulls and @llvm.arm.neon.vmullu.* back. Frontends
Evan Cheng [Tue, 29 Mar 2011 23:06:19 +0000 (23:06 +0000)]
Add intrinsics @llvm.arm.neon.vmulls and @llvm.arm.neon.vmullu.* back. Frontends
was lowering them to sext / uxt + mul instructions. Unfortunately the
optimization passes may hoist the extensions out of the loop and separate them.
When that happens, the long multiplication instructions can be broken into
several scalar instructions, causing significant performance issue.

Note the vmla and vmls intrinsics are not added back. Frontend will codegen them
as intrinsics vmull* + add / sub. Also note the isel optimizations for catching
mul + sext / zext are not changed either.

First part of rdar://8832507, rdar://9203134

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

13 years agoWe need to copy over the unnamed_addr attribute.
Bill Wendling [Tue, 29 Mar 2011 23:05:41 +0000 (23:05 +0000)]
We need to copy over the unnamed_addr attribute.

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

13 years agoRevert accidental change to LLVMLibDeps.cmake
Matt Beaumont-Gay [Tue, 29 Mar 2011 22:42:41 +0000 (22:42 +0000)]
Revert accidental change to LLVMLibDeps.cmake

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

13 years agoQuiet a gcc warning about changed name lookup rules
Matt Beaumont-Gay [Tue, 29 Mar 2011 22:25:36 +0000 (22:25 +0000)]
Quiet a gcc warning about changed name lookup rules

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

13 years agoInstCombine: Add a few missing combines for ANDs and ORs of sign bit tests.
Benjamin Kramer [Tue, 29 Mar 2011 22:06:41 +0000 (22:06 +0000)]
InstCombine: Add a few missing combines for ANDs and ORs of sign bit tests.

On x86 we now compile "if (a < 0 && b < 0)" into
testl %edi, %esi
js IF.THEN

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

13 years agoAdding a test for "-inf" as well.
Kevin Enderby [Tue, 29 Mar 2011 21:54:10 +0000 (21:54 +0000)]
Adding a test for "-inf" as well.

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

13 years agoAdd a test case for MSRi.
Johnny Chen [Tue, 29 Mar 2011 21:52:02 +0000 (21:52 +0000)]
Add a test case for MSRi.

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

13 years agoAdd Neon SINT_TO_FP and UINT_TO_FP lowering from v4i16 to v4f32. Fixes
Cameron Zwarich [Tue, 29 Mar 2011 21:41:55 +0000 (21:41 +0000)]
Add Neon SINT_TO_FP and UINT_TO_FP lowering from v4i16 to v4f32. Fixes
<rdar://problem/8875309> and <rdar://problem/9057191>.

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

13 years agoRecompute register class and hint for registers created during spilling.
Jakob Stoklund Olesen [Tue, 29 Mar 2011 21:20:19 +0000 (21:20 +0000)]
Recompute register class and hint for registers created during spilling.

The spill weight is not recomputed for an unspillable register - it stays infinite.

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

13 years agoIn ClangSACheckersEmitter:
Argyrios Kyrtzidis [Tue, 29 Mar 2011 21:16:19 +0000 (21:16 +0000)]
In ClangSACheckersEmitter:
  - Also emit a list of packages and groups sorted by name
  - Avoid iterating over DenseSet so that the output of the arrays is deterministic.

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

13 years agoAdded support symbolic floating point constants in the MC assembler for Infinity
Kevin Enderby [Tue, 29 Mar 2011 21:11:52 +0000 (21:11 +0000)]
Added support symbolic floating point constants in the MC assembler for Infinity
and Nans with the same strings as GAS supports.  rdar://8673024

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

13 years agoAdd a thumb test file for printf (iOS 4.3).
Johnny Chen [Tue, 29 Mar 2011 21:09:30 +0000 (21:09 +0000)]
Add a thumb test file for printf (iOS 4.3).

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

13 years agoInstantiate a JITMemoryManager for MCJIT Dyld
Jim Grosbach [Tue, 29 Mar 2011 21:03:05 +0000 (21:03 +0000)]
Instantiate a JITMemoryManager for MCJIT Dyld

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

13 years agoFixed the build of Clang's unit tests on MinGW. Also removed some
Oscar Fuentes [Tue, 29 Mar 2011 20:51:08 +0000 (20:51 +0000)]
Fixed the build of Clang's unit tests on MinGW. Also removed some
unnecesary conditionals and introduced a new convenience function.

The problem was that the list of libraries for Clang's unit tests was
<clang libraries> <system libraries> <llvm libraries>. As the llvm
libraries references symbols defined on the system libraries, those
were reported as undefined.

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

13 years agoDSE: Remove an early exit optimization that depended on the ordering of a SmallPtrSet.
Benjamin Kramer [Tue, 29 Mar 2011 20:28:57 +0000 (20:28 +0000)]
DSE: Remove an early exit optimization that depended on the ordering of a SmallPtrSet.

Fixes PR9569 and will hopefully make selfhost on ASLR-enabled systems more deterministic.

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

13 years agoCheck early if this is an unsupported opcode, so that we can avoid needlessly instant...
Owen Anderson [Tue, 29 Mar 2011 20:27:38 +0000 (20:27 +0000)]
Check early if this is an unsupported opcode, so that we can avoid needlessly instantiating the base register in some cases.

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

13 years agoA8.6.188 STC, STC2
Johnny Chen [Tue, 29 Mar 2011 19:49:38 +0000 (19:49 +0000)]
A8.6.188 STC, STC2
The STC_OPTION and STC2_OPTION instructions should have their coprocessor option enclosed in {}.

rdar://problem/9200661

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

13 years agoRename invalid-VLDMSDB-arm.txt to be invalid-VLDMSDB_UPD-arm.txt.
Johnny Chen [Tue, 29 Mar 2011 19:10:06 +0000 (19:10 +0000)]
Rename invalid-VLDMSDB-arm.txt to be invalid-VLDMSDB_UPD-arm.txt.

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

13 years agoAdd and modify some tests.
Johnny Chen [Tue, 29 Mar 2011 19:08:52 +0000 (19:08 +0000)]
Add and modify some tests.

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

13 years agoFor ClangSACheckersEmitter, allow a package to belong to checker group, in which...
Argyrios Kyrtzidis [Tue, 29 Mar 2011 18:53:00 +0000 (18:53 +0000)]
For ClangSACheckersEmitter, allow a package to belong to checker group, in which all its checkers will go into the group.

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

13 years agoRemember to use the correct register when rematerializing for snippets.
Jakob Stoklund Olesen [Tue, 29 Mar 2011 17:47:02 +0000 (17:47 +0000)]
Remember to use the correct register when rematerializing for snippets.

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

13 years agoRun dead code elimination immediately after rematerialization.
Jakob Stoklund Olesen [Tue, 29 Mar 2011 17:47:00 +0000 (17:47 +0000)]
Run dead code elimination immediately after rematerialization.

This may eliminate some uses of the spilled registers, and we don't want to
insert reloads for that.

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

13 years agoAdd safety check that didn't show up in testing.
Owen Anderson [Tue, 29 Mar 2011 17:42:25 +0000 (17:42 +0000)]
Add safety check that didn't show up in testing.

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

13 years agoDocument llvm.dbg.sp, llvm.dbg.gv and llvm.dbg.enum
Devang Patel [Tue, 29 Mar 2011 17:27:08 +0000 (17:27 +0000)]
Document llvm.dbg.sp, llvm.dbg.gv and llvm.dbg.enum

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

13 years agoInline check that's used only once.
Bill Wendling [Tue, 29 Mar 2011 17:12:55 +0000 (17:12 +0000)]
Inline check that's used only once.

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

13 years agoGet rid of the non-writeback versions VLDMDB and VSTMDB, which don't actually exist.
Owen Anderson [Tue, 29 Mar 2011 16:45:53 +0000 (16:45 +0000)]
Get rid of the non-writeback versions VLDMDB and VSTMDB, which don't actually exist.

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

13 years agoRework the logic (and removing the bad check for an unreachable block) so that
Bill Wendling [Tue, 29 Mar 2011 07:28:52 +0000 (07:28 +0000)]
Rework the logic (and removing the bad check for an unreachable block) so that
the FailBB dominator is correctly calculated. Believe it or not, there isn't a
functionality change here.

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

13 years agoDo some simple copy propagation through integer loads and stores when promoting
Cameron Zwarich [Tue, 29 Mar 2011 05:19:52 +0000 (05:19 +0000)]
Do some simple copy propagation through integer loads and stores when promoting
vector types. This helps a lot with inlined functions when using the ARM soft
float ABI. Fixes <rdar://problem/9184212>.

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

13 years agoDon't try to add stack protector logic to a dead basic block. It messes up
Bill Wendling [Tue, 29 Mar 2011 05:15:48 +0000 (05:15 +0000)]
Don't try to add stack protector logic to a dead basic block. It messes up
dominator information.

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

13 years agoSpruce up the error output.
Bill Wendling [Tue, 29 Mar 2011 04:28:26 +0000 (04:28 +0000)]
Spruce up the error output.

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

13 years agoHandle the special case when all uses follow the last split point.
Jakob Stoklund Olesen [Tue, 29 Mar 2011 03:12:04 +0000 (03:12 +0000)]
Handle the special case when all uses follow the last split point.

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

13 years agoProperly enable rematerialization when spilling after live range splitting.
Jakob Stoklund Olesen [Tue, 29 Mar 2011 03:12:02 +0000 (03:12 +0000)]
Properly enable rematerialization when spilling after live range splitting.

The instruction to be rematerialized may not be the one defining the register
that is being spilled. The traceSiblingValue() function sees through sibling
copies to find the remat candidate.

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

13 years agoC-API: Include DataTypes.h instead of stdint.h.
Daniel Dunbar [Tue, 29 Mar 2011 02:30:34 +0000 (02:30 +0000)]
C-API: Include DataTypes.h instead of stdint.h.

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

13 years agoReduce test case.
Rafael Espindola [Tue, 29 Mar 2011 02:18:54 +0000 (02:18 +0000)]
Reduce test case.

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

13 years agoOptimizing (zext A + zext B) * C, to (VMULL A, C) + (VMULL B, C) during
Evan Cheng [Tue, 29 Mar 2011 01:56:09 +0000 (01:56 +0000)]
Optimizing (zext A + zext B) * C, to (VMULL A, C) + (VMULL B, C) during
isel lowering to fold the zero-extend's and take advantage of no-stall
back to back vmul + vmla:
 vmull q0, d4, d6
 vmlal q0, d5, d6
is faster than
 vaddl q0, d4, d5
 vmovl q1, d6
 vmul  q0, q0, q1

This allows us to vmull + vmlal for:
    f = vmull_u8(   vget_high_u8(s), c);
    f = vmlal_u8(f, vget_low_u8(s),  c);

rdar://9197392

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

13 years agoFix the MSVC build.
Francois Pichet [Tue, 29 Mar 2011 00:30:01 +0000 (00:30 +0000)]
Fix the MSVC build.

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