oota-llvm.git
14 years agoDataTypes.h.cmake (MSVC): Protect some #define's and use specific
Oscar Fuentes [Thu, 24 Jun 2010 22:05:52 +0000 (22:05 +0000)]
DataTypes.h.cmake (MSVC): Protect some #define's and use specific
suffixes for integer types.

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

14 years agoRefactor SSE cmp intrinsics and declare the same for AVX
Bruno Cardoso Lopes [Thu, 24 Jun 2010 22:04:40 +0000 (22:04 +0000)]
Refactor SSE cmp intrinsics and declare the same for AVX

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

14 years agoFix up some comments.
Bob Wilson [Thu, 24 Jun 2010 22:04:30 +0000 (22:04 +0000)]
Fix up some comments.

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

14 years agoUse the struct tags mandated by ARM's ABI. Also use the public type names for
Bob Wilson [Thu, 24 Jun 2010 22:03:41 +0000 (22:03 +0000)]
Use the struct tags mandated by ARM's ABI.  Also use the public type names for
the array fields in these structs.

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

14 years agoIt's possible that a flag is added to the SDNode that points back to the
Bill Wendling [Thu, 24 Jun 2010 22:00:37 +0000 (22:00 +0000)]
It's possible that a flag is added to the SDNode that points back to the
original SDNode. This is badness. Also, this function allows one SDNode to point
multiple flags to another SDNode. Badness as well.

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

14 years agoDBG_VALUE machine instruction pointing to undefined register for a variable justify...
Devang Patel [Thu, 24 Jun 2010 21:51:19 +0000 (21:51 +0000)]
DBG_VALUE machine instruction pointing to undefined register for a variable justify a separate scope if the variable is inlined function's argument.
Radar 8122864.

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

14 years agoDon't return a std::vector in the Spiller interface, but take a reference to a
Jakob Stoklund Olesen [Thu, 24 Jun 2010 20:54:29 +0000 (20:54 +0000)]
Don't return a std::vector in the Spiller interface, but take a reference to a
vector instead. This avoids needless copying and allocation.

Add documentation.

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

14 years ago- Add AVX COMI{SS,SD}{rr,rm} and UCOMI{SS,SD}{rr,rm}.
Bruno Cardoso Lopes [Thu, 24 Jun 2010 20:48:23 +0000 (20:48 +0000)]
- Add AVX COMI{SS,SD}{rr,rm} and UCOMI{SS,SD}{rr,rm}.
- Fix a small VEX encoding issue.
- Move compare instructions to their appropriate place.

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

14 years agoRemove the now unused LiveIntervals::getVNInfoSourceReg().
Jakob Stoklund Olesen [Thu, 24 Jun 2010 20:18:15 +0000 (20:18 +0000)]
Remove the now unused LiveIntervals::getVNInfoSourceReg().

This method was always a bit too simplistic for the real world. It didn't really
deal with subregisters and such.

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

14 years agoTeach AdjustCopiesBackFrom to also use CoalescerPair to identify compatible copies.
Jakob Stoklund Olesen [Thu, 24 Jun 2010 20:16:00 +0000 (20:16 +0000)]
Teach AdjustCopiesBackFrom to also use CoalescerPair to identify compatible copies.

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

14 years agoDisallow matching "i" constraint to symbol addresses when
Dale Johannesen [Thu, 24 Jun 2010 20:14:51 +0000 (20:14 +0000)]
Disallow matching "i" constraint to symbol addresses when
address requires a register or secondary load to compute
(most PIC modes).  This improves "g" constraint handling.  8015842.

The test from 2007 is attempting to test the fix for PR1761,
but since -relocation-model=static doesn't work on Darwin
x86-64, it was not testing what it was supposed to be testing
and was passing erroneously.  Fixed to use Linux x86-64.

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

14 years agoSilence some unused variable warnings.
Eric Christopher [Thu, 24 Jun 2010 20:14:34 +0000 (20:14 +0000)]
Silence some unused variable warnings.

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

14 years agoRemove the -fast-spill option.
Jakob Stoklund Olesen [Thu, 24 Jun 2010 19:56:08 +0000 (19:56 +0000)]
Remove the -fast-spill option.

