1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-26 22:42:46 +02:00
Commit Graph

93 Commits

Author SHA1 Message Date
Chris Lattner
6a9861953b Move some methods around so that BU specific code is together, TD specific code
is together, and direction independent code is together.

llvm-svn: 26712
2006-03-11 22:28:35 +00:00
Chris Lattner
40c02c01a5 merge preds/chainpreds -> preds set
merge succs/chainsuccs -> succs set

This has no functionality change, simplifies the code, and reduces the size
of sunits.

llvm-svn: 26711
2006-03-11 22:24:20 +00:00
Chris Lattner
da5f77e3cf Move some simple-sched-specific instance vars to the simple scheduler.
llvm-svn: 26690
2006-03-10 07:42:02 +00:00
Chris Lattner
89a5a946f5 Make EmitNode take a SDNode instead of a NodeInfo*
llvm-svn: 26687
2006-03-10 07:28:36 +00:00
Chris Lattner
3f870d581e Move the VRBase field from NodeInfo to being a separate, explicit, map.
llvm-svn: 26686
2006-03-10 07:25:12 +00:00
Chris Lattner
a316d82d2a no need to build groups anymore
llvm-svn: 26684
2006-03-10 07:15:58 +00:00
Chris Lattner
e23afcfd6d Create SUnits directly from the SelectionDAG.
llvm-svn: 26683
2006-03-10 07:13:32 +00:00
Chris Lattner
ed528a5652 Push PrepareNodeInfo/IdentifyGroups down the inheritance hierarchy
llvm-svn: 26682
2006-03-10 06:34:51 +00:00
Chris Lattner
920325db0a Teach the latency scheduler some new tricks. In particular, to break ties,
keep track of a sense of "mobility", i.e. how many other nodes scheduling one
node will free up.  For something like this:

float testadd(float *X, float *Y, float *Z, float *W, float *V) {
  return (*X+*Y)*(*Z+*W)+*V;
}

For example, this makes us schedule *X then *Y, not *X then *Z.  The former
allows us to issue the add, the later only lets us issue other loads.

This turns the above code from this:

_testadd:
        lfs f0, 0(r3)
        lfs f1, 0(r6)
        lfs f2, 0(r4)
        lfs f3, 0(r5)
        fadds f0, f0, f2
        fadds f1, f3, f1
        lfs f2, 0(r7)
        fmadds f1, f0, f1, f2
        blr

into this:

_testadd:
        lfs f0, 0(r6)
        lfs f1, 0(r5)
        fadds f0, f1, f0
        lfs f1, 0(r4)
        lfs f2, 0(r3)
        fadds f1, f2, f1
        lfs f2, 0(r7)
        fmadds f1, f1, f0, f2
        blr

llvm-svn: 26680
2006-03-10 05:51:05 +00:00
Chris Lattner
1bb3ae8dae add an aggregate method for reinserting scheduled nodes, add a callback for
priority impls that want to be notified when a node is scheduled

llvm-svn: 26678
2006-03-10 04:32:49 +00:00
Jeff Cohen
5002cf68b4 Fix VC++ build breakage.
llvm-svn: 26676
2006-03-10 03:57:45 +00:00
Chris Lattner
4fe39d8f9e remove temporary option
llvm-svn: 26646
2006-03-09 17:31:22 +00:00
Chris Lattner
f35a70d050 yes yes, enabled debug output is bad
llvm-svn: 26637
2006-03-09 07:39:25 +00:00
Chris Lattner
0020b50bac switch the t-d scheduler to use a really dumb and trivial critical path
latency priority function.

llvm-svn: 26636
2006-03-09 07:38:27 +00:00
Chris Lattner
074a604a1b Pull latency information for target instructions out of the latency tables. :)
Only enable this with -use-sched-latencies, I'll enable it by default with a
clean nightly tester run tonight.

PPC is the only target that provides latency info currently.

llvm-svn: 26634
2006-03-09 07:15:18 +00:00
Chris Lattner
b1f716a6d1 PriorityQueue is an instance var, use it.
llvm-svn: 26632
2006-03-09 06:48:37 +00:00
Chris Lattner
1d9c1edaa8 add some comments
llvm-svn: 26631
2006-03-09 06:37:29 +00:00
Chris Lattner
2dd7bcc95b Refactor the priority mechanism one step further: now that it is a separate
class, sever its implementation from the interface.  Now we can provide new
implementations of the same interface (priority computation) without touching
the scheduler itself.

llvm-svn: 26630
2006-03-09 06:35:14 +00:00
Chris Lattner
133ec8c3f0 Split the priority function computation and priority queue management out
of the ScheduleDAGList class into a new SchedulingPriorityQueue class.

