Commit Graph

11432 Commits

Author SHA1 Message Date
Chris Lattner
24edbb7a6c Fix the trunc(load) case, finally allowing crafty and povray to pass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23718 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-13 22:10:05 +00:00
Chris Lattner
f98840531a Fix some bugs in (sext (load x))
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23717 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-13 21:52:31 +00:00
Chris Lattner
9ad8481cfb When ExpandOp'ing a [SZ]EXTLOAD, make sure to remember that the chain
is also legal.  Add support for ExpandOp'ing raw EXTLOADs too.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23716 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-13 21:44:47 +00:00
Chris Lattner
4c8f8f0481 Implement PromoteOp for *EXTLOAD, allowing MallocBench/gs to Legalize
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23715 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-13 20:07:41 +00:00
Nate Begeman
bfd65a05c9 Fix the remaining DAGCombiner issues pointed out by sabre. This should fix
the remainder of the failures introduced by my patch last night.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23714 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-13 18:34:58 +00:00
Chris Lattner
67a44cd3aa Fix a minor bug in the dag combiner that broke pcompress2 and some other
tests.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23713 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-13 18:16:34 +00:00
Nate Begeman
144ff660e6 Add support to Legalize for expanding i64 sextload/zextload into hi and lo
parts. This should fix the crafty and signed long long unit test failure
on x86 last night.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23711 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-13 17:15:37 +00:00
Jim Laskey
53c523c00e Inhibit instructions from being pushed before function calls. This will
minimize unnecessary spilling.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23710 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-13 16:44:00 +00:00
Nate Begeman
ded4963ab9 Move some Legalize functionality over to the DAGCombiner where it belongs.
Kill some dead code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23706 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-13 03:11:28 +00:00
Nate Begeman
765784ad76 Fix a potential bug with two combine-to's back to back that chris pointed
out, where after the first CombineTo() call, the node the second CombineTo
wishes to replace may no longer exist.

Fix a very real bug with the truncated load optimization on little endian
targets, which do not need a byte offset added to the load.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23704 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-12 23:18:53 +00:00
Nate Begeman
3df4d525c5 More cool stuff for the dag combiner. We can now finally handle things
like turning:

_foo:
        fctiwz f0, f1
        stfd f0, -8(r1)
        lwz r2, -4(r1)
        rlwinm r3, r2, 0, 16, 31
        blr

into
_foo:
        fctiwz f0,f1
        stfd f0,-8(r1)
        lhz r3,-2(r1)
        blr

Also removed an unncessary constraint from sra -> srl conversion, which
should take care of hte only reason we would ever need to handle sra in
MaskedValueIsZero, AFAIK.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23703 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-12 20:40:40 +00:00
Jim Laskey
fab66f6900 Finally committing to the new scheduler. Still -sched=none by default.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23702 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-12 18:29:35 +00:00
Jim Laskey
851a22db2b Added graphviz/gv support for MF.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23700 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-12 12:09:05 +00:00
Chris Lattner
d6155e96f7 Fix (hopefully the last) issue where LSR is nondeterminstic. When pulling
out CSE's of base expressions it could build a result whose order was
nondet.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23698 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-11 18:41:04 +00:00
Chris Lattner
7b445c521b Fix another problem where LSR was being nondeterminstic. Also remove elements
from the end of a vector instead of the beginning


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23697 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-11 18:30:57 +00:00
Chris Lattner
b4dd1b86fa Fix another lsr-is-nondeterministic case
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23695 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-11 18:17:57 +00:00
Chris Lattner
a179ab3016 Fix a powerpc crash on CodeGen/Generic/llvm-ct-intrinsics.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23694 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-11 17:56:34 +00:00
Chris Lattner
05b57433e6 Add a canonicalization that got lost, fixing PowerPC/fold-li.ll:SUB
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23693 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-11 06:07:15 +00:00
Chris Lattner
04ecf6d65f clean up some corner cases
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23692 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-10 23:00:08 +00:00
Chris Lattner
87514ca04c Implement trivial DSE. If two stores are neighbors and store to the same
location, replace them with a new store of the last value.  This occurs
in the same neighborhood in 197.parser, speeding it up about 1.5%


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23691 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-10 22:31:19 +00:00
Chris Lattner
01a2202138 Add support for CombineTo, allowing the dag combiner to replace nodes with
multiple results.

Use this support to implement trivial store->load forwarding, implementing
CodeGen/PowerPC/store-load-fwd.ll.  Though this is the most simple case and
can be extended in the future, it is still useful.  For example, it speeds
up 197.parser by 6.2% by avoiding an LSU reject in xalloc:

        stw r6, lo16(l5_end_of_array)(r2)
        addi r2, r5, -4
        stwx r5, r4, r2
