* limit the number of binary operations by removing some simple ones */
| 436 | * limit the number of binary operations by removing some simple ones |
| 437 | */ |
| 438 | void |
| 439 | ReducerOutputMgr::limit_binarys(vector<const FunctionInvocationBinary*>& binarys, vector<int>& ids) |
| 440 | { |
| 441 | int s; |
| 442 | while (binarys.size() > BINARY_REDUCTION_LIMIT) { |
| 443 | for (s = binarys.size() - 1; s>=0; s--) { |
| 444 | const FunctionInvocationBinary* fib = binarys[s]; |
| 445 | vector<const FunctionInvocationBinary*> dummy1; |
| 446 | vector<int> dummy2; |
| 447 | if (reducer->find_binary_operations(fib->param_value[0], dummy1, dummy2, true) == 0 && |
| 448 | reducer->find_binary_operations(fib->param_value[1], dummy1, dummy2, true) == 0) { |
| 449 | binarys.erase(binarys.begin() + s); |
| 450 | ids.erase(ids.begin() + s); |
| 451 | break; |
| 452 | } |
| 453 | } |
| 454 | } |
| 455 | // if still more than limit, delete the last few binary operations |
| 456 | if (binarys.size() > BINARY_REDUCTION_LIMIT) { |
| 457 | int extra = binarys.size() - BINARY_REDUCTION_LIMIT; |
| 458 | for (s=0; s<extra; s++) { |
| 459 | binarys.pop_back(); |
| 460 | ids.pop_back(); |
| 461 | } |
| 462 | } |
| 463 | } |
| 464 | |
| 465 | /******************************************************************************* |
| 466 | * output statement with "all" possible binary reductions. |
nothing calls this directly
no test coverage detected