[XLA] LHLO-to-Ploop: explicitly construct ValueRange when building scf::ParallelOp

The builder API is about to change in LLVM, which would lead to ambiguity in
overload resolution in these cases. Proactively fix the issue by constructing
ValueRange of steps explicitly before it is passed to the builder function.

PiperOrigin-RevId: 316497983
Change-Id: Ibb5dfe006071ab9513634c9613f43ce60a0efd22
This commit is contained in:
Alex Zinenko 2020-06-15 10:47:31 -07:00 committed by TensorFlower Gardener
parent 8d5d9a50d3
commit 80b3b4fa9f

View File

@ -261,7 +261,7 @@ class ReduceOpConverter : public OpConversionPattern<xla_lhlo::ReduceOp> {
rewriter->setInsertionPointToStart(outer.getBody());
}
scf::ParallelOp inner = rewriter->create<scf::ParallelOp>(
loc, reduce_lower, reduce_upper, reduce_step, init_value);
loc, reduce_lower, reduce_upper, reduce_step, ValueRange(init_value));
Value reduction_result = *inner.getResults().begin();
SmallVector<Value, 1> out_indices;
@ -406,7 +406,7 @@ class ReduceWindowOpConverter
rewriter->create<ConstantIndexOp>(loc, window_dim.getSExtValue()));
}
auto window_loop = rewriter->create<scf::ParallelOp>(
loc, window_lower, window_upper, window_step, init_value);
loc, window_lower, window_upper, window_step, ValueRange(init_value));
Value reduction_result = *window_loop.getResults().begin();
auto output_ivs = output_loop.getInductionVars();