oota-llvm.git
14 years agoswitch the value# in OPC_CompleteMatch and OPC_EmitNode to use a
Chris Lattner [Tue, 23 Feb 2010 00:59:59 +0000 (00:59 +0000)]
switch the value# in OPC_CompleteMatch and OPC_EmitNode to use a
VBR encoding for the insanity being perpetrated by the spu backend.

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

14 years agoAdded VCEQ (immediate #0) NEON instruction for disassembly only.
Johnny Chen [Tue, 23 Feb 2010 00:33:12 +0000 (00:33 +0000)]
Added VCEQ (immediate #0) NEON instruction for disassembly only.

A8.6.281

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

14 years agoDead code elimination
Jakob Stoklund Olesen [Tue, 23 Feb 2010 00:28:53 +0000 (00:28 +0000)]
Dead code elimination

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

14 years agoFix viewCFG on Linux.
Jeffrey Yasskin [Tue, 23 Feb 2010 00:04:53 +0000 (00:04 +0000)]
Fix viewCFG on Linux.

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

14 years agoadd a new Push2 opcode for targets (like cellspu) which have
Chris Lattner [Mon, 22 Feb 2010 23:55:39 +0000 (23:55 +0000)]
add a new Push2 opcode for targets (like cellspu) which have
ridiculously ginormous patterns and need more than one byte
of displacement for encodings.  This fixes CellSPU/fdiv.ll.
SPU is still doing something else ridiculous though.

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

14 years agoThese should not have been committed.
Evan Cheng [Mon, 22 Feb 2010 23:37:48 +0000 (23:37 +0000)]
These should not have been committed.

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

14 years agono need to run llvm-as here.
Chris Lattner [Mon, 22 Feb 2010 23:34:12 +0000 (23:34 +0000)]
no need to run llvm-as here.

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

14 years agoInstcombine constant folding can normalize gep with negative index to index with...
Evan Cheng [Mon, 22 Feb 2010 23:34:00 +0000 (23:34 +0000)]
Instcombine constant folding can normalize gep with negative index to index with large offset. When instcombine objsize checking transformation sees these geps where the offset seemingly point out of bound, it should just return "i don't know" rather than asserting.

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

14 years agoChange ComplexPattern handling to push the node being matched as
Chris Lattner [Mon, 22 Feb 2010 23:33:44 +0000 (23:33 +0000)]
Change ComplexPattern handling to push the node being matched as
well as the operands produced when the pattern is matched.  This
allows CheckSame to work correctly when matching replicated
names involving ComplexPatterns.  This fixes a bunch of MSP430
failures, we're down to 13 failures, two of which are
due to a sched bug.

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

14 years agoUpdated version of r96634 (which was reverted due to failing 176.gcc and
Jim Grosbach [Mon, 22 Feb 2010 23:10:38 +0000 (23:10 +0000)]
Updated version of r96634 (which was reverted due to failing 176.gcc and
126.gcc nightly tests. These failures uncovered latent bugs that machine DCE
could remove one half of a stack adjust down/up pair, causing PEI to assert.
This update fixes that, and the tests now pass.

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

14 years agoAdd a test for canonicalizing ConstantExpr operands.
Dan Gohman [Mon, 22 Feb 2010 23:07:52 +0000 (23:07 +0000)]
Add a test for canonicalizing ConstantExpr operands.

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

14 years agoClean up a bit and fix for when SPAdj != 0
Jim Grosbach [Mon, 22 Feb 2010 22:54:55 +0000 (22:54 +0000)]
Clean up a bit and fix for when SPAdj != 0

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

14 years agoThe predicate index isn't fixed, so scan for it to make sure we get the proper
Jim Grosbach [Mon, 22 Feb 2010 22:47:46 +0000 (22:47 +0000)]
The predicate index isn't fixed, so scan for it to make sure we get the proper
value.

Thumb2 uses the tADJCALLSTACK* instructions, and doesn't need t2 versions, so
remove the FIXME entry.

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

14 years agoCanonicalize ConstantInts to the right operand of commutative
Dan Gohman [Mon, 22 Feb 2010 22:43:23 +0000 (22:43 +0000)]
Canonicalize ConstantInts to the right operand of commutative
operators.

The test difference is just due to the multiplication operands
being commuted (and thus requiring a more elaborate match). In
optimized code, that expression would be folded.

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

14 years agoexpand my hack to work with nodes that have flags but no chains and the
Chris Lattner [Mon, 22 Feb 2010 22:37:11 +0000 (22:37 +0000)]
expand my hack to work with nodes that have flags but no chains and the
isel doesn't know the correct # results.  This fixes 8 codegen tests,
down to 22 failures.

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

14 years agoadd a new CheckMultiOpcode opcode for checking that a node
Chris Lattner [Mon, 22 Feb 2010 22:30:37 +0000 (22:30 +0000)]
add a new CheckMultiOpcode opcode for checking that a node
has one of the list of acceptable opcodes for a complex
pattern.  This fixes 4 regtest failures.

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

14 years agoWhen matching patterns that have a complex pattern as their root, make
Chris Lattner [Mon, 22 Feb 2010 22:18:05 +0000 (22:18 +0000)]
When matching patterns that have a complex pattern as their root, make
sure to only run the complex pattern on nodes where the target opts in.
This patch only handles targets with one opcode specified so far, but
fixes 16 failures, only 34 left.

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

14 years agoadd some debug hooks for tracking the behavior of the isel.
Chris Lattner [Mon, 22 Feb 2010 22:15:39 +0000 (22:15 +0000)]
add some debug hooks for tracking the behavior of the isel.

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

14 years agoremove dupes now.
Chris Lattner [Mon, 22 Feb 2010 22:15:05 +0000 (22:15 +0000)]
remove dupes now.

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

14 years agomove #includes earlier.
Chris Lattner [Mon, 22 Feb 2010 22:14:47 +0000 (22:14 +0000)]
move #includes earlier.

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

14 years agoMC/Mach-O: Remove non-sensical comment, and add a missing AddValueSymbols call.
Daniel Dunbar [Mon, 22 Feb 2010 22:08:57 +0000 (22:08 +0000)]
MC/Mach-O: Remove non-sensical comment, and add a missing AddValueSymbols call.

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

14 years agoMinor formatting cleanup.
Dan Gohman [Mon, 22 Feb 2010 22:07:27 +0000 (22:07 +0000)]
Minor formatting cleanup.

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

14 years agoUse Instruction::isCommutative instead of duplicating it.
Dan Gohman [Mon, 22 Feb 2010 22:05:18 +0000 (22:05 +0000)]
Use Instruction::isCommutative instead of duplicating it.

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

14 years agoAdded SEL, SXTB16, SXTAB16, UXTAB16, SMMULR, SMMLAR, SMMLSR, SMUAD, and SMUSD,
Johnny Chen [Mon, 22 Feb 2010 21:50:40 +0000 (21:50 +0000)]
Added SEL, SXTB16, SXTAB16, UXTAB16, SMMULR, SMMLAR, SMMLSR, SMUAD, and SMUSD,
for disassembly only.

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

14 years agoErase deleted instructions from GVN's ValueTable. This fixes assertion
Bob Wilson [Mon, 22 Feb 2010 21:39:41 +0000 (21:39 +0000)]
Erase deleted instructions from GVN's ValueTable.  This fixes assertion
failures from ValueTable::verifyRemoved() when using -debug.

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

14 years agoActually enable the -enable-unsafe-fp-math tests.
Dan Gohman [Mon, 22 Feb 2010 18:53:26 +0000 (18:53 +0000)]
Actually enable the -enable-unsafe-fp-math tests.

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

14 years agoAdded a bunch of instructions for disassembly only:
Johnny Chen [Mon, 22 Feb 2010 18:50:54 +0000 (18:50 +0000)]
Added a bunch of instructions for disassembly only:

o signed/unsigned add/subtract
o signed/unsigned halving add/subtract
o unsigned sum of absolute difference [and accumulate]
o signed/unsigned saturate
o signed multiply accumulate/subtract [long] dual

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

14 years agoMark the return address stack slot as mutable when moving the return address
Arnold Schwaighofer [Mon, 22 Feb 2010 16:18:09 +0000 (16:18 +0000)]
Mark the return address stack slot as mutable when moving the return address
during a tail call. A parameter might overwrite this stack slot during the tail
call.

The sequence during a tail call is:
1.) load return address to temp reg
2.) move parameters (might involve storing to return address stack slot)
3.) store return address to new location from temp reg

If the stack location is marked immutable CodeGen can colocate load (1) with the
store (3).

This fixes bug 6225.

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

14 years agoLLVMC/MultiplePluginPriorities.td: Generally XFAIL this test for now, it is
Daniel Dunbar [Mon, 22 Feb 2010 05:55:32 +0000 (05:55 +0000)]
LLVMC/MultiplePluginPriorities.td: Generally XFAIL this test for now, it is
still failing during (one) llvm-gcc powerpc build, and is also failing on my
x86_64-apple-darwin10.

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

14 years agoRemove unused variables and parameters.
Dan Gohman [Mon, 22 Feb 2010 04:11:59 +0000 (04:11 +0000)]
Remove unused variables and parameters.

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

14 years agoFix various doxygen warnings.
Dan Gohman [Mon, 22 Feb 2010 04:10:52 +0000 (04:10 +0000)]
Fix various doxygen warnings.

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

14 years agoFix a typo in a comment.
Dan Gohman [Mon, 22 Feb 2010 04:09:26 +0000 (04:09 +0000)]
Fix a typo in a comment.

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

14 years agoConstant-fold certain comparisons with infinity and negative infinity.
Dan Gohman [Mon, 22 Feb 2010 04:06:03 +0000 (04:06 +0000)]
Constant-fold certain comparisons with infinity and negative infinity.

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

14 years agoRename a variable to avoid a -Wshadow warning.
Dan Gohman [Mon, 22 Feb 2010 04:04:24 +0000 (04:04 +0000)]
Rename a variable to avoid a -Wshadow warning.

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

14 years agoRemove the logic for reasoning about NaNs from the code that forms
Dan Gohman [Mon, 22 Feb 2010 04:03:39 +0000 (04:03 +0000)]
Remove the logic for reasoning about NaNs from the code that forms
SSE min and max instructions. The real thing this code needs to be
concerned about is negative zero.

Update the sse-minmax.ll test accordingly, and add tests for
-enable-unsafe-fp-math mode as well.

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

14 years agoWhen emitting an instruction which depends on both a post-incremented
Dan Gohman [Mon, 22 Feb 2010 03:59:54 +0000 (03:59 +0000)]
When emitting an instruction which depends on both a post-incremented
induction variable value and a loop-variant value, don't force the
insert position to be at the post-increment position, because it may
not be dominated by the loop-variant value. This fixes a
use-before-def problem noticed on PPC.

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

14 years agoThis cast<Instruction> is unnecessary.
Dan Gohman [Mon, 22 Feb 2010 02:07:36 +0000 (02:07 +0000)]
This cast<Instruction> is unnecessary.

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

14 years agoenhance my hack for flags handling, this allows us to pass
Chris Lattner [Mon, 22 Feb 2010 00:47:38 +0000 (00:47 +0000)]
enhance my hack for flags handling, this allows us to pass
CodeGen/X86/pr2182.ll.  Down to 13 x86 failures out of ~1100

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

14 years agofix an incorrect VT: eflags is always i32. The bug was causing us to
Chris Lattner [Mon, 22 Feb 2010 00:28:59 +0000 (00:28 +0000)]
fix an incorrect VT: eflags is always i32.  The bug was causing us to
create an X86ISD::Cmp node with result type i64 on the
CodeGen/X86/shift-i256.ll testcase and the new isel was assert on it
downstream.

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

14 years agofix most of the failures in the x86 suite by handling multiple
Chris Lattner [Sun, 21 Feb 2010 23:54:05 +0000 (23:54 +0000)]
fix most of the failures in the x86 suite by handling multiple
result nodes correctly.  Note that this includes a horrible hack
in DAGISelHeader which cannot be fixed reasonably without
eliminating (parallel) from input patterns.  That, in turn,
can't be done until we support writing multiple result patterns
for the X86and_flag and related multiple-result nodes.

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

14 years agoMC/X86: Add stub AsmBackend.
Daniel Dunbar [Sun, 21 Feb 2010 21:54:14 +0000 (21:54 +0000)]
MC/X86: Add stub AsmBackend.

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

14 years agoMC: Sketch registry support for target specific assembler backends.
Daniel Dunbar [Sun, 21 Feb 2010 21:53:53 +0000 (21:53 +0000)]
MC: Sketch registry support for target specific assembler backends.

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

14 years agoFormatting tweaks (trailing whitespace, ordering, comments).
Daniel Dunbar [Sun, 21 Feb 2010 21:53:37 +0000 (21:53 +0000)]
Formatting tweaks (trailing whitespace, ordering, comments).

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

14 years agofix an odd thinko in an assertion, all arm tests pass now.
Chris Lattner [Sun, 21 Feb 2010 20:57:28 +0000 (20:57 +0000)]
fix an odd thinko in an assertion, all arm tests pass now.

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

14 years agoAlways emit register class id references as i32 like
Chris Lattner [Sun, 21 Feb 2010 20:53:45 +0000 (20:53 +0000)]
Always emit register class id references as i32 like
DAGISelEmitter does.  This fixes 11 arm failures (8
left).

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

14 years agoadd some no-unwinds, other minor cleanups.
Chris Lattner [Sun, 21 Feb 2010 20:33:20 +0000 (20:33 +0000)]
add some no-unwinds, other minor cleanups.

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

14 years agoIt turned out that we failed to emit proper symbol stubs on non-x86/darwin for ages...
Anton Korobeynikov [Sun, 21 Feb 2010 20:28:15 +0000 (20:28 +0000)]
It turned out that we failed to emit proper symbol stubs on non-x86/darwin for ages (we emitted a reference to a stub, but no stub was emitted). The code inside x86-32/macho target objfile lowering should actually be the generic one - move it there.

This (I really, really hope) should fix EH issues on ppc/darwin
and arm/darwin.

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

14 years agospeculatively teach OPC_CheckValueType and OPC_EmitNode to handle
Chris Lattner [Sun, 21 Feb 2010 20:15:25 +0000 (20:15 +0000)]
speculatively teach OPC_CheckValueType and OPC_EmitNode to handle
MVT::iPTR.

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

14 years agoteach OPC_CheckType to handle MVT::iPTR, down to 2 ppc failures.
Chris Lattner [Sun, 21 Feb 2010 20:10:43 +0000 (20:10 +0000)]
teach OPC_CheckType to handle MVT::iPTR, down to 2 ppc failures.

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

14 years agomake this check a bit more generous, it may be outliving its
Chris Lattner [Sun, 21 Feb 2010 20:02:15 +0000 (20:02 +0000)]
make this check a bit more generous, it may be outliving its
utility.  Down to 6 ppc failures.

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

14 years agoRelax an assertion a bit. We allow replacing things like
Chris Lattner [Sun, 21 Feb 2010 19:35:07 +0000 (19:35 +0000)]
Relax an assertion a bit.  We allow replacing things like
<4 x i32> with <4 x float> values if they end up the same
register class.  This gets us up to 231 passes on the ppc
tests (only 7 fails).

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

14 years agoadd a triple so that this doesn't fail due to linux/ppc register printing
Chris Lattner [Sun, 21 Feb 2010 19:27:38 +0000 (19:27 +0000)]
add a triple so that this doesn't fail due to linux/ppc register printing
syntax.

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

14 years agoSort the patterns before adding them to the FA so that we get the
Chris Lattner [Sun, 21 Feb 2010 19:22:06 +0000 (19:22 +0000)]
Sort the patterns before adding them to the FA so that we get the
least cost matches.  This gets us from 195 -> 208 passes on the ppc codegen tests.

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

14 years agoRemove a bunch of duplicated code, where there was one version taking a std::ostream
Duncan Sands [Sun, 21 Feb 2010 19:15:19 +0000 (19:15 +0000)]
Remove a bunch of duplicated code, where there was one version taking a std::ostream
and another taking a raw_ostream, but otherwise identical.  Use raw_ostream everywhere.

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

14 years agofilecheckize and add nouwinds.
Chris Lattner [Sun, 21 Feb 2010 18:53:28 +0000 (18:53 +0000)]
filecheckize and add nouwinds.

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

14 years agoEnable assertion to detect cyclic valno references.
Jakob Stoklund Olesen [Sun, 21 Feb 2010 18:51:48 +0000 (18:51 +0000)]
Enable assertion to detect cyclic valno references.

This changes the stack overflow in PR6363 to an assertion failure.

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

14 years agoIT turns out that during jumpless setcc lowering eq and ne were swapped.
Anton Korobeynikov [Sun, 21 Feb 2010 12:28:58 +0000 (12:28 +0000)]
IT turns out that during jumpless setcc lowering eq and ne were swapped.
This fixes PR6348

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

14 years agowhen a match fails and we have to rollback, make sure to keep 'N' in
Chris Lattner [Sun, 21 Feb 2010 07:55:48 +0000 (07:55 +0000)]
when a match fails and we have to rollback, make sure to keep 'N' in
sync with the top of stack.  This fixes a bunch of failures on larger
testcases.

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

14 years agohandle optional in flags that aren't present.
Chris Lattner [Sun, 21 Feb 2010 07:19:06 +0000 (07:19 +0000)]
handle optional in flags that aren't present.

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

14 years agoemit table indexes before each row so that it is debuggable.
Chris Lattner [Sun, 21 Feb 2010 07:16:41 +0000 (07:16 +0000)]
emit table indexes before each row so that it is debuggable.

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

14 years agofix two bugs in OPC_EmitRegister, which makes ppc happier.
Chris Lattner [Sun, 21 Feb 2010 06:58:27 +0000 (06:58 +0000)]
fix two bugs in OPC_EmitRegister, which makes ppc happier.

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

14 years agofix a table size miscomputation, target opcodes are 2 bytes.
Chris Lattner [Sun, 21 Feb 2010 06:44:29 +0000 (06:44 +0000)]
fix a table size miscomputation, target opcodes are 2 bytes.
With this, the matcher actually works reasonably well, but
crashes on larger examples in the scheduler.

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

14 years agoemit to the right streams, to avoid emitting the push
Chris Lattner [Sun, 21 Feb 2010 06:30:04 +0000 (06:30 +0000)]
emit to the right streams, to avoid emitting the push
body before the push.

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

14 years agooops don't turn this on for everyone yet.
Chris Lattner [Sun, 21 Feb 2010 06:03:56 +0000 (06:03 +0000)]
oops don't turn this on for everyone yet.

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

14 years agoimplement the last known missing feature: updating uses of results
Chris Lattner [Sun, 21 Feb 2010 06:03:07 +0000 (06:03 +0000)]
implement the last known missing feature: updating uses of results
of the matched pattern to use the newly created node results.  Onto
the "making it actually work" phase!

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

14 years agofix and un-xfail X86/vec_ss_load_fold.ll
Chris Lattner [Sun, 21 Feb 2010 04:53:34 +0000 (04:53 +0000)]
fix and un-xfail X86/vec_ss_load_fold.ll

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

14 years agoUndo r96654. The printing of ARM shift instructions in canonical forms can be
Johnny Chen [Sun, 21 Feb 2010 04:42:01 +0000 (04:42 +0000)]
Undo r96654.  The printing of ARM shift instructions in canonical forms can be
handled in ARMInstPrinter.cpp.

And added PLD/PLDW/PLI (Preload Data/Instruction) for disassembly only.

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

14 years agoReduce size of 'StackAlignment' field from 5 to 3 bits. Seriously, who needs a
Charles Davis [Sun, 21 Feb 2010 04:26:06 +0000 (04:26 +0000)]
Reduce size of 'StackAlignment' field from 5 to 3 bits. Seriously, who needs a
2GB-aligned stack anyway? 256 bytes is plenty. Requested by Chris.

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

14 years agotemporarily disable this.
Chris Lattner [Sun, 21 Feb 2010 03:24:41 +0000 (03:24 +0000)]
temporarily disable this.

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

14 years agoLots of improvements to the new dagisel emitter. This gets it to
Chris Lattner [Sun, 21 Feb 2010 03:22:59 +0000 (03:22 +0000)]
Lots of improvements to the new dagisel emitter.  This gets it to
the point where it is to the 95% feature complete mark, it just
needs result updating to be done (then testing, optimization
etc).

More specificallly, this adds support for chain and flag handling
on the result nodes, support for sdnodexforms, support for variadic
nodes, memrefs, pinned physreg inputs, and probably lots of other
stuff.

In the old DAGISelEmitter, this deletes the dead code related to
OperatorMap, cleans up a variety of dead stuff handling "implicit
remapping" from things like globaladdr -> targetglobaladdr (which
is no longer used because globaladdr always needs to be legalized),
and some minor formatting fixes.

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

