Utility method to check eligibility for flattening.
| 114 | |
| 115 | // Utility method to check eligibility for flattening. |
| 116 | bool allInputTypesEquivalent(const TypedExprPtr& expr) { |
| 117 | const auto& inputs = expr->inputs(); |
| 118 | for (int i = 1; i < inputs.size(); i++) { |
| 119 | if (!inputs[0]->type()->equivalent(*inputs[i]->type())) { |
| 120 | return false; |
| 121 | } |
| 122 | } |
| 123 | return true; |
| 124 | } |
| 125 | |
| 126 | std::optional<std::string> shouldFlatten( |
| 127 | const TypedExprPtr& expr, |
no test coverage detected