This code path has never really been used, and we are going to be handling
spilling through the Spiller interface in the future.

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

14 years agoDocument problems that I encountered when working on -scev-aa.
Dan Gohman [Thu, 24 Jun 2010 19:34:03 +0000 (19:34 +0000)]
Document problems that I encountered when working on -scev-aa.

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

14 years agoOops. IT block formation pass needs to be run at any optimization level.
Evan Cheng [Thu, 24 Jun 2010 19:10:14 +0000 (19:10 +0000)]
Oops. IT block formation pass needs to be run at any optimization level.

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

14 years agoLoosen up the requirements in the Horrible Hack(tm) to include all selectors
Bill Wendling [Thu, 24 Jun 2010 18:49:10 +0000 (18:49 +0000)]
Loosen up the requirements in the Horrible Hack(tm) to include all selectors
which don't have a catch-all associated with them not just clean-ups. This fixes
the SingleSource/Benchmarks/Shootout-C++/except.cpp testcase that broke because
of my change r105902.

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

14 years agoAlways allow Thumb-2 SXTB, SXTH, UXTB, and UXTH. Fixes PR7324.
Eli Friedman [Thu, 24 Jun 2010 18:20:04 +0000 (18:20 +0000)]
Always allow Thumb-2 SXTB, SXTH, UXTB, and UXTH.  Fixes PR7324.

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

14 years agoReplace a big gob of old coalescer logic with the new CoalescerPair class.
Jakob Stoklund Olesen [Thu, 24 Jun 2010 18:15:01 +0000 (18:15 +0000)]
Replace a big gob of old coalescer logic with the new CoalescerPair class.

CoalescerPair can determine if a copy can be coalesced, and which register gets
merged away. The old logic in SimpleRegisterCoalescing had evolved into
something a bit too convoluted.

This second attempt fixes some crashes that only occurred Linux.

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

14 years agoAdd an exports file for the Hello example plugin.
Dan Gohman [Thu, 24 Jun 2010 17:36:51 +0000 (17:36 +0000)]
Add an exports file for the Hello example plugin.

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

14 years agoPrint the LSBs of a SlotIndex symbolically using letters referring to the
Jakob Stoklund Olesen [Thu, 24 Jun 2010 17:31:07 +0000 (17:31 +0000)]
Print the LSBs of a SlotIndex symbolically using letters referring to the
[L]oad, [u]se, [d]ef, or [S]tore slots.

This makes it easier to see if two indices refer to the same instruction,
avoiding mental mod 4 calculations.

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

14 years agoSimplify this code; switch lowering shouldn't produce cases
Dan Gohman [Thu, 24 Jun 2010 17:08:31 +0000 (17:08 +0000)]
Simplify this code; switch lowering shouldn't produce cases
which trivially fold away.

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

14 years agoA few minor micro-optimizations.
Dan Gohman [Thu, 24 Jun 2010 16:57:52 +0000 (16:57 +0000)]
A few minor micro-optimizations.

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

14 years agoTeach getExactSDiv to evaluate x/1 to x up front, as it's a common
Dan Gohman [Thu, 24 Jun 2010 16:51:25 +0000 (16:51 +0000)]
Teach getExactSDiv to evaluate x/1 to x up front, as it's a common
enough special case, and it theoretically allows more folding because
it works even when x is unanalyzable.

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

14 years agoPR7458: Try commuting Thumb2 instruction operands to put them into 2-address
Bob Wilson [Thu, 24 Jun 2010 16:50:20 +0000 (16:50 +0000)]
PR7458: Try commuting Thumb2 instruction operands to put them into 2-address
form so they can be narrowed to 16-bit instructions.

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

14 years agoEdit and clarify comments for TargetInstrInfo methods:
Bob Wilson [Thu, 24 Jun 2010 16:48:26 +0000 (16:48 +0000)]
Edit and clarify comments for TargetInstrInfo methods:

None of the existing implementations of commuteInstruction create new
instructions unless the NewMI parameter is true, but the comment had
implied otherwise.

findCommutedOpIndices returns false, not true, when it doesn't know
how to commute the instruction.

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