14 years agorename SelectScalarSSELoad -> SelectScalarSSELoadXXX and rewrite
Chris Lattner [Sun, 21 Feb 2010 03:17:59 +0000 (03:17 +0000)]
rename SelectScalarSSELoad -> SelectScalarSSELoadXXX and rewrite
it to follow the mode needed by the new isel.  Instead of returning
the input and output chains, it just returns the (currently only one,
which is a silly limitation) node that has input and output chains.

Since we want the old thing to still work, add a new
SelectScalarSSELoad to emulate the old interface.  The XXX suffix
and the wrapper will eventually go away.

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

14 years agoadd a hook so that the new isel can run SDNodeXForms.
Chris Lattner [Sun, 21 Feb 2010 03:15:11 +0000 (03:15 +0000)]
add a hook so that the new isel can run SDNodeXForms.

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

14 years agoEliminate some uses of immAllOnes, just use -1, it does
Chris Lattner [Sun, 21 Feb 2010 03:13:10 +0000 (03:13 +0000)]
Eliminate some uses of immAllOnes, just use -1, it does
the same thing and is more efficient for the matcher.

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

14 years agoEliminate some uses of immAllOnes, just use -1, it does
Chris Lattner [Sun, 21 Feb 2010 03:12:16 +0000 (03:12 +0000)]
Eliminate some uses of immAllOnes, just use -1, it does
the same thing and is more efficient for the matcher.

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

