[Mlir-commits] [mlir] [mlir][python] Fixup the constantTypes of pdl.TypesOp (PR #75812)

Jiefeng Wang llvmlistbot at llvm.org
Tue Dec 19 09:13:08 PST 2023


jiefwo wrote:

If `constantTypes` is `[]`, then `position` of this node in `PatternLowering::generateMatcher` is not null either. 
```c++
  // If this node contains a position, get the corresponding value for this
  // block.
  Block *currentBlock = block;
  Position *position = node.getPosition();
  Value val = position ? getValueAt(currentBlock, position) : Value();
```

A types check with `[] will be created for PDL interpreter.
```mlir
^bb4:  // pred: ^bb3
  %2 = pdl_interp.get_results of %arg0 : !pdl.range<value>
  %3 = pdl_interp.get_value_type of %2 : !pdl.range<type>
  pdl_interp.check_types %3 are [] -> ^bb5, ^bb1
```

https://github.com/llvm/llvm-project/pull/75812


More information about the Mlir-commits mailing list