Commit Graph

1844 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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