summaryrefslogtreecommitdiff
path: root/utils/TableGen/DAGISelMatcherEmitter.cpp
Commit message (Collapse)AuthorAge
* Moar words!Eric Christopher2010-08-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110422 91177308-0d34-0410-b5e6-96231b3b80d8
* generate better code in CheckComplexPatternChris Lattner2010-06-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105970 91177308-0d34-0410-b5e6-96231b3b80d8
* print the complexity of the pattern being matched in theChris Lattner2010-03-29
| | | | | | | comment in the generated table. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99794 91177308-0d34-0410-b5e6-96231b3b80d8
* add an optimized form of OPC_EmitMergeInputChains for the 1, 0 and Chris Lattner2010-03-28
| | | | | | | | 1, 1 cases which are by-far the most frequent. This shrinks the X86 isel table from 77014 -> 74657 bytes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99740 91177308-0d34-0410-b5e6-96231b3b80d8
* fix a bug in my recent patch that increased opcode size to 2 bytes:Chris Lattner2010-03-27
| | | | | | | | the index comments nested under OPC_SwitchOpcode were off by one. This fixes the comments. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99722 91177308-0d34-0410-b5e6-96231b3b80d8
* Change tblgen to emit FOOISD opcode names as twoChris Lattner2010-03-25
| | | | | | | | | | | | | | | bytes instead of one byte. This is important because we're running up to too many opcodes to fit in a byte and it is aggrevated by FIRST_TARGET_MEMORY_OPCODE making the numbering sparse. This just bites the bullet and bloats out the table. In practice, this increases the size of the x86 isel table from 74.5K to 76K. I think we'll cope :) This fixes rdar://7791648 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99494 91177308-0d34-0410-b5e6-96231b3b80d8
* add plumbing for handling multiple result nodes Chris Lattner2010-03-24
| | | | | | | in some more places. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99366 91177308-0d34-0410-b5e6-96231b3b80d8
* so hey, it turns out that the histogram was completely wrong, becauseChris Lattner2010-03-04
| | | | | | | | we sometimes emit nodes multiple times to string buffers to size them. Compute the histogram correctly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97708 91177308-0d34-0410-b5e6-96231b3b80d8
* change the new isel matcher to emit ComplexPattern matchesChris Lattner2010-03-04
| | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97703 91177308-0d34-0410-b5e6-96231b3b80d8
* enhance comment output to specify what recorded slotChris Lattner2010-03-04
| | | | | | | numbers a ComplexPat will match into. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97696 91177308-0d34-0410-b5e6-96231b3b80d8
* introduce a new SwitchTypeMatcher node (which is analogous toChris Lattner2010-03-03
| | | | | | | | | SwitchOpcodeMatcher) and have DAGISelMatcherOpt form it. This speeds up selection, particularly for X86 which has lots of variants of instructions with only type differences. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97645 91177308-0d34-0410-b5e6-96231b3b80d8
* Rewrite chain handling validation and input TokenFactor handlingChris Lattner2010-03-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97539 91177308-0d34-0410-b5e6-96231b3b80d8
* add some missing \n'sChris Lattner2010-03-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97527 91177308-0d34-0410-b5e6-96231b3b80d8
* fixme resolved.Chris Lattner2010-03-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97517 91177308-0d34-0410-b5e6-96231b3b80d8
* remove a little hack I did for the old isel, not neededChris Lattner2010-03-01
| | | | | | | now that it is gone. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97516 91177308-0d34-0410-b5e6-96231b3b80d8
* Missed a \n in previous commit.Torok Edwin2010-03-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97472 91177308-0d34-0410-b5e6-96231b3b80d8
* Add command-line flag to tblgen to turn off generating comments for the newTorok Edwin2010-03-01
| | | | | | | | isel (defaults it to generate comments). This reduces the size of the generated source file. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97470 91177308-0d34-0410-b5e6-96231b3b80d8
* eliminate the CheckMultiOpcodeMatcher code and have each Chris Lattner2010-03-01
| | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97439 91177308-0d34-0410-b5e6-96231b3b80d8
* add a new OPC_SwitchOpcode which is semantically equivalentChris Lattner2010-03-01
| | | | | | | | | | | | | | to a scope where every child starts with a CheckOpcode, but executes more efficiently. Enhance DAGISelMatcherOpt to form it. This also fixes a bug in CheckOpcode: apparently the SDNodeInfo objects are not pointer comparable, we have to compare the enum name. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97438 91177308-0d34-0410-b5e6-96231b3b80d8
* enhance RecordNode and RecordChild comments to indicate whatChris Lattner2010-03-01
| | | | | | | slot they're recording into, no functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97433 91177308-0d34-0410-b5e6-96231b3b80d8
* inline the node transforms and node predicates into the generatedChris Lattner2010-03-01
| | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97431 91177308-0d34-0410-b5e6-96231b3b80d8
* simplify some code now that chain/flag results are not stored in Chris Lattner2010-02-28
| | | | | | | the vtlist for emitnode. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97429 91177308-0d34-0410-b5e6-96231b3b80d8
* don't emit useless functions. These were producingChris Lattner2010-02-28
| | | | | | | warnings in release-assert builds if there were no cases. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97428 91177308-0d34-0410-b5e6-96231b3b80d8
* change a few opcodes to use VBRs instead of embeddingChris Lattner2010-02-28
| | | | | | | immediate sizes into the opcode. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97423 91177308-0d34-0410-b5e6-96231b3b80d8
* enhance the EmitNode/MorphNodeTo operands to take a bit thatChris Lattner2010-02-28
| | | | | | | | | specifies whether there is an output flag or not. Use this instead of redundantly encoding the chain/flag results in the output vtlist. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97419 91177308-0d34-0410-b5e6-96231b3b80d8
* use MorphNodeTo instead of SelectNodeTo. SelectNodeToChris Lattner2010-02-28
| | | | | | | is just a silly wrapper around MorphNodeTo. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97416 91177308-0d34-0410-b5e6-96231b3b80d8
* enhance the new isel to use SelectNodeTo for most patterns,Chris Lattner2010-02-28
| | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97415 91177308-0d34-0410-b5e6-96231b3b80d8
* enhance EmitNodeMatcher to keep track of the recorded slot numbersChris Lattner2010-02-28
| | | | | | | it will populate. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97363 91177308-0d34-0410-b5e6-96231b3b80d8
* add infrastructure to support forming selectnodeto. Not used yetChris Lattner2010-02-28
| | | | | | | because I have to go on another detour first. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97362 91177308-0d34-0410-b5e6-96231b3b80d8
* change CheckOpcodeMatcher to hold the SDNodeInfo instead ofChris Lattner2010-02-27
| | | | | | | the opcode name. This gives the optimizer more semantic info. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97346 91177308-0d34-0410-b5e6-96231b3b80d8
* add some helpful comments to the emitterChris Lattner2010-02-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97219 91177308-0d34-0410-b5e6-96231b3b80d8
* change the scope node to include a list of children to be checkedChris Lattner2010-02-25
| | | | | | | | | | instead of to have a chained series of scope nodes. This makes the generated table smaller, improves the efficiency of the interpreter, and make the factoring optimization much more reasonable to implement. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97160 91177308-0d34-0410-b5e6-96231b3b80d8
* formatting.Chris Lattner2010-02-25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97097 91177308-0d34-0410-b5e6-96231b3b80d8
* rename fooMatcherNode to fooMatcher.Chris Lattner2010-02-25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97096 91177308-0d34-0410-b5e6-96231b3b80d8
* rename PushMatcherNode -> ScopeMatcherNode to more accuratelyChris Lattner2010-02-25
| | | | | | | | reflect what it does. Switch the sense of the Next and the Check arms to be more logical. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97093 91177308-0d34-0410-b5e6-96231b3b80d8
* contract movechild+checktype into a new checkchild node, shrinking theChris Lattner2010-02-24
| | | | | | | x86 table by 1200 bytes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97053 91177308-0d34-0410-b5e6-96231b3b80d8
* emit a histogram of the opcodes in comments.Chris Lattner2010-02-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97047 91177308-0d34-0410-b5e6-96231b3b80d8
* Since the new instruction selector now works, I don't need to keepChris Lattner2010-02-24
| | | | | | | | | the old one around for comparative purposes: have the ENABLE_NEW_ISEL #define (which is not enabled on mainline) stop emitting the old isel at all, yay for build time win. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97033 91177308-0d34-0410-b5e6-96231b3b80d8
* implement a simple proof-of-concept optimization forChris Lattner2010-02-24
| | | | | | | | | the new isel: fold movechild+record+moveparent into a single recordchild N node. This shrinks the X86 table from 125443 to 117502 bytes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97031 91177308-0d34-0410-b5e6-96231b3b80d8
* The new isel was not properly handling patterns that coveredChris Lattner2010-02-24
| | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97021 91177308-0d34-0410-b5e6-96231b3b80d8
* really fix an off-by-one errorChris Lattner2010-02-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96845 91177308-0d34-0410-b5e6-96231b3b80d8
* switch the value# in OPC_CompleteMatch and OPC_EmitNode to use aChris Lattner2010-02-23
| | | | | | | VBR encoding for the insanity being perpetrated by the spu backend. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96843 91177308-0d34-0410-b5e6-96231b3b80d8
* add a new Push2 opcode for targets (like cellspu) which haveChris Lattner2010-02-22
| | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96833 91177308-0d34-0410-b5e6-96231b3b80d8
* add a new CheckMultiOpcode opcode for checking that a nodeChris Lattner2010-02-22
| | | | | | | | has one of the list of acceptable opcodes for a complex pattern. This fixes 4 regtest failures. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96814 91177308-0d34-0410-b5e6-96231b3b80d8
* emit table indexes before each row so that it is debuggable.Chris Lattner2010-02-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96730 91177308-0d34-0410-b5e6-96231b3b80d8
* fix a table size miscomputation, target opcodes are 2 bytes.Chris Lattner2010-02-21
| | | | | | | | With this, the matcher actually works reasonably well, but crashes on larger examples in the scheduler. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96727 91177308-0d34-0410-b5e6-96231b3b80d8
* emit to the right streams, to avoid emitting the pushChris Lattner2010-02-21
| | | | | | | body before the push. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96726 91177308-0d34-0410-b5e6-96231b3b80d8
* implement the last known missing feature: updating uses of results Chris Lattner2010-02-21
| | | | | | | | | of the matched pattern to use the newly created node results. Onto the "making it actually work" phase! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96724 91177308-0d34-0410-b5e6-96231b3b80d8
* Lots of improvements to the new dagisel emitter. This gets it toChris Lattner2010-02-21
| | | | | | | | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96716 91177308-0d34-0410-b5e6-96231b3b80d8
* add emitter support for integer constants and simple physreg references.Chris Lattner2010-02-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96663 91177308-0d34-0410-b5e6-96231b3b80d8