summaryrefslogtreecommitdiffstats
path: root/llvm/utils/TableGen/AsmMatcherEmitter.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* [TableGen] Use 'size_t' instead of 'unsigned' to better match the argument ↵Craig Topper2015-12-301-5/+5
| | | | | | types of addAsmOperand. Simplify some code by using StringRef::find instead of std::find. These were previously done in r247527 and r247528, but another commit seems to have erased them. NFC llvm-svn: 256624
* De-virtualize mnemonicIsValid and remove from the base class. It's not ↵Craig Topper2015-12-291-1/+1
| | | | | | called by any common code. llvm-svn: 256544
* [TableGen] Add missing space to output.Craig Topper2015-12-291-1/+1
| | | | llvm-svn: 256540
* [TableGen] Use range-based for loops. NFCCraig Topper2015-12-291-10/+5
| | | | llvm-svn: 256539
* Default SetVector to use a DenseSet.Rafael Espindola2015-11-181-3/+3
| | | | | | | | | | | | | | | We use to have an odd difference among MapVector and SetVector. The map used a DenseMop, but the set used a SmallSet, which in turn uses a std::set. I have changed SetVector to use a DenseSet. If you were depending on the old behaviour you can pass an explicit set type or use SmallSetVector. The common cases for needing to do it are: * Optimizing for small sets. * Sets for types not supported by DenseSet. llvm-svn: 253439
* [MCTargetAsmParser] Move the member varialbes that referenceAkira Hatanaka2015-11-141-1/+1
| | | | | | | | | | MCSubtargetInfo in the subclasses into MCTargetAsmParser and define a member function getSTI. This is done in preparation for making changes to shrink the size of MCRelaxableFragment. (see http://reviews.llvm.org/D14346). llvm-svn: 253124
* [AsmParser] Generalize matching for grammars without mnemonic-lead statementsColin LeMahieu2015-11-091-35/+31
| | | | | | Differential Revision: http://reviews.llvm.org/D14257 llvm-svn: 252440
* [AsmParser] Backends can parameterize ASM tokenization.Colin LeMahieu2015-11-091-47/+68
| | | | llvm-svn: 252439
* [TableGen] Use range-based for loops and make a helper function static. NFCCraig Topper2015-09-131-46/+39
| | | | llvm-svn: 247529
* [TableGen] Simplify some code by using StringRef::find instead of std::find. NFCCraig Topper2015-09-131-3/+3
| | | | llvm-svn: 247528
* [TableGen] Use 'size_t' instead of 'unsigned' to better match the argument ↵Craig Topper2015-09-131-2/+2
| | | | | | types of addAsmOperand. NFC llvm-svn: 247527
* [TableGen] Use make_unique. NFC.Craig Topper2015-09-061-3/+3
| | | | llvm-svn: 246936
* [TableGen] Use range-based for loop.Craig Topper2015-08-161-4/+2
| | | | llvm-svn: 245191
* [TableGen] Move the ConversionRow vector into the ConversionTable instead of ↵Craig Topper2015-08-161-1/+1
| | | | | | copying. llvm-svn: 245190
* [TableGen] NFC improving comments about what the tokenized identifiers will ↵Colin LeMahieu2015-08-101-1/+2
| | | | | | contain. llvm-svn: 244493
* -Wdeprecated-clean: Fix cases of violating the rule of 5 in ways that are ↵David Blaikie2015-08-011-0/+14
| | | | | | deprecated in C++11 llvm-svn: 243816
* Reverting r241058 because it's causing buildbot failures.Ranjeet Singh2015-06-301-30/+26
| | | | llvm-svn: 241061
* There are a few places where subtarget features are stillRanjeet Singh2015-06-301-26/+30
| | | | | | | | | represented by uint64_t, this patch replaces these usages with the FeatureBitset (std::bitset) type. Differential Revision: http://reviews.llvm.org/D10542 llvm-svn: 241058
* [TableGen] Use range-based for loops. NFC.Craig Topper2015-06-021-2/+2
| | | | llvm-svn: 238805
* Replace push_back(Constructor(foo)) with emplace_back(foo) for non-trivial typesBenjamin Kramer2015-05-291-6/+4
| | | | | | | | | | | | | | | | | | | | 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][AsmMatcherEmitter] Only parse isolated tokens as registers.Ahmed Bougacha2015-05-291-4/+22
| | | | | | | | | | | | | | Fixes PR23455, where, when TableGen generates the matcher from the AsmString, it splits "cmp${cc}ss" into tokens, and the "ss" suffix is recognized as the SS register. I can't think of a situation where that's a feature, not a bug, hence: when a token is "isolated", i.e., it is followed and preceded by separators, it shouldn't be parsed as a register. Differential Revision: http://reviews.llvm.org/D9844 llvm-svn: 238536
* [TableGen][AsmMatcherEmitter] Factor out AsmOperand creation. NFC.Ahmed Bougacha2015-05-291-8/+15
| | | | llvm-svn: 238534
* AsmMatcherEmitter: Add an option to override custom converters for InstAliasTom Stellard2015-05-261-3/+12
| | | | | | | | | | | | | | | | | If there is an InstAlias defined for an instruction that had a custom converter (AsmMatchConverter), then when the alias is matched, the custom converter will be used rather than the converter generated by the InstAlias. This patch adds the UseInstAsmMatchConverter field to the InstAlias class, which allows you to override this behavior and force the converter generated by the InstAlias to be used. This is required for some future improvemnts to the R600 assembler. Differential Revision: http://reviews.llvm.org/D9083 llvm-svn: 238210
* Use std::bitset for SubtargetFeatures.Michael Kuperstein2015-05-261-7/+5
| | | | | | | | | | | | Previously, subtarget features were a bitfield with the underlying type being uint64_t. Since several targets (X86 and ARM, in particular) have hit or were very close to hitting this bound, switching the features to use a bitset. No functional change. The first several times this was committed (e.g. r229831, r233055), it caused several buildbot failures. Apparently the reason for most failures was both clang and gcc's inability to deal with large numbers (> 10K) of bitset constructor calls in tablegen-generated initializers of instruction info tables. This should now be fixed. llvm-svn: 238192
* MC: Modernize MCOperand API naming. NFC.Jim Grosbach2015-05-131-2/+2
| | | | | | MCOperand::Create*() methods renamed to MCOperand::create*(). llvm-svn: 237275
* Reverting r237234, "Use std::bitset for SubtargetFeatures"Michael Kuperstein2015-05-131-5/+7
| | | | | | | The buildbots are still not satisfied. MIPS and ARM are failing (even though at least MIPS was expected to pass). llvm-svn: 237245
* Use std::bitset for SubtargetFeaturesMichael Kuperstein2015-05-131-7/+5
| | | | | | | | | | | Previously, subtarget features were a bitfield with the underlying type being uint64_t. Since several targets (X86 and ARM, in particular) have hit or were very close to hitting this bound, switching the features to use a bitset. No functional change. The first two times this was committed (r229831, r233055), it caused several buildbot failures. At least some of the ARM and MIPS ones were due to gcc/binutils issues, and should now be fixed. llvm-svn: 237234
* Revert "Use std::bitset for SubtargetFeatures"Michael Kuperstein2015-03-241-5/+7
| | | | | | | | This reverts commit r233055. It still causes buildbot failures (gcc running out of memory on several platforms, and a self-host failure on arm), although less than the previous time. llvm-svn: 233068
* Use std::bitset for SubtargetFeaturesMichael Kuperstein2015-03-241-7/+5
| | | | | | | | | | | | | Previously, subtarget features were a bitfield with the underlying type being uint64_t. Since several targets (X86 and ARM, in particular) have hit or were very close to hitting this bound, switching the features to use a bitset. No functional change. The first time this was committed (r229831), it caused several buildbot failures. At least some of the ARM ones were due to gcc/binutils issues, and should now be fixed. Differential Revision: http://reviews.llvm.org/D8542 llvm-svn: 233055
* TableGen: Initialize ErrorInfo to ~0ULL in the MatchInstructionImplTom Stellard2015-03-051-1/+1
| | | | | | | | This is what all the targets check for and is consistent with the initialized value of MissingFeatures, which is sometimes assinged to ErrorInfo. llvm-svn: 231397
* Add a FIXME for PR22796, broken ordering of ClassInfo in TableGenDavid Blaikie2015-03-041-0/+5
| | | | | | As discussed (at length) in code review of r222935, with Duncan. llvm-svn: 231282
* Revert "Remove the explicit SDNodeIterator::operator= in favor of the ↵David Blaikie2015-03-031-2/+0
| | | | | | | | | | | implicit default" Accidentally committed a few more of these cleanup changes than intended. Still breaking these out & tidying them up. This reverts commit r231135. llvm-svn: 231136
* Remove the explicit SDNodeIterator::operator= in favor of the implicit defaultDavid Blaikie2015-03-031-0/+2
| | | | | | | | | | There doesn't seem to be any need to assert that iterator assignment is between iterators over the same node - if you want to reuse an iterator variable to iterate another node, that's perfectly acceptable. Just don't mix comparisons between iterators into disjoint sequences, as usual. llvm-svn: 231135
* Replace std::copy with a back inserter with vector append where feasibleBenjamin Kramer2015-02-281-2/+3
| | | | | | | | | All of the cases were just appending from random access iterators to a vector. Using insert/append can grow the vector to the perfect size directly and moves the growing out of the loop. No intended functionalty change. llvm-svn: 230845
* Reverting r229831 due to multiple ARM/PPC/MIPS build-bot failures.Michael Kuperstein2015-02-191-5/+7
| | | | llvm-svn: 229841
* Use std::bitset for SubtargetFeaturesMichael Kuperstein2015-02-191-7/+5
| | | | | | | | | | | Previously, subtarget features were a bitfield with the underlying type being uint64_t. Since several targets (X86 and ARM, in particular) have hit or were very close to hitting this bound, switching the features to use a bitset. No functional change. Differential Revision: http://reviews.llvm.org/D7065 llvm-svn: 229831
* MathExtras: Bring Count(Trailing|Leading)Ones and CountPopulation in line ↵Benjamin Kramer2015-02-121-2/+2
| | | | | | | | with countTrailingZeros Update all callers. llvm-svn: 228930
* Replace size method call of containers to empty method where appropriateAlexander Kornienko2015-01-151-2/+2
| | | | | | | | | | | | | | | | This patch was generated by a clang tidy checker that is being open sourced. The documentation of that checker is the following: /// The emptiness of a container should be checked using the empty method /// instead of the size method. It is not guaranteed that size is a /// constant-time function, and it is generally more efficient and also shows /// clearer intent to use empty. Furthermore some containers may implement the /// empty method but not implement the size method. Using empty whenever /// possible makes it easier to switch to another container in the future. Patch by Gábor Horváth! llvm-svn: 226161
* [TableGen] Add support for negative immediates to AsmMatcherEmitterHal Finkel2015-01-151-0/+2
| | | | | | | | | | | | | | | | This adds support for creating an InstAlias with a negative immediate, i.e.: def NOT : InstAlias<"not $dst, $src", (XORI GR32:$dst, GR32:$src, -1)>; by resolving this problem: RISCVGenAsmMatcher.inc:95:11: error: expected '= constant-expression' or end of enumerator definition CVT_imm_-1, ^^^^^^^^^^ Patch by Jordy Potman, thanks! llvm-svn: 226073
* Fix some formatting in tablegen output.Craig Topper2015-01-031-7/+4
| | | | llvm-svn: 225113
* Replace some 'unreachable' comments with llvm_unreachable.Craig Topper2015-01-031-2/+2
| | | | llvm-svn: 225112
* Use iterators rather than indices to make this forwards-compatible with a ↵David Blaikie2014-12-221-4/+5
| | | | | | change to the underlying container (to std::list) llvm-svn: 224734
* unique_ptrify MatchableInfo(const CodeGenInstAlias *Alias)'s parameterDavid Blaikie2014-12-221-14/+11
| | | | llvm-svn: 224733
* [MC] Reset the MCInst in the matcher function before adding opcode/operands.Ahmed Bougacha2014-12-161-0/+1
| | | | | | | | | | | | | | | | | | On X86, the Intel asm parser tries to match all memory operand sizes when none is explicitly specified. For LEA, which doesn't really have a memory operand (just a pointer one), this results in multiple successful matches, one for each memory size. There's no error because it's same opcode, so really, it's just one match. However, the tablegen'd matcher function adds opcode/operands to the passed MCInst, and this results in multiple duplicated operands. This commit clears the MCInst in the tablegen'd matcher function. We sometimes clear it when the match failed, so there's no expectation of keeping the previous content anyway. Differential Revision: http://reviews.llvm.org/D6670 llvm-svn: 224347
* Simplify ownership of RegClasses by using list<CodeGenRegisterClass> instead ↵David Blaikie2014-12-031-11/+11
| | | | | | | | | | of vector<CodeGenRegisterClass*> This complicates a few algorithms due to not having random access, but not by a huge degree I don't think (open to debate/design discussion/etc). llvm-svn: 223261
* Range-for some stuff related to RegClasses, and comment cases where ↵David Blaikie2014-12-031-2/+1
| | | | | | range-for isn't suitable. llvm-svn: 223260
* Remove indirection of vector<T*> in favor of deque<T>David Blaikie2014-11-291-13/+10
| | | | llvm-svn: 222958
* Revert "Simplify some more ownership using forward_list<T> rather than ↵Duncan P. N. Exon Smith2014-11-281-66/+82
| | | | | | | | | | | | vector<unique_ptr<T>>" This reverts commit r222935 and its follow-up r222938 ("Push unique_ptr a bit further through some APIs and simplify some cleanup"), since it causes bot failures (at least on Darwin): http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-incremental/1391/ llvm-svn: 222943
* Reapply "Use std::map<K, V> rather than std::map<K, std::unique_ptr<V>>""David Blaikie2014-11-281-16/+14
| | | | | | | | | Just avoid using std::map::emplace since it's not implemented in libstdc++ 4.7. Reapplies r222937, reverted in r222939. llvm-svn: 222940
* Revert "Use std::map<K, V> rather than std::map<K, std::unique_ptr<V>>"David Blaikie2014-11-281-15/+16
| | | | | | | | | Seems libstdc++ on some buildbots is lacking std::map::emplace, which is weird... reverting while I look into it. This reverts commit r222937. llvm-svn: 222939
OpenPOWER on IntegriCloud