| 4010 | } |
| 4011 | |
| 4012 | Status AlgebraicSimplifierVisitor::HandleSelect(HloInstruction* select) { |
| 4013 | // select(x, y, y) -> y. |
| 4014 | if (select->operand(1) == select->operand(2)) { |
| 4015 | return ReplaceInstruction(select, select->mutable_operand(1)); |
| 4016 | } |
| 4017 | // select(true, x, y) -> x. |
| 4018 | if (IsAll(select->operand(0), true)) { |
| 4019 | return ReplaceInstruction(select, select->mutable_operand(1)); |
| 4020 | } |
| 4021 | // select(false, x, y) -> y. |
| 4022 | if (IsAll(select->operand(0), false)) { |
| 4023 | return ReplaceInstruction(select, select->mutable_operand(2)); |
| 4024 | } |
| 4025 | return Status::OK(); |
| 4026 | } |
| 4027 | |
| 4028 | Status AlgebraicSimplifierVisitor::HandleScatter(HloInstruction* scatter) { |
| 4029 | if (ShapeUtil::IsZeroElementArray(scatter->operand(2)->shape()) && |
nothing calls this directly
no test coverage detected