14 years agoDon't try to preserve pointer types in SCEVConstants; the old code
Dan Gohman [Thu, 24 Jun 2010 16:47:03 +0000 (16:47 +0000)]
Don't try to preserve pointer types in SCEVConstants; the old code
was over-complicated.

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

14 years agoFix copy+pasto issues in isMulSExtable.
Dan Gohman [Thu, 24 Jun 2010 16:45:11 +0000 (16:45 +0000)]
Fix copy+pasto issues in isMulSExtable.

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

14 years agoMake the trunc code consistent with the zext and sext code in its
Dan Gohman [Thu, 24 Jun 2010 16:33:38 +0000 (16:33 +0000)]
Make the trunc code consistent with the zext and sext code in its
handling of pointer types.

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

14 years agoAdd a comment about a thread safety issue in Statistic.h.
Dan Gohman [Thu, 24 Jun 2010 16:31:32 +0000 (16:31 +0000)]
Add a comment about a thread safety issue in Statistic.h.

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

14 years agoAdd overloads for getFile and getFileOrSTDIN which take a const char *
Dan Gohman [Thu, 24 Jun 2010 16:25:50 +0000 (16:25 +0000)]
Add overloads for getFile and getFileOrSTDIN which take a const char *
instead of a StringRef, avoiding the need to copy the string in the
common case.

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

14 years agoBe more strict about subreg-to-subreg copies in CoalescerPair.
Jakob Stoklund Olesen [Thu, 24 Jun 2010 16:19:28 +0000 (16:19 +0000)]
Be more strict about subreg-to-subreg copies in CoalescerPair.

Also keep track of the original DstREg before subregister adjustments.

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

14 years agouse ArgOperand API
Gabor Greif [Thu, 24 Jun 2010 16:11:44 +0000 (16:11 +0000)]
use ArgOperand API

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

14 years agoVerify that VNI kills are pointing to existing instructions.
Jakob Stoklund Olesen [Thu, 24 Jun 2010 15:56:59 +0000 (15:56 +0000)]
Verify that VNI kills are pointing to existing instructions.

In this case it is essential that the kill is real because the spiller will
decide to omit a spill if it thinks there is a later kill.

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

14 years agouse (even more, still) ArgOperand API
Gabor Greif [Thu, 24 Jun 2010 15:51:11 +0000 (15:51 +0000)]
use (even more, still) ArgOperand API

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

14 years agoEliminate the other half of the BRCOND optimization, and update
Dan Gohman [Thu, 24 Jun 2010 15:24:03 +0000 (15:24 +0000)]
Eliminate the other half of the BRCOND optimization, and update
as many tests as possible.

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

14 years agoEliminate the first have of the optimization which eliminates BRCOND
Dan Gohman [Thu, 24 Jun 2010 15:04:11 +0000 (15:04 +0000)]
Eliminate the first have of the optimization which eliminates BRCOND
when the condition is constant. This optimization shouldn't be
necessary, because codegen shouldn't be able to find dead control
paths that the IR-level optimizer can't find. And it's undesirable,
because it encourages bugpoint to leave "br i1 false" branches
in its output. And it wasn't updating the CFG.

I updated all the tests I could, but some tests are too reduced
and I wasn't able to meaningfully preserve them.

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

14 years agouse ArgOperand API and CallSite for arg range; add necessary casts and perform some...
Gabor Greif [Thu, 24 Jun 2010 14:42:01 +0000 (14:42 +0000)]
use ArgOperand API and CallSite for arg range; add necessary casts and perform some cosmetics

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

14 years agoReapply r106634, now that the bug it exposed is fixed.
Dan Gohman [Thu, 24 Jun 2010 14:30:44 +0000 (14:30 +0000)]
Reapply r106634, now that the bug it exposed is fixed.

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

14 years agouse ArgOperand API and CallSite for arg range
Gabor Greif [Thu, 24 Jun 2010 14:13:36 +0000 (14:13 +0000)]
use ArgOperand API and CallSite for arg range

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

14 years agouse (even more) ArgOperand API
Gabor Greif [Thu, 24 Jun 2010 13:54:33 +0000 (13:54 +0000)]
use (even more) ArgOperand API

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

