summaryrefslogtreecommitdiffstats
path: root/llvm/utils/TableGen/DAGISelMatcherGen.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* add a new SDNPVariadic SDNP node flag, and use it inChris Lattner2010-03-191-1/+2
| | | | | | | | dag isel gen instead of instruction properties. This allows the oh-so-useful behavior of matching a variadic non-root node. llvm-svn: 98934
* look up instructions by record, not by name.Chris Lattner2010-03-191-1/+1
| | | | llvm-svn: 98904
* expand tblgen's support for instructions with implicit defs.Chris Lattner2010-03-181-6/+14
| | | | llvm-svn: 98900
* Completely rewrite tblgen's type inference mechanism,Chris Lattner2010-03-151-12/+11
| | | | | | | | | | | | | | | | | | | | | | | | changing the primary datastructure from being a "std::vector<unsigned char>" to being a new TypeSet class that actually has (gasp) invariants! This changes more things than I remember, but one major innovation here is that it enforces that named input values agree in type with their output values. This also eliminates code that transparently assumes (in some cases) that SDNodeXForm input/output types are the same, because this is wrong in many case. This also eliminates a bug which caused a lot of ambiguous patterns to go undetected, where a register class would sometimes pick the first possible type, causing an ambiguous pattern to get arbitrary results. With all the recent target changes, this causes no functionality change! llvm-svn: 98534
* more factoring.Chris Lattner2010-03-071-10/+4
| | | | llvm-svn: 97911
* zap fixme.Chris Lattner2010-03-041-4/+0
| | | | llvm-svn: 97705
* now that complexpatterns are all emitted at the end of the matchChris Lattner2010-03-041-4/+3
| | | | | | | | sequence, just emit instruction predicates right before them. This exposes yet more factoring opportunitites, shrinking the X86 table to 79144 bytes. llvm-svn: 97704
* change the new isel matcher to emit ComplexPattern matchesChris Lattner2010-03-041-27/+66
| | | | | | | | | | as the very last thing before node emission. This should dramatically reduce the number of times we do 'MatchAddress' on X86, speeding up compile time. This also improves comments in the tables and shrinks the table a bit, now down to 80506 bytes for x86. llvm-svn: 97703
* enhance comment output to specify what recorded slotChris Lattner2010-03-041-1/+1
| | | | | | numbers a ComplexPat will match into. llvm-svn: 97696
* Rewrite chain handling validation and input TokenFactor handlingChris Lattner2010-03-021-23/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | stuff now that we don't care about emulating the old broken behavior of the old isel. This eliminates the 'CheckChainCompatible' check (along with IsChainCompatible) which did an incorrect and inefficient scan *up* the chain nodes which happened as the pattern was being formed and does the validation at the end in HandleMergeInputChains when it forms a structural pattern. This scans "down" the graph, which means that it is quickly bounded by nodes already selected. This also handles token factors that get "trapped" in the dag. Removing the CheckChainCompatible nodes also shrinks the generated tables by about 6K for X86 (down to 83K). There are two pieces remaining before I can nuke PreprocessRMW: 1. I xfailed a test because we're now producing worse code in a case that has nothing to do with the change: it turns out that our use of MorphNodeTo will leave dead nodes in the graph which (depending on how the graph is walked) end up causing bogus uses of chains and blocking matches. This is really bad for other reasons, so I'll fix this in a follow-up patch. 2. CheckFoldableChainNode needs to be improved to handle the TF. llvm-svn: 97539
* resolve some fixmesChris Lattner2010-03-011-10/+3
| | | | llvm-svn: 97515
* resolve a fixme and simplify code by moving insertion of theChris Lattner2010-03-011-18/+8
| | | | | | | | EmitMergeInputChainsMatcher node up into EmitResultCode. This doesn't have much of an effect on the generated code, the X86 table is exactly the same size. llvm-svn: 97514
* resolve a fixme by having the .td file parser reject thigns likeChris Lattner2010-03-011-9/+4
| | | | | | | | (set GPR, somecomplexpattern) if somecomplexpattern doesn't declare what it can match. llvm-svn: 97513
* Emit type checks late instead of early, this encouragesChris Lattner2010-03-011-1/+6
| | | | | | | structural matching code to be factored and shared this shrinks the X86 isel table from 86537 to 83890 bytes. llvm-svn: 97442
* Emit a redundant check for immediates at root context, e.g. (imm 0).Chris Lattner2010-03-011-1/+10
| | | | | | | | This allows formation of OpcodeSwitch for top level patterns, in particular on X86. This saves about 1K of data space in the x86 table and makes the dispatch much more efficient. llvm-svn: 97440
* eliminate the CheckMultiOpcodeMatcher code and have each Chris Lattner2010-03-011-21/+33
| | | | | | | | | ComplexPattern at the root be generated multiple times, once for each opcode they are part of. This encourages factoring because the opcode checks get treated just like everything else in the matcher. llvm-svn: 97439
* enhance RecordNode and RecordChild comments to indicate whatChris Lattner2010-03-011-4/+7
| | | | | | slot they're recording into, no functionality change. llvm-svn: 97433
* Emit redundant opcode checks for andimm and orimm tests at rootChris Lattner2010-03-011-0/+7
| | | | | | | | | | | so that we get grouping at the top level. Add an optimization to reorder type check & record nodes after opcode checks. We prefer to expose tree shape matching which improves grouping and will enhance the next optimization. llvm-svn: 97432
* inline the node transforms and node predicates into the generatedChris Lattner2010-03-011-1/+1
| | | | | | | | dispatcher method. This eliminates the dependence of the new isel's generated code on the old isel's predicates, however some random hand written isel code still uses them. llvm-svn: 97431
* enhance the EmitNode/MorphNodeTo operands to take a bit thatChris Lattner2010-02-281-5/+1
| | | | | | | | specifies whether there is an output flag or not. Use this instead of redundantly encoding the chain/flag results in the output vtlist. llvm-svn: 97419
* enhance the new isel to use SelectNodeTo for most patterns,Chris Lattner2010-02-281-8/+1
| | | | | | | | | even some the old isel didn't. There are several parts of this that make me feel dirty, but it's no worse than the old isel. I'll clean up the parts I can do without ripping out the old one next. llvm-svn: 97415
* enhance EmitNodeMatcher to keep track of the recorded slot numbersChris Lattner2010-02-281-1/+2
| | | | | | it will populate. llvm-svn: 97363
* add infrastructure to support forming selectnodeto. Not used yetChris Lattner2010-02-281-4/+4
| | | | | | because I have to go on another detour first. llvm-svn: 97362
* change CheckOpcodeMatcher to hold the SDNodeInfo instead ofChris Lattner2010-02-271-7/+5
| | | | | | the opcode name. This gives the optimizer more semantic info. llvm-svn: 97346
* rename fooMatcherNode to fooMatcher.Chris Lattner2010-02-251-49/+49
| | | | llvm-svn: 97096
* add a fixme for an experiment that defeated me for the time being.Chris Lattner2010-02-251-0/+4
| | | | llvm-svn: 97081
* The new isel was not properly handling patterns that coveredChris Lattner2010-02-241-7/+33
| | | | | | | | | internal nodes with flag results. Record these with a new OPC_MarkFlagResults opcode and use this to update the interior nodes' flag results properly. This fixes CodeGen/X86/i256-add.ll with the new isel. llvm-svn: 97021
* Change ComplexPattern handling to push the node being matched asChris Lattner2010-02-221-21/+13
| | | | | | | | | | 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
* add a new CheckMultiOpcode opcode for checking that a nodeChris Lattner2010-02-221-3/+5
| | | | | | | has one of the list of acceptable opcodes for a complex pattern. This fixes 4 regtest failures. llvm-svn: 96814
* When matching patterns that have a complex pattern as their root, make Chris Lattner2010-02-221-1/+16
| | | | | | | | 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
* fix most of the failures in the x86 suite by handling multiple Chris Lattner2010-02-211-8/+36
| | | | | | | | | | 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
* Always emit register class id references as i32 likeChris Lattner2010-02-211-1/+1
| | | | | | | DAGISelEmitter does. This fixes 11 arm failures (8 left). llvm-svn: 96757
* implement the last known missing feature: updating uses of results Chris Lattner2010-02-211-4/+4
| | | | | | | of the matched pattern to use the newly created node results. Onto the "making it actually work" phase! llvm-svn: 96724
* Lots of improvements to the new dagisel emitter. This gets it toChris Lattner2010-02-211-89/+335
| | | | | | | | | | | | | | | | | | | 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
* I confused myself, temporaries will be recorded right along with other inputs.Chris Lattner2010-02-191-31/+7
| | | | llvm-svn: 96639
* introduce a new ResultVal and start keeping track of temporary values.Chris Lattner2010-02-191-12/+60
| | | | llvm-svn: 96636
* add support for referencing registers and immediates,Chris Lattner2010-02-181-0/+32
| | | | | | | building the tree to represent them but not emitting table entries for them yet. llvm-svn: 96617
* start sketching out the structure of code for result emission generation.Chris Lattner2010-02-181-8/+113
| | | | | | Nothing real here yet. llvm-svn: 96575
* rename the child field to 'next'. This is not a parent/child Chris Lattner2010-02-181-3/+3
| | | | | | relationship, this is a linear list relationship. llvm-svn: 96561
* eliminate the MatcherNodeWithChild class, give the 'child'Chris Lattner2010-02-181-7/+7
| | | | | | field to MatcherNode. llvm-svn: 96560
* Emulate the current isel's "IsChainCompatible" logic for now.Chris Lattner2010-02-171-4/+17
| | | | | | | 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
* properly record chain inputs to complex patterns,Chris Lattner2010-02-171-6/+13
| | | | | | resolving a fixme. llvm-svn: 96457
* Prep work to handle input chains of matched patterns and checking forChris Lattner2010-02-171-4/+28
| | | | | | | '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
* record input chains.Chris Lattner2010-02-171-0/+9
| | | | llvm-svn: 96437
* prefix captured value names with $ so they look likeChris Lattner2010-02-171-3/+2
| | | | | | | variables. Use the fancy OpNo variable instead of i, which has the right index including chains. llvm-svn: 96436
* improve comments on OPC_Record to say what we're recording a node.Chris Lattner2010-02-171-1/+1
| | | | llvm-svn: 96433
* make the new isel generator plop out a CheckComplexPattern functionChris Lattner2010-02-171-3/+9
| | | | | | | for evaluating complex patterns. Some cleanup has to happen before this can be used though. llvm-svn: 96419
* fix inverted condition.Chris Lattner2010-02-171-1/+3
| | | | llvm-svn: 96416
* complex patterns don't get 'record' nodes, they implicitlyChris Lattner2010-02-161-1/+20
| | | | | | record all their results. llvm-svn: 96412
* fix rdar://7653908, a crash on a case where we would fold a loadChris Lattner2010-02-161-1/+0
| | | | | | | | | | 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
OpenPOWER on IntegriCloud