Correct non ConversionRewriter transformation in LegalizeToLinalg

PiperOrigin-RevId: 347622657
This commit is contained in:
Tres Popp 2020-12-15 08:56:01 -08:00 committed by TensorFlow MLIR Team
parent f0c2695d31
commit 6d7812bbc5
1 changed files with 2 additions and 1 deletions

View File

@ -813,7 +813,8 @@ class ReduceConverter : public OpConversionPattern<lmhlo::ReduceOp> {
loc, /*resultTensorTypes=*/ArrayRef<Type>{},
/*inputs=*/adaptor.operands(), /*outputBuffers=*/adaptor.out(),
/*initTensors=*/ValueRange{}, maps, types);
linalg_op.region().takeBody(reduce_op.body());
rewriter.inlineRegionBefore(reduce_op.body(), linalg_op.region(),
linalg_op.region().end());
{
OpBuilder::InsertionGuard region_guard(rewriter);
Block* block = linalg_op.getBody();