14 years agouse ArgOperand API
Gabor Greif [Thu, 24 Jun 2010 13:42:49 +0000 (13:42 +0000)]
use ArgOperand API

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

14 years agouse ArgOperand API
Gabor Greif [Thu, 24 Jun 2010 12:58:35 +0000 (12:58 +0000)]
use ArgOperand API

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

14 years agouse ArgOperand API
Gabor Greif [Thu, 24 Jun 2010 12:35:13 +0000 (12:35 +0000)]
use ArgOperand API

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

14 years agouse ArgOperand API, also tighten the type of visitFree to make this work out smoothly
Gabor Greif [Thu, 24 Jun 2010 12:21:15 +0000 (12:21 +0000)]
use ArgOperand API, also tighten the type of visitFree to make this work out smoothly

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

14 years agouse ArgOperand API; introduce downcasted pointers into scope to facilitate this
Gabor Greif [Thu, 24 Jun 2010 12:03:56 +0000 (12:03 +0000)]
use ArgOperand API; introduce downcasted pointers into scope to facilitate this

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

14 years agouse ArgOperand API
Gabor Greif [Thu, 24 Jun 2010 10:42:46 +0000 (10:42 +0000)]
use ArgOperand API

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

14 years agouse ArgOperand API
Gabor Greif [Thu, 24 Jun 2010 10:17:17 +0000 (10:17 +0000)]
use ArgOperand API

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

14 years agouse callsite to obtain all arguments
Gabor Greif [Thu, 24 Jun 2010 10:04:07 +0000 (10:04 +0000)]
use callsite to obtain all arguments

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

14 years agouse callsite to obtain all arguments
Gabor Greif [Thu, 24 Jun 2010 09:56:43 +0000 (09:56 +0000)]
use callsite to obtain all arguments

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

14 years agoTeach the x86 mc assembler that %dr6 = %db6, this implements
Chris Lattner [Thu, 24 Jun 2010 07:29:18 +0000 (07:29 +0000)]
Teach the x86 mc assembler that %dr6 = %db6, this implements
rdar://8013734

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

14 years agomore cleanups
Chris Lattner [Thu, 24 Jun 2010 07:18:14 +0000 (07:18 +0000)]
more cleanups

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

14 years agoreduce indentation
Chris Lattner [Thu, 24 Jun 2010 07:16:25 +0000 (07:16 +0000)]
reduce indentation

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

14 years agofix breakage from r98938 by correctly marking msp430 calls as variadic.
Chris Lattner [Thu, 24 Jun 2010 06:46:50 +0000 (06:46 +0000)]
fix breakage from r98938 by correctly marking msp430 calls as variadic.

Patch by Ben Ransford!

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

14 years agoFix a bug in the code which determines when it's safe to use the
Dan Gohman [Thu, 24 Jun 2010 02:07:59 +0000 (02:07 +0000)]
Fix a bug in the code which determines when it's safe to use the
bt instruction, which was exposed by r106263.

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

14 years agoAdd a couple more quick comments.
Eric Christopher [Thu, 24 Jun 2010 02:07:57 +0000 (02:07 +0000)]
Add a couple more quick comments.

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

14 years agoOptimize the "bit test" code path for switch lowering in the
Dan Gohman [Thu, 24 Jun 2010 02:06:24 +0000 (02:06 +0000)]
Optimize the "bit test" code path for switch lowering in the
case where the bit mask has exactly one bit.

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

14 years agoRevert "Replace a big gob of old coalescer logic with the new CoalescerPair class."
Jakob Stoklund Olesen [Thu, 24 Jun 2010 00:52:22 +0000 (00:52 +0000)]
Revert "Replace a big gob of old coalescer logic with the new CoalescerPair class."

Whiny buildbots.

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

14 years agouse getNumArgOperands
Gabor Greif [Thu, 24 Jun 2010 00:48:48 +0000 (00:48 +0000)]
use getNumArgOperands

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

14 years agouse ArgOperand API
Gabor Greif [Thu, 24 Jun 2010 00:44:01 +0000 (00:44 +0000)]
use ArgOperand API

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

