message: [XLA] Allow base dilated pad operations to fold into reduce-window operations
  This comes up in the gradient of pooling operations where the input must be
  dilated by what was the stride.
diff: @@ -3356,12 +3356,6 @@ Status AlgebraicSimplifierVisitor::HandleReduceWindow(
  return Status::OK();
  }
  - // Bail on dilation.
  - if (window_util::HasDilation(window)) {
  - VLOG(10) << "Not folding pad into reduce-window as there is dilation.";
  - return Status::OK();
  - }
  -
  VLOG(10) << "Considering folding Pad: " << pad->ToString()
  << "\ninto reduce-window: " << reduce_window->ToString()
  << (convert != nullptr
  @@ -3371,8 +3365,8 @@ Status AlgebraicSimplifierVisitor::HandleReduceWindow(
  // Do not fold interior padding into ReduceWindow since the backends do not
  // support it.
  const PaddingConfig& pad_config = pad->padding_config();
  - if (HasInteriorPadding(pad_config)) {
  - VLOG(10) << "Not folding pad into reduce-window due to interior padding.";
  + if (HasInteriorPadding(pad_config) && window_util::HasBaseDilation(window)) {
  + VLOG(10) << "Not folding interior pad into base-dilated reduce-window.";
  return Status::OK();
  }
  @@ -3417,6 +3411,10 @@ Status AlgebraicSimplifierVisitor::HandleReduceWindow(
  VLOG(10) << "Window has uneven padding.";
  return false;
  }
  + if (HasInteriorPadding(pad_config)) {
  + VLOG(10) << "Window has interior padding.";
  + return false;
  + }
  for (int64 i = 0; i < pad_config.dimensions_size(); ++i) {
  const auto& pad_dimension = pad_config.dimensions(i);
  if ((pad_dimension.edge_padding_low() != 0 ||
  @@ -3487,6 +3485,10 @@ Status AlgebraicSimplifierVisitor::HandleReduceWindow(
  pad_dim.edge_padding_low());
  window_dim.set_padding_high(window_dim.padding_high() +
  pad_dim.edge_padding_high());
  + if (pad_dim.interior_padding() != 0) {
  + CHECK_EQ(window_dim.base_dilation(), 1);
  + window_dim.set_base_dilation(1 + pad_dim.interior_padding());
  + }
  }
  return ReplaceWithNewInstruction(
  