summaryrefslogtreecommitdiffstats
path: root/mlir/test/lib/IR
Commit message (Collapse)AuthorAgeFilesLines
* [mlir] NFC: Remove unused variable.River Riddle2020-01-131-1/+1
|
* [mlir] Update the use-list algorithms in SymbolTable to support nested ↵River Riddle2020-01-131-42/+60
| | | | | | | | | | references. Summary: This updates the use list algorithms to support querying from a specific symbol, allowing for the collection and detection of nested references. This works by walking the parent "symbol scopes" and applying the existing algorithm at each level. Reviewed By: jpienaar Differential Revision: https://reviews.llvm.org/D72042
* [mlir] m_Constant()Lorenzo Chelini2020-01-131-0/+3
| | | | | | Summary: Introduce m_Constant() which allows matching a constant operation without forcing the user also to capture the attribute value. Differential Revision: https://reviews.llvm.org/D72397
* Adjust License.txt file to use the LLVM licenseMehdi Amini2019-12-233-39/+12
| | | | PiperOrigin-RevId: 286906740
* Add missing CMake dependency for MLIRTestIR.Mahesh Ravishankar2019-12-111-0/+3
| | | | PiperOrigin-RevId: 285039153
* Post-submit cleanups in RecursiveMatchersNicolas Vasilache2019-12-091-28/+34
| | | | | | | This CL addresses leftover cleanups and adds a test mixing RecursiveMatchers and m_Constant that captures properly. PiperOrigin-RevId: 284551567
* Add a layer of recursive matchers that compose.Nicolas Vasilache2019-12-082-0/+151
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This CL adds support for building matchers recursively. The following matchers are provided: 1. `m_any()` can match any value 2. `m_val(Value *)` binds to a value and must match it 3. `RecursivePatternMatcher<OpType, Matchers...>` n-arity pattern that matches `OpType` and whose operands must be matched exactly by `Matchers...`. This allows building expression templates for patterns, declaratively, in a very natural fashion. For example pattern `p9` defined as follows: ``` auto mul_of_muladd = m_Op<MulFOp>(m_Op<MulFOp>(), m_Op<AddFOp>()); auto mul_of_anyadd = m_Op<MulFOp>(m_any(), m_Op<AddFOp>()); auto p9 = m_Op<MulFOp>(m_Op<MulFOp>( mul_of_muladd, m_Op<MulFOp>()), m_Op<MulFOp>(mul_of_anyadd, mul_of_anyadd)); ``` Successfully matches `%6` in: ``` %0 = addf %a, %b: f32 %1 = addf %a, %c: f32 // matched %2 = addf %c, %b: f32 %3 = mulf %a, %2: f32 // matched %4 = mulf %3, %1: f32 // matched %5 = mulf %4, %4: f32 // matched %6 = mulf %5, %5: f32 // matched ``` Note that 0-ary matchers can be used as leaves in place of n-ary matchers. This alleviates from passing explicit `m_any()` leaves. In the future, we may add extra patterns to specify that operands may be matched in any order. PiperOrigin-RevId: 284469446
* Add include path to the TestDialect to fix broken build.River Riddle2019-12-051-0/+2
| | | | PiperOrigin-RevId: 284067891
* Move ModuleManager functionality into mlir::SymbolTable.Tres Popp2019-12-051-1/+17
| | | | | | | | | | Note for broken code, the following transformations occurred: ModuleManager::insert(Block::iterator, Operation*) - > SymbolTable::insert(Operation*, Block::iterator) ModuleManager::lookupSymbol -> SymbolTable::lookup ModuleManager::getModule() -> SymbolTable::getOp() ModuleManager::getContext() -> SymbolTable::getOp()->getContext() ModuleManager::* -> SymbolTable::* PiperOrigin-RevId: 283944635
* Add FuncOp::eraseArgumentSean Silva2019-11-132-0/+68
| | | | | | | | | | | | This is a quite complex operation that users are likely to attempt to write themselves and get wrong (citation: users=me). Ideally, we could pull this into FunctionLike, but for now, the FunctionType rewriting makes it FuncOp specific. We would need some hook for rewriting the function type (which for LLVM's func op, would need to rewrite the underlying LLVM type). PiperOrigin-RevId: 280234164
* Add support for replacing all uses of a symbol.River Riddle2019-10-241-0/+19
| | | | | | This requires reconstructing the attribute dictionary of each operation containing a use. PiperOrigin-RevId: 276520544
* Add a Symbol trait to simplify defining operations that represent symbols.River Riddle2019-10-211-2/+2
| | | | | | This trait provides accessors for the name, symbol use list methods, verification, with more to be added. PiperOrigin-RevId: 275864554
* Update the symbol utility methods to handle the case of unknown operations.River Riddle2019-10-081-18/+21
| | | | | | This enhances the symbol table utility methods to handle the case where an unknown operation may define a symbol table. When walking symbols, we now collect all symbol uses before allowing the user to iterate. This prevents the user from assuming that all symbols are actually known before performing a transformation. PiperOrigin-RevId: 273651963
* Add support for walking the uses of a symbol.River Riddle2019-10-082-0/+71
MLIR uses symbol references to model references to many global entities, such as functions/variables/etc. Before this change, there is no way to actually reason about the uses of such entities. This change provides a walker for symbol references(via SymbolTable::walkSymbolUses), as well as 'use_empty' support(via SymbolTable::symbol_use_empty). It also resolves some deficiencies in the LangRef definition of SymbolRefAttr, namely the restrictions on where a SymbolRefAttr can be stored, ArrayAttr and DictionaryAttr, and the relationship with operations containing the SymbolTable trait. PiperOrigin-RevId: 273549331
OpenPOWER on IntegriCloud