oota-llvm.git
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

12 years agoDon't add live ranges for aliases of physregs that are live in to the
Lang Hames [Wed, 25 Jan 2012 22:11:06 +0000 (22:11 +0000)]
Don't add live ranges for aliases of physregs that are live in to the
function. They don't appear to be used, and are inconsistent with handling of
other physreg intervals (i.e. intervals that are not live-in) where ranges are
not inserted for aliases.

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

12 years agoTidy up. s/Low Level Virtual Machine/LLVM/.
Jim Grosbach [Wed, 25 Jan 2012 22:00:23 +0000 (22:00 +0000)]
Tidy up. s/Low Level Virtual Machine/LLVM/.

LLVM isn't an acronym anymore.

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

12 years agoAlways break upon finding a vreg operand (in Release as well as +Asserts). Remove...
Lang Hames [Wed, 25 Jan 2012 21:53:23 +0000 (21:53 +0000)]
Always break upon finding a vreg operand (in Release as well as +Asserts). Remove assertion which can no longer trigger.

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

12 years agoARM assemly parsing and validation of IT instruction.
Jim Grosbach [Wed, 25 Jan 2012 19:52:01 +0000 (19:52 +0000)]
ARM assemly parsing and validation of IT instruction.

"Although a Thumb2 instruction, the IT mnemonic shall be permitted in
ARM mode, and the condition verified to match the condition code(s)
on the following instruction(s)."

PR11853

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

12 years agoUse precomputed BB size instead of BB->size().
Nick Lewycky [Wed, 25 Jan 2012 18:54:13 +0000 (18:54 +0000)]
Use precomputed BB size instead of BB->size().

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

12 years agofix a bug I introduced in r148929, this is not a splat!
Chris Lattner [Wed, 25 Jan 2012 09:56:22 +0000 (09:56 +0000)]
fix a bug I introduced in r148929, this is not a splat!
Thanks to Eli for noticing.

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

12 years agoGracefully degrade precision in branch probability numbers.
Nick Lewycky [Wed, 25 Jan 2012 09:43:14 +0000 (09:43 +0000)]
Gracefully degrade precision in branch probability numbers.

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

12 years agoSupport pointer comparisons against constants, when looking at the inline-cost
Nick Lewycky [Wed, 25 Jan 2012 08:27:40 +0000 (08:27 +0000)]
Support pointer comparisons against constants, when looking at the inline-cost
savings from a pointer argument becoming an alloca. Sometimes callees will even
compare a pointer to null and then branch to an otherwise unreachable block!
Detect these cases and compute the number of saved instructions, instead of
bailing out and reporting no savings.

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

12 years agoRevert a tiny bit of r148553 which extended LLVM's function attributes
Chandler Carruth [Wed, 25 Jan 2012 07:40:15 +0000 (07:40 +0000)]
Revert a tiny bit of r148553 which extended LLVM's function attributes
to 64-bits, and added a new attribute in bit #32. Specifically, remove
this new attribute from the enum used in the C API. It's not yet clear
what the best approach is for exposing these new attributes in the
C API, and several different proposals are on the table. Until then, we
can simply not expose this bit in the API at all.

Also, I've reverted a somewhat unrelated change in the same revision
which switched from "1 << 31" to "1U << 31" for the top enum. While "1
<< 31" is technically undefined behavior, implementations DTRT here.
However, MS and -pedantic mode warn about non-'int' type enumerator
values. If folks feel strongly about this I can put the 'U' back in, but
it seemed best to wait for the proper solution.

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

12 years agoUpdate hasProperty comment.
Evan Cheng [Wed, 25 Jan 2012 07:38:48 +0000 (07:38 +0000)]
Update hasProperty comment.

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

12 years agouse Constant::getAggregateElement to simplify a bunch of code.
Chris Lattner [Wed, 25 Jan 2012 06:48:06 +0000 (06:48 +0000)]
use Constant::getAggregateElement to simplify a bunch of code.

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

12 years agoCustom lower PSIGN and PSHUFB intrinsics to their corresponding target specific nodes...
Craig Topper [Wed, 25 Jan 2012 06:43:11 +0000 (06:43 +0000)]
Custom lower PSIGN and PSHUFB intrinsics to their corresponding target specific nodes so we can remove the isel patterns.

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

12 years agoconstify some methods and add a new Constant::getAggregateElement
Chris Lattner [Wed, 25 Jan 2012 06:16:32 +0000 (06:16 +0000)]
constify some methods and add a new Constant::getAggregateElement
helper method for the common operation of extracting an element
out of a constant aggregate.

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

12 years agouse ConstantVector::getSplat in a few places.
Chris Lattner [Wed, 25 Jan 2012 06:02:56 +0000 (06:02 +0000)]
use ConstantVector::getSplat in a few places.

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

12 years agoCustom lower phadd and phsub intrinsics to target specific nodes. Remove the patterns...
Craig Topper [Wed, 25 Jan 2012 05:37:32 +0000 (05:37 +0000)]
Custom lower phadd and phsub intrinsics to target specific nodes. Remove the patterns that are no longer necessary.

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

12 years agoreapply r148901 with a crucial fix.
Chris Lattner [Wed, 25 Jan 2012 05:19:54 +0000 (05:19 +0000)]
reapply r148901 with a crucial fix.

"Introduce a new ConstantVector::getSplat constructor function to
simplify a really common case."

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

12 years agoRemove AVX 256-bit unaligned load intrinsics. 128-bit versions had been removed a...
Craig Topper [Wed, 25 Jan 2012 04:42:03 +0000 (04:42 +0000)]
Remove AVX 256-bit unaligned load intrinsics. 128-bit versions had been removed a while ago.

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

12 years agoMark 64-bit register RA_64 unused too.
Akira Hatanaka [Wed, 25 Jan 2012 04:19:22 +0000 (04:19 +0000)]
Mark 64-bit register RA_64 unused too.

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

12 years agoModify MipsFrameLowering::emitPrologue and emitEpilogue.
Akira Hatanaka [Wed, 25 Jan 2012 04:12:04 +0000 (04:12 +0000)]
Modify MipsFrameLowering::emitPrologue and emitEpilogue.

- Use MipsAnalyzeImmediate to expand immediates that do not fit in 16-bit.
- Change the types of variables so that they are sufficiently large to handle
  64-bit pointers.
- Emit instructions to set register $28 in a function prologue after
  instructions which store callee-saved registers have been emitted.

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

12 years agoModify MipsRegisterInfo::eliminateFrameIndex to use MipsAnalyzeImmediate to
Akira Hatanaka [Wed, 25 Jan 2012 03:55:10 +0000 (03:55 +0000)]
Modify MipsRegisterInfo::eliminateFrameIndex to use MipsAnalyzeImmediate to
expand offsets that do not fit in the 16-bit immediate field of load and store
instructions. Also change the types of variables so that they are sufficiently
large to handle 64-bit pointers.

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

12 years agoMerge intrinsic pattern and no pattern versions of VCVTSD2SI intruction definitions...
Craig Topper [Wed, 25 Jan 2012 03:52:09 +0000 (03:52 +0000)]
Merge intrinsic pattern and no pattern versions of VCVTSD2SI intruction definitions. Matches non-AVX version of same instructions.

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

12 years ago-fvisibility-inlines-hidden is a c++ only option.
Rafael Espindola [Wed, 25 Jan 2012 03:39:26 +0000 (03:39 +0000)]
-fvisibility-inlines-hidden is a c++ only option.
Thanks to Peter Collingbourne for noticing it.

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