Chris Lattner
3a3c8682b5
Fold X+Y -> X|Y when safe. This implements:
...
Regression/CodeGen/PowerPC/and_add.ll
a case that occurs with dynamic allocas of constant size.
llvm-svn: 26727
2006-03-13 06:51:27 +00:00
Chris Lattner
7821da357e
new testcase
...
llvm-svn: 26726
2006-03-13 06:50:47 +00:00
Chris Lattner
1782f3971d
I can't convince myself that this is safe, remove the recursive call.
...
llvm-svn: 26725
2006-03-13 06:42:16 +00:00
Chris Lattner
9d0ebb55a6
add a couple of missing folds
...
llvm-svn: 26724
2006-03-13 06:26:26 +00:00
Chris Lattner
3cb122bfa8
For targets with FABS/FNEG support, lower copysign to an integer load,
...
a select and FABS/FNEG.
This speeds up a trivial (aka stupid) copysign benchmark I wrote from 6.73s
to 2.64s, woo.
llvm-svn: 26723
2006-03-13 06:08:38 +00:00
Chris Lattner
3aff8e6acf
Fix a couple of bugs that broke the alpha tester build
...
llvm-svn: 26722
2006-03-13 05:23:59 +00:00
Chris Lattner
9898674f99
Handle cracked instructions in dispatch group formation.
...
llvm-svn: 26721
2006-03-13 05:20:04 +00:00
Chris Lattner
ba10d4e4ab
Mark instructions that are cracked by the PPC970 decoder as such.
...
llvm-svn: 26720
2006-03-13 05:15:10 +00:00
Chris Lattner
a278639f29
Several big changes:
...
1. Use flags on the instructions in the .td file to indicate the PPC970 unit
type instead of a table in the .cpp file. Much cleaner.
2. Change the hazard recognizer to build d-groups according to the actual
algorithm used, not my flawed understanding of it.
3. Model "must be in the first slot" and "must be the only instr in a group"
accurately.
llvm-svn: 26719
2006-03-12 09:13:49 +00:00
Chris Lattner
a54a9d83c3
Don't advance the hazard recognizer when there are no hazards and no instructions
...
to be emitted.
Don't add one to the latency of a completed instruction if the latency of the
op is 0.
llvm-svn: 26718
2006-03-12 09:01:41 +00:00
Chris Lattner
aea53fc36f
Chain operands aren't real uses: they don't require the full latency of the
...
predecessor to finish before they can start.
llvm-svn: 26717
2006-03-12 03:52:09 +00:00
Chris Lattner
7396b82585
As a pending queue data structure to keep track of instructions whose
...
operands have all issued, but whose results are not yet available. This
allows us to compile:
int G;
int test(int A, int B, int* P) {
return (G+A)*(B+1);
}
to:
_test:
lis r2, ha16(L_G$non_lazy_ptr)
addi r4, r4, 1
lwz r2, lo16(L_G$non_lazy_ptr)(r2)
lwz r2, 0(r2)
add r2, r2, r3
mullw r3, r2, r4
blr
instead of this, which has a stall between the lis/lwz:
_test:
lis r2, ha16(L_G$non_lazy_ptr)
lwz r2, lo16(L_G$non_lazy_ptr)(r2)
addi r4, r4, 1
lwz r2, 0(r2)
add r2, r2, r3
mullw r3, r2, r4
blr
llvm-svn: 26716
2006-03-12 00:38:57 +00:00
Chris Lattner
2594ddf452
Mark llvm.stacksave as only reading memory, this fixes
...
Regression/Transforms/InstCombine/stacksaverestore.ll
llvm-svn: 26715
2006-03-12 00:04:28 +00:00
Chris Lattner
62eafde9c1
rename priorityqueue -> availablequeue. When a node is scheduled, remember
...
which cycle it lands on.
llvm-svn: 26714
2006-03-11 22:44:37 +00:00
Chris Lattner
04ada12cb7
Make CurrCycle a local var instead of an instance var
...
llvm-svn: 26713
2006-03-11 22:34:41 +00:00
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
19b93158c1
blr is a branch too
...
llvm-svn: 26710
2006-03-11 21:49:49 +00:00
Chris Lattner
916761949b
add an example
...
llvm-svn: 26709
2006-03-11 20:20:40 +00:00
Chris Lattner
115b1be710
add a note
...
llvm-svn: 26708
2006-03-11 20:17:08 +00:00
Nate Begeman
7c2afcfc02
Fix PR681 by using the standard Lengauer and Tarjan algorithm for dominator
...
set construction, rather than intersecting various std::sets. This reduces
the memory usage for the testcase in PR681 from 496 to 26MB of ram on my
darwin system, and reduces the runtime from 32.8 to 0.8 seconds on a
2.5GHz G5. This also enables future code sharing between Dom and PostDom
now that they share near-identical implementations.
llvm-svn: 26707
2006-03-11 02:20:46 +00:00
Chris Lattner
8930c740ac
fix pasto in generate assertion msg
...
llvm-svn: 26706
2006-03-11 00:20:47 +00:00
Evan Cheng
02418117e1
Doh!
...
llvm-svn: 26705
2006-03-11 00:13:10 +00:00
Evan Cheng
57c206232d
Added a parameter to control whether Constant::getStringValue() would chop
...
off the result string at the first null terminator.
llvm-svn: 26704
2006-03-10 23:52:03 +00:00
Chris Lattner
f176c9ecac
remove some dead code
...
llvm-svn: 26703
2006-03-10 23:14:22 +00:00
Chris Lattner
f80c0a7188
remove ShouldEmitDebugFunctions, a hack to support llvm-db via the jit
...
llvm-svn: 26702
2006-03-10 22:49:05 +00:00
Chris Lattner
02e6c29ad2
scrape out bits of llvm-db
...
llvm-svn: 26701
2006-03-10 22:48:19 +00:00
Chris Lattner
ec8860221c
Remove UnixLocalInferiorProcess: debugging via the JIT isn't a good idea.
...
Perhaps llvm-db will turn into a read debugger someday.
llvm-svn: 26700
2006-03-10 22:39:48 +00:00
Chris Lattner
12786a1616
Simplify this testcase
...
llvm-svn: 26699
2006-03-10 22:32:18 +00:00
Chris Lattner
11613abcee
reorder these to make it work with static libraries
...
llvm-svn: 26698
2006-03-10 21:01:34 +00:00
Chris Lattner
2370965e55
teach the JIT to encode vector registers
...
llvm-svn: 26697
2006-03-10 20:19:50 +00:00
Chris Lattner
d6bc58d086
Fix another broken intrinsic.
...
llvm-svn: 26696
2006-03-10 18:01:03 +00:00
Chris Lattner
9e05c75c4a
weak globals on darwin require an extra load, breaking this test
...
llvm-svn: 26695
2006-03-10 17:55:10 +00:00
Chris Lattner
228fa5bd76
Fix incorrect definitions of these intrinsics, which broke a bunch of
...
stuff last night.
llvm-svn: 26694
2006-03-10 17:48:34 +00:00
Chris Lattner
0a64d261e0
Move simple-selector-specific types to the simple selector.
...
llvm-svn: 26693
2006-03-10 07:51:18 +00:00
Chris Lattner
2024573f47
Simplify the interface to the schedulers, to not pass the selected heuristicin.
...
llvm-svn: 26692
2006-03-10 07:49:12 +00:00
Chris Lattner
40b1b16c56
Simplify the interface to the schedulers, to not pass the selected heuristic
...
in.
llvm-svn: 26691
2006-03-10 07:48:52 +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
ec2c5aa0bb
prune #includes
...
llvm-svn: 26689
2006-03-10 07:37:35 +00:00
Chris Lattner
808cc02983
move some simple scheduler methods into the simple scheduler
...
llvm-svn: 26688
2006-03-10 07:35:21 +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
f1be1182f0
Store VRBase in a map, not in NodeInfo.
...
llvm-svn: 26685
2006-03-10 07:24:45 +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
6ef56b998f
make some methods protected instead of private
...
llvm-svn: 26681
2006-03-10 06:30:11 +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
Jeff Cohen
3fca15ca78
Put intrinsics.gen in its proper place.
...
llvm-svn: 26679
2006-03-10 04:36:01 +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