oota-llvm.git
12 years agoMake sure the non-SSE lowering for fences correctly clobbers EFLAGS. PR11768.
Eli Friedman [Mon, 16 Jan 2012 16:42:21 +0000 (16:42 +0000)]
Make sure the non-SSE lowering for fences correctly clobbers EFLAGS.  PR11768.

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

12 years agoGet rid of unused codegen-only instruction.
Eli Friedman [Mon, 16 Jan 2012 16:29:35 +0000 (16:29 +0000)]
Get rid of unused codegen-only instruction.

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

12 years agoAdding a Hexagon cell for segmented stacks, as they have been implemented for X86...
Joe Abbey [Mon, 16 Jan 2012 13:16:05 +0000 (13:16 +0000)]
Adding a Hexagon cell for segmented stacks, as they have been implemented for X86 and not Sparc...

Committed as obvious

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

12 years agoGive priority to AVX over SSE for 128-bit floating point unpck instructions.
Craig Topper [Mon, 16 Jan 2012 09:56:42 +0000 (09:56 +0000)]
Give priority to AVX over SSE for 128-bit floating point unpck instructions.

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

12 years agoA fix for the previous commit: "integer constant is too large for ‘long’ type" error...
Eli Bendersky [Mon, 16 Jan 2012 09:31:10 +0000 (09:31 +0000)]
A fix for the previous commit: "integer constant is too large for ‘long’ type" error on some 32-bit bots

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

12 years agoAdding a basic ELF dynamic loader and MC-JIT for ELF. Functionality is currently...
Eli Bendersky [Mon, 16 Jan 2012 08:56:09 +0000 (08:56 +0000)]
Adding a basic ELF dynamic loader and MC-JIT for ELF. Functionality is currently basic and will be enhanced with future patches.
Patch developed by Andy Kaylor and Daniel Malea. Reviewed on llvm-commits.

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

