llvm-project/mlir/include
Laszlo Kindrat ac14d5a1db [mlir] Enable perfect forwarding in RewritePatternSet::add
This patch modifies the implementation of `RewritePatternSet::add` to perfectly forward its arguments to pattern constructors. Without this, code like the following compiles but, due to the limited lifetime of the temporary TypeConverter, can produce unexpected behavior:
```
RewritePatternSet patterns(context);
patterns.add<SomeOpConversion, OtherOpConversion>(TypeConverter(), context);

if (failed(applyPartialConversion(getOperation(), target, std::move(patterns))))
  return signalPassFailure();
```

The patch also changes the linalg fusion pattern implementation to correctly fill the test pattern set given the new behavior.

Author: Laszlo Kindrat <laszlokindrat@gmail.com>

Reviewed By: nicolasvasilache

Differential Revision: https://reviews.llvm.org/D129601
2022-07-15 19:44:18 +02:00
..
mlir [mlir] Enable perfect forwarding in RewritePatternSet::add 2022-07-15 19:44:18 +02:00
mlir-c [mlir] Structured transforms: introduce op splitting 2022-07-07 13:19:44 +02:00