-       lwzx r5, r4, r2
-       rlwinm r5, r5, 0, 0, 30
        stwx r5, r4, r2
        lwz r2, -4(r4)
        ori r2, r2, 1


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23690 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-10 22:04:48 +00:00
Nate Begeman
07ed417df2 Teach the DAGCombiner several new tricks, teaching it how to turn
sext_inreg into zext_inreg based on the signbit (fires a lot), srem into
urem, etc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23688 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-10 21:26:48 +00:00
Chris Lattner
d739075cbb Fix comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23686 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-10 16:52:03 +00:00
Chris Lattner
bba9aa3475 Add ISD::ADD to MaskedValueIsZero
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23685 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-10 16:51:40 +00:00
Chris Lattner
3892560680 This function is now dead
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23684 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-10 16:49:22 +00:00
Chris Lattner
af21d55aee Enable Nate's excellent DAG combiner work by default. This allows the
removal of a bunch of ad-hoc and crufty code from SelectionDAG.cpp.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23682 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-10 16:47:10 +00:00
Chris Lattner
7b1fe15de0 These definitions have been moved to common code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23681 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-10 06:01:00 +00:00
Chris Lattner
17f2cf05b3 Pull DAG ISel generation nodes out of the PowerPC backend to where they
can be used by other targets.  For those targets that want to use it,
have at.  :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23680 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-10 06:00:30 +00:00
Chris Lattner
a19cea061e add a todo for something I noticed
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23679 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-09 22:59:08 +00:00
Chris Lattner
ee899e6bfc (X & Y) & C == 0 if either X&C or Y&C are zero
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23678 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-09 22:12:36 +00:00
Chris Lattner
5fb0deb43a Make MaskedValueIsZero a bit more aggressive
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23677 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-09 22:08:50 +00:00
Andrew Lenharth
fa08fb2c78 This seems useful from the original patch that added the function. If there is a reason it is not useful on a RISC type target, let me know and I will pull it out
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23676 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-09 20:11:35 +00:00
Chris Lattner
60de63d0b6 Fix funky xcode indentation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23674 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-09 06:36:35 +00:00
Chris Lattner
a18af06360 Hrm, you didn't see this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23673 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-09 06:24:02 +00:00
Chris Lattner
7305ae28df Fix a source of non-determinism in the backend: the order of processing
IV strides dependend on the pointer order of the strides in memory.
Non-determinism is bad.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23672 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-09 06:20:55 +00:00
Chris Lattner
089c25ccb3 When emiting a CopyFromReg and the source is already a vreg, do not bother
creating a new vreg and inserting a copy: just use the input vreg directly.

This speeds up the compile (e.g. about 5% on mesa with a debug build of llc)
by not adding a bunch of copies and vregs to be coallesced away.  On mesa,
for example, this reduces the number of intervals from 168601 to 129040
going into the coallescer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23671 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-09 05:58:56 +00:00
Chris Lattner
65a419a104 Disable formation of rlwinm instructions from SRA bases. This fixes
the 177.mesa failure from last night, and fixes the
CodeGen/PowerPC/2005-10-08-ArithmeticRotate.ll regression test I added.
If this code cannot be fixed, it should be removed for good, but I'll leave
it to Nate to decide its fate.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23670 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-09 05:36:17 +00:00
Nate Begeman
7d47a61496 Remove another unused file. Preparing for the great "enable i64 on ppc32"
merge, and using subtarget info for ptr size.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23668 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-08 01:32:34 +00:00
Nate Begeman
02f77d1e83 Remove a file that is no longer used
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23666 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-08 01:21:27 +00:00
Nate Begeman
f845b4563a Lo and behold, the last bits of SelectionDAG.cpp have been moved over.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23665 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-08 00:29:44 +00:00
Chris Lattner
cf01a70550 When preselecting, favor things that have low depth to select first. This
is faster and uses less stack space.  This reduces our stack requirement
enough to compile sixtrack, and though it's a hack, should be enough until
we switch to iterative isel


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23664 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-07 22:10:27 +00:00
Chris Lattner
9a9719eea1 remove debugging code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23663 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-07 15:31:26 +00:00
Chris Lattner
c4ced268d8 implement CodeGen/PowerPC/div-2.ll:test2-4 by propagating zero bits through
C-X's


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23662 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-07 15:30:32 +00:00
Chris Lattner
6c4dad0b8b fix indentation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23660 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-07 06:37:02 +00:00
Chris Lattner
094c8fcd14 Turn sdivs into udivs when we can prove the sign bits are clear. This
implements CodeGen/PowerPC/div-2.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23659 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-07 06:10:46 +00:00
Jeff Cohen
68d98e0bdc Remove useless variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23656 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-07 05:28:29 +00:00
Chris Lattner
71abaab1d2 add a hack to work around broken VC++ scoping rules. Thx to JeffC for pointing
this out to me


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23655 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-07 05:23:36 +00:00
Chris Lattner
eb5d47d99d Fix a CQ regression from my patch to split F32/F64 into seperate register
classes on PPC.  We were emitting fmr instructions to do fp extensions, which
weren't getting coallesced.  This fixes Regression/CodeGen/PowerPC/fpcopy.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23654 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-07 05:00:52 +00:00
Chris Lattner
7a7c979ddd Fix CodeGen/Generic/bool-to-double.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23652 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-07 04:50:48 +00:00
Chris Lattner
6a16f6a14f Pull out Call, reducing stack frame size from 6032 bytes to 5184 bytes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23650 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-06 19:07:45 +00:00
Chris Lattner
222adac30a Pull out setcc, this reduces stack frame size from 7520 to 6032 bytes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23649 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-06 19:03:35 +00:00
Chris Lattner
2b63e4c5e2 Pull two more methods out, reducing stack frame size from 8224 -> 7520 bytes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23648 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-06 18:56:10 +00:00
Chris Lattner
bd937b98f4 Add a recursive-iterative hybrid stage to attempt to reduce stack space, this
helps but not enough.

