summaryrefslogtreecommitdiffstats
path: root/llvm/utils/TableGen/DAGISelMatcherOpt.cpp
Commit message (Collapse)AuthorAgeFilesLines
* DAGISelMatcherOpt - TGParser::ParseOperation - silence static analyzer ↵Simon Pilgrim2019-09-261-4/+5
| | | | | | | | cast_or_null<CheckTypeMatcher> null dereference warning. NFCI. The static analyzer is warning about a potential null dereference, replace with an null/isa assertion and cast<CheckTypeMatcher>. llvm-svn: 373001
* [SelectionDAG] Add a OPC_CheckChild2CondCode to SelectionDAGISel to remove a ↵Craig Topper2019-02-251-2/+6
| | | | | | | | | | MoveChild and MoveParent pair. OPC_CheckCondCode is always used as operand 2 of a setcc. And its always surrounded by a MoveChild2 and a MoveParent. By having a dedicated opcode for this case we can reduce the number of bytes needed for this pattern from 4 bytes to 2. This saves ~3000 bytes in the X86 table. llvm-svn: 354763
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* Rename DEBUG macro to LLVM_DEBUG.Nicola Zaghen2018-05-141-9/+6
| | | | | | | | | | | | | | | | The DEBUG() macro is very generic so it might clash with other projects. The renaming was done as follows: - git grep -l 'DEBUG' | xargs sed -i 's/\bDEBUG\s\?(/LLVM_DEBUG(/g' - git diff -U0 master | ../clang/tools/clang-format/clang-format-diff.py -i -p1 -style LLVM - Manual change to APInt - Manually chage DOCS as regex doesn't match it. In the transition period the DEBUG() macro is still present and aliased to the LLVM_DEBUG() one. Differential Revision: https://reviews.llvm.org/D43624 llvm-svn: 332240
* [TableGen] Use less stack in DAGISelMatcherOptJon Chesterfield2017-02-061-9/+15
| | | | | | | | Refactor a helper function, FactorNodes, to search for a push node in constant space. This resolves a problem in a not-yet-upstreamed backend where a recursive pattern blew the call stack (at a depth of 255) under a debug build of tablegen. No functional change so no new test coverage. The change is minimal to avoid disturbing existing behaviour. Differential Revision: https://reviews.llvm.org/D29080 llvm-svn: 294230
* [TableGen][ISel] When factoring ScopeMatcher, if the child of the ↵Craig Topper2016-11-221-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ScopeMatcher we're working on is also a ScopeMatcher, merge all its children into the one we're working on. There were several cases in X86 where we were unable to fully factor a ScopeMatcher but created nested ScopeMatchers for some portions of it. Then we created a SwitchType that split it up and further factored it so that we ended up with something like this: SwitchType Scope Scope Sequence of matchers Some other sequence of matchers EndScope Another sequence of matchers EndScope ...Next type This change turns it into this: SwitchType Scope Sequence of matchers Some other sequence of matchers Another sequence of matchers EndScope ...Next type Several other in-tree targets had similar nested scopes like this. Overall this doesn't save many bytes, but makes the isel output a little more regular. llvm-svn: 287624
* [TableGen][ISel] Do a better job of factoring ScopeMatchers created during ↵Craig Topper2016-11-211-3/+11
| | | | | | | | | | creation of SwitchTypeMatcher. Previously we were factoring when the ScopeMatcher was initially created, but it might get more Matchers added to it later. Delay factoring until we have fully created/populated the ScopeMatchers. This reduces X86 isel tables by 154 bytes. llvm-svn: 287520
* [TableGen] Fix a memory leak when creating SwitchOpcodeMatchers.Craig Topper2016-05-061-1/+2
| | | | llvm-svn: 268712
* [TableGen] Remove SinkPatternPredicates from the DAG isel matcher optimizer.Craig Topper2016-05-061-54/+0
| | | | | | Pattern predicates already appear to be emitted as far down as they can be. The optimization was making no changes on any in-tree target. llvm-svn: 268705
* SDAG: Remove OPC_MarkGlueResults and associated logic. NFCJustin Bogner2016-05-051-18/+0
| | | | | | | | | This opcode never happens in practice, and yet the logic we have in place to handle it would be undefined behaviour if we ever executed it. Remove it rather than trying to refactor code that's never reached. llvm-svn: 268692
* [TableGen] Make sure to recursively factor any ScopeMatchers created while ↵Craig Topper2016-05-051-1/+3
| | | | | | forming a SwitchType node. Remove a couple hundred bytes from the X86 matcher table. llvm-svn: 268611
* [TableGen] Remove stale comment.Craig Topper2016-05-051-2/+1
| | | | llvm-svn: 268610
* [NFC] Header cleanupMehdi Amini2016-04-181-1/+0
| | | | | | | | | | | | | | Removed some unused headers, replaced some headers with forward class declarations. Found using simple scripts like this one: clear && ack --cpp -l '#include "llvm/ADT/IndexedMap.h"' | xargs grep -L 'IndexedMap[<]' | xargs grep -n --color=auto 'IndexedMap' Patch by Eugene Kosov <claprix@yandex.ru> Differential Revision: http://reviews.llvm.org/D19219 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 266595
* Use unique_ptr to remove explicit delete.Craig Topper2014-12-151-4/+3
| | | | llvm-svn: 224224
* Make StringSet::insert return pair<iterator, bool> like other ↵David Blaikie2014-11-191-1/+1
| | | | | | | | | | | | self-associative containers StringSet is still a bit dodgy in that it exposes the raw iterator of the StringMap parent, which exposes the weird detail that StringSet actually has a 'value'... but anyway, this is useful for a handful of clients that want to reference the newly inserted/persistent string data in the StringSet/Map/Entry/thing. llvm-svn: 222302
* Fix typos in comments, NFCRobin Morisset2014-08-291-1/+1
| | | | | | | | | | | | | | Summary: Just fixing comments, no functional change. Test Plan: N/A Reviewers: jfb Subscribers: mcrosier, llvm-commits Differential Revision: http://reviews.llvm.org/D5130 llvm-svn: 216784
* Remove uses of the redundant ".reset(nullptr)" of unique_ptr, in favor of ↵David Blaikie2014-07-191-1/+1
| | | | | | | | | | | ".reset()" It's also possible to just write "= nullptr", but there's some question of whether that's as readable, so I leave it up to authors to pick which they prefer for now. If we want to discuss standardizing on one or the other, we can do that at some point in the future. llvm-svn: 213438
* [Modules] Fix potential ODR violations by sinking the DEBUG_TYPEChandler Carruth2014-04-221-1/+2
| | | | | | definition below all of the header #include lines, TableGen edition. llvm-svn: 206846
* [C++11] More 'nullptr' conversion. In some cases just using a boolean check ↵Craig Topper2014-04-151-10/+10
| | | | | | instead of comparing to nullptr. llvm-svn: 206254
* Replace OwningPtr<T> with std::unique_ptr<T>.Ahmed Charles2014-03-061-7/+7
| | | | | | | | | | This compiles with no changes to clang/lld/lldb with MSVC and includes overloads to various functions which are used by those projects and llvm which have OwningPtr's as parameters. This should allow out of tree projects some time to move. There are also no changes to libs/Target, which should help out of tree targets have time to move, if necessary. llvm-svn: 203083
* [C++11] Replace OwningPtr::take() with OwningPtr::release().Ahmed Charles2014-03-051-8/+8
| | | | llvm-svn: 202957
* Add CheckChildInteger to ISelMatcher operations. Removes nearly 2000 bytes ↵Craig Topper2014-02-051-1/+5
| | | | | | from X86 matcher table. llvm-svn: 200821
* Use ArrayRef to simplify some code.Craig Topper2014-01-211-6/+5
| | | | llvm-svn: 199712
* Add OPC_CheckChildSame0-3 to the DAG isel matcher. This replaces sequences ↵Craig Topper2013-10-051-1/+5
| | | | | | of MoveChild, CheckSame, MoveParent. Saves 846 bytes from the X86 DAG isel matcher, ~300 from ARM, ~840 from Hexagon. llvm-svn: 192026
* Revert r191940 to see if it fixes the build bots.Craig Topper2013-10-041-5/+1
| | | | llvm-svn: 191941
* Add OPC_CheckChildSame0-3 to the DAG isel matcher. This replaces sequences ↵Craig Topper2013-10-041-1/+5
| | | | | | of MoveChild, CheckSame, MoveParent. Saves 846 bytes from the X86 DAG isel matcher, ~300 from ARM, ~840 from Hexagon. llvm-svn: 191940
* Remove unused STL header includes.Jay Foad2011-04-231-1/+0
| | | | llvm-svn: 130068
* Flag -> Glue, the ongoing sagaChris Lattner2010-12-231-1/+1
| | | | llvm-svn: 122513
* continue renaming flag -> glue.Chris Lattner2010-12-231-8/+8
| | | | llvm-svn: 122506
* add plumbing for handling multiple result nodes Chris Lattner2010-03-241-4/+7
| | | | | | in some more places. llvm-svn: 99366
* don't form a RecordChild or CheckChildType for child #'s over 7, we don'tChris Lattner2010-03-161-3/+5
| | | | | | have enums for them. llvm-svn: 98597
* turn off debug spewChris Lattner2010-03-071-2/+2
| | | | llvm-svn: 97912
* more factoring.Chris Lattner2010-03-071-22/+30
| | | | llvm-svn: 97911
* teach tblgen to be more aggressive when factoring CheckType nodes.Chris Lattner2010-03-071-29/+95
| | | | | | | | | | | | | | | | | | | | | | Now it will factor things like this: CheckType i32 ... CheckOpcode ISD::AND CheckType i64 ... into: SwitchType: i32: ... i64: CheckOpcode ISD::AND ... This shrinks hte table by a few bytes, nothing spectacular. llvm-svn: 97908
* introduce a new SwitchTypeMatcher node (which is analogous toChris Lattner2010-03-031-11/+38
| | | | | | | | 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
* resolve a fixme by having the .td file parser reject thigns likeChris Lattner2010-03-011-1/+1
| | | | | | | | (set GPR, somecomplexpattern) if somecomplexpattern doesn't declare what it can match. llvm-svn: 97513
* remove dead code, simplify.Chris Lattner2010-03-011-10/+4
| | | | llvm-svn: 97510
* tolerate factoring the *last* node for CellSPU.Chris Lattner2010-03-011-0/+5
| | | | llvm-svn: 97508
* eliminate the CheckMultiOpcodeMatcher code and have each Chris Lattner2010-03-011-2/+1
| | | | | | | | | 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
* add a new OPC_SwitchOpcode which is semantically equivalentChris Lattner2010-03-011-5/+49
| | | | | | | | | | | | 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
* pull MarkFlagResult out from between an EmitNode/CompleteMatchChris Lattner2010-03-011-1/+17
| | | | | | | pair. This encourages MorphNodeTo formation, this gets us 200 more MorphNodeTo's on X86 and shrinks the table a bit. llvm-svn: 97434
* enhance RecordNode and RecordChild comments to indicate whatChris Lattner2010-03-011-1/+2
| | | | | | 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/+20
| | | | | | | | | | | 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
* simplify some code now that chain/flag results are not stored in Chris Lattner2010-02-281-3/+3
| | | | | | the vtlist for emitnode. llvm-svn: 97429
* enhance the EmitNode/MorphNodeTo operands to take a bit thatChris Lattner2010-02-281-3/+4
| | | | | | | | 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
* use MorphNodeTo instead of SelectNodeTo. SelectNodeToChris Lattner2010-02-281-13/+13
| | | | | | is just a silly wrapper around MorphNodeTo. llvm-svn: 97416
* enhance the new isel to use SelectNodeTo for most patterns,Chris Lattner2010-02-281-8/+65
| | | | | | | | | 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-3/+2
| | | | | | it will populate. llvm-svn: 97363
* add infrastructure to support forming selectnodeto. Not used yetChris Lattner2010-02-281-0/+9
| | | | | | because I have to go on another detour first. llvm-svn: 97362
* change CheckOpcodeMatcher to hold the SDNodeInfo instead ofChris Lattner2010-02-271-1/+3
| | | | | | the opcode name. This gives the optimizer more semantic info. llvm-svn: 97346
OpenPOWER on IntegriCloud