Chris Lattner
94d3b0a77d
reject patterns that mention a name in the destination pattern
...
but not in the input. Previously, this would trigger an abort
late in the isel logic.
llvm-svn: 96898
2010-02-23 06:35:45 +00:00
Chris Lattner
0c0baa91a4
merge some code.
...
llvm-svn: 96896
2010-02-23 06:16:51 +00:00
Chris Lattner
f66b6aa232
more tidying up
...
llvm-svn: 96891
2010-02-23 05:59:10 +00:00
Chris Lattner
ee820ace06
reduce indentation by eliminating 'else after return'
...
llvm-svn: 96889
2010-02-23 05:51:07 +00:00
Chris Lattner
addbb0290c
really fix an off-by-one error
...
llvm-svn: 96845
2010-02-23 01:07:39 +00:00
Chris Lattner
a7d0e304e9
switch the value# in OPC_CompleteMatch and OPC_EmitNode to use a
...
VBR encoding for the insanity being perpetrated by the spu backend.
llvm-svn: 96843
2010-02-23 00:59:59 +00:00
Chris Lattner
60680ad316
add a new Push2 opcode for targets (like cellspu) which have
...
ridiculously ginormous patterns and need more than one byte
of displacement for encodings. This fixes CellSPU/fdiv.ll.
SPU is still doing something else ridiculous though.
llvm-svn: 96833
2010-02-22 23:55:39 +00:00
Chris Lattner
d0b16bd219
Change ComplexPattern handling to push the node being matched as
...
well as the operands produced when the pattern is matched. This
allows CheckSame to work correctly when matching replicated
names involving ComplexPatterns. This fixes a bunch of MSP430
failures, we're down to 13 failures, two of which are
due to a sched bug.
llvm-svn: 96824
2010-02-22 23:33:44 +00:00
Chris Lattner
bb2afb79c0
add a new CheckMultiOpcode opcode for checking that a node
...
has one of the list of acceptable opcodes for a complex
pattern. This fixes 4 regtest failures.
llvm-svn: 96814
2010-02-22 22:30:37 +00:00
Chris Lattner
a5a298517e
When matching patterns that have a complex pattern as their root, make
...
sure to only run the complex pattern on nodes where the target opts in.
This patch only handles targets with one opcode specified so far, but
fixes 16 failures, only 34 left.
llvm-svn: 96813
2010-02-22 22:18:05 +00:00
Chris Lattner
9fd97c3690
fix most of the failures in the x86 suite by handling multiple
...
result nodes correctly. Note that this includes a horrible hack
in DAGISelHeader which cannot be fixed reasonably without
eliminating (parallel) from input patterns. That, in turn,
can't be done until we support writing multiple result patterns
for the X86and_flag and related multiple-result nodes.
llvm-svn: 96767
2010-02-21 23:54:05 +00:00
Chris Lattner
2bad7b0456
Always emit register class id references as i32 like
...
DAGISelEmitter does. This fixes 11 arm failures (8
left).
llvm-svn: 96757
2010-02-21 20:53:45 +00:00
Chris Lattner
8f40097073
Sort the patterns before adding them to the FA so that we get the
...
least cost matches. This gets us from 195 -> 208 passes on the ppc codegen tests.
llvm-svn: 96747
2010-02-21 19:22:06 +00:00
Chris Lattner
816f638f6b
emit table indexes before each row so that it is debuggable.
...
llvm-svn: 96730
2010-02-21 07:16:41 +00:00
Chris Lattner
eb3c0435b7
fix a table size miscomputation, target opcodes are 2 bytes.
...
With this, the matcher actually works reasonably well, but
crashes on larger examples in the scheduler.
llvm-svn: 96727
2010-02-21 06:44:29 +00:00
Chris Lattner
9f6c24ccd5
emit to the right streams, to avoid emitting the push
...
body before the push.
llvm-svn: 96726
2010-02-21 06:30:04 +00:00
Chris Lattner
55875c10d9
oops don't turn this on for everyone yet.
...
llvm-svn: 96725
2010-02-21 06:03:56 +00:00
Chris Lattner
79eaeb4cfe
implement the last known missing feature: updating uses of results
...
of the matched pattern to use the newly created node results. Onto
the "making it actually work" phase!
llvm-svn: 96724
2010-02-21 06:03:07 +00:00
Chris Lattner
132df652a4
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.
llvm-svn: 96716
2010-02-21 03:22:59 +00:00
Chris Lattner
b4905cbd12
add emitter support for integer constants and simple physreg references.
...
llvm-svn: 96663
2010-02-19 07:49:56 +00:00
Chris Lattner
23ac248faa
fix this to work more determinstically, patch by Thomas Veith!
...
llvm-svn: 96661
2010-02-19 07:02:20 +00:00
Chris Lattner
dc61962e67
I confused myself, temporaries will be recorded right along with other inputs.
...
llvm-svn: 96639
2010-02-19 00:33:13 +00:00
Chris Lattner
16cd8cdec1
introduce a new ResultVal and start keeping track of temporary values.
...
llvm-svn: 96636
2010-02-19 00:27:40 +00:00
Chris Lattner
42a7ba7a67
add support for referencing registers and immediates,
...
building the tree to represent them but not emitting
table entries for them yet.
llvm-svn: 96617
2010-02-18 22:03:03 +00:00
Chris Lattner
7ed81690ab
start sketching out the structure of code for result emission generation.
...
Nothing real here yet.
llvm-svn: 96575
2010-02-18 06:47:49 +00:00
Chris Lattner
186ad8098e
rename the child field to 'next'. This is not a parent/child
...
relationship, this is a linear list relationship.
llvm-svn: 96561
2010-02-18 02:53:41 +00:00
Chris Lattner
d582a367b5
eliminate the MatcherNodeWithChild class, give the 'child'
...
field to MatcherNode.
llvm-svn: 96560
2010-02-18 02:49:24 +00:00
Chris Lattner
3a74a23c64
fit in 80 cols
...
llvm-svn: 96541
2010-02-18 00:23:27 +00:00
Chris Lattner
afce454d94
redisable this to save people a small amount of build time.
...
llvm-svn: 96497
2010-02-17 19:19:50 +00:00
Chris Lattner
1fa9c2cce4
move isOnlyReachableByFallthrough out of MachineBasicBlock into AsmPrinter,
...
and add a sparc implementation that knows about delay slots. Patch by
Nathan Keynes!
llvm-svn: 96492
2010-02-17 18:52:56 +00:00
Chris Lattner
f2d7099b3b
reduce nesting.
...
llvm-svn: 96466
2010-02-17 06:53:36 +00:00
Chris Lattner
f46dba81a8
improve comments, the matcher is now feature complete, on to codegen.
...
llvm-svn: 96464
2010-02-17 06:47:35 +00:00
Chris Lattner
e78bc753fe
sink special case "cannotyetselect" for intrinsics out of the
...
tblgen splatted code into the implementation.
llvm-svn: 96460
2010-02-17 06:28:22 +00:00
Chris Lattner
f8a5bb0f89
Emulate the current isel's "IsChainCompatible" logic for now.
...
I'd like to eventually rip it out, but for now producing the
same selections as the old matcher is more important.
llvm-svn: 96458
2010-02-17 06:23:39 +00:00
Chris Lattner
8ad29342b8
properly record chain inputs to complex patterns,
...
resolving a fixme.
llvm-svn: 96457
2010-02-17 06:08:25 +00:00
Chris Lattner
2392195d61
simplify IsChainCompatible codegen, add comments. no
...
functionality change.
llvm-svn: 96453
2010-02-17 05:35:28 +00:00
Chris Lattner
469cfb9fdf
Prep work to handle input chains of matched patterns and checking for
...
'ischaincompatible' when a pattern has more than one input chain. Need
to do some commenting and cleanup now that I understand how this works.
llvm-svn: 96443
2010-02-17 02:16:19 +00:00
Chris Lattner
022e511f4a
record input chains.
...
llvm-svn: 96437
2010-02-17 01:34:15 +00:00
Chris Lattner
ac27c2e3f3
prefix captured value names with $ so they look like
...
variables. Use the fancy OpNo variable instead of i,
which has the right index including chains.
llvm-svn: 96436
2010-02-17 01:27:29 +00:00
Chris Lattner
f773f03736
improve comments on OPC_Record to say what we're recording a node.
...
llvm-svn: 96433
2010-02-17 01:03:09 +00:00
Chris Lattner
e01545280b
improve comments in generated matcher a bit.
...
llvm-svn: 96422
2010-02-17 00:39:26 +00:00
Chris Lattner
a845f654fa
make the new isel generator plop out a CheckComplexPattern function
...
for evaluating complex patterns. Some cleanup has to happen before
this can be used though.
llvm-svn: 96419
2010-02-17 00:31:50 +00:00
Chris Lattner
7b390142fc
fix inverted condition.
...
llvm-svn: 96416
2010-02-17 00:11:30 +00:00
Chris Lattner
e2347aac52
complex patterns don't get 'record' nodes, they implicitly
...
record all their results.
llvm-svn: 96412
2010-02-16 23:16:25 +00:00
Chris Lattner
e83e2483bd
clean up some code, eliminate NodeIsComplexPattern, which
...
does the same thing as getComplexPatternInfo.
llvm-svn: 96411
2010-02-16 23:13:59 +00:00
Chris Lattner
314e34b5b8
fix indentation
...
llvm-svn: 96409
2010-02-16 22:38:31 +00:00
Chris Lattner
afac7dad21
fix rdar://7653908, a crash on a case where we would fold a load
...
into a roundss intrinsic, producing a cyclic dag. The root cause
of this is badness handling ComplexPattern nodes in the old dagisel
that I noticed through inspection. Eliminate a copy of the of the
code that handled ComplexPatterns by making EmitChildMatchCode call
into EmitMatchCode.
llvm-svn: 96408
2010-02-16 22:35:06 +00:00
Chris Lattner
6c132331ee
simplify this code. In the new world order there is no
...
need to scan the entire subtree of the pattern anymore.
llvm-svn: 96369
2010-02-16 19:19:58 +00:00
Chris Lattner
f8695c1ee9
convert the new matcher to check intermediate nodes for a single
...
use and only call IsProfitableToFold/IsLegalToFold on the load
being folded, like the old dagiselemitter does. This
substantially simplifies the code and improves opportunities for
sharing.
llvm-svn: 96368
2010-02-16 19:15:55 +00:00
Chris Lattner
300048631b
change dag isel emitter to only call 'IsProfitableToFold' on nodes
...
with chains. On interior nodes that lead up to them, we just directly
check that there is a single use. This generates slightly more
efficient code.
llvm-svn: 96366
2010-02-16 19:03:34 +00:00