summaryrefslogtreecommitdiffstats
path: root/llvm/utils/TableGen/CodeGenDAGPatterns.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [TableGen] Store result of getInstructionsByEnumValue in an ArrayRef instead ↵Craig Topper2016-02-011-1/+1
| | | | | | of accidentally copying to a vector. llvm-svn: 259336
* [TableGen] Remove an assumption about the order of encodings in the ↵Craig Topper2015-12-031-2/+13
| | | | | | MVT::SimpleValueType enum. Instead of assuming the types are sorted by size, scan the typeset arrays to find the smallest/largest type. NFC llvm-svn: 254589
* [TableGen] Use SmallString instead of std::string to build up a string to ↵Craig Topper2015-11-281-2/+3
| | | | | | avoid heap allocations. NFC llvm-svn: 254221
* [TableGen] Sort pattern predicates before concatenating into a string so ↵Craig Topper2015-11-271-4/+11
| | | | | | that different orders of the same set will produce the same string. This can reduce the number of unique predicates in the isel tables. NFC llvm-svn: 254192
* [SelectionDAG] Add a SDTCisSameSizeAs type constraint that can be used to ↵Craig Topper2015-11-261-0/+66
| | | | | | ensure vector widths match even if the element size and count don't. llvm-svn: 254138
* [TableGen] Flip reversed comments.Craig Topper2015-11-261-2/+2
| | | | llvm-svn: 254136
* [TableGen] Use std::remove_if instead of manually coded loops that call ↵Craig Topper2015-11-241-74/+74
| | | | | | erase multiple times. NFC llvm-svn: 253964
* [TableGen] Use the other version of EnforceVectorEltTypeIs inside the ↵Craig Topper2015-11-241-15/+1
| | | | | | TypeSet version of EnforceVectorEltTypeIs to reduce duplicated code. NFC llvm-svn: 253963
* [TableGen] Fix formatting and use logical OR. NFCCraig Topper2015-11-241-2/+1
| | | | llvm-svn: 253962
* [TableGen] Use std::set_intersection to merge TypeSets. NFCCraig Topper2015-11-241-9/+8
| | | | llvm-svn: 253961
* [TableGen] Use SmallVector::assign instead of a resize and replace element.Craig Topper2015-11-241-2/+1
| | | | llvm-svn: 253960
* [TableGen] Use std::remove_if instead of manually coded loops that called ↵Craig Topper2015-11-231-15/+13
| | | | | | erase inside them. NFC llvm-svn: 253857
* [TableGen] Use empty() instead of checking if size of vector is greater than ↵Craig Topper2015-11-231-1/+2
| | | | | | or equal to 1. llvm-svn: 253856
* Revert a portion of r253836 that seems to have broke a couple bots.Craig Topper2015-11-221-11/+14
| | | | llvm-svn: 253838
* [TableGen] Use range-based for loops. NFCCraig Topper2015-11-221-127/+112
| | | | llvm-svn: 253836
* [TableGen] Use std::fill instead of a manually coded loop. NFCCraig Topper2015-11-221-2/+2
| | | | llvm-svn: 253835
* Further simplify from r253832 with some unique_ptr and coalescing conditionsDavid Blaikie2015-11-221-17/+12
| | | | llvm-svn: 253834
* Further simplify from r253832, removing unnecessary intermediate lambdasDavid Blaikie2015-11-221-16/+4
| | | | llvm-svn: 253833
* [TableGen] Use std::any_of and std::find instead of manual loops. NFCCraig Topper2015-11-221-32/+23
| | | | llvm-svn: 253832
* [TableGen] Add a space between type and '*' in front of a variable name in ↵Craig Topper2015-10-111-1/+1
| | | | | | output file. While there replace type with 'auto' since there's a cast on the right side of the assignment. NFC llvm-svn: 249980
* Fix typos.Bruce Mitchener2015-09-121-9/+9
| | | | | | | | | | Summary: This fixes a variety of typos in docs, code and headers. Subscribers: jholewinski, sanjoy, arsenm, llvm-commits Differential Revision: http://reviews.llvm.org/D12626 llvm-svn: 247495
* Avoid a Symbol -> Name -> Symbol conversion.Rafael Espindola2015-06-221-1/+2
| | | | | | | | | | | | | | Before this we were producing a TargetExternalSymbol from a MCSymbol. That meant extracting the symbol name and fetching the symbol again down the pipeline. This patch adds a DAG.getMCSymbol that lets the MCSymbol pass unchanged on the DAG. Doing so removes the need for MO_NOPREFIX and fixes the root cause of pr23900, allowing r240130 to be committed again. llvm-svn: 240300
* [TableGen] Use range-based for loops. NFC.Craig Topper2015-06-021-6/+6
| | | | llvm-svn: 238805
* Replace push_back(Constructor(foo)) with emplace_back(foo) for non-trivial typesBenjamin Kramer2015-05-291-7/+5
| | | | | | | | | | | | | | | | | | | | If the type isn't trivially moveable emplace can skip a potentially expensive move. It also saves a couple of characters. Call sites were found with the ASTMatcher + some semi-automated cleanup. memberCallExpr( argumentCountIs(1), callee(methodDecl(hasName("push_back"))), on(hasType(recordDecl(has(namedDecl(hasName("emplace_back")))))), hasArgument(0, bindTemporaryExpr( hasType(recordDecl(hasNonTrivialDestructor())), has(constructExpr()))), unless(isInTemplateInstantiation())) No functional change intended. llvm-svn: 238602
* [TableGen] Replace some calls to ListInit::getSize() with ListInit::empty() ↵Craig Topper2015-05-141-2/+2
| | | | | | if it was just comparing to 0. NFC. llvm-svn: 237340
* Fix tablegen's PrintFatalError function to run registered fileJames Y Knight2015-05-111-15/+13
| | | | | | | | | | | | | | | cleanups. Also, change code in tablegen which printed a message and then called "exit(1)" to use PrintFatalError, instead. This fixes instances where an empty output file was left behind after a failed tablegen invocation, which would confuse subsequent ninja runs into not attempting to rebuild. Differential Revision: http://reviews.llvm.org/D9608 llvm-svn: 237058
* [TableGen] Use 'isa' to identify UnsetInits rather than comparing with the ↵Craig Topper2015-04-221-1/+1
| | | | | | singleton object created by UnsetInit::get(). Makes it more consistent with the other types. llvm-svn: 235465
* [Tablegen] Attempt to add support for patterns containing nodes with ↵Craig Topper2015-03-201-22/+27
| | | | | | | | | | multiple results. This is needed for AVX512 masked scatter/gather support. The R600 change is necessary to remove a hack that was working around the lack of multiple results. llvm-svn: 232798
* Improve and simplify EnforceSmallerThan for vector types.Craig Topper2015-03-101-54/+28
| | | | | | Explicitly compare the size of the scalar types and the whole vector size rather than just comparing enum encodings. llvm-svn: 231746
* Remove extra indentation of entire function body. NFC.Craig Topper2015-03-101-140/+140
| | | | llvm-svn: 231745
* Revert "[TableGen] Implement at least some support for multiple explicit ↵Craig Topper2015-03-051-10/+10
| | | | | | | | results in an instruction pattern. No functional change to existing patterns." This is failing on several build bots. llvm-svn: 231358
* [TableGen] Implement at least some support for multiple explicit results in ↵Craig Topper2015-03-051-10/+10
| | | | | | | | an instruction pattern. No functional change to existing patterns. This should help with the AVX512 masked gather changes Elena is working on. This patch is derived from some of the changes Elena made to tablegen, but modified by me to support arbitrary number of results. llvm-svn: 231357
* [TableGen] Add support constraining a vector type in a pattern to have a ↵Craig Topper2015-03-051-0/+111
| | | | | | specific element type and for constraining a vector type to have the same number of elements as another vector type. This is useful for AVX512 mask operations so we relate the mask type to the type of the other arguments. llvm-svn: 231356
* [Tablegen] Use correct result number variables with the pattern nodes they ↵Craig Topper2015-03-041-2/+2
| | | | | | go with when handling SDTCisSameAs. No functional change as they are always both 0 unless you try to define a multi result type profile that uses SDTCisSame on one of the other results. llvm-svn: 231226
* Reverted 230471 - gather scatter handling in table gen.Elena Demikhovsky2015-03-011-15/+5
| | | | llvm-svn: 230892
* AVX-512: Gather and Scatter patternsElena Demikhovsky2015-02-251-5/+15
| | | | | | | | | | | | | | | Gather and scatter instructions additionally write to one of the source operands - mask register. In this case Gather has 2 destination values - the loaded value and the mask. Till now we did not support code gen pattern for gather - the instruction was generated from intrinsic only and machine node was hardcoded. When we introduce the masked_gather node, we need to select instruction automatically, in the standard way. I added a flag "hasTwoExplicitDefs" that allows to handle 2 destination operands. (Some code in the X86InstrFragmentsSIMD.td is commented out, just to split one big patch in many small patches) llvm-svn: 230471
* Intrinsics: introduce llvm_any_ty aka ValueType AnyRamkumar Ramachandra2015-01-221-1/+1
| | | | | | | | | | | | | | | Specifically, gc.result benefits from this greatly. Instead of: gc.result.int.* gc.result.float.* gc.result.ptr.* ... We now have a gc.result.* that can specialize to literally any type. Differential Revision: http://reviews.llvm.org/D7020 llvm-svn: 226857
* Clean up static analyzer warnings.Michael Ilseman2014-12-121-1/+3
| | | | | | | | | Clang's static analyzer found several potential cases of undefined behavior, use of un-initialized values, and potentially null pointer dereferences in tablegen, Support, MC, and ADT. This cleans them up with specific assertions on the assumptions of the code. llvm-svn: 224154
* Try to include operand counts for mismatches in tablegen.Matt Arsenault2014-12-111-6/+21
| | | | llvm-svn: 224068
* Remove neverHasSideEffects support from TableGen CodeGenInstruction. ↵Craig Topper2014-11-261-7/+0
| | | | | | Everyone should use hasSideEffects now. llvm-svn: 222809
* Revert "Improve memory ownership/management in TableGen by unique_ptrifying ↵David Blaikie2014-11-171-36/+34
| | | | | | | | | | | | TreePattern's Tree member." This reverts commit r222183. Broke on the MSVC buildbots due to MSVC not producing default move operations - I'd fix it immediately but just broke my build system a bit, so backing out until I have a chance to get everything going again. llvm-svn: 222187
* Improve memory ownership/management in TableGen by unique_ptrifying ↵David Blaikie2014-11-171-34/+36
| | | | | | | | | | | | TreePattern's Tree member. The next step is to actually use unique_ptr in TreePatternNode's Children vector. That will be more intrusive, and may not work, depending on exactly how these things are handled (I have a bad suspicion things are shared more than they should be, making this more DAG than tree - but if it's really a tree, unique_ptr should suffice) llvm-svn: 222183
* Turn a leaked object into a stack variable instead.David Blaikie2014-11-141-19/+19
| | | | llvm-svn: 222046
* Use unique_ptr to handle ownership of TreePatterns in ↵David Blaikie2014-11-131-15/+8
| | | | | | | | | CodeGenDAGPatterns::PatternFragments We might be able to use unique_ptr to handle ownership of the TreePatternNodes too - looking into that next. llvm-svn: 221928
* Make TreePattern::error use TwineMatt Arsenault2014-11-111-1/+1
| | | | | | | The underlying error function already uses a Twine, and most of the uses build up strings. llvm-svn: 221740
* Support REG_SEQUENCE in tablegen.Matt Arsenault2014-11-021-2/+39
| | | | | | | | | The problem is mostly that variadic output instruction aren't handled, so it is rejected for having an inconsistent number of operands, and then the right number of operands isn't emitted. llvm-svn: 221117
* TableGen: Allow AddedComplexity values to be negativeTom Stellard2014-08-011-1/+1
| | | | | | | | | | | | | This is useful for cases when stand-alone patterns are preferred to the patterns included in the instruction definitions. Instead of requiring that stand-alone patterns set a larger AddedComplexity value, which can be confusing to new developers, the allows us to reduce the complexity of the included patterns to achieve the same result. There will be test cases for this added to the R600 backend in a future commit. llvm-svn: 214466
* Revert of r213521. This change introduced a non-hermetic test (depending on aRichard Smith2014-07-221-1/+1
| | | | | | | | | | file not in the test/ area). Backing out now so that this test isn't part of the 3.5 branch. Original commit message: "TableGen: Allow AddedComplexity values to be negative [...]" llvm-svn: 213596
* TableGen: Allow AddedComplexity values to be negativeTom Stellard2014-07-211-1/+1
| | | | | | | | | | This is useful for cases when stand-alone patterns are preferred to the patterns included in the instruction definitions. Instead of requiring that stand-alone patterns set a larger AddedComplexity value, which can be confusing to new developers, the allows us to reduce the complexity of the included patterns to achieve the same result. llvm-svn: 213521
* Change an assert() to a diagnostic.Jim Grosbach2014-07-091-3/+5
| | | | llvm-svn: 212637
OpenPOWER on IntegriCloud