12 years agoRefactor variables unused under non-assert builds (& remove two entirely unused varia...
David Blaikie [Mon, 16 Jan 2012 05:17:39 +0000 (05:17 +0000)]
Refactor variables unused under non-assert builds (& remove two entirely unused variables).

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

12 years agoChanged intrinsic ID operand to a target constant as its not used in any arithmetic...
Pete Cooper [Mon, 16 Jan 2012 04:08:12 +0000 (04:08 +0000)]
Changed intrinsic ID operand to a target constant as its not used in any arithmetic so should not be checked in legalisation

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

12 years ago[AVX] Optimize x86 VSELECT instructions using SimplifyDemandedBits.
Nadav Rotem [Sun, 15 Jan 2012 19:27:55 +0000 (19:27 +0000)]
[AVX] Optimize x86 VSELECT instructions using SimplifyDemandedBits.
We know that the blend instructions only use the MSB, so if the mask is
sign-extended then we can convert it into a SHL instruction. This is a
common pattern because the type-legalizer sign-extends the i1 type which
is used by the LLVM-IR for the condition.

Added a new optimization in SimplifyDemandedBits for SIGN_EXTEND_INREG -> SHL.

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

12 years agoReturn an ArrayRef from ShuffleVectorSDNode::getMask and push it through CodeGen.
Benjamin Kramer [Sun, 15 Jan 2012 13:16:05 +0000 (13:16 +0000)]
Return an ArrayRef from ShuffleVectorSDNode::getMask and push it through CodeGen.

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

12 years agoDAGCombiner: Deduplicate code.
Benjamin Kramer [Sun, 15 Jan 2012 11:50:43 +0000 (11:50 +0000)]
DAGCombiner: Deduplicate code.

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

12 years agoCosmetic patch for r148215.
Stepan Dyatkovskiy [Sun, 15 Jan 2012 09:45:11 +0000 (09:45 +0000)]
Cosmetic patch for r148215.

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

12 years agoFixup for r148132. Type replacement for LoopsProperties: from DenseMap to std::map...
Stepan Dyatkovskiy [Sun, 15 Jan 2012 09:44:07 +0000 (09:44 +0000)]
Fixup for r148132. Type replacement for LoopsProperties: from DenseMap to std::map, since we need to keep a valid pointer to properties of current loop.

Message for r148132:
LoopUnswitch: All helper data that is collected during loop-unswitch iterations was moved to separated class (LUAnalysisCache).

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

12 years agoRelax the FileCheck assertion a bit -- all we really care about is that
Chandler Carruth [Sun, 15 Jan 2012 09:38:59 +0000 (09:38 +0000)]
Relax the FileCheck assertion a bit -- all we really care about is that
we're loading from the global array, not how it is spelled in the asm.
This should fix the MSVC bots.

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

12 years agoFileCheck-ize a test, make it more specific to directly test the shift
Chandler Carruth [Sun, 15 Jan 2012 09:32:57 +0000 (09:32 +0000)]
FileCheck-ize a test, make it more specific to directly test the shift
removal desired.

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

12 years agoRemove SetWorkingDirectory from the Process interface. Nothing in LLVM
Chandler Carruth [Sun, 15 Jan 2012 08:41:35 +0000 (08:41 +0000)]
Remove SetWorkingDirectory from the Process interface. Nothing in LLVM
or Clang is using this, and it would be hard to use it correctly given
the thread hostility of the function. Also, it never checked the return
which is rather dangerous with chdir. If someone was in fact using this,
please let me know, as well as what the usecase actually is so that
I can add it back and make it more correct and secure to use. (That
said, it's never going to be "safe" per-se, but we could at least
document the risks...)

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

12 years agoRemove dead code.
David Blaikie [Sun, 15 Jan 2012 01:09:13 +0000 (01:09 +0000)]
Remove dead code.

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

12 years agoTruncate of undef is just undef of smaller size.
Craig Topper [Sun, 15 Jan 2012 01:05:11 +0000 (01:05 +0000)]
Truncate of undef is just undef of smaller size.

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

12 years agoFix the memop type on a couple 256-bit AVX instructions that were using f128mem inste...
Craig Topper [Sat, 14 Jan 2012 18:29:57 +0000 (18:29 +0000)]
Fix the memop type on a couple 256-bit AVX instructions that were using f128mem instead of f256mem.

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

12 years agoAdd a bunch of AVX instructions to the folding tables. Also fixed the alignment on...
Craig Topper [Sat, 14 Jan 2012 18:14:53 +0000 (18:14 +0000)]
Add a bunch of AVX instructions to the folding tables. Also fixed the alignment on 256-bit AVX2 instructions.

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

12 years agoSpeculatively revert commit 148175 (rafael), to see if this fixes
Duncan Sands [Sat, 14 Jan 2012 17:16:48 +0000 (17:16 +0000)]
Speculatively revert commit 148175 (rafael), to see if this fixes
non-determinism in the 32 bit dragonegg buildbot.  Original commit
message:
Only emit the Leh_func_endN symbol when needed.

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

12 years agoFix a corner case hit by redundant phi elimination running after LSR.
Andrew Trick [Sat, 14 Jan 2012 03:17:23 +0000 (03:17 +0000)]
Fix a corner case hit by redundant phi elimination running after LSR.

Fixes PR11761: bad IR w/ redundant Phi elim

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

12 years agoOnly emit the Leh_func_endN symbol when needed.
Rafael Espindola [Sat, 14 Jan 2012 02:36:51 +0000 (02:36 +0000)]
Only emit the Leh_func_endN symbol when needed.

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

12 years agomisched: Initial code for building an MI level scheduling DAG
Andrew Trick [Sat, 14 Jan 2012 02:17:18 +0000 (02:17 +0000)]
misched: Initial code for building an MI level scheduling DAG

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

12 years agoMove physreg dependency generation into aptly named addPhysRegDeps.
Andrew Trick [Sat, 14 Jan 2012 02:17:15 +0000 (02:17 +0000)]
Move physreg dependency generation into aptly named addPhysRegDeps.

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

12 years agomisched: Added ScheduleDAGInstrs::IsPostRA
Andrew Trick [Sat, 14 Jan 2012 02:17:12 +0000 (02:17 +0000)]
misched: Added ScheduleDAGInstrs::IsPostRA

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

12 years agomisched: Invoke the DAG builder on each sequence of schedulable instructions.
Andrew Trick [Sat, 14 Jan 2012 02:17:09 +0000 (02:17 +0000)]
misched: Invoke the DAG builder on each sequence of schedulable instructions.

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

12 years agoMove things around to make the file navigable, even though it will probably be split...
Andrew Trick [Sat, 14 Jan 2012 02:17:06 +0000 (02:17 +0000)]
Move things around to make the file navigable, even though it will probably be split up later.

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

12 years agoAfter r147827 and r147902, it's now possible for unallocatable registers to be
Evan Cheng [Sat, 14 Jan 2012 01:53:46 +0000 (01:53 +0000)]
After r147827 and r147902, it's now possible for unallocatable registers to be
live across BBs before register allocation. This miscompiled 197.parser
when a cmp + b are optimized to a cbnz instruction even though the CPSR def
is live-in a successor.
        cbnz    r6, LBB89_12
...
LBB89_12:
        ble     LBB89_1

The fix consists of two parts. 1) Teach LiveVariables that some unallocatable
registers might be liveouts so don't mark their last use as kill if they are.
2) ARM constantpool island pass shouldn't form cbz / cbnz if the conditional
branch does not kill CPSR.

