summaryrefslogtreecommitdiff
path: root/utils/TableGen/DAGISelMatcher.cpp
Commit message (Collapse)AuthorAge
* Delete the Matchers stored in the SmallVectors in ↵Craig Topper2014-01-29
| | | | | | SwitchOpcodeMatcher/SwitchTypeMatcher. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200377 91177308-0d34-0410-b5e6-96231b3b80d8
* Add OPC_CheckChildSame0-3 to the DAG isel matcher. This replaces sequences ↵Craig Topper2013-10-05
| | | | | | of MoveChild, CheckSame, MoveParent. Saves 846 bytes from the X86 DAG isel matcher, ~300 from ARM, ~840 from Hexagon. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192026 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r191940 to see if it fixes the build bots.Craig Topper2013-10-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191941 91177308-0d34-0410-b5e6-96231b3b80d8
* Add OPC_CheckChildSame0-3 to the DAG isel matcher. This replaces sequences ↵Craig Topper2013-10-04
| | | | | | of MoveChild, CheckSame, MoveParent. Saves 846 bytes from the X86 DAG isel matcher, ~300 from ARM, ~840 from Hexagon. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191940 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix doxygen comments to use correct function name.Craig Topper2013-09-25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191356 91177308-0d34-0410-b5e6-96231b3b80d8
* Sort the #include lines for utils/...Chandler Carruth2012-12-04
| | | | | | | I've tried to find main moudle headers where possible, but the TableGen stuff may warrant someone else looking at it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169251 91177308-0d34-0410-b5e6-96231b3b80d8
* Unweaken vtables as per ↵David Blaikie2011-12-20
| | | | | | http://llvm.org/docs/CodingStandards.html#ll_virtual_anch git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146960 91177308-0d34-0410-b5e6-96231b3b80d8
* Move TableGen's parser and entry point into a libraryPeter Collingbourne2011-10-01
| | | | | | This is the first step towards splitting LLVM and Clang's tblgen executables. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140951 91177308-0d34-0410-b5e6-96231b3b80d8
* Rework our internal representation of node predicates to expose moreChris Lattner2011-04-17
| | | | | | | | | structure and fix some fixmes. We now have a TreePredicateFn class that handles all of the decoding of these things. This is an internal cleanup that has no impact on the code generated by tblgen. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129670 91177308-0d34-0410-b5e6-96231b3b80d8
* Flag -> Glue, the ongoing sagaChris Lattner2010-12-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122513 91177308-0d34-0410-b5e6-96231b3b80d8
* continue renaming flag -> glue.Chris Lattner2010-12-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122506 91177308-0d34-0410-b5e6-96231b3b80d8
* Tidy up a bit. Trailing whitespace, hard tabs and 80-columns.Jim Grosbach2010-12-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122337 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
* eliminate the last use of EEVT::isUnknownChris Lattner2010-03-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98918 91177308-0d34-0410-b5e6-96231b3b80d8
* add some helper functions and implement isContradictory Chris Lattner2010-03-07
| | | | | | | | | for CheckValueTypeMatcher. The isContradictory implementation helps us factor better, shrinking x86 table from 79144 -> 78896 bytes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97905 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
* 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 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
* Generalize my hack to use SDNodeInfo to find out when aChris Lattner2010-02-28
| | | | | | | | | | node is always guaranteed to have a particular type instead of hacking in ISD::STORE explicitly. This allows us to use implied types for a broad range of nodes, even target specific ones. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97355 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 another case from the ppc backend. This is obviously a huge andChris Lattner2010-02-27
| | | | | | | dissatisfying hack. TODO: Improve it. :) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97317 91177308-0d34-0410-b5e6-96231b3b80d8
* teach the optimizer that opcode == ISD::STORE is contradictoryChris Lattner2010-02-27
| | | | | | | | | | with getType() == MVT::i32 etc. Teach it that two different integer constants are contradictory. This cuts 1K off the X86 table, down to 98k git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97314 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach the grouper some simple tricks about looking contradictoryChris Lattner2010-02-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | predicates. For example if we have: Scope: CheckType i32 ABC CheckType f32 DEF CheckType i32 GHI Then we know that we can transform this into: Scope: CheckType i32 Scope ABC GHI CheckType f32 DEF This reorders the check for the 'GHI' predicate above the check for the 'DEF' predidate. However it is safe to do this in this situation because we know that a node cannot have both an i32 and f32 type. We're now doing more factoring that the old isel did. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97312 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
* factor the print method better.Chris Lattner2010-02-25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97125 91177308-0d34-0410-b5e6-96231b3b80d8
* add methods to do equality checks and get hashes of MatchersChris Lattner2010-02-25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97123 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
* 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
* 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
* 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 support for referencing registers and immediates,Chris Lattner2010-02-18
| | | | | | | | | building the tree to represent them but not emitting table entries for them yet. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96617 91177308-0d34-0410-b5e6-96231b3b80d8
* rename the child field to 'next'. This is not a parent/child Chris Lattner2010-02-18
| | | | | | | relationship, this is a linear list relationship. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96561 91177308-0d34-0410-b5e6-96231b3b80d8
* eliminate the MatcherNodeWithChild class, give the 'child'Chris Lattner2010-02-18
| | | | | | | field to MatcherNode. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96560 91177308-0d34-0410-b5e6-96231b3b80d8
* Emulate the current isel's "IsChainCompatible" logic for now.Chris Lattner2010-02-17
| | | | | | | | I'd like to eventually rip it out, but for now producing the same selections as the old matcher is more important. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96458 91177308-0d34-0410-b5e6-96231b3b80d8
* convert the new matcher to check intermediate nodes for a singleChris Lattner2010-02-16
| | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96368 91177308-0d34-0410-b5e6-96231b3b80d8
* add support for the new isel matcher to generate Chris Lattner2010-02-16
| | | | | | | (isprofitable|islegal)tofold checks. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96331 91177308-0d34-0410-b5e6-96231b3b80d8
* Check in the first big step of rewriting DAGISelEmitter to Chris Lattner2010-02-15
produce a table based matcher instead of gobs of C++ Code. Though it's not done yet, the shrinkage seems promising, the table for the X86 ISel is 75K and still has a lot of optimization to come (compare to the ~1.5M of .o generated the old way, much of which will go away). The code is currently disabled by default (the #if 0 in DAGISelEmitter.cpp). When enabled it generates a dead SelectCode2 function in the DAGISel Header which will eventually replace SelectCode. There is still a lot of stuff left to do, which are documented with a trail of FIXMEs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96215 91177308-0d34-0410-b5e6-96231b3b80d8