llvm-svn: 26613
2006-03-08 05:18:27 +00:00
Chris Lattner
46a80382ce switch from an explicitly managed list of SUnits to a simple vector of sunits
llvm-svn: 26612
2006-03-08 04:54:34 +00:00
Chris Lattner
427dbaccca Shrinkify some fields, fit to 80 columns
llvm-svn: 26611
2006-03-08 04:41:06 +00:00
Chris Lattner
7965026ed9 remove "Slot", it is dead
llvm-svn: 26609
2006-03-08 04:37:58 +00:00
Chris Lattner
3f23d22d3f Change the interface for getting a target HazardRecognizer to be more clean.
llvm-svn: 26608
2006-03-08 04:25:59 +00:00
Chris Lattner
ced780efee Fix some formatting, when looking for hazards, prefer target nodes over
things like copyfromreg.

llvm-svn: 26586
2006-03-07 05:40:43 +00:00
Chris Lattner
86375c060a update file comment
llvm-svn: 26573
2006-03-06 17:58:04 +00:00
Evan Cheng
2fad0ea044 Remove some code that doesn't make sense
llvm-svn: 26572
2006-03-06 07:31:44 +00:00
Evan Cheng
8fd9503fbd Remove SUnit::Priority1: it is re-calculated on demand as number of live
range to be generated.

llvm-svn: 26570
2006-03-06 06:08:54 +00:00
Chris Lattner
c6d1fbab70 Hoist the HazardRecognizer out of the ScheduleDAGList.cpp file to where
targets can implement them.  Make the top-down scheduler non-g5-specific.

Remove the old testing hazard recognizer.

llvm-svn: 26569
2006-03-06 00:22:00 +00:00
Chris Lattner
ca7ed30ee6 Comment fixes
llvm-svn: 26567
2006-03-05 23:59:20 +00:00
Chris Lattner
5c28fdcae8 When a hazard recognizer needs noops to be inserted, do so. This represents
noops as null pointers in the instruction sequence.

llvm-svn: 26564
2006-03-05 23:51:47 +00:00
Chris Lattner
0ee7522721 Implement G5HazardRecognizer as a trivial thing that wants 5 cycles between
copyfromreg nodes.  Clearly useful!

llvm-svn: 26559
2006-03-05 23:13:56 +00:00
Chris Lattner
ccda7ffffd Add basic hazard recognizer support. noop insertion isn't complete yet though.
llvm-svn: 26558
2006-03-05 22:45:01 +00:00
Chris Lattner
ef4bef419b Split the list scheduler into top-down and bottom-up pieces. The priority
function of the top-down scheduler are completely bogus currently, and
having (future) PPC specific in this file is also wrong, but this is a
small incremental step.

llvm-svn: 26552
2006-03-05 21:10:33 +00:00
Chris Lattner
49ccda9563 Move the available queue to being inside the ListSchedule method, since it
bounds its lifetime.

llvm-svn: 26550
2006-03-05 20:21:55 +00:00
Evan Cheng
b91460b269 A bit more tweaking
llvm-svn: 26500
2006-03-03 06:23:43 +00:00
Jeff Cohen
ee1a26dc07 Fix VC++ compilation errors.
llvm-svn: 26498
2006-03-03 03:25:07 +00:00
Evan Cheng
71fa36ef12 - Fixed some priority calculation bugs that were causing bug 478. Among them:
a predecessor appearing more than once in the operand list was counted as
  multiple predecessor; priority1 should be updated during scheduling;
  CycleBound was updated after the node is inserted into priority queue; one
  of the tie breaking condition was flipped.
- Take into consideration of two address opcodes. If a predecessor is a def&use
  operand, it should have a higher priority.
- Scheduler should also favor floaters, i.e. nodes that do not have real
  predecessors such as MOV32ri.
- The scheduling fixes / tweaks fixed bug 478:
        .text
        .align  4
        .globl  _f
_f:
        movl 4(%esp), %eax
        movl 8(%esp), %ecx
        movl %eax, %edx
        imull %ecx, %edx
        imull %eax, %eax
        imull %ecx, %ecx
        addl %eax, %ecx
        leal (%ecx,%edx,2), %eax
        ret

  It is also a slight performance win (1% - 3%) for most tests.

llvm-svn: 26470
2006-03-02 21:38:29 +00:00
Chris Lattner
f3bfec6117 make -debug output less newliney
llvm-svn: 25895
2006-02-02 00:38:08 +00:00
Evan Cheng
fcd2a73349 Clean up some code; improve efficiency; and fixed a potential bug involving
chain successors.

llvm-svn: 25630
2006-01-26 00:30:29 +00:00
Reid Spencer
f45272f413 Don't break the optimized build (by incorrect placement of #endif)
llvm-svn: 25613
2006-01-25 21:49:13 +00:00
Jeff Cohen
7d0e421a42 Fix VC++ compilation error.
llvm-svn: 25604
2006-01-25 17:17:49 +00:00
Evan Cheng
0296933dbe Bottom up register usage reducing list scheduler.
llvm-svn: 25601
2006-01-25 09:14:32 +00:00
Evan Cheng
f622869383 Skeleton of the list schedule.
llvm-svn: 25544
2006-01-23 08:26:10 +00:00