rdar://10676853

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

12 years agoFix pasto from r146196.
Chad Rosier [Sat, 14 Jan 2012 01:50:21 +0000 (01:50 +0000)]
Fix pasto from r146196.

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

12 years agoCleanup test case by adding checks for test names.
Chad Rosier [Sat, 14 Jan 2012 01:46:51 +0000 (01:46 +0000)]
Cleanup test case by adding checks for test names.

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

12 years agoAdd TRI::getCallPreservedMask() hook.
Jakob Stoklund Olesen [Sat, 14 Jan 2012 01:45:25 +0000 (01:45 +0000)]
Add TRI::getCallPreservedMask() hook.

The hook returns a bit-mask of call-preserved registers that will
eventually replace the current list of implicit defs on call
instructions.  This will make it possible to support multiple calling
conventions without duplicating call instruction descriptors.

The call-preserved mask is slightly different from the list returned by
the getCalleeSavedRegs() hook, it includes all aliases that are
preserved by calls.

The hook takes a CallingConv::ID argument instead of a MachineFunction
pointer, so it can provide information about calls to extern functions,
and even indirect function calls.

TRI::getCalleeSavedRegs() returns information about the function
currently being compiled. TRI::getCallPreservedMask() returns
information about the functions it is calling.

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

12 years agoFix an unused variable warning that Chad noticed.
Dan Gohman [Sat, 14 Jan 2012 00:47:44 +0000 (00:47 +0000)]
Fix an unused variable warning that Chad noticed.

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

12 years agoAdd a test showing how the Leh_func_endN symbol is used.
Rafael Espindola [Sat, 14 Jan 2012 00:12:59 +0000 (00:12 +0000)]
Add a test showing how the Leh_func_endN symbol is used.

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

12 years agoRemove previous commit while I debug the bot failures.
Rafael Espindola [Fri, 13 Jan 2012 23:28:50 +0000 (23:28 +0000)]
Remove previous commit while I debug the bot failures.

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

12 years agoUse RegisterTuples to generate pseudo-registers.
Jakob Stoklund Olesen [Fri, 13 Jan 2012 22:55:42 +0000 (22:55 +0000)]
Use RegisterTuples to generate pseudo-registers.

The QQ and QQQQ registers are not 'real', they are pseudo-registers used
to model some vld and vst instructions.

This makes the call clobber lists longer, but I intend to get rid of
those soon.

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

12 years agoRemove label that is not used anymore.
Rafael Espindola [Fri, 13 Jan 2012 22:41:58 +0000 (22:41 +0000)]
Remove label that is not used anymore.

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

12 years agoSpeculatively revert r148132+r148133 to try and fix a buildbot failure.
Eli Friedman [Fri, 13 Jan 2012 22:34:39 +0000 (22:34 +0000)]
Speculatively revert r148132+r148133 to try and fix a buildbot failure.

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

12 years agoSkip the NAME field when forming tuples.
Jakob Stoklund Olesen [Fri, 13 Jan 2012 22:23:50 +0000 (22:23 +0000)]
Skip the NAME field when forming tuples.

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

12 years agoRemove pointless mode line in .cpp file.
Andrew Trick [Fri, 13 Jan 2012 22:04:16 +0000 (22:04 +0000)]
Remove pointless mode line in .cpp file.

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

12 years agoTry to clarify a little how exception handling works.
Duncan Sands [Fri, 13 Jan 2012 19:59:16 +0000 (19:59 +0000)]
Try to clarify a little how exception handling works.

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

12 years agoRevert r148131, it was committed before it was ready.
Devang Patel [Fri, 13 Jan 2012 19:28:58 +0000 (19:28 +0000)]
Revert r148131, it was committed before it was ready.

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