Start pulling cases out of PPC32DAGToDAGISel::Select.  With GCC 4, this function
required 8512 bytes of stack space for each invocation (GCC 3 required less
than 700 bytes).  Pulling this first function out gets us down to 8224.  More
to come :(


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23647 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-06 18:45:51 +00:00
Chris Lattner
cf5c79b34f silence a bogus GCC warning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23646 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-06 17:39:10 +00:00
Chris Lattner
8a61a7524a Fix the LLC regressions on X86 last night. In particular, when undoing
previous copy elisions and we discover we need to reload a register, make
sure to use the regclass of the original register for the reload, not the
class of the current register.  This avoid using 16-bit loads to reload 32-bit
values.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23645 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-06 17:19:06 +00:00
Andrew Lenharth
f3fb71bfd7 This is suppose to work now
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23644 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-06 16:54:29 +00:00
Andrew Lenharth
d5613debf9 remove VAX compatibility instruction, we will never use this
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23643 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-06 16:53:32 +00:00
Chris Lattner
32fca00a23 Make the legalizer completely non-recursive
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23642 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-06 01:20:27 +00:00
Nate Begeman
0558f61b0c Let the combiner handle more cases
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23641 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-05 21:44:43 +00:00
Nate Begeman
829cb81806 Remove some bad code from Legalize
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23640 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-05 21:44:10 +00:00
Nate Begeman
e17daebb30 Check in some more DAGCombiner pieces
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23639 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-05 21:43:42 +00:00
Chris Lattner
22480c4350 Fix a bug in the local spiller, where we could take code like this:
store r12 -> [ss#2]
  R3 = load [ss#1]
  use R3
  R3 = load [ss#2]
  R4 = load [ss#1]

and turn it into this code:

  store R12 -> [ss#2]
  R3 = load [ss#1]
  use R3
  R3 = R12
  R4 = R3    <- oops!

The problem was that promoting R3 = load[ss#2] to a copy missed the fact that
the instruction invalidated R3 at that point.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23638 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-05 18:30:19 +00:00
Chris Lattner
f5c6e6b745 silence some warnings
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23637 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-05 17:15:09 +00:00
Chris Lattner
3ea0b47f81 implement visitBR_CC so that PowerPC/inverted-bool-compares.ll passes
with the dag combiner.  This speeds up espresso by 8%, reaching performance
parity with the dag-combiner-disabled llc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23636 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-05 06:47:48 +00:00
Chris Lattner
ad13715ed4 fix some pastos
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23635 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-05 06:37:22 +00:00
Chris Lattner
9503859c54 Add a new HandleNode class, which is used to handle (haha) cases in the
dead node elim and dag combiner passes where the root is potentially updated.
This fixes a fixme in the dag combiner.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23634 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-05 06:35:28 +00:00
Chris Lattner
5c46f74ec7 Implement the code for PowerPC/inverted-bool-compares.ll, even though it
that testcase still does not pass with the dag combiner.  This is because
not all forms of br* are folded yet.

Also, when we combine a node into another one, delete the node immediately
instead of waiting for the node to potentially come up in the future.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23632 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-05 06:11:08 +00:00
Chris Lattner
d48050aa15 make sure that -view-isel-dags is the input to the isel, not the input to
the second phase of dag combining


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23631 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-05 06:09:10 +00:00
Chris Lattner
91559026d3 Fix a crash compiling Olden/tsp
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23630 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-05 04:45:43 +00:00
Chris Lattner
a1e3f54396 refactor a bit of code.
When moving constant entries in 'Map' if the entry is the representative
constant for the abstractypemap, make sure to update it as well.  This
fixes the bcreader failures from last night on several C++ apps.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23628 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-04 21:35:50 +00:00
Chris Lattner
23ec01fcc3 Minor speedup to avoid array searches given a Use*. This speeds up bc reading
of the python test from 1:00 to 54s.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23627 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-04 18:47:09 +00:00
Chris Lattner
d0ff1adbdb Change the signature of replaceUsesOfWithOnConstant. The bool was always
true dynamically.  Finally, pass the Use* that replaceAllUsesWith has into
the method for future use.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23626 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-04 18:13:04 +00:00
Chris Lattner
a55b30a225 For large constants (e.g. arrays and structs with many elements) just
creating the keys and doing comparisons to index into 'Map' takes a lot
of time.  For these large constants, keep an inverse map so that 'remove'
and move operations are much faster.

This speeds up a release build of the bc reader on Eric's nasty python
bytecode file from 1:39 to 1:00s.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23624 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-04 17:48:46 +00:00
Chris Lattner
d7a3fc6819 minor cleanup/fastpath for the bcreader. This speeds up the bcreader
from 1:41 -> 1:39 on the large python .bc file in a release build.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23623 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-04 16:52:46 +00:00
Jim Laskey
9d528dc2b4 Reverting to version - until problem isolated.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23622 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-04 16:41:51 +00:00
Chris Lattner
ccc8ed7bb5 Add a forward def
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23621 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-04 05:09:20 +00:00
Nate Begeman
1aa1972c63 Fix some faulty logic in the libcall inserter.
Since calls return more than one value, don't bail if one of their uses
happens to be a node that's not an MVT::Other when following the chain
from CALLSEQ_START to CALLSEQ_END.

Once we've found a CALLSEQ_START, we can just return; there's no need to
tail-recurse further up the graph.

Most importantly, just because something only has one use doesn't mean we
should use it's one use to follow from start to end.  This faulty logic
caused us to follow a chain of one-use FP operations back to a much earlier
call, putting a cycle in the graph from a later start to an earlier end.

This is a better fix that reverting to the workaround committed earlier
today.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23620 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-04 02:10:55 +00:00
Chris Lattner
c182a88aec implement the struct version of the array speedup, speeding up the
testcase a bit more from 1:48 -> 1.40.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23619 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-04 01:17:50 +00:00
Chris Lattner
ab55698349 Fix DemoteRegToStack on an invoke. This fixes PR634.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23618 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-04 00:44:01 +00:00
Nate Begeman
27d404ccd1 Add back a workaround that fixes some breakages from chris's last change.
Neither of us have yet figured out why this code is necessary, but stuff
breaks if its not there.  Still tracking this down...


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23617 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-04 00:37:37 +00:00
Chris Lattner
7a66e686fe Clean up the code a bit. Use isInstructionTriviallyDead to be more aggressive
and more correct than use_empty().  This fixes PR635 and
SimplifyCFG/2005-10-02-InvokeSimplify.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23616 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-03 23:43:43 +00:00
Chris Lattner
cea141f1d1 Change ConstantArray::replaceUsesOfWithOnConstant to attempt to update
constant arrays in place instead of reallocating them and replaceAllUsesOf'ing
the result.  This speeds up a release build of the bcreader from:

136.987u 120.866s 4:24.38
to
49.790u 49.890s 1:40.14

... a 2.6x speedup parsing a large python bc file.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23614 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-03 22:51:37 +00:00
Chris Lattner
5cbade9f83 move some methods, no other changes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23613 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-03 21:58:36 +00:00
Chris Lattner
dfdd6c5d7a minor microoptimizations
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23612 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-03 21:56:24 +00:00
Chris Lattner
eebac5fee6 Use a map to cache the ModuleType information, so we can do logarithmic
lookups instead of linear time lookups.  This speeds up bc parsing of a
large file from

137.834u 118.256s 4:27.96
to
132.611u 114.436s 4:08.53

with a release build.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23611 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-03 21:26:53 +00:00
Jim Laskey
8ba732bb1c Refactor gathering node info and emission.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23610 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-03 12:30:32 +00:00
Chris Lattner
6db0756f02 clean up this code a bit, no functionality change
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23609 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-03 07:22:07 +00:00
Chris Lattner
8ca02914e5 Speed up the asm printer a lot by not printing formatted LLVM asm output
for globals


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23608 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-03 07:08:36 +00:00
Chris Lattner
53a79aaae9 Break the body of the loop out into a new method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23606 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-03 04:47:08 +00:00
Chris Lattner
5e8ca66914 Make IVUseShouldUsePostIncValue more aggressive when the use is a PHI. In
particular, it should realize that phi's use their values in the pred block
not the phi block itself.  This change turns our em3d loop from this:

_test:
        cmpwi cr0, r4, 0
        bgt cr0, LBB_test_2     ; entry.no_exit_crit_edge
LBB_test_1:     ; entry.loopexit_crit_edge
        li r2, 0
        b LBB_test_6    ; loopexit
LBB_test_2:     ; entry.no_exit_crit_edge
        li r6, 0
LBB_test_3:     ; no_exit
        or r2, r6, r6
        lwz r6, 0(r3)
        cmpw cr0, r6, r5
        beq cr0, LBB_test_6     ; loopexit
LBB_test_4:     ; endif
        addi r3, r3, 4
        addi r6, r2, 1
        cmpw cr0, r6, r4
        blt cr0, LBB_test_3     ; no_exit
LBB_test_5:     ; endif.loopexit.loopexit_crit_edge
        addi r3, r2, 1
        blr
LBB_test_6:     ; loopexit
        or r3, r2, r2
        blr

into:

_test:
        cmpwi cr0, r4, 0
        bgt cr0, LBB_test_2     ; entry.no_exit_crit_edge
LBB_test_1:     ; entry.loopexit_crit_edge
        li r2, 0
        b LBB_test_5    ; loopexit
LBB_test_2:     ; entry.no_exit_crit_edge
        li r6, 0
LBB_test_3:     ; no_exit
        lwz r2, 0(r3)
        cmpw cr0, r2, r5
        or r2, r6, r6
        beq cr0, LBB_test_5     ; loopexit
LBB_test_4:     ; endif
        addi r3, r3, 4
        addi r6, r6, 1
        cmpw cr0, r6, r4
        or r2, r6, r6
        blt cr0, LBB_test_3     ; no_exit
LBB_test_5:     ; loopexit
        or r3, r2, r2
        blr


Unfortunately, this is actually worse code, because the register coallescer
is getting confused somehow.  If it were doing its job right, it could turn the
code into this:

_test:
        cmpwi cr0, r4, 0
        bgt cr0, LBB_test_2     ; entry.no_exit_crit_edge
LBB_test_1:     ; entry.loopexit_crit_edge
        li r6, 0
        b LBB_test_5    ; loopexit
LBB_test_2:     ; entry.no_exit_crit_edge
        li r6, 0
LBB_test_3:     ; no_exit
        lwz r2, 0(r3)
        cmpw cr0, r2, r5
        beq cr0, LBB_test_5     ; loopexit
LBB_test_4:     ; endif
        addi r3, r3, 4
        addi r6, r6, 1
        cmpw cr0, r6, r4
        blt cr0, LBB_test_3     ; no_exit
LBB_test_5:     ; loopexit
        or r3, r6, r6
        blr

... which I'll work on next. :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23604 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-03 02:50:05 +00:00
Chris Lattner
0ae33eb243 Refactor some code into a function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23603 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-03 01:04:44 +00:00
Chris Lattner
1902ff4d82 This break is bogus and I have no idea why it was there. Basically it prevents
memoizing code when IV's are used by phinodes outside of loops.  In a simple
example, we were getting this code before (note that r6 and r7 are isomorphic
IV's):

        li r6, 0
        or r7, r6, r6
LBB_test_3:     ; no_exit
        lwz r2, 0(r3)
        cmpw cr0, r2, r5
        or r2, r7, r7
        beq cr0, LBB_test_5     ; loopexit
LBB_test_4:     ; endif
        addi r2, r7, 1
        addi r7, r7, 1
        addi r3, r3, 4
        addi r6, r6, 1
        cmpw cr0, r6, r4
        blt cr0, LBB_test_3     ; no_exit

Now we get:

        li r6, 0
LBB_test_3:     ; no_exit
        or r2, r6, r6
        lwz r6, 0(r3)
        cmpw cr0, r6, r5
        beq cr0, LBB_test_6     ; loopexit
LBB_test_4:     ; endif
        addi r3, r3, 4
        addi r6, r2, 1
        cmpw cr0, r6, r4
        blt cr0, LBB_test_3     ; no_exit

this was noticed in em3d.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23602 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-03 00:37:33 +00:00
Chris Lattner
37edbf0b21 when checking if we should move a split edge block outside of a loop,
check the presplit pred, not the post-split pred.  This was causing us
to make the wrong decision in some cases, leaving the critical edge block
in the loop.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23601 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-03 00:31:52 +00:00
Chris Lattner
ab510a76d6 Fix a problem where the legalizer would run out of stack space on extremely
large basic blocks because it was purely recursive.  This switches it to an
iterative/recursive hybrid.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23596 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-02 17:49:46 +00:00
Chris Lattner
dcd5abc70c silence a bogus warning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23595 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-02 16:30:51 +00:00
Chris Lattner
3cf8760dc5 silence some warnings
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23594 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-02 16:29:36 +00:00
Chris Lattner
123557fcf0 silence a warning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23593 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-02 16:27:59 +00:00
Chris Lattner
dff06f4348 add patterns for float binops and fma ops
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23592 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-02 07:46:28 +00:00
Chris Lattner
080a4b1637 Sort the cpu and features table, so that the alpha backend doesn't fail EVERY
compile with an assertion that the tables are not sorted!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23591 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-02 07:13:52 +00:00
Chris Lattner
a3638c0f1f Add assertions to the trivial scheduler to check that the value types match
up between defs and uses.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23590 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-02 07:10:55 +00:00
Chris Lattner
43f07a4bbc another solution to the fsel issue. Instead of having 4 variants, just force
the comparison to be 64-bits.  This is fine because extensions from float
to double are free.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23589 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-02 07:07:49 +00:00
Chris Lattner
867940d1b7 fsel can take a different FP type for the comparison and for the result. As such
split the FSEL family into 4 things instead of just two.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23588 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-02 06:58:23 +00:00
Chris Lattner
7c0d664c21 fix an f32/f64 type mismatch
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23587 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-02 06:37:13 +00:00
Chris Lattner
14765be0bc Codegen CopyFromReg using the regclass that matches the valuetype of the
destination vreg.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23586 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-02 06:34:16 +00:00
Chris Lattner
a916dd8888 Adjust to change in ctor
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23585 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-02 06:23:51 +00:00
Chris Lattner
ca0a4778a8 Minor tweak to the branch selector. When emitting a two-way branch, and if
we're in a single-mbb loop, make sure to emit the backwards branch as the
conditional branch instead of the uncond branch.  For example, emit this:

LBBl29_z__44:
        stw r9, 0(r15)
        stw r9, 4(r15)
        stw r9, 8(r15)
        stw r9, 12(r15)
        addi r15, r15, 16
        addi r8, r8, 1
        cmpw cr0, r8, r28
        ble cr0, LBBl29_z__44
        b LBBl29_z__48                   *** NOT PART OF LOOP

Instead of:

LBBl29_z__44:
        stw r9, 0(r15)
        stw r9, 4(r15)
        stw r9, 8(r15)
        stw r9, 12(r15)
        addi r15, r15, 16
        addi r8, r8, 1
        cmpw cr0, r8, r28
        bgt cr0, LBBl29_z__48            *** PART OF LOOP!
        b LBBl29_z__44

The former sequence has one fewer dispatch group for the loop body.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23582 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-01 23:06:26 +00:00
Chris Lattner
b91956e7f8 like the comment says, enable this
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23581 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-01 23:02:40 +00:00
Chris Lattner
505277a7f5 Add some very paranoid checking for operand/result reg class matchup
For instructions that define multiple results, use the right regclass
to define the result, not always the rc of result #0


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23580 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-01 07:45:09 +00:00
Jeff Cohen
2aeaf4e839 Fix VC++ warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23579 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-01 03:57:14 +00:00
Chris Lattner
2c1760f636 fix typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23578 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-01 02:51:36 +00:00
Chris Lattner
919c032fa4 Modify the ppc backend to use two register classes for FP: F8RC and F4RC.
These are used to represent float and double values, and the two regclasses
contain the same physical registers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23577 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-01 01:35:02 +00:00
Chris Lattner
37345fe3cd add a method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23575 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-01 00:17:07 +00:00
Jim Laskey
22f6212e9f typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23574 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-01 00:08:23 +00:00
Jim Laskey
41755e2c7e 1. Simplify the gathering of node groups.
2. Printing node groups when displaying nodes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23573 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-01 00:03:07 +00:00
Jim Laskey
242f2557cc Should be using flag and not chain.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23572 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-30 23:43:37 +00:00
Nate Begeman
2b5e66fc6e Remove some now-dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23571 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-30 21:28:27 +00:00
Andrew Lenharth
ac35cd207f subtarget support for CIX and FIX extentions (the only 2 I care about right now)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23569 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-30 20:24:38 +00:00
Jim Laskey
b6d4c2cf2d 1. Made things node-centric (from operand).
2. Added node groups to handle flagged nodes.

3. Started weaning simple scheduling off existing emitter.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23566 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-30 19:15:27 +00:00
Chris Lattner
0f21fd5204 Rename MRegisterDesc -> TargetRegisterDesc for consistency
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23564 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-30 17:49:27 +00:00
Chris Lattner
863914feb5 trim down the target info structs now that we have a preferred spill register class for each callee save register
Why is V9 maintaining these tables manually? ugh!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23561 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-30 17:38:36 +00:00
Chris Lattner
8fb040e584 now that we have a reg class to spill with, get this info from the regclass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23559 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-30 17:19:22 +00:00
Chris Lattner
5802be13e0 constant fold these calls
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23558 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-30 17:16:59 +00:00
Chris Lattner
56bcae0de9 simplify this code using the new regclass info passed in
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23557 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-30 17:12:38 +00:00
Chris Lattner
80a4f169b4 Now that we have getCalleeSaveRegClasses() info, use it to pass the register
class into the spill/reload methods.  Targets can now rely on that argument.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23556 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-30 16:59:07 +00:00
Chris Lattner
e4047188e7 stub out a virtual method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23554 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-30 06:55:18 +00:00
Chris Lattner
d174fe0ec3 CR registers are not used by this "target"
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23552 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-30 06:43:58 +00:00
Chris Lattner
0a37960d32 these registers don't belong to any register classes, so don't mark them
as callee save.  They can never be generated by the compiler.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23551 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-30 06:42:24 +00:00
Chris Lattner
ef242b1ccc Now that self referential classes are supported, get rid of a work-around.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23544 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-30 04:13:23 +00:00
Chris Lattner
b48d2cf5eb pass extra args
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23539 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-30 01:31:52 +00:00
Chris Lattner
0ffb1a56ff these methods get extra args
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23538 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-30 01:30:55 +00:00
Chris Lattner
97d5e6461a Pass extra regclasses into spilling code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23537 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-30 01:29:42 +00:00
Chris Lattner
bf9716b9c4 Change this code ot pass register classes into the stack slot spiller/reloader
code.  PrologEpilogInserter hasn't been updated yet though, so targets cannot
use this info.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23536 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-30 01:29:00 +00:00
Chris Lattner
ff201eebea Use the 32-bit version for now
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23534 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-30 00:05:05 +00:00
Chris Lattner
67ab118a6d Add a bunch of patterns for F64 FP ops, add some more integer ops
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23533 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-29 23:34:24 +00:00
Chris Lattner
237733e933 Remove code for patterns that are autogenerated
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23532 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-29 23:33:31 +00:00
Andrew Lenharth
120ab480ab begining alpha subtarget support
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23531 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-29 22:54:56 +00:00
Chris Lattner
c7a37a52cd tblgen autogens this pattern now
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23530 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-29 22:37:24 +00:00
Andrew Lenharth
68fd4866de copy and paste error
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23528 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-29 21:11:57 +00:00
Chris Lattner
221e53caea now that tblgen is smarter, this pattern is not needed. Also, tblgen
now inverts commuted versions of ANDC/ORC with the current .td file.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23527 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-29 19:29:15 +00:00
Chris Lattner
93e50ce04c Insert stores after phi nodes in the normal dest. This fixes
LowerInvoke/2005-08-03-InvokeWithPHI.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23525 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-29 17:44:20 +00:00
Chris Lattner
52897f827e consistency with other cases, no functionality change
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23524 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-29 17:38:52 +00:00
Chris Lattner
f13befb456 Make the JIT default to the DAG isel instead of the pattern isel, like LLC.
The Pattern isel has some strange memory corruption issues going on. :(

This should have been converted over anyway, but it got forgotten somehow
when switching to the dag isel.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23523 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-29 17:31:03 +00:00
Chris Lattner
473a99073c Fix two bugs in my patch earlier today that broke int->fp conversion on X86.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23522 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-29 06:44:39 +00:00
Chris Lattner
a48bc53cad Fold isascii into a simple comparison. This speeds up 197.parser by 7.4%,
bringing the LLC time down to the CBE time.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23521 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-29 06:17:27 +00:00
Chris Lattner
e9b6242780 remove a bunch of unneeded stuff, or self evident comments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23519 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-29 06:16:11 +00:00
Chris Lattner
c330069e20 Implement a couple of memcmp folds from the todo list
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23517 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-29 04:54:20 +00:00
Jeff Cohen
fef80f43e0 Silence VC++ redeclaration warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23516 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-29 01:59:49 +00:00
Chris Lattner
d3d2cf52bb Never rely on ReplaceAllUsesWith when selecting, use CodeGenMap instead.
ReplaceAllUsesWith does not replace scalars SDOperand floating around on
the stack, permitting things to be selected multiple times.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23515 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-29 00:59:32 +00:00
Chris Lattner
79d0e9f3d1 Codegen ADD X, IMM -> addis/addi if needed.
This implements PowerPC/fold-li.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23514 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-28 23:07:13 +00:00
Chris Lattner
d8ead9e250 Autogen MUL, move FP cases together
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23512 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-28 22:53:16 +00:00
Chris Lattner
88add100b3 disentangle FP from INT versions of div/mul
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23511 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-28 22:50:24 +00:00
Chris Lattner
4a7de219b4 Use the autogenerated matcher for ADD/SUB
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23510 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-28 22:47:28 +00:00
Chris Lattner
e025574370 add a patter for SUBFIC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23509 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-28 22:47:06 +00:00
Chris Lattner
0648ccf1e9 Mark int binops as int-only, add FP binops. Mark FADD/FMUL as commutative but
not associative.  Add [SU]REM.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23508 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-28 22:38:27 +00:00
Chris Lattner
bed21de39b wrap a long line
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23507 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-28 22:30:58 +00:00
Chris Lattner
615c2d0920 Add FP versions of the binary operators, keeping the int and fp worlds seperate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23506 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-28 22:29:58 +00:00
Chris Lattner
3e2bafd640 Add FP versions of the binary operators, keeping the int and fp worlds seperate.
Though I have done extensive testing, it is possible that this will break
things in configs I can't test.  Please let me know if this causes a problem
and I'll fix it ASAP.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23505 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-28 22:29:17 +00:00
Chris Lattner
01b3d73c20 Add FP versions of the binary operators, keeping the int and fp worlds seperate.
Though I have done extensive testing, it is possible that this will break
things in configs I can't test.  Please let me know if this causes a problem
and I'll fix it ASAP.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23504 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-28 22:28:18 +00:00
Chris Lattner
a5cac6f6eb Mark associative nodes as associative
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23503 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-28 20:58:39 +00:00
Chris Lattner
645992f595 Nate pointed out that mulh[us] are commutative as well. Thanks!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23500 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-28 19:01:44 +00:00
Chris Lattner
6bcf1b7eed expose commutativity information
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23498 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-28 18:27:58 +00:00
Chris Lattner
393e138f60 All (xor *) cases are autogenerated now
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23497 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-28 18:12:37 +00:00
Chris Lattner
cfc828a3d0 add support for missed eqv tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23496 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-28 18:10:51 +00:00
Chris Lattner
1bd8b7b06e Implement PowerPC/eqv-andc-orc-nor.ll:EQV3
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23494 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-28 18:04:52 +00:00
Chris Lattner
91da8623be learn to codegen not as NOR instead of xoris/xori
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23490 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-28 17:13:15 +00:00
Chris Lattner
d135fa4fd6 These nodes are all autogenerated
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23489 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-28 17:07:09 +00:00
Chris Lattner
32643d8e05 Constant fold llvm.sqrt
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23487 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-28 01:34:32 +00:00
Chris Lattner
5b3c70263b add a note about a way to improve this code further, that I won't be getting
to right now.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23485 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-27 22:44:59 +00:00
Chris Lattner
9a5582f251 Fix a regression in my previous patch, fixing GlobalOpt/2005-09-27-Crash.ll
and PR632.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23484 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-27 22:28:11 +00:00
Chris Lattner
d145a61f8f Darwin, like many BSD systems, has a setjmp/longjmp which saves the signal mask
on setjmp calls and restores it on longjmp calls (both of which require syscalls).

This makes the calls REALLY slow.  Use _setjmp/_longjmp instead.  This speeds up
hexxagon from 120.31s to 15.68s: from 5.53x slower than GCC to 28% faster than GCC.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23482 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-27 22:18:25 +00:00
Chris Lattner
6c38b33613 If the target prefers it, use _setjmp/_longjmp should be used instead of setjmp/longjmp for llvm.setjmp/llvm.longjmp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23481 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-27 22:15:53 +00:00
Chris Lattner
8e6be8b921 initialize new flag
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23480 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-27 22:13:56 +00:00
Chris Lattner
4531371960 Avoid spilling stack slots... to stack slots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23478 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-27 21:33:12 +00:00
Chris Lattner
f4e6c3a69b Completely rewrite 'correct' eh support. This changes how setjmp insertion
is performed so it is only at most once per function that contains an invoke
instead of once per invoke in the function.  This patch has the following perks:

1. It fixes PR631, which complains about slowness.
2. If fixes PR240, which complains about non-volatile vars being live across
   setjmp/longjmps.
3. It improves (but does not fix) the jmpbuf alignment issue on itanium by not
   forcing the jmpbufs to always be 8-bytes off the alignment of the structure.
4. It speeds up 253.perlbmk from 338s to 13.70s (a 25x improvement!), making us
   now about 4% faster than GCC.

Further improvements are also possible.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23477 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-27 21:18:17 +00:00
Chris Lattner
fe15830f96 Make the pass name simpler
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23476 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-27 21:10:32 +00:00
Chris Lattner
b94388a76a fix CBackend/2005-09-27-VolatileFuncPtr.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23475 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-27 20:52:44 +00:00
Chris Lattner
6d7277b3b4 allow demotion to volatile values, add support for invoke
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23473 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-27 19:39:00 +00:00
Chris Lattner
333bd835bd Make sure to clear the CodeGenMap after each basic block is selected to avoid
cross MBB pollution.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23470 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-27 17:45:33 +00:00
Jim Laskey
5324fec644 Remove some redundancies.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23469 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-27 17:32:45 +00:00
Chris Lattner
df0ef1d0fe Split SimpleConstantVal up into its components, so each Constant subclass getsa different enum value. This allows 'classof' for these to be really simple,not needing to call getType() anymore.
This speeds up isa/dyncast/etc for constants, and also makes them smaller.
For example, the text section of a release build of InstCombine.cpp shrinks
from 230037 bytes to 216363 bytes, a 6% reduction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23467 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-27 06:09:08 +00:00
Chris Lattner
a9ec8ab32b Add support for external calls that we know how to constant fold. This implements
ctor-list-opt.ll:CTOR8


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23465 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-27 05:02:43 +00:00
Chris Lattner
231308c545 Fix a bug where we would evaluate stores into linkonce objects which could be
potentially replaced at link-time.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23463 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-27 04:50:03 +00:00
Chris Lattner
cd27142cc8 Implement support for static constructors with calls in them. This is useful
because gccas runs globalopt before inlining.

This implements ctor-list-opt.ll:CTOR7


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23462 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-27 04:45:34 +00:00
Chris Lattner
8a7cc6e71c Refactor this code a bit, no functionality changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23460 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-27 04:27:01 +00:00
Chris Lattner
5e8d2dc197 Move the post-lsr simplify cfg pass after lowereh, so it can clean up after
eh lowering as well.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23459 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-27 00:14:41 +00:00
Chris Lattner
30e21a46f0 minor pattern shuffling
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23458 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-26 22:20:16 +00:00
Jim Laskey
e6b90fba4a Addition of a simple two pass scheduler. This version is currently hacked up
for testing and will require target machine info to do a proper scheduling.
The simple scheduler can be turned on using -sched=simple (defaults
to -sched=none)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23455 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-26 21:57:04 +00:00
Chris Lattner
ff0c1ef9eb Remove some dead code. ctor evaluation subsumes empty ctor elim
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23453 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-26 20:38:20 +00:00
Chris Lattner
a22fdb0a37 Add support for alloca, implementing ctor-list-opt.ll:CTOR6
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23452 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-26 17:07:09 +00:00
Chris Lattner
aae4a1cd3f Add a debug printout, fix a crash on kc++
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23450 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-26 07:34:35 +00:00
Chris Lattner
798b4d5bb3 Implement loads/stores through GEP's of globals. This implements
ctor-list-opt.ll:CTOR5.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23449 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-26 06:52:44 +00:00
Chris Lattner
0b142e3920 Replace TraverseGEPInitializer with ConstantFoldLoadThroughGEPConstantExpr
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23447 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-26 05:34:07 +00:00
Chris Lattner
ebe61201d1 Eliminate GetGEPGlobalInitializer in favor of the more powerful
ConstantFoldLoadThroughGEPConstantExpr function in the utils lib.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23446 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-26 05:28:52 +00:00
Chris Lattner
363f2a26d5 Factor the GetGEPGlobalInitializer out of this pass and into Transforms/Utils
as ConstantFoldLoadThroughGEPConstantExpr.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23445 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-26 05:28:06 +00:00
Chris Lattner
c5f52e6da1 Move the ConstantFoldLoadThroughGEPConstantExpr function out of the InstCombine
pass.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23444 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-26 05:27:10 +00:00
Chris Lattner
562a055ca7 add a comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23442 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-26 05:16:34 +00:00
Chris Lattner
04de1cfb2b Add support for getelementptr, load, and correctly reject volatile stores.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23441 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-26 05:15:37 +00:00
Chris Lattner
cdf98bed96 Add support for br/brcond/switch and phi
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23439 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-26 04:57:38 +00:00
Chris Lattner
79c1101947 Add a simple interpreter to this code, allowing us to statically evaluate
global ctors that are simple enough.  This implements ctor-list-opt.ll:CTOR2.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23437 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-26 04:44:35 +00:00
Chris Lattner
db973e60ce factor some code into a InstallGlobalCtors method, add comments. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23435 91177308-0d34-0410-b5e6-96231b3b80d8
2005-09-26 02:31:18 +00:00