| 2197 | } |
| 2198 | |
| 2199 | Status AlgebraicSimplifierVisitor::HandleClamp(HloInstruction* clamp) { |
| 2200 | HloInstruction* clamp_lower_bound; |
| 2201 | HloInstruction* clamp_upper_bound; |
| 2202 | HloInstruction* to_clamp; |
| 2203 | CHECK(Match(clamp, m::Clamp(m::Op(&clamp_lower_bound), m::Op(&to_clamp), |
| 2204 | m::Op(&clamp_upper_bound)))); |
| 2205 | |
| 2206 | // clamp(a, clamp(a, x, b), b) -> clamp(a, x, b) |
| 2207 | if (Match(to_clamp, m::Clamp(m::Op().Is(clamp_lower_bound), m::Op(), |
| 2208 | m::Op().Is(clamp_upper_bound))) && |
| 2209 | ReplaceInstructionIfSameShape(clamp, to_clamp)) { |
| 2210 | return Status::OK(); |
| 2211 | } |
| 2212 | |
| 2213 | return Status::OK(); |
| 2214 | } |
| 2215 | |
| 2216 | Status AlgebraicSimplifierVisitor::HandleMultiply(HloInstruction* multiply) { |
| 2217 | HloInstruction *lhs, *rhs; |