12 years agoCosmetic patch for r148132.
Stepan Dyatkovskiy [Fri, 13 Jan 2012 19:27:22 +0000 (19:27 +0000)]
Cosmetic patch for r148132.

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

12 years agoLoopUnswitch: All helper data that is collected during loop-unswitch iterations was...
Stepan Dyatkovskiy [Fri, 13 Jan 2012 19:13:54 +0000 (19:13 +0000)]
LoopUnswitch: All helper data that is collected during loop-unswitch iterations was moved to separated class (LUAnalysisCache).

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

12 years agoRefactor.
Devang Patel [Fri, 13 Jan 2012 19:12:18 +0000 (19:12 +0000)]
Refactor.

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

12 years agoAdd new test.
Devang Patel [Fri, 13 Jan 2012 18:45:31 +0000 (18:45 +0000)]
Add new test.

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

12 years agoFixed comment. Thanks Duncan!
Pete Cooper [Fri, 13 Jan 2012 17:52:01 +0000 (17:52 +0000)]
Fixed comment.  Thanks Duncan!

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

12 years agoConvert SHUFPD with the same register for both sources to PSHUFD if it would prevent...
Craig Topper [Fri, 13 Jan 2012 09:21:41 +0000 (09:21 +0000)]
Convert SHUFPD with the same register for both sources to PSHUFD if it would prevent a register copy. Similar to SHUFPS, but requires the mask to be converted.

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

12 years agouse v8i32 as optimal mem type over v8f32 if AVX2 is enabled. Similar to SSE2 vs SSE1.
Craig Topper [Fri, 13 Jan 2012 08:32:21 +0000 (08:32 +0000)]
use v8i32 as optimal mem type over v8f32 if AVX2 is enabled. Similar to SSE2 vs SSE1.

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

12 years agoMake X86 instruction selection use 256-bit VPXOR for build_vector of all ones if...
Craig Topper [Fri, 13 Jan 2012 08:12:35 +0000 (08:12 +0000)]
Make X86 instruction selection use 256-bit VPXOR for build_vector of all ones if AVX2 is enabled. This gives the ExeDepsFix pass a chance to choose FP vs int as appropriate. Also use v8i32 as the type for getZeroVector if AVX2 is enabled. This is consistent with SSE2 using prefering v4i32.

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

12 years agotest/CodeGen/ARM/test-sharedidx.ll: Fix for -Asserts.
NAKAMURA Takumi [Fri, 13 Jan 2012 07:03:55 +0000 (07:03 +0000)]
test/CodeGen/ARM/test-sharedidx.ll: Fix for -Asserts.

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

12 years agoAdd patterns for v16i16 and v32i8 immAllZerosV to select VPXOR to match v4i64 and...
Craig Topper [Fri, 13 Jan 2012 06:59:47 +0000 (06:59 +0000)]
Add patterns for v16i16 and v32i8 immAllZerosV to select VPXOR to match v4i64 and v8i32.

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

12 years agoAdded the MachineSchedulerPass skeleton.
Andrew Trick [Fri, 13 Jan 2012 06:30:30 +0000 (06:30 +0000)]
Added the MachineSchedulerPass skeleton.

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

12 years agowhitespace
Andrew Trick [Fri, 13 Jan 2012 06:30:25 +0000 (06:30 +0000)]
whitespace

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

12 years agowrong filename
Andrew Trick [Fri, 13 Jan 2012 06:30:22 +0000 (06:30 +0000)]
wrong filename

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

12 years ago80-col violation
Andrew Trick [Fri, 13 Jan 2012 06:30:19 +0000 (06:30 +0000)]
80-col violation

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

12 years agoUse 8i32 constant pool entry for converting AVX2_SETALLONES. Possibly fixes PR11750.
Craig Topper [Fri, 13 Jan 2012 06:12:41 +0000 (06:12 +0000)]
Use 8i32 constant pool entry for converting AVX2_SETALLONES. Possibly fixes PR11750.

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

12 years agoFix typo in PerformAddCombine that caused any vector type to be checked for horizonta...
Craig Topper [Fri, 13 Jan 2012 05:04:25 +0000 (05:04 +0000)]
Fix typo in PerformAddCombine that caused any vector type to be checked for horizontal add/sub if AVX2 is enabled. This caused an assert to fail for non 128/256-bit vectors when done before type legalizing. Fixes PR11749.

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