14 years agoUse ValueMap instead of DenseMap.
Devang Patel [Thu, 24 Jun 2010 00:33:28 +0000 (00:33 +0000)]
Use ValueMap instead of DenseMap.
The ValueMapper used by various cloning utility maps MDNodes also.

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

14 years agoAdd AVX CMP{SS,SD}{rr,rm} instructions and encoding testcases
Bruno Cardoso Lopes [Thu, 24 Jun 2010 00:32:06 +0000 (00:32 +0000)]
Add AVX CMP{SS,SD}{rr,rm} instructions and encoding testcases

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

14 years agoMove SSE and AVX shuffle, unpack and compare code to more appropriate places
Bruno Cardoso Lopes [Thu, 24 Jun 2010 00:15:50 +0000 (00:15 +0000)]
Move SSE and AVX shuffle, unpack and compare code to more appropriate places

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

14 years agoReplace a big gob of old coalescer logic with the new CoalescerPair class.
Jakob Stoklund Olesen [Thu, 24 Jun 2010 00:12:39 +0000 (00:12 +0000)]
Replace a big gob of old coalescer logic with the new CoalescerPair class.

CoalescerPair can determine if a copy can be coalesced, and which register gets
merged away. The old logic in SimpleRegisterCoalescing had evolved into
something a bit too convoluted.

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

14 years agoUse available typedef for " DenseMap<const Value*, Value*>".
Devang Patel [Thu, 24 Jun 2010 00:00:42 +0000 (00:00 +0000)]
Use available typedef for " DenseMap<const Value*, Value*>".

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

14 years agoCosmetic change.
Devang Patel [Wed, 23 Jun 2010 23:55:51 +0000 (23:55 +0000)]
Cosmetic change.
Do not use "ValueMap" as a name for a local variable or an argument.

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

14 years agouse ArgOperand accessors
Gabor Greif [Wed, 23 Jun 2010 23:38:07 +0000 (23:38 +0000)]
use ArgOperand accessors

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

14 years agoWe are missing opportunites to use ldm. Take code like this:
Bill Wendling [Wed, 23 Jun 2010 23:00:16 +0000 (23:00 +0000)]
We are missing opportunites to use ldm. Take code like this:

void t(int *cp0, int *cp1, int *dp, int fmd) {
  int c0, c1, d0, d1, d2, d3;
  c0 = (*cp0++ & 0xffff) | ((*cp1++ << 16) & 0xffff0000);
  c1 = (*cp0++ & 0xffff) | ((*cp1++ << 16) & 0xffff0000);
  /* ... */
}

It code gens into something pretty bad. But with this change (analogous to the
X86 back-end), it will use ldm and generate few instructions.

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

14 years agouse the new isFreeCall API and ArgOperand accessors
Gabor Greif [Wed, 23 Jun 2010 22:48:06 +0000 (22:48 +0000)]
use the new isFreeCall API and ArgOperand accessors

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

14 years agominor enhancement to llvm::isFreeCall API: return CallInst; no functional change
Gabor Greif [Wed, 23 Jun 2010 21:51:12 +0000 (21:51 +0000)]
minor enhancement to llvm::isFreeCall API: return CallInst; no functional change

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

14 years agouse ArgOperand getters
Gabor Greif [Wed, 23 Jun 2010 21:41:47 +0000 (21:41 +0000)]
use ArgOperand getters

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

14 years agoAdd AVX MOVMSK{PS,PD}rr instructions
Bruno Cardoso Lopes [Wed, 23 Jun 2010 21:30:27 +0000 (21:30 +0000)]
Add AVX MOVMSK{PS,PD}rr instructions

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

14 years agoAdd tests for different AVX cmp opcodes, also teach the x86 asm parser to understand...
Bruno Cardoso Lopes [Wed, 23 Jun 2010 21:10:57 +0000 (21:10 +0000)]
Add tests for different AVX cmp opcodes, also teach the x86 asm parser to understand the vcmp instruction

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

14 years agoUpdate according to feedback.
Eric Christopher [Wed, 23 Jun 2010 20:49:35 +0000 (20:49 +0000)]
Update according to feedback.

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

