message: Use matching infrastructure in FoldConvInputPad rule
diff: @@ -5351,22 +5351,14 @@ Status AlgebraicSimplifierVisitor::HandleTranspose(HloInstruction* transpose) {
  StatusOr<bool> AlgebraicSimplifierVisitor::FoldConvInputPad(
  HloInstruction* convolution) {
  - auto* lhs = convolution->mutable_operand(0);
  - auto* rhs = convolution->mutable_operand(1);
  + HloInstruction *lhs, *a, *b;
  + if (Match(convolution,
  + m::Convolution(m::Pad(&lhs, m::Op(&a), m::ConstantScalar(0)),
  + m::Op(&b)))) {
  const auto& window = convolution->window();
  const ConvolutionDimensionNumbers& dnums =
  convolution->convolution_dimension_numbers();
  - if (lhs->opcode() != HloOpcode::kPad) {
  - return false;
  - }
  -
  - // Convolution's padding is always zero, so bail if the kPad is adding
  - // something other than zero.
  - if (!IsAll(lhs->operand(1), 0)) {
  - return false;
  - }
  -
  const auto& padding = lhs->padding_config();
  // Can't pad batch or feature dims.
  @@ -5408,13 +5400,15 @@ StatusOr<bool> AlgebraicSimplifierVisitor::FoldConvInputPad(
  }
  }
  - auto new_conv = convolution->CloneWithNewOperands(
  - convolution->shape(), {lhs->mutable_operand(0), rhs});
  + auto new_conv =
  + convolution->CloneWithNewOperands(convolution->shape(), {a, b});
  new_conv->set_window(new_window);
  TF_RETURN_IF_ERROR(
  ReplaceWithNewInstruction(convolution, std::move(new_conv)));
  return true;
  }
  + return false;
  +}
  StatusOr<bool> AlgebraicSimplifierVisitor::FoldConvFilterPad(
  HloInstruction* convolution) {
  