12 years agoDelete CodeInit and CodeRecTy from TableGen.
Jakob Stoklund Olesen [Fri, 13 Jan 2012 03:38:34 +0000 (03:38 +0000)]
Delete CodeInit and CodeRecTy from TableGen.

The code type was always identical to a string anyway. Now it is simply
a synonym. The code literal syntax [{...}] is still valid.

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

12 years agoUse uniqued StringInit pointers for lookups.
Jakob Stoklund Olesen [Fri, 13 Jan 2012 03:16:35 +0000 (03:16 +0000)]
Use uniqued StringInit pointers for lookups.

This avoids a gazillion StringMap and dynamic_cast calls, making
TableGen run 3x faster.

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

12 years agoDAGCombine's logic for forming pre- and post- indexed loads / stores were being
Evan Cheng [Fri, 13 Jan 2012 01:37:24 +0000 (01:37 +0000)]
DAGCombine's logic for forming pre- and post- indexed loads / stores were being
overly conservative. It was concerned about cases where it would prohibit
folding simple [r, c] addressing modes. e.g.
  ldr r0, [r2]
  ldr r1, [r2, #4]
=>
  ldr r0, [r2], #4
  ldr r1, [r2]
Change the logic to look for such cases which allows it to form indexed memory
ops more aggressively.

rdar://10674430

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

12 years agoFix off-by-one error.
Bill Wendling [Fri, 13 Jan 2012 00:41:53 +0000 (00:41 +0000)]
Fix off-by-one error.

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

12 years agoImplement proper ObjC ARC objc_retainBlock "escape" analysis, so that
Dan Gohman [Fri, 13 Jan 2012 00:39:07 +0000 (00:39 +0000)]
Implement proper ObjC ARC objc_retainBlock "escape" analysis, so that
the optimizer doesn't eliminate objc_retainBlock calls which are needed
for their side effect of copying blocks onto the heap.
This implements rdar://10361249.

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

12 years agoAdded MVT::v2f16
Pete Cooper [Thu, 12 Jan 2012 23:14:13 +0000 (23:14 +0000)]
Added MVT::v2f16

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

12 years agoRevert accidental commit.
Bill Wendling [Thu, 12 Jan 2012 23:06:28 +0000 (23:06 +0000)]
Revert accidental commit.

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

12 years agoFix the code that was WRONG.
Bill Wendling [Thu, 12 Jan 2012 23:05:03 +0000 (23:05 +0000)]
Fix the code that was WRONG.

The registers are placed into the saved registers list in the reverse order,
which is why the original loop was written to loop backwards.

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

12 years agoAdded FPOW, FEXP, FLOG to PromoteNode so that custom actions can be set to Promote...
Pete Cooper [Thu, 12 Jan 2012 21:46:18 +0000 (21:46 +0000)]
Added FPOW, FEXP, FLOG to PromoteNode so that custom actions can be set to Promote for those operations.

Sorry, no test case yet

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

12 years agoFixed a bug in LowerVECTOR_SHUFFLE caused assertion failure
Elena Demikhovsky [Thu, 12 Jan 2012 20:33:10 +0000 (20:33 +0000)]
Fixed a bug in LowerVECTOR_SHUFFLE caused assertion failure
 lc: X86ISelLowering.cpp:6480: llvm::SDValue llvm::X86TargetLowering::LowerVECTOR_SHUFFLE(llvm::SDValue, llvm::SelectionDAG&) const: Assertion `V1.getOpcode() != ISD::UNDEF&&  "Op 1 of shuffle should not be undef"' failed.
Added a test.

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

12 years agoWhen hoisting common code, watch out for uses which are marked "kill". If the
Evan Cheng [Thu, 12 Jan 2012 20:31:24 +0000 (20:31 +0000)]
When hoisting common code, watch out for uses which are marked "kill". If the
killed registers are needed below the insertion point, then unset the kill
marker.

Sorry I'm not able to find a reduced test case.

rdar://10660944

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

12 years agoAdd error-reporting tests for platforms that don't support segmented stacks.
Rafael Espindola [Thu, 12 Jan 2012 20:26:13 +0000 (20:26 +0000)]
Add error-reporting tests for platforms that don't support segmented stacks.
Patch by Brian Anderson.

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

12 years agoSupport segmented stacks on 64-bit FreeBSD.
Rafael Espindola [Thu, 12 Jan 2012 20:24:30 +0000 (20:24 +0000)]
Support segmented stacks on 64-bit FreeBSD.
This patch uses tcb_spare field in the tcb structure to store info.
Patch by Jyun-Yan You.

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

12 years agoSupport segmented stacks on win32.
Rafael Espindola [Thu, 12 Jan 2012 20:22:08 +0000 (20:22 +0000)]
Support segmented stacks on win32.
Uses the pvArbitrary slot of the TIB, which is reserved for applications. We
only support frames with a static size.

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

12 years agoRemove test case, as Chris suggested.
Devang Patel [Thu, 12 Jan 2012 19:54:02 +0000 (19:54 +0000)]
Remove test case, as Chris suggested.

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

12 years agoAdd test case to check intel syntax parsing.
Devang Patel [Thu, 12 Jan 2012 18:40:46 +0000 (18:40 +0000)]
Add test case to check intel syntax parsing.

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

12 years agoAllow targets to select source order pre-RA scheduler.
Evan Cheng [Thu, 12 Jan 2012 18:27:52 +0000 (18:27 +0000)]
Allow targets to select source order pre-RA scheduler.

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

12 years agoRename X86ATTAsmParser -> X86AsmParser
Devang Patel [Thu, 12 Jan 2012 18:03:40 +0000 (18:03 +0000)]
Rename X86ATTAsmParser -> X86AsmParser

We are using one parser to parse att as well as intel style syntax.

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

12 years agoMake SplitAnalysis::UseSlots private.
Jakob Stoklund Olesen [Thu, 12 Jan 2012 17:53:44 +0000 (17:53 +0000)]
Make SplitAnalysis::UseSlots private.

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

12 years agoAfter Jakob's r147938 exception handling on i386 was completely broken.
Benjamin Kramer [Thu, 12 Jan 2012 17:37:18 +0000 (17:37 +0000)]
After Jakob's r147938 exception handling on i386 was completely broken.

Restore the (obviously wrong) behavior from before r147938 without relying on
undefined behavior. Add a fat FIXME note.

This should fix nightly tester failures.

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

12 years agoFix a bug in the AVX 256-bit shuffle code in cases where the splat element is on...
Nadav Rotem [Thu, 12 Jan 2012 15:31:55 +0000 (15:31 +0000)]
Fix a bug in the AVX 256-bit shuffle code in cases where the splat element is on the boundary of two 128-bit vectors.
The attached testcase was stuck in an endless loop.

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

12 years agoX86: Generalize the x << (y & const) optimization to also catch masks with more set...
Benjamin Kramer [Thu, 12 Jan 2012 12:41:34 +0000 (12:41 +0000)]
X86: Generalize the x << (y & const) optimization to also catch masks with more set bits set than 31 or 63.

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

12 years agoMove Sched::Preference out of TargetMachine.h where it is not referenced.
Evan Cheng [Thu, 12 Jan 2012 02:35:23 +0000 (02:35 +0000)]
Move Sched::Preference out of TargetMachine.h where it is not referenced.

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

12 years agoAdd predicate method check match memory operand size, if available.
Devang Patel [Thu, 12 Jan 2012 01:51:42 +0000 (01:51 +0000)]
Add predicate method check match memory operand size, if available.

In att style asm syntax memory operand size is derived from suffix attached with mnemonic.  In intel style asm syntax it is part of memory operand hence predicate method check is required to select appropriate instruction.

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

12 years agoA DenseMap of a std::map isn't a very good idea because the "grow()" method will
Bill Wendling [Thu, 12 Jan 2012 01:41:03 +0000 (01:41 +0000)]
A DenseMap of a std::map isn't a very good idea because the "grow()" method will
need to make a deep copy of each of the std::maps. Use a std::map of the
std::map instead. This improves the compile time of sqlite3 by ~2%.

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

12 years agoAdd intel style operand parser skeleton.
Devang Patel [Thu, 12 Jan 2012 01:36:43 +0000 (01:36 +0000)]
Add intel style operand parser skeleton.
This is a work in progress.

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

12 years agoSwitch all of the uses of my InsertDAGNode helper to follow the exact
Chandler Carruth [Thu, 12 Jan 2012 01:34:44 +0000 (01:34 +0000)]
Switch all of the uses of my InsertDAGNode helper to follow the exact
same pattern. We already had this pattern is a few places, but others
tried to make a rough approximation of an actual DAG structure. As not
everywhere went to this trouble, nothing could rely on this being done.
In fact, I've checked all references to these node Ids, and the ones
that are using the topo-sort properties are actually satisfied with
a strict-weak-ordering. The requirement appears to be that Use >= Def.

I've added a big blurb of comments to this bit of the transform to
clarify why the order is so important for the next reader of the code.

I'm starting with this change as it is very small, and trivially
reverted if something breaks or the >= above really does need to be >.
If that proves the case, we can hide the problem by reverting this
patch, but the problem exists elsewhere as well, and so a more
comprehensive solution will be needed.

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

12 years agoRevert r147978. A DenseMap's iterators may become invalidated here.
Bill Wendling [Wed, 11 Jan 2012 23:43:34 +0000 (23:43 +0000)]
Revert r147978. A DenseMap's iterators may become invalidated here.

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

12 years agoMake data structures private.
Jakob Stoklund Olesen [Wed, 11 Jan 2012 23:19:08 +0000 (23:19 +0000)]
Make data structures private.

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

12 years agoUse a DenseMap.
Bill Wendling [Wed, 11 Jan 2012 22:57:32 +0000 (22:57 +0000)]
Use a DenseMap.

This appears to improve sqlite3's compile time by ~2%.

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

12 years agoSink spillInterferences into RABasic.
Jakob Stoklund Olesen [Wed, 11 Jan 2012 22:52:14 +0000 (22:52 +0000)]
Sink spillInterferences into RABasic.

This helper method is too simplistic for RAGreedy.

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

12 years agoCleanup.
Jakob Stoklund Olesen [Wed, 11 Jan 2012 22:52:11 +0000 (22:52 +0000)]
Cleanup.

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

12 years agoMove RegAllocBase into its own cpp file separate from RABasic.
Jakob Stoklund Olesen [Wed, 11 Jan 2012 22:28:30 +0000 (22:28 +0000)]
Move RegAllocBase into its own cpp file separate from RABasic.

No functional change.

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

12 years agoRe-fix the issue Bill fixed in r147899 in a slightly different way, which doesn't...
Eli Friedman [Wed, 11 Jan 2012 22:06:46 +0000 (22:06 +0000)]
Re-fix the issue Bill fixed in r147899 in a slightly different way, which doesn't abuse the semantics of linker_private.  We don't really want to merge any string constant with a weak_odr global.

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

12 years ago80 columns.
Jim Grosbach [Wed, 11 Jan 2012 21:23:35 +0000 (21:23 +0000)]
80 columns.

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

12 years agolli should only create memmgr when JITing.
Jim Grosbach [Wed, 11 Jan 2012 21:19:49 +0000 (21:19 +0000)]
lli should only create memmgr when JITing.

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

12 years agolli should create a JIT memory manager.
Jim Grosbach [Wed, 11 Jan 2012 21:12:51 +0000 (21:12 +0000)]
lli should create a JIT memory manager.

Previously let the JITEmitter do it. That's rather odd, and doesn't play nice
with the MCJIT, so move the (trivial) logic up.

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

12 years agoFix assert.
Eric Christopher [Wed, 11 Jan 2012 20:55:27 +0000 (20:55 +0000)]
Fix assert.

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

12 years agoDisable the crash reporter when running lit tests.
Argyrios Kyrtzidis [Wed, 11 Jan 2012 20:53:25 +0000 (20:53 +0000)]
Disable the crash reporter when running lit tests.

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

12 years agoOn AVX, we can load v8i32 at a time. The bug happens when two uneven loads are used.
Nadav Rotem [Wed, 11 Jan 2012 20:19:17 +0000 (20:19 +0000)]
On AVX, we can load v8i32 at a time. The bug happens when two uneven loads are used.
When we load the v12i32 type, the GenWidenVectorLoads method generates two loads: v8i32 and v4i32
and attempts to use CONCAT_VECTORS to join them. In this fix I concat undef values to widen
the smaller value. The test "widen_load-2.ll" also exposes this bug on AVX.

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

12 years agoCheck to make sure that the CFString's back store ends up in the correct section.
Bill Wendling [Wed, 11 Jan 2012 19:33:37 +0000 (19:33 +0000)]
Check to make sure that the CFString's back store ends up in the correct section.

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

12 years agoSupport segmented stacks on mac.
Rafael Espindola [Wed, 11 Jan 2012 19:00:37 +0000 (19:00 +0000)]
Support segmented stacks on mac.
This uses TLS slot 90, which actually belongs to JavaScriptCore. We only support
frames with static size
Patch by Brian Anderson.

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