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>