summaryrefslogtreecommitdiffstats
path: root/llvm/utils/TableGen/CodeGenDAGPatterns.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Cleanup dump() functions.Matthias Braun2017-01-281-2/+2
| | | | | | | | | | | | | | | | | | We had various variants of defining dump() functions in LLVM. Normalize them (this should just consistently implement the things discussed in http://lists.llvm.org/pipermail/cfe-dev/2014-January/034323.html For reference: - Public headers should just declare the dump() method but not use LLVM_DUMP_METHOD or #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) - The definition of a dump method should look like this: #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) LLVM_DUMP_METHOD void MyClass::dump() { // print stuff to dbgs()... } #endif llvm-svn: 293359
* [TableGen] Use 'unsigned' instead of 'bool' in a place where the code ↵Craig Topper2016-12-191-1/+1
| | | | | | conditionally assigns numeric values. They happen to be 0 and 1 so this is NFC. llvm-svn: 290088
* TableGen: Use StringInit instead of std::string for DagInit arg namesMatthias Braun2016-12-051-9/+11
| | | | llvm-svn: 288644
* TableGen: Use StringInit instead of std::string for DagInit nameMatthias Braun2016-12-051-4/+4
| | | | llvm-svn: 288643
* TableGen: Use StringRef instead of const std::string& in return vals.Matthias Braun2016-12-041-1/+1
| | | | | | | This will allow to switch to a different string storage in an upcoming commit. llvm-svn: 288612
* Re-apply r286384, "X86: Introduce the "relocImm" ComplexPattern, which ↵Peter Collingbourne2016-11-091-6/+1
| | | | | | | | | represents a relocatable immediate.", with a fix for 32-bit x86. Teach X86InstrInfo::analyzeCompare() not to crash on CMP and SUB instructions that take a global address operand. llvm-svn: 286420
* Revert r286384, "X86: Introduce the "relocImm" ComplexPattern, which ↵Peter Collingbourne2016-11-091-1/+6
| | | | | | | | | represents a relocatable immediate." Suspected to be the cause of a sanitizer-windows bot failure: Assertion failed: isImm() && "Wrong MachineOperand accessor", file C:\b\slave\sanitizer-windows\llvm\include\llvm/CodeGen/MachineOperand.h, line 420 llvm-svn: 286385
* X86: Introduce the "relocImm" ComplexPattern, which represents a relocatable ↵Peter Collingbourne2016-11-091-6/+1
| | | | | | | | | | | | | | | immediate. A relocatable immediate is either an immediate operand or an operand that can be relocated by the linker to an immediate, such as a regular symbol in non-PIC code. Start using relocImm for 32-bit and 64-bit MOV instructions, and for operands of type "imm32_su". Remove a number of now-redundant patterns. Differential Revision: https://reviews.llvm.org/D25812 llvm-svn: 286384
* Use the range variant of remove_if instead of unpacking begin/endDavid Majnemer2016-08-121-54/+39
| | | | | | No functionality change is intended. llvm-svn: 278475
* Use range algorithms instead of unpacking begin/endDavid Majnemer2016-08-111-8/+7
| | | | | | No functionality change is intended. llvm-svn: 278417
* IR: Sort generic intrinsics before target specific onesJustin Bogner2016-07-151-2/+2
| | | | | | | | | | | | This splits out the intrinsic table such that generic intrinsics come first and target specific intrinsics are grouped by target. From here we can find out which target an intrinsic is for or differentiate between generic and target intrinsics. The motivation here is to make it easier to move target specific intrinsic handling out of generic code. llvm-svn: 275575
* Add IntrWrite[Arg]Mem intrinsic propertyNicolai Haehnle2016-04-191-3/+3
| | | | | | | | | | | | | | | | | | | | | | Summary: This property is used to mark an intrinsic that only writes to memory, but neither reads from memory nor has other side effects. An example where this is useful is the llvm.amdgcn.buffer.store.format.* intrinsic, which corresponds to a store instruction that goes through a special buffer descriptor rather than through a plain pointer. With this property, the intrinsic should still be handled as having side effects at the LLVM IR level, but machine scheduling can make smarter decisions. Reviewers: tstellarAMD, arsenm, joker.eph, reames Subscribers: arsenm, llvm-commits Differential Revision: http://reviews.llvm.org/D18291 llvm-svn: 266826
* [TableGen] Make an error message slightly more informativeNicolai Haehnle2016-04-191-2/+9
| | | | | | | | | | Reviewers: ab, spop, stoklund Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D19192 llvm-svn: 266823
* [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
OpenPOWER on IntegriCloud