Commit Graph

57591 Commits

Author SHA1 Message Date
Chris Lattner
8e946bea14 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
2010-02-21 03:22:59 +00:00
Chris Lattner
a170b5e818 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
2010-02-21 03:17:59 +00:00
Chris Lattner
beff6a3fd0 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
2010-02-21 03:15:11 +00:00
Chris Lattner
d76fe6649c 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
2010-02-21 03:13:10 +00:00
Chris Lattner
9f036412ac 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
2010-02-21 03:12:16 +00:00
Tanya Lattner
0a42c5e5bf Test commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96711 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-21 03:01:05 +00:00
Tanya Lattner
50642b792c Test commit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96710 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-21 02:59:05 +00:00
Dan Gohman
f09b71233b 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
2010-02-19 19:35:48 +00:00
Dan Gohman
aae01f17a6 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
2010-02-19 19:32:49 +00:00
Bob Wilson
1a2e8686f8 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
2010-02-19 18:59:53 +00:00
Dan Gohman
bc02853b89 Add a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96688 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-19 18:49:22 +00:00
Charles Davis
5dfa26795d 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
2010-02-19 18:17:13 +00:00
Dan Gohman
00cb5b7245 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
2010-02-19 18:12:07 +00:00
Bob Wilson
6b89aa57e6 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
2010-02-19 17:10:59 +00:00
Duncan Sands
3eba667081 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
2010-02-19 11:30:41 +00:00
Duncan Sands
d03502318d 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
2010-02-19 09:18:53 +00:00
Chris Lattner
906b4995ee 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
2010-02-19 07:49:56 +00:00
Dale Johannesen
45a2d7d44a 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
2010-02-19 07:14:22 +00:00
Chris Lattner
01a5bee716 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
2010-02-19 07:02:20 +00:00
Devang Patel
7b9d6d2e55 Test case for r96656.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96657 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-19 02:58:33 +00:00
Johnny Chen
8f5e04098f 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
2010-02-19 02:12:06 +00:00
Dale Johannesen
efd9e95051 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
2010-02-19 01:54:37 +00:00
Evan Cheng
97a35fc3a7 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
2010-02-19 00:34:39 +00:00
Chris Lattner
853b919d93 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
2010-02-19 00:33:13 +00:00
Anton Korobeynikov
f0e7c87e56 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
2010-02-19 00:29:36 +00:00
Chris Lattner
c94fa4c759 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
2010-02-19 00:27:40 +00:00
Jim Grosbach
cf43e60544 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
2010-02-19 00:16:24 +00:00
Dan Gohman
1b7bf18def 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
2010-02-19 00:05:23 +00:00
Dan Gohman
aa11defd1c 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
2010-02-18 23:26:33 +00:00
Mon P Wang
1c40e188c5 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
2010-02-18 22:33:18 +00:00
Johnny Chen
39a4bb3527 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
2010-02-18 22:31:18 +00:00
Chris Lattner
845c042734 add support for referencing registers and immediates,
building the tree to represent them but not emitting 
table entries for them yet.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96617 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-18 22:03:03 +00:00
Talin
196c60a571 replaceUsesOfWithOnConstant implementation for unions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96616 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-18 21:43:45 +00:00
Dan Gohman
814f2b2d19 Hoist this loop-invariant logic out of the loop.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96614 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-18 21:34:02 +00:00
Jakob Stoklund Olesen
352d352c02 Always normalize spill weights, also for intervals created by spilling.
Moderate the weight given to very small intervals.

The spill weight given to new intervals created when spilling was not
normalized in the same way as the original spill weights calculated by
CalcSpillWeights. That meant that restored registers would tend to hang around
because they had a much higher spill weight that unspilled registers.

This improves the runtime of a few tests by up to 10%, and there are no
significant regressions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96613 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-18 21:33:05 +00:00
Dan Gohman
49d7f8d341 Make CodePlacementOpt detect special EH control flow by
checking whether AnalyzeBranch disagrees with the CFG
directly, rather than looking for EH_LABEL instructions.
EH_LABEL instructions aren't always at the end of the
block, due to FP_REG_KILL and other things. This fixes
an infinite loop compiling MultiSource/Benchmarks/Bullet.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96611 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-18 21:25:53 +00:00
Devang Patel
0ce7b1255c Fix comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96610 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-18 21:03:36 +00:00
Devang Patel
06fdaccc89 Destroy MDNodes gracefully while deleting llvm context.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96609 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-18 20:53:16 +00:00
Devang Patel
16c1e79cb2 Ignore target dependent value in grep search.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96604 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-18 19:52:12 +00:00
Dale Johannesen
116b799488 Generate DBG_VALUE from dbg.value intrinsics. These currently
comes out as comments but will eventually generate DWARF.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96601 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-18 18:51:15 +00:00
Dan Gohman
e921792509 Clarify that ptrtoint+inttoptr are an alternative to GEP which are
not restricted by the GEP rules.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96598 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-18 18:40:29 +00:00
Dan Gohman
a52eeb93e0 Fix a typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96597 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-18 18:22:41 +00:00
Dan Gohman
48f6a3175a Clarify that the rules about object hopping kick in when a pointer is
deferenced, rather than when the pointer value is computed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96596 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-18 18:22:18 +00:00
Dan Gohman
cf3d08445d Fix typos Duncan noticed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96594 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-18 18:19:17 +00:00
Sanjiv Gupta
7310fe4a69 Remap the call sites of a shared function in interrupt line functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96591 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-18 18:00:35 +00:00
Sanjiv Gupta
d6d9fb503d Re-factoring.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96589 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-18 17:32:25 +00:00
Duncan Sands
18619b2aeb Uniformize the way these options are printed. Requested by
Russell Wallace.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96580 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-18 14:37:52 +00:00
Duncan Sands
1aecd15bd1 Remove terminating dot in description. Inconsistency pointed
out by Russell Wallace.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96579 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-18 14:10:41 +00:00
Duncan Sands
7e7ae5ad69 Refer to -help instead of --help since this is what tools themselves say.
Also, have tools output -help-hidden rather than refer to --help-hidden,
for consistency, and likewise adjust documentation.  This doesn't change
every mention of --help, only those which seemed clearly safe.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96578 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-18 14:08:13 +00:00
Benjamin Kramer
3460f221cd Avoid a dangling pointer dereference, PassManager::add can delete the Pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96576 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-18 12:57:05 +00:00