aboutsummaryrefslogtreecommitdiff
path: root/llvm/utils/TableGen/DAGISelMatcher.cpp
AgeCommit message (Collapse)AuthorFilesLines
2014-04-15[C++11] More 'nullptr' conversion. In some cases just using a boolean check ↵Craig Topper1-2/+2
instead of comparing to nullptr. llvm-svn: 206254
2014-02-05Add CheckChildInteger to ISelMatcher operations. Removes nearly 2000 bytes ↵Craig Topper1-0/+17
from X86 matcher table. llvm-svn: 200821
2014-01-29Delete the Matchers stored in the SmallVectors in ↵Craig Topper1-0/+9
SwitchOpcodeMatcher/SwitchTypeMatcher. llvm-svn: 200377
2013-10-05Add OPC_CheckChildSame0-3 to the DAG isel matcher. This replaces sequences ↵Craig Topper1-0/+4
of MoveChild, CheckSame, MoveParent. Saves 846 bytes from the X86 DAG isel matcher, ~300 from ARM, ~840 from Hexagon. llvm-svn: 192026
2013-10-04Revert r191940 to see if it fixes the build bots.Craig Topper1-4/+0
llvm-svn: 191941
2013-10-04Add OPC_CheckChildSame0-3 to the DAG isel matcher. This replaces sequences ↵Craig Topper1-0/+4
of MoveChild, CheckSame, MoveParent. Saves 846 bytes from the X86 DAG isel matcher, ~300 from ARM, ~840 from Hexagon. llvm-svn: 191940
2013-09-25Fix doxygen comments to use correct function name.Craig Topper1-1/+1
llvm-svn: 191356
2012-12-04Sort the #include lines for utils/...Chandler Carruth1-2/+2
I've tried to find main moudle headers where possible, but the TableGen stuff may warrant someone else looking at it. llvm-svn: 169251
2011-12-20Unweaken vtables as per ↵David Blaikie1-0/+6
http://llvm.org/docs/CodingStandards.html#ll_virtual_anch llvm-svn: 146960
2011-10-01Move TableGen's parser and entry point into a libraryPeter Collingbourne1-1/+1
This is the first step towards splitting LLVM and Clang's tblgen executables. llvm-svn: 140951
2011-04-17Rework our internal representation of node predicates to expose moreChris Lattner1-3/+11
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. llvm-svn: 129670
2010-12-23Flag -> Glue, the ongoing sagaChris Lattner1-1/+1
llvm-svn: 122513
2010-12-23continue renaming flag -> glue.Chris Lattner1-6/+6
llvm-svn: 122506
2010-12-21Tidy up a bit. Trailing whitespace, hard tabs and 80-columns.Jim Grosbach1-14/+14
llvm-svn: 122337
2010-03-24add plumbing for handling multiple result nodes Chris Lattner1-7/+7
in some more places. llvm-svn: 99366
2010-03-19eliminate the last use of EEVT::isUnknownChris Lattner1-4/+3
llvm-svn: 98918
2010-03-07add some helper functions and implement isContradictory Chris Lattner1-0/+55
for CheckValueTypeMatcher. The isContradictory implementation helps us factor better, shrinking x86 table from 79144 -> 78896 bytes. llvm-svn: 97905
2010-03-03introduce a new SwitchTypeMatcher node (which is analogous toChris Lattner1-0/+9
SwitchOpcodeMatcher) and have DAGISelMatcherOpt form it. This speeds up selection, particularly for X86 which has lots of variants of instructions with only type differences. llvm-svn: 97645
2010-03-02Rewrite chain handling validation and input TokenFactor handlingChris Lattner1-5/+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
2010-03-01eliminate the CheckMultiOpcodeMatcher code and have each Chris Lattner1-13/+0
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
2010-03-01add a new OPC_SwitchOpcode which is semantically equivalentChris Lattner1-1/+21
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. llvm-svn: 97438
2010-02-28enhance the EmitNode/MorphNodeTo operands to take a bit thatChris Lattner1-1/+2
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
2010-02-28use MorphNodeTo instead of SelectNodeTo. SelectNodeToChris Lattner1-1/+1
is just a silly wrapper around MorphNodeTo. llvm-svn: 97416
2010-02-28enhance the new isel to use SelectNodeTo for most patterns,Chris Lattner1-2/+6
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
2010-02-28enhance EmitNodeMatcher to keep track of the recorded slot numbersChris Lattner1-1/+1
it will populate. llvm-svn: 97363
2010-02-28add infrastructure to support forming selectnodeto. Not used yetChris Lattner1-5/+7
because I have to go on another detour first. llvm-svn: 97362
2010-02-28Generalize my hack to use SDNodeInfo to find out when aChris Lattner1-19/+26
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. llvm-svn: 97355
2010-02-27change CheckOpcodeMatcher to hold the SDNodeInfo instead ofChris Lattner1-7/+7
the opcode name. This gives the optimizer more semantic info. llvm-svn: 97346
2010-02-27add another case from the ppc backend. This is obviously a huge andChris Lattner1-1/+4
dissatisfying hack. TODO: Improve it. :) llvm-svn: 97317
2010-02-27teach the optimizer that opcode == ISD::STORE is contradictoryChris Lattner1-2/+11
with getType() == MVT::i32 etc. Teach it that two different integer constants are contradictory. This cuts 1K off the X86 table, down to 98k llvm-svn: 97314
2010-02-27Teach the grouper some simple tricks about looking contradictoryChris Lattner1-0/+55
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. llvm-svn: 97312
2010-02-25change the scope node to include a list of children to be checkedChris Lattner1-1/+10
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. llvm-svn: 97160
2010-02-25factor the print method better.Chris Lattner1-66/+35
llvm-svn: 97125
2010-02-25add methods to do equality checks and get hashes of MatchersChris Lattner1-1/+67
llvm-svn: 97123
2010-02-25rename fooMatcherNode to fooMatcher.Chris Lattner1-34/+34
llvm-svn: 97096
2010-02-25rename PushMatcherNode -> ScopeMatcherNode to more accuratelyChris Lattner1-4/+4
reflect what it does. Switch the sense of the Next and the Check arms to be more logical. No functionality change. llvm-svn: 97093
2010-02-24contract movechild+checktype into a new checkchild node, shrinking theChris Lattner1-0/+7
x86 table by 1200 bytes. llvm-svn: 97053
2010-02-24implement a simple proof-of-concept optimization forChris Lattner1-0/+5
the new isel: fold movechild+record+moveparent into a single recordchild N node. This shrinks the X86 table from 125443 to 117502 bytes. llvm-svn: 97031
2010-02-24The new isel was not properly handling patterns that coveredChris Lattner1-0/+5
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
2010-02-22add a new CheckMultiOpcode opcode for checking that a nodeChris Lattner1-0/+5
has one of the list of acceptable opcodes for a complex pattern. This fixes 4 regtest failures. llvm-svn: 96814
2010-02-21implement the last known missing feature: updating uses of results Chris Lattner1-1/+2
of the matched pattern to use the newly created node results. Onto the "making it actually work" phase! llvm-svn: 96724
2010-02-21Lots of improvements to the new dagisel emitter. This gets it toChris Lattner1-9/+61
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-18add support for referencing registers and immediates,Chris Lattner1-0/+17
building the tree to represent them but not emitting table entries for them yet. llvm-svn: 96617
2010-02-18rename the child field to 'next'. This is not a parent/child Chris Lattner1-21/+21
relationship, this is a linear list relationship. llvm-svn: 96561
2010-02-18eliminate the MatcherNodeWithChild class, give the 'child'Chris Lattner1-1/+1
field to MatcherNode. llvm-svn: 96560
2010-02-17Emulate the current isel's "IsChainCompatible" logic for now.Chris Lattner1-0/+6
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-16convert the new matcher to check intermediate nodes for a singleChris Lattner1-8/+3
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-16add support for the new isel matcher to generate Chris Lattner1-0/+10
(isprofitable|islegal)tofold checks. llvm-svn: 96331
2010-02-15Check in the first big step of rewriting DAGISelEmitter to Chris Lattner1-0/+108
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. llvm-svn: 96215