14 years agoTest commit.
Tanya Lattner [Sun, 21 Feb 2010 03:01:05 +0000 (03:01 +0000)]
Test commit.

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

14 years agoTest commit
Tanya Lattner [Sun, 21 Feb 2010 02:59:05 +0000 (02:59 +0000)]
Test commit

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

14 years agoRename getSDiv to getExactSDiv to reflect its behavior in cases where
Dan Gohman [Fri, 19 Feb 2010 19:35:48 +0000 (19:35 +0000)]
Rename getSDiv to getExactSDiv to reflect its behavior in cases where
the division would have a remainder.

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

14 years agoCheck for overflow when scaling up an add or an addrec for
Dan Gohman [Fri, 19 Feb 2010 19:32:49 +0000 (19:32 +0000)]
Check for overflow when scaling up an add or an addrec for
scaled reuse.

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

14 years agoRevert 96634. It causes assertion failures for 126.gcc and 176.gcc in
Bob Wilson [Fri, 19 Feb 2010 18:59:53 +0000 (18:59 +0000)]
Revert 96634.  It causes assertion failures for 126.gcc and 176.gcc in
the armv6 nightly tests.

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

14 years agoAdd a comment.
Dan Gohman [Fri, 19 Feb 2010 18:49:22 +0000 (18:49 +0000)]
Add a comment.

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

14 years agoAdd support for the 'alignstack' attribute to the x86 backend. Fixes PR5254.
Charles Davis [Fri, 19 Feb 2010 18:17:13 +0000 (18:17 +0000)]
Add support for the 'alignstack' attribute to the x86 backend. Fixes PR5254.

Also, FileCheck'ize a test.

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

14 years agoTeach ScalarEvolution how to compute a tripcount for a loop with
Dan Gohman [Fri, 19 Feb 2010 18:12:07 +0000 (18:12 +0000)]
Teach ScalarEvolution how to compute a tripcount for a loop with
true or false as its exit condition. These are usually eliminated by
SimplifyCFG, but the may be left around during a pass which wishes
to preserve the CFG.

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

14 years agoRevert Anton's most recent EH patch (r96637), since it breaks a lot of
Bob Wilson [Fri, 19 Feb 2010 17:10:59 +0000 (17:10 +0000)]
Revert Anton's most recent EH patch (r96637), since it breaks a lot of
ARM and Thumb tests.

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

14 years agoRevert commits 96556 and 96640, because commit 96556 breaks the
Duncan Sands [Fri, 19 Feb 2010 11:30:41 +0000 (11:30 +0000)]
Revert commits 96556 and 96640, because commit 96556 breaks the
dragonegg self-host build.  I reverted 96640 in order to revert
96556 (96640 goes on top of 96556), but it also looks like with
both of them applied the breakage happens even earlier.  The
symptom of the 96556 miscompile is the following crash:

  llvm[3]: Compiling AlphaISelLowering.cpp for Release build
  cc1plus: /home/duncan/tmp/tmp/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:4982: void llvm::SelectionDAG::ReplaceAllUsesWith(llvm::SDNode*, llvm::SDNode*, llvm::SelectionDAG::DAGUpdateListener*): Assertion `(!From->hasAnyUseOfValue(i) || From->getValueType(i) == To->getValueType(i)) && "Cannot use this version of ReplaceAllUsesWith!"' failed.
  Stack dump:
  0. Running pass 'X86 DAG->DAG Instruction Selection' on function '@_ZN4llvm19AlphaTargetLowering14LowerOperationENS_7SDValueERNS_12SelectionDAGE'
  g++: Internal error: Aborted (program cc1plus)

This occurs when building LLVM using LLVM built by LLVM (via
dragonegg).  Probably LLVM has miscompiled itself, though it
may have miscompiled GCC and/or dragonegg itself: at this point
of the self-host build, all of GCC, LLVM and dragonegg were built
using LLVM.  Unfortunately this kind of thing is extremely hard
to debug, and while I did rummage around a bit I didn't find any
smoking guns, aka obviously miscompiled code.

Found by bisection.

r96556 | evancheng | 2010-02-18 03:13:50 +0100 (Thu, 18 Feb 2010) | 5 lines

Some dag combiner goodness:
Transform br (xor (x, y)) -> br (x != y)
Transform br (xor (xor (x,y), 1)) -> br (x == y)
Also normalize (and (X, 1) == / != 1 -> (and (X, 1)) != / == 0 to match to "test on x86" and "tst on arm"

r96640 | evancheng | 2010-02-19 01:34:39 +0100 (Fri, 19 Feb 2010) | 16 lines

Transform (xor (setcc), (setcc)) == / != 1 to
(xor (setcc), (setcc)) != / == 1.

e.g. On x86_64
  %0 = icmp eq i32 %x, 0
  %1 = icmp eq i32 %y, 0
  %2 = xor i1 %1, %0
  br i1 %2, label %bb, label %return
=>
testl   %edi, %edi
sete    %al
testl   %esi, %esi
sete    %cl
cmpb    %al, %cl
je      LBB1_2

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

14 years agoCorrect LastPrimitiveTyID: MetadataType is a primitive type.
Duncan Sands [Fri, 19 Feb 2010 09:18:53 +0000 (09:18 +0000)]
Correct LastPrimitiveTyID: MetadataType is a primitive type.
This change probably has no functional effect.

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

14 years agoadd emitter support for integer constants and simple physreg references.
Chris Lattner [Fri, 19 Feb 2010 07:49:56 +0000 (07:49 +0000)]
add emitter support for integer constants and simple physreg references.

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

14 years agorecommit 96626, evidence that it broke things appears
Dale Johannesen [Fri, 19 Feb 2010 07:14:22 +0000 (07:14 +0000)]
recommit 96626, evidence that it broke things appears
to be spurious

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

14 years agofix this to work more determinstically, patch by Thomas Veith!
Chris Lattner [Fri, 19 Feb 2010 07:02:20 +0000 (07:02 +0000)]
fix this to work more determinstically, patch by Thomas Veith!

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

14 years agoTest case for r96656.
Devang Patel [Fri, 19 Feb 2010 02:58:33 +0000 (02:58 +0000)]
Test case for r96656.

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

14 years agoAdded entries for ASR, LSL, LSR, ROR, and RRX so that the disassembler prints
Johnny Chen [Fri, 19 Feb 2010 02:12:06 +0000 (02:12 +0000)]
Added entries for ASR, LSL, LSR, ROR, and RRX so that the disassembler prints
out the canonical form (A8.6.98) instead of the pseudo-instruction as provided
via MOVs.

DBG_ARM_DISASM=YES llvm-mc -triple=arm-unknown-unknown --disassemble
0xc0 0x00 0xa0 0xe1
Opcode=29 Name=ASR Format=ARM_FORMAT_LDMISCFRM
 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10  9  8  7  6  5  4  3  2  1  0
-------------------------------------------------------------------------------------------------
| 1: 1: 1: 0| 0: 0: 0: 1| 1: 0: 1: 0| 0: 0: 0: 0| 0: 0: 0: 0| 0: 0: 0: 0| 1: 1: 0: 0| 0: 0: 0: 0|
-------------------------------------------------------------------------------------------------

asr r0, r0, #1

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

14 years agoRevert 96626, which causes build failure on ppc Darwin.
Dale Johannesen [Fri, 19 Feb 2010 01:54:37 +0000 (01:54 +0000)]
Revert 96626, which causes build failure on ppc Darwin.

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

14 years agoTransform (xor (setcc), (setcc)) == / != 1 to
Evan Cheng [Fri, 19 Feb 2010 00:34:39 +0000 (00:34 +0000)]
Transform (xor (setcc), (setcc)) == / != 1 to
(xor (setcc), (setcc)) != / == 1.

e.g. On x86_64
  %0 = icmp eq i32 %x, 0
  %1 = icmp eq i32 %y, 0
  %2 = xor i1 %1, %0
  br i1 %2, label %bb, label %return
=>
testl   %edi, %edi
sete    %al
testl   %esi, %esi
sete    %cl
cmpb    %al, %cl
je      LBB1_2

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

14 years agoI confused myself, temporaries will be recorded right along with other inputs.
Chris Lattner [Fri, 19 Feb 2010 00:33:13 +0000 (00:33 +0000)]
I confused myself, temporaries will be recorded right along with other inputs.

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

14 years agoUse the same encoding for EH stuff uniformly on all MachO targets.
Anton Korobeynikov [Fri, 19 Feb 2010 00:29:36 +0000 (00:29 +0000)]
Use the same encoding for EH stuff uniformly on all MachO targets.
This hopefulyl should unbreak EH on PPC/Darwin.

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

14 years agointroduce a new ResultVal and start keeping track of temporary values.
Chris Lattner [Fri, 19 Feb 2010 00:27:40 +0000 (00:27 +0000)]
introduce a new ResultVal and start keeping track of temporary values.

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

14 years agoRadar 7636153. In the presence of large call frames, it's not sufficient
Jim Grosbach [Fri, 19 Feb 2010 00:16:24 +0000 (00:16 +0000)]
Radar 7636153. In the presence of large call frames, it's not sufficient
for ARM to just check if a function has a FP to determine if it's safe
to simplify the stack adjustment pseudo ops prior to eliminating frame
indices. Allow targets to override the default behavior and does so for ARM
and Thumb2.

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

14 years agoWhen determining the set of interesting reuse factors, consider
Dan Gohman [Fri, 19 Feb 2010 00:05:23 +0000 (00:05 +0000)]
When determining the set of interesting reuse factors, consider
strides in foreign loops. This helps locate reuse opportunities
with existing induction variables in foreign loops and reduces
the need for inserting new ones. This fixes rdar://7657764.

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

14 years agoIndvars needs to explicitly notify ScalarEvolution when it is replacing
Dan Gohman [Thu, 18 Feb 2010 23:26:33 +0000 (23:26 +0000)]
Indvars needs to explicitly notify ScalarEvolution when it is replacing
a loop exit value, so that if a loop gets deleted, ScalarEvolution
isn't stick holding on to dangling SCEVAddRecExprs for that loop. This
fixes PR6339.

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

14 years agogetSplatIndex assumes that the first element of the mask contains the splat index
Mon P Wang [Thu, 18 Feb 2010 22:33:18 +0000 (22:33 +0000)]
getSplatIndex assumes that the first element of the mask contains the splat index
which is not always true if the mask contains undefs. Modified it to return
the first non undef value.

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

14 years agoAdded LDRD_PRE/POST & STRD_PRE/POST for disassembly only.
Johnny Chen [Thu, 18 Feb 2010 22:31:18 +0000 (22:31 +0000)]
Added LDRD_PRE/POST & STRD_PRE/POST for disassembly only.

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