14 years agoAdd an extra-library-path option to the plugin. This is used to support
Rafael Espindola [Wed, 23 Jun 2010 20:20:59 +0000 (20:20 +0000)]
Add an extra-library-path option to the plugin. This is used to support
having a library both as bitcode and native code. We want to use the
bitcode first, but if codegen produces new undefined references we have to use
the native code to satisfy those references.

Gold has no notion of bitcode and native search directories, so instead it has
an API where the plugin can instruct it to look for the libraries it is passing
to it. This patch uses that API.

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

14 years agoAdd AVX SHUF{PS,PD}{rr,rm} instructions
Bruno Cardoso Lopes [Wed, 23 Jun 2010 20:07:15 +0000 (20:07 +0000)]
Add AVX SHUF{PS,PD}{rr,rm} instructions

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

14 years agoAdd support for the x86 instructions "pusha" and "popa".
Nico Weber [Wed, 23 Jun 2010 20:00:58 +0000 (20:00 +0000)]
Add support for the x86 instructions "pusha" and "popa".

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

14 years agoFix a tblgen bug.
Bruno Cardoso Lopes [Wed, 23 Jun 2010 19:50:39 +0000 (19:50 +0000)]
Fix a tblgen bug.

Given the pattern below as an example:
list<dag> Pattern = [(set RC:$dst, (v4f32 (shufp:src3 RC:$src1,
                            (mem_frag addr:$src2))))];

The right reference resolving should lead to:
list<dag> Pattern = [(set VR128:$dst, (v4f32 (shufp:src3 VR128:$src1,
                            (mem_frag addr:$src2))))];
But was yielding:
list<dag> Pattern = [(set VR128:$dst, (v4f32 (shufp VR128:$src1,
                            (mem_frag addr:$src2))))];

Fix this by passing the right name when creating a new DagInit node.

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

14 years agoReinstate correct test, remove the real invalidated test.
Dale Johannesen [Wed, 23 Jun 2010 18:56:06 +0000 (18:56 +0000)]
Reinstate correct test, remove the real invalidated test.

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

14 years agoRemove tests invalidated by previous checkin.
Dale Johannesen [Wed, 23 Jun 2010 18:53:12 +0000 (18:53 +0000)]
Remove tests invalidated by previous checkin.

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

14 years agoDo not do tail calls to external symbols. If the
Dale Johannesen [Wed, 23 Jun 2010 18:52:34 +0000 (18:52 +0000)]
Do not do tail calls to external symbols.  If the
branch turns out to be ARM-to-Thumb or vice versa
the linker cannot resolve this.  8120438.

If this optimization is going to be useful we probably
need a compiler flag "assume callees are same architecture"
or something like that.

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

14 years agoMorphNodeTo doesn't preserve the memory operands. Because we're morphing a node
Bill Wendling [Wed, 23 Jun 2010 18:16:24 +0000 (18:16 +0000)]
MorphNodeTo doesn't preserve the memory operands. Because we're morphing a node
into the same node, but with different non-memory operands, we need to replace
the memory operands after it's finished morphing.

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

14 years agotests: Tweak lit.cfg to fix breakage with out-of-dir lookup.
Daniel Dunbar [Wed, 23 Jun 2010 18:06:16 +0000 (18:06 +0000)]
tests: Tweak lit.cfg to fix breakage with out-of-dir lookup.

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

14 years agoRevert r106263, "Fold the ShrinkDemandedOps pass into the regular DAGCombiner pass...
Daniel Dunbar [Wed, 23 Jun 2010 17:09:26 +0000 (17:09 +0000)]
Revert r106263, "Fold the ShrinkDemandedOps pass into the regular DAGCombiner pass,"... it was causing both 'file' (with clang) and 176.gcc (with llvm-gcc) to be miscompiled.

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

14 years agoThe generic DAG combiner can now fold atomic fences when needed, so switch
Jim Grosbach [Wed, 23 Jun 2010 16:25:07 +0000 (16:25 +0000)]
The generic DAG combiner can now fold atomic fences when needed, so switch
to using that.

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

14 years agoWhen using libcall expansions for the atomic intrinsics, the explicit
Jim Grosbach [Wed, 23 Jun 2010 16:08:49 +0000 (16:08 +0000)]
When using libcall expansions for the atomic intrinsics, the explicit
MEMBARRIER fences aren't necessary for ARM. Tell the combiner to fold them
away.

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

14 years agoSome targets don't require the fencing MEMBARRIER instructions surrounding
Jim Grosbach [Wed, 23 Jun 2010 16:07:42 +0000 (16:07 +0000)]
Some targets don't require the fencing MEMBARRIER instructions surrounding
atomic intrinsics, either because the use locking instructions for the
atomics, or because they perform the locking directly. Add support in the
DAG combiner to fold away the fences.

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

14 years agoremove trailing whitespace
Jim Grosbach [Wed, 23 Jun 2010 15:49:18 +0000 (15:49 +0000)]
remove trailing whitespace

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

14 years agoAdd a few VNInfo data structure checks.
Jakob Stoklund Olesen [Wed, 23 Jun 2010 15:34:36 +0000 (15:34 +0000)]
Add a few VNInfo data structure checks.

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

14 years agouse ArgOperand accessors
Gabor Greif [Wed, 23 Jun 2010 13:56:57 +0000 (13:56 +0000)]
use ArgOperand accessors

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

14 years agouse ArgOperand accessors
Gabor Greif [Wed, 23 Jun 2010 13:09:06 +0000 (13:09 +0000)]
use ArgOperand accessors

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

14 years agouse helper to neatly access arguments
Gabor Greif [Wed, 23 Jun 2010 08:45:32 +0000 (08:45 +0000)]
use helper to neatly access arguments

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

14 years agoUpdate uses, defs, and comments for darwin tls patterns.
Eric Christopher [Wed, 23 Jun 2010 08:01:49 +0000 (08:01 +0000)]
Update uses, defs, and comments for darwin tls patterns.

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

14 years agoDon't link against libm and libpthread which don't exist in BeOS/Haiku. Also,
Nick Lewycky [Wed, 23 Jun 2010 06:48:34 +0000 (06:48 +0000)]
Don't link against libm and libpthread which don't exist in BeOS/Haiku. Also,
Haiku like Linux provides <regex.h>, so use it. Patch by Paul Davey!

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

14 years agoRevert r106066, "Create a more targeted fix for not sinking instructions into a range...
Daniel Dunbar [Wed, 23 Jun 2010 00:48:25 +0000 (00:48 +0000)]
Revert r106066, "Create a more targeted fix for not sinking instructions into a range where it"... it causes bzip2 to be miscompiled by Clang.

Conflicts:

lib/CodeGen/MachineSink.cpp

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

14 years agoLess incorrect handling of zero-length bitfields. Radars 7992077 and 8093043.
Stuart Hastings [Wed, 23 Jun 2010 00:31:14 +0000 (00:31 +0000)]
Less incorrect handling of zero-length bitfields.  Radars 7992077 and 8093043.

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

14 years agoGet the addend correct for i386 pic.
Eric Christopher [Tue, 22 Jun 2010 23:51:47 +0000 (23:51 +0000)]
Get the addend correct for i386 pic.

Thanks Daniel!

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

14 years agoGenerate DWARF information during Apple-style build. They'll be stripped out
Bill Wendling [Tue, 22 Jun 2010 23:44:15 +0000 (23:44 +0000)]
Generate DWARF information during Apple-style build. They'll be stripped out
later on. But we need them saved in the symbols directory.

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

14 years agoReplace ScalarEvolution's private copy of getLoopPredecessor
Dan Gohman [Tue, 22 Jun 2010 23:43:28 +0000 (23:43 +0000)]
Replace ScalarEvolution's private copy of getLoopPredecessor
with LoopInfo's public copy.

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

14 years agoAdd AVX compare packed instructions
Bruno Cardoso Lopes [Tue, 22 Jun 2010 23:37:59 +0000 (23:37 +0000)]
Add AVX compare packed instructions

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

14 years agoLoosen up this test so that it doesn't depend as much on register
Dan Gohman [Tue, 22 Jun 2010 23:32:47 +0000 (23:32 +0000)]
Loosen up this test so that it doesn't depend as much on register
allocation details.

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