aboutsummaryrefslogtreecommitdiff
path: root/llvm/utils/TableGen/CodeGenDAGPatterns.cpp
AgeCommit message (Collapse)AuthorFilesLines
2016-08-12Use the range variant of remove_if instead of unpacking begin/endDavid Majnemer1-54/+39
No functionality change is intended. llvm-svn: 278475
2016-08-11Use range algorithms instead of unpacking begin/endDavid Majnemer1-8/+7
No functionality change is intended. llvm-svn: 278417
2016-07-15IR: Sort generic intrinsics before target specific onesJustin Bogner1-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
2016-04-19Add IntrWrite[Arg]Mem intrinsic propertyNicolai Haehnle1-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
2016-04-19[TableGen] Make an error message slightly more informativeNicolai Haehnle1-2/+9
Reviewers: ab, spop, stoklund Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D19192 llvm-svn: 266823
2016-02-01[TableGen] Store result of getInstructionsByEnumValue in an ArrayRef instead ↵Craig Topper1-1/+1
of accidentally copying to a vector. llvm-svn: 259336
2015-12-03[TableGen] Remove an assumption about the order of encodings in the ↵Craig Topper1-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
2015-11-28[TableGen] Use SmallString instead of std::string to build up a string to ↵Craig Topper1-2/+3
avoid heap allocations. NFC llvm-svn: 254221
2015-11-27[TableGen] Sort pattern predicates before concatenating into a string so ↵Craig Topper1-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
2015-11-26[SelectionDAG] Add a SDTCisSameSizeAs type constraint that can be used to ↵Craig Topper1-0/+66
ensure vector widths match even if the element size and count don't. llvm-svn: 254138
2015-11-26[TableGen] Flip reversed comments.Craig Topper1-2/+2
llvm-svn: 254136
2015-11-24[TableGen] Use std::remove_if instead of manually coded loops that call ↵Craig Topper1-74/+74
erase multiple times. NFC llvm-svn: 253964
2015-11-24[TableGen] Use the other version of EnforceVectorEltTypeIs inside the ↵Craig Topper1-15/+1
TypeSet version of EnforceVectorEltTypeIs to reduce duplicated code. NFC llvm-svn: 253963
2015-11-24[TableGen] Fix formatting and use logical OR. NFCCraig Topper1-2/+1
llvm-svn: 253962
2015-11-24[TableGen] Use std::set_intersection to merge TypeSets. NFCCraig Topper1-9/+8
llvm-svn: 253961
2015-11-24[TableGen] Use SmallVector::assign instead of a resize and replace element.Craig Topper1-2/+1
llvm-svn: 253960
2015-11-23[TableGen] Use std::remove_if instead of manually coded loops that called ↵Craig Topper1-15/+13
erase inside them. NFC llvm-svn: 253857
2015-11-23[TableGen] Use empty() instead of checking if size of vector is greater than ↵Craig Topper1-1/+2
or equal to 1. llvm-svn: 253856
2015-11-22Revert a portion of r253836 that seems to have broke a couple bots.Craig Topper1-11/+14
llvm-svn: 253838
2015-11-22[TableGen] Use range-based for loops. NFCCraig Topper1-127/+112
llvm-svn: 253836
2015-11-22[TableGen] Use std::fill instead of a manually coded loop. NFCCraig Topper1-2/+2
llvm-svn: 253835
2015-11-22Further simplify from r253832 with some unique_ptr and coalescing conditionsDavid Blaikie1-17/+12
llvm-svn: 253834
2015-11-22Further simplify from r253832, removing unnecessary intermediate lambdasDavid Blaikie1-16/+4
llvm-svn: 253833
2015-11-22[TableGen] Use std::any_of and std::find instead of manual loops. NFCCraig Topper1-32/+23
llvm-svn: 253832
2015-10-11[TableGen] Add a space between type and '*' in front of a variable name in ↵Craig Topper1-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
2015-09-12Fix typos.Bruce Mitchener1-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
2015-06-22Avoid a Symbol -> Name -> Symbol conversion.Rafael Espindola1-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
2015-06-02[TableGen] Use range-based for loops. NFC.Craig Topper1-6/+6
llvm-svn: 238805
2015-05-29Replace push_back(Constructor(foo)) with emplace_back(foo) for non-trivial typesBenjamin Kramer1-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
2015-05-14[TableGen] Replace some calls to ListInit::getSize() with ListInit::empty() ↵Craig Topper1-2/+2
if it was just comparing to 0. NFC. llvm-svn: 237340
2015-05-11Fix tablegen's PrintFatalError function to run registered fileJames Y Knight1-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
2015-04-22[TableGen] Use 'isa' to identify UnsetInits rather than comparing with the ↵Craig Topper1-1/+1
singleton object created by UnsetInit::get(). Makes it more consistent with the other types. llvm-svn: 235465
2015-03-20[Tablegen] Attempt to add support for patterns containing nodes with ↵Craig Topper1-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
2015-03-10Improve and simplify EnforceSmallerThan for vector types.Craig Topper1-54/+28
Explicitly compare the size of the scalar types and the whole vector size rather than just comparing enum encodings. llvm-svn: 231746
2015-03-10Remove extra indentation of entire function body. NFC.Craig Topper1-140/+140
llvm-svn: 231745
2015-03-05Revert "[TableGen] Implement at least some support for multiple explicit ↵Craig Topper1-10/+10
results in an instruction pattern. No functional change to existing patterns." This is failing on several build bots. llvm-svn: 231358
2015-03-05[TableGen] Implement at least some support for multiple explicit results in ↵Craig Topper1-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
2015-03-05[TableGen] Add support constraining a vector type in a pattern to have a ↵Craig Topper1-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
2015-03-04[Tablegen] Use correct result number variables with the pattern nodes they ↵Craig Topper1-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
2015-03-01Reverted 230471 - gather scatter handling in table gen.Elena Demikhovsky1-15/+5
llvm-svn: 230892
2015-02-25AVX-512: Gather and Scatter patternsElena Demikhovsky1-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
2015-01-22Intrinsics: introduce llvm_any_ty aka ValueType AnyRamkumar Ramachandra1-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
2014-12-12Clean up static analyzer warnings.Michael Ilseman1-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
2014-12-11Try to include operand counts for mismatches in tablegen.Matt Arsenault1-6/+21
llvm-svn: 224068
2014-11-26Remove neverHasSideEffects support from TableGen CodeGenInstruction. ↵Craig Topper1-7/+0
Everyone should use hasSideEffects now. llvm-svn: 222809
2014-11-17Revert "Improve memory ownership/management in TableGen by unique_ptrifying ↵David Blaikie1-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
2014-11-17Improve memory ownership/management in TableGen by unique_ptrifying ↵David Blaikie1-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
2014-11-14Turn a leaked object into a stack variable instead.David Blaikie1-19/+19
llvm-svn: 222046
2014-11-13Use unique_ptr to handle ownership of TreePatterns in ↵David Blaikie1-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
2014-11-11Make TreePattern::error use TwineMatt Arsenault1-1/+1
The underlying error function already uses a Twine, and most of the uses build up strings. llvm-svn: 221740