oota-llvm.git
12 years agoIntel syntax. Adjust special code, used to recognize cmp<comparison code>{ss,sd,ps...
Devang Patel [Mon, 30 Jan 2012 22:47:12 +0000 (22:47 +0000)]
Intel syntax. Adjust special code, used to recognize cmp<comparison code>{ss,sd,ps,pd}, for intel syntax.

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

12 years agoTypo.
Chad Rosier [Mon, 30 Jan 2012 22:44:13 +0000 (22:44 +0000)]
Typo.

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

12 years agoTypo.
Chad Rosier [Mon, 30 Jan 2012 21:13:22 +0000 (21:13 +0000)]
Typo.

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

12 years agoImplement String Cast from Integer
David Greene [Mon, 30 Jan 2012 20:47:04 +0000 (20:47 +0000)]
Implement String Cast from Integer

Allow casts from integer to string.

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

12 years agoIntel syntax. Support .intel_syntax directive.
Devang Patel [Mon, 30 Jan 2012 20:02:42 +0000 (20:02 +0000)]
Intel syntax. Support .intel_syntax directive.

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

12 years agoFix refacto.
Benjamin Kramer [Mon, 30 Jan 2012 20:01:35 +0000 (20:01 +0000)]
Fix refacto.

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

12 years agoHere's a new one: GCC was complaining about an only-used-in-asserts
Matt Beaumont-Gay [Mon, 30 Jan 2012 19:26:20 +0000 (19:26 +0000)]
Here's a new one: GCC was complaining about an only-used-in-asserts
*function*. Wrap the function in #ifndef NDEBUG.

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

12 years agoVarious improvements suggested by Duncan
Chris Lattner [Mon, 30 Jan 2012 18:19:30 +0000 (18:19 +0000)]
Various improvements suggested by Duncan

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

12 years agoEliminate narrowing conversion in initializer list, to make C++11 happy
Douglas Gregor [Mon, 30 Jan 2012 16:57:18 +0000 (16:57 +0000)]
Eliminate narrowing conversion in initializer list, to make C++11 happy

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

12 years agoX86: Simplify shuffle mask generation code.
Benjamin Kramer [Mon, 30 Jan 2012 15:16:21 +0000 (15:16 +0000)]
X86: Simplify shuffle mask generation code.

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

12 years agoFix compilation of ASan tests on OS X Lion (see http://code.google.com/p/address...
Alexander Potapenko [Mon, 30 Jan 2012 10:40:22 +0000 (10:40 +0000)]
Fix compilation of ASan tests on OS X Lion (see code.google.com/p/address-sanitizer/issues/detail?id=32)
The redzones emitted by AddressSanitizer for CFString instances confuse the linker and are of little use, so we shouldn't add them.

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

12 years agoAdd GCCBuiltin declarations for cmpsd/cmpss/cmppd/cmpps to allow custom code to be...
Craig Topper [Mon, 30 Jan 2012 08:33:36 +0000 (08:33 +0000)]
Add GCCBuiltin declarations for cmpsd/cmpss/cmppd/cmpps to allow custom code to be removed from clang.

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

12 years agoFix pattern for memory form of PSHUFD for use with FP vectors to remove bitcast to...
Craig Topper [Mon, 30 Jan 2012 07:50:31 +0000 (07:50 +0000)]
Fix pattern for memory form of PSHUFD for use with FP vectors to remove bitcast to an integer vector that normal code wouldn't have. Also remove bitcasts from code that turns splat vector loads into a shuffle as it was making the broken pattern necessary.

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

12 years agofix a major oversight that is breaking some llvm-test tests.
Chris Lattner [Mon, 30 Jan 2012 07:36:01 +0000 (07:36 +0000)]
fix a major oversight that is breaking some llvm-test tests.

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

12 years agoDenseMap::find_as() and unit tests.
Talin [Mon, 30 Jan 2012 06:55:43 +0000 (06:55 +0000)]
DenseMap::find_as() and unit tests.

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

12 years agoFirst step of flipping on ConstantDataSequential: enable ConstantDataVector
Chris Lattner [Mon, 30 Jan 2012 06:21:21 +0000 (06:21 +0000)]
First step of flipping on ConstantDataSequential: enable ConstantDataVector
to be formed whenever ConstantVector::get is used.

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

12 years agowhen verbose asm is on, print integers in ConstantDataSequentials just
Chris Lattner [Mon, 30 Jan 2012 05:55:11 +0000 (05:55 +0000)]
when verbose asm is on, print integers in ConstantDataSequentials just
like normal integers.

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

12 years agodon't lose tail padding on ConstantDataAggregate vec3's.
Chris Lattner [Mon, 30 Jan 2012 05:49:43 +0000 (05:49 +0000)]
don't lose tail padding on ConstantDataAggregate vec3's.

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

12 years agoFix ConstantFoldShuffleVectorInstruction to properly handle the case
Chris Lattner [Mon, 30 Jan 2012 05:34:13 +0000 (05:34 +0000)]
Fix ConstantFoldShuffleVectorInstruction to properly handle the case
when the result type has a different # elements than the input vectors.

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

12 years agoCMake: Promote the testing targets out of folders on IDE.
NAKAMURA Takumi [Mon, 30 Jan 2012 03:15:47 +0000 (03:15 +0000)]
CMake: Promote the testing targets out of folders on IDE.

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

12 years agoCMake: Add the folder "Tablegenning" on llvm-tblgen targets.
NAKAMURA Takumi [Mon, 30 Jan 2012 03:01:03 +0000 (03:01 +0000)]
CMake: Add the folder "Tablegenning" on llvm-tblgen targets.

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

12 years agoinitialize the Next field to null
Chris Lattner [Mon, 30 Jan 2012 01:17:43 +0000 (01:17 +0000)]
initialize the Next field to null

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

12 years agoMove some XOP patterns into instruction definition. Replae VPCMOV intrinsic patterns...
Craig Topper [Mon, 30 Jan 2012 01:10:15 +0000 (01:10 +0000)]
Move some XOP patterns into instruction definition. Replae VPCMOV intrinsic patterns with custom lowering to a target specific nodes.

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

12 years agoAdd bitcode reader and writer support for ConstantDataAggregate, which
Chris Lattner [Mon, 30 Jan 2012 00:51:16 +0000 (00:51 +0000)]
Add bitcode reader and writer support for ConstantDataAggregate, which
should be feature complete now.  Lets see if it works.

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

12 years agoCleanup the organization of some methods in llvm::Triple and provide
Chandler Carruth [Sun, 29 Jan 2012 23:09:12 +0000 (23:09 +0000)]
Cleanup the organization of some methods in llvm::Triple and provide
a better doxyment group for convenience predicates.

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

12 years agoMove Clang's file-level locking facility over to LLVM's support
Douglas Gregor [Sun, 29 Jan 2012 20:15:10 +0000 (20:15 +0000)]
Move Clang's file-level locking facility over to LLVM's support
library, since it doesn't really have anything to do with Clang.

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

12 years agoCleanups for EABI standard functions
Anton Korobeynikov [Sun, 29 Jan 2012 09:11:50 +0000 (09:11 +0000)]
Cleanups for EABI standard functions

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

12 years agoUse base AAPCS for varargs functions even for AAPCS-VFP CC
Anton Korobeynikov [Sun, 29 Jan 2012 09:06:09 +0000 (09:06 +0000)]
Use base AAPCS for varargs functions even for AAPCS-VFP CC

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

12 years agoFix some scavenger performance issues.
Jakob Stoklund Olesen [Sun, 29 Jan 2012 01:29:28 +0000 (01:29 +0000)]
Fix some scavenger performance issues.

- Don't call malloc+free in the very hot forward().
- Don't call isTiedToDefOperand().
- Don't create BitVector temporaries.
- Merge DeadRegs into KillRegs.
- Eliminate the early clobber checks, they were irrelevant to scavenging.
- Remove unnecessary code from -Asserts builds.

This speeds up ARM PEI by 3.4x and overall llc -O0 codegen time by 11%.

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

12 years agoAvoid creating BitVector temporaries.
Jakob Stoklund Olesen [Sun, 29 Jan 2012 01:29:25 +0000 (01:29 +0000)]
Avoid creating BitVector temporaries.

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

12 years agoAdd a BitVector::reset(BitVector&) method.
Jakob Stoklund Olesen [Sun, 29 Jan 2012 01:29:22 +0000 (01:29 +0000)]
Add a BitVector::reset(BitVector&) method.

The alternative LHS &= ~RHS is way too slow because it creates a
temporary that calls malloc/free.

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

12 years agoFix typo.
Nick Lewycky [Sat, 28 Jan 2012 23:33:44 +0000 (23:33 +0000)]
Fix typo.

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

12 years agoAdd a note about a potential optimization for clz/ctz patterns for ARM
Bob Wilson [Sat, 28 Jan 2012 18:30:07 +0000 (18:30 +0000)]
Add a note about a potential optimization for clz/ctz patterns for ARM
(and other targets).

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

12 years agoEnsure .AliasedSymbol() is called on all uses of getSymbol(). Affects ARM and MIPS...
James Molloy [Sat, 28 Jan 2012 15:58:32 +0000 (15:58 +0000)]
Ensure .AliasedSymbol() is called on all uses of getSymbol(). Affects ARM and MIPS ELF backends.

Fixes PR11877

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

12 years agoSilence GCC's -Wreturn-type warning.
Benjamin Kramer [Sat, 28 Jan 2012 15:28:41 +0000 (15:28 +0000)]
Silence GCC's -Wreturn-type warning.

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

12 years agoSmall improvement to the recursion detection logic from the previous commit.
Rafael Espindola [Sat, 28 Jan 2012 06:22:14 +0000 (06:22 +0000)]
Small improvement to the recursion detection logic from the previous commit.

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

12 years agoHandle recursive variable definitions directly. This gives us better error
Rafael Espindola [Sat, 28 Jan 2012 05:57:00 +0000 (05:57 +0000)]
Handle recursive variable definitions directly. This gives us better error
messages and allows us to fix PR11865.

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

12 years ago[asan] correctly use ConstantExpr::getGetElementPtr. Catch by NAKAMURA Takumi
Kostya Serebryany [Sat, 28 Jan 2012 04:27:16 +0000 (04:27 +0000)]
[asan] correctly use ConstantExpr::getGetElementPtr. Catch by NAKAMURA Takumi

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

12 years agoReapply r149159 with a fix to add to a PHI node with a non-null parent.
Bill Wendling [Sat, 28 Jan 2012 01:17:56 +0000 (01:17 +0000)]
Reapply r149159 with a fix to add to a PHI node with a non-null parent.

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

12 years agoRemove code that adds live ranges for dead defs. It seems to be breaking things.
Lang Hames [Sat, 28 Jan 2012 01:17:01 +0000 (01:17 +0000)]
Remove code that adds live ranges for dead defs. It seems to be breaking things.

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

12 years agoRevert r149159 until I can fix tests.
Bill Wendling [Sat, 28 Jan 2012 01:10:01 +0000 (01:10 +0000)]
Revert r149159 until I can fix tests.

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

12 years agoDon't always create a separate block for the call to _Unwind_Resume.
Bill Wendling [Sat, 28 Jan 2012 00:47:18 +0000 (00:47 +0000)]
Don't always create a separate block for the call to _Unwind_Resume.

Sometimes there is only one 'resume' instruction per function. In those
situations, we don't need a separate block for the call to _Unwind_Resume. In
fact, it adds a lot of overhead to code-gen if we do that -- especially at -O0.
If we have a single 'resume' instruction, just generate the call within that
block.
<rdar://problem/10694814>

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

12 years agoFix Record Name Reference
David Greene [Sat, 28 Jan 2012 00:03:24 +0000 (00:03 +0000)]
Fix Record Name Reference

Get the record name though the init to avoid an assert.

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

12 years agoSilence warning about parens for && within ||
Lang Hames [Fri, 27 Jan 2012 23:52:25 +0000 (23:52 +0000)]
Silence warning about parens for && within ||

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

12 years agoAdd r149110 back with a fix for when the vector and the int have the same
Rafael Espindola [Fri, 27 Jan 2012 23:33:07 +0000 (23:33 +0000)]
Add r149110 back with a fix for when the vector and the int have the same
width.

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

12 years agoRemove Deprecated Features
David Greene [Fri, 27 Jan 2012 23:01:35 +0000 (23:01 +0000)]
Remove Deprecated Features

Move to a model where we build whatever branches are checked out
in the source directories.  This was a bit too smart (and complicated)
in handling details best left to the user and the revision control
system.

In addition, get rid of support for llvm-gcc and building gcc as
these are no longer necessary.

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

12 years agoRevert r149110 and add a testcase that was crashing since that revision.
Rafael Espindola [Fri, 27 Jan 2012 22:42:48 +0000 (22:42 +0000)]
Revert r149110 and add a testcase that was crashing since that revision.
Unfortunately I also had to disable constant-pool-sharing.ll the code it tests has been
updated to use the IL logic.

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

12 years agoAdd a "moveInstr" method to LiveIntervals. This can be used to move instructions
Lang Hames [Fri, 27 Jan 2012 22:36:19 +0000 (22:36 +0000)]
Add a "moveInstr" method to LiveIntervals. This can be used to move instructions
around within a basic block while maintaining live-intervals.

Updated ScheduleTopDownLive in MachineScheduler.cpp to use the moveInstr API
when reordering MIs.

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

12 years agoBacking out ill-considered 'refactor'.
Lang Hames [Fri, 27 Jan 2012 21:43:32 +0000 (21:43 +0000)]
Backing out ill-considered 'refactor'.

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

12 years agoMove some duplicate loops in the coalescer into their own function.
Lang Hames [Fri, 27 Jan 2012 19:58:14 +0000 (19:58 +0000)]
Move some duplicate loops in the coalescer into their own function.

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

12 years agoIntel Syntax: Parse mem operand with seg reg. QWORD PTR FS:[320]
Devang Patel [Fri, 27 Jan 2012 19:48:28 +0000 (19:48 +0000)]
Intel Syntax: Parse mem operand with seg reg. QWORD PTR FS:[320]

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

12 years agoFix typo.
Jim Grosbach [Fri, 27 Jan 2012 18:35:03 +0000 (18:35 +0000)]
Fix typo.

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

12 years agoMove some patterns back near their instructions and use AddedComplexity to fix priori...
Craig Topper [Fri, 27 Jan 2012 07:09:40 +0000 (07:09 +0000)]
Move some patterns back near their instructions and use AddedComplexity to fix priority. Merge some patterns into their instruction definition.

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

12 years agoPhysreg dead defs should be handled too.
Lang Hames [Fri, 27 Jan 2012 03:20:42 +0000 (03:20 +0000)]
Physreg dead defs should be handled too.

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

12 years agosmallvectorize.
Chris Lattner [Fri, 27 Jan 2012 03:15:49 +0000 (03:15 +0000)]
smallvectorize.

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

12 years agocontinue making the world safe for ConstantDataVector. At this point,
Chris Lattner [Fri, 27 Jan 2012 03:08:05 +0000 (03:08 +0000)]
continue making the world safe for ConstantDataVector.  At this point,
we should (theoretically optimize and codegen ConstantDataVector as well
as ConstantVector.

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

12 years agoUnix line endings
Matt Beaumont-Gay [Fri, 27 Jan 2012 02:31:29 +0000 (02:31 +0000)]
Unix line endings

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

12 years agoPlace the GEP instructions nearer to the instructions which use them.
Bill Wendling [Fri, 27 Jan 2012 02:02:24 +0000 (02:02 +0000)]
Place the GEP instructions nearer to the instructions which use them.

GEP instructions are there for the compiler and shouldn't really output much
code (if any at all). When a GEP is stored in the entry block, Fast ISel (for
one) will not know that it could fold it into further uses. For instance, inside
of the EH handling code. This results in a lot of unnecessary spills and loads
which bloat code and slows down pretty much everything.
<rdar://problem/10694814>

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

12 years agomake sure the file's matching header is #include'd first.
Chris Lattner [Fri, 27 Jan 2012 01:47:28 +0000 (01:47 +0000)]
make sure the file's matching header is #include'd first.

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

12 years agoRewrite CanShareConstantPoolEntry to be implemented in terms of the
Chris Lattner [Fri, 27 Jan 2012 01:46:00 +0000 (01:46 +0000)]
Rewrite CanShareConstantPoolEntry to be implemented in terms of the
mid-level constant folding APIs instead of doing its own analysis.
This makes it more general (e.g. can now share a <2 x i64> with a
<4 x i32>) and avoid duplicating a bunch of logic.

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

12 years agoenhance constant folding to be able to constant fold bitcast of
Chris Lattner [Fri, 27 Jan 2012 01:44:03 +0000 (01:44 +0000)]
enhance constant folding to be able to constant fold bitcast of
ConstantVector's to integer type.

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

12 years agoKeep source location information for X86 MCFixup's.
Jim Grosbach [Fri, 27 Jan 2012 00:51:27 +0000 (00:51 +0000)]
Keep source location information for X86 MCFixup's.

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

12 years agoSource information in 'expected relocatable expression' diagnostic.
Jim Grosbach [Fri, 27 Jan 2012 00:51:23 +0000 (00:51 +0000)]
Source information in 'expected relocatable expression' diagnostic.

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

12 years agoBetter user diagnostics for more ARM MachO relocation errors.
Jim Grosbach [Fri, 27 Jan 2012 00:37:12 +0000 (00:37 +0000)]
Better user diagnostics for more ARM MachO relocation errors.

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

12 years agoBetter diagnostic for malformed .org assembly directive.
Jim Grosbach [Fri, 27 Jan 2012 00:37:08 +0000 (00:37 +0000)]
Better diagnostic for malformed .org assembly directive.

Provide source line number information.

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

12 years agoRewrite instruction operands in AdjustCopiesBackFrom. Fixes PR11861.
Lang Hames [Fri, 27 Jan 2012 00:05:42 +0000 (00:05 +0000)]
Rewrite instruction operands in AdjustCopiesBackFrom. Fixes PR11861.

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

12 years agoTidy up.
Jim Grosbach [Thu, 26 Jan 2012 23:47:45 +0000 (23:47 +0000)]
Tidy up.

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

12 years agoKeep source information, if available, around for ARM Fixups.
Jim Grosbach [Thu, 26 Jan 2012 23:20:15 +0000 (23:20 +0000)]
Keep source information, if available, around for ARM Fixups.

Adjust an example MachObjectWriter diagnostic to use the information
to issue a better message.

Before:
LLVM ERROR: unknown ARM fixup kind!

After:
x.s:6:5: error: unsupported relocation on symbol
    beq bar
    ^

rdar://9800182

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

12 years agoAdd simple support for keeping MCFixup source information.
Jim Grosbach [Thu, 26 Jan 2012 23:20:11 +0000 (23:20 +0000)]
Add simple support for keeping MCFixup source information.

Can be used to issue more user friendly diagnostics for faulty
relocation constructs and such.

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

12 years agollvm-mc pass through SourceMgr to MCContext.
Jim Grosbach [Thu, 26 Jan 2012 23:20:07 +0000 (23:20 +0000)]
llvm-mc pass through SourceMgr to MCContext.

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

12 years agoAdd SourceMgr to MCContext for backend diagnostics.
Jim Grosbach [Thu, 26 Jan 2012 23:20:05 +0000 (23:20 +0000)]
Add SourceMgr to MCContext for backend diagnostics.

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

12 years agoHandle call-clobbered ymm registers on Win64.
Jakob Stoklund Olesen [Thu, 26 Jan 2012 22:59:28 +0000 (22:59 +0000)]
Handle call-clobbered ymm registers on Win64.

The Win64 calling convention has xmm6-15 as callee-saved while still
clobbering all ymm registers.

Add a YMM_HI_6_15 pseudo-register that aliases the clobbered part of the
ymm registers, and mark that as call-clobbered.  This allows live xmm
registers across calls.

This hack wouldn't be necessary with RegisterMask operands representing
the call clobbers, but they are not quite operational yet.

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

12 years agoUse -H on darwin as well.
Eric Christopher [Thu, 26 Jan 2012 22:06:23 +0000 (22:06 +0000)]
Use -H on darwin as well.

Patch by Liang Wang!

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

12 years agoprogress making the world safe to ConstantDataVector. While
Chris Lattner [Thu, 26 Jan 2012 21:37:55 +0000 (21:37 +0000)]
progress making the world safe to ConstantDataVector.  While
we're at it, allow PatternMatch's "neg" pattern to match integer
vector negations, and enhance ComputeNumSigned bits to handle
shl of vectors.

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

12 years agotidy up forward declarations.
Chris Lattner [Thu, 26 Jan 2012 20:44:57 +0000 (20:44 +0000)]
tidy up forward declarations.

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

12 years agosmallvectorize and ArrayRef'ize some stuff.
Chris Lattner [Thu, 26 Jan 2012 20:40:56 +0000 (20:40 +0000)]
smallvectorize and ArrayRef'ize some stuff.

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

12 years agoReduce a lot of code duplication by implementing
Chris Lattner [Thu, 26 Jan 2012 20:37:11 +0000 (20:37 +0000)]
Reduce a lot of code duplication by implementing
ConstantExpr::getWithOperandReplaced and ConstantExpr::replaceUsesOfWithOnConstant
 in terms of ConstantExpr::getWithOperands.  While we're at it,
make sure that ConstantExpr::getWithOperands covers all instructions: it was
missing insert/extractvalue.

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

12 years agoUpdate comment for r149070.
Chad Rosier [Thu, 26 Jan 2012 20:19:05 +0000 (20:19 +0000)]
Update comment for r149070.

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

12 years agoReplace the use of isPredicable() with isPredicated() in
Chad Rosier [Thu, 26 Jan 2012 18:24:25 +0000 (18:24 +0000)]
Replace the use of isPredicable() with isPredicated() in
MachineBasicBlock::canFallThrough().  We're interested in the state of the
instruction (i.e., is this a barrier or not?), not if the instruction is
predicable or not.
rdar://10501092

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

12 years agoClear kill flags before propagating a copy.
Jakob Stoklund Olesen [Thu, 26 Jan 2012 17:52:15 +0000 (17:52 +0000)]
Clear kill flags before propagating a copy.

The live range of the source register may be extended when a redundant
copy is eliminated. Make sure any kill flags between the two copies are
cleared.

This fixes PR11765.

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

12 years agoTidy up. Fix mismatched return types for error handling.
Jim Grosbach [Thu, 26 Jan 2012 15:56:45 +0000 (15:56 +0000)]
Tidy up. Fix mismatched return types for error handling.

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

12 years agocomment tweaks
Gabor Greif [Thu, 26 Jan 2012 10:28:58 +0000 (10:28 +0000)]
comment tweaks

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

12 years agoAdd support for the R_ARM_TARGET1 relocation, which should be given to relocations...
James Molloy [Thu, 26 Jan 2012 09:25:43 +0000 (09:25 +0000)]
Add support for the R_ARM_TARGET1 relocation, which should be given to relocations applied to all C++ constructors and destructors.

This enables the linker to match concrete relocation types (absolute or relative) with whatever library or C++ support code is being linked against.

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

12 years agoFix for the following bug in AVX codegen for double-to-int conversions:
Victor Umansky [Thu, 26 Jan 2012 08:51:39 +0000 (08:51 +0000)]
Fix for the following bug in AVX codegen for double-to-int conversions:
. "fptosi" and "fptoui" IR instructions are defined with round-to-zero rounding mode.
. Currently for AVX mode for <4xdouble> and <8xdouble>  the "VCVTPD2DQ.128" and "VCVTPD2DQ.256" instructions are selected (for .fp_to_sint. DAG node operation ) by AVX codegen. However they use round-to-nearest-even rounding mode.
. Consequently, the conversion produces incorrect numbers.

The fix is to replace selection of VCVTPD2DQ instructions with VCVTTPD2DQ instructions. The latter use truncate (i.e. round-to-zero) rounding mode.
As .fp_to_sint. DAG node operation is used only for lowering of  "fptosi" and "fptoui" IR instructions, the fix in X86InstrSSE.td definition file doesn.t have an impact on other LLVM flows.

The patch includes changes in the .td file, LIT test for the changes and a fix in a legacy LIT test (which produced asm code conflicting with LLVN IR spec).

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

12 years agoAdd HasXOP predicate check covering a bunch of XOP intrinsic patterns.
Craig Topper [Thu, 26 Jan 2012 07:51:55 +0000 (07:51 +0000)]
Add HasXOP predicate check covering a bunch of XOP intrinsic patterns.

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

12 years agoFix AVX vs SSE patterns ordering issue for VPCMPESTRM and VPCMPISTRM.
Craig Topper [Thu, 26 Jan 2012 07:31:30 +0000 (07:31 +0000)]
Fix AVX vs SSE patterns ordering issue for VPCMPESTRM and VPCMPISTRM.

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

12 years agoRemove some more patterns by custom lowering intrinsics to target specific nodes.
Craig Topper [Thu, 26 Jan 2012 07:18:03 +0000 (07:18 +0000)]
Remove some more patterns by custom lowering intrinsics to target specific nodes.

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

12 years agounbreak test/Bitcode/shuffle.ll.
Chris Lattner [Thu, 26 Jan 2012 03:10:45 +0000 (03:10 +0000)]
unbreak test/Bitcode/shuffle.ll.

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

12 years agosimplify by using ShuffleVectorInst::getMaskValue.
Chris Lattner [Thu, 26 Jan 2012 02:54:54 +0000 (02:54 +0000)]
simplify by using ShuffleVectorInst::getMaskValue.

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

12 years agoeliminate the Constant::getVectorElements method. There are better (and
Chris Lattner [Thu, 26 Jan 2012 02:51:13 +0000 (02:51 +0000)]
eliminate the Constant::getVectorElements method.  There are better (and
more robust) ways to do what it was doing now.  Also, add static methods
for decoding a ShuffleVector mask.

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

12 years agoContinue improving support for ConstantDataAggregate, and use the
Chris Lattner [Thu, 26 Jan 2012 02:32:04 +0000 (02:32 +0000)]
Continue improving support for ConstantDataAggregate, and use the
new methods recently added to (sometimes greatly!) simplify code.

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

12 years agoAdd a ConstantDataVector::getSplatValue() method, for parity with
Chris Lattner [Thu, 26 Jan 2012 02:31:22 +0000 (02:31 +0000)]
Add a ConstantDataVector::getSplatValue() method, for parity with
ConstantVector.  Fix some outright bugs in the implementation of
ConstantArray and Constant struct, which would cause us to not make
one big UndefValue when asking for an array/struct with all undef
elements.  Enhance Constant::isAllOnesValue to work with
ConstantDataVector.

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

12 years agollvm-config: Add support for CMake build trees in which the build
Peter Collingbourne [Thu, 26 Jan 2012 01:31:38 +0000 (01:31 +0000)]
llvm-config: Add support for CMake build trees in which the build
mode does not form part of the path.

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

12 years agosome general cleanup, using new methods and tidying up old code.
Chris Lattner [Thu, 26 Jan 2012 00:42:34 +0000 (00:42 +0000)]
some general cleanup, using new methods and tidying up old code.

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

12 years agofix pasto in the new (and still unused) ShuffleVectorInst::getShuffleMask method.
Chris Lattner [Thu, 26 Jan 2012 00:41:50 +0000 (00:41 +0000)]
fix pasto in the new (and still unused) ShuffleVectorInst::getShuffleMask method.

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

12 years agoadd StructType helpers too.
Chris Lattner [Thu, 26 Jan 2012 00:06:44 +0000 (00:06 +0000)]
add StructType helpers too.

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

12 years agoOk, break down and add some cast<>'ing helper methods to the Type class
Chris Lattner [Thu, 26 Jan 2012 00:01:10 +0000 (00:01 +0000)]
Ok, break down and add some cast<>'ing helper methods to the Type class
to reduce the number of cast<>'s we have.  This allows someone to use
things like Ty->getVectorNumElements() instead of
cast<VectorType>(Ty)->getNumElements() when you know that a type is a
vector.

It would be a great general cleanup to move the codebase to use these,
I will do so in the code I'm touching.

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

12 years agoadd some helper methods to ShuffleVectorInst and enhance its
Chris Lattner [Wed, 25 Jan 2012 23:49:49 +0000 (23:49 +0000)]
add some helper methods to ShuffleVectorInst and enhance its
"isValidOperands" and "getMaskValue" methods to allow
ConstantDataSequential.

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

12 years agoImprove sub-register def handling in ProcessImplicitDefs.
Jakob Stoklund Olesen [Wed, 25 Jan 2012 23:36:27 +0000 (23:36 +0000)]
Improve sub-register def handling in ProcessImplicitDefs.

This boils down to using MachineOperand::readsReg() more.

This fixes PR11829 where a use ended up after the first def when
lowering REG_SEQUENCE instructions involving IMPLICIT_DEFs.

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

12 years agoProperly emit ctors / dtors with priorities into desired sections
Anton Korobeynikov [Wed, 25 Jan 2012 22:24:19 +0000 (22:24 +0000)]
Properly emit ctors / dtors with priorities into desired sections
and let linker handle the rest.

This finally fixes PR5329

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