combine: Improve PLUS/MINUS cases in make_compound_operation.
The combine pass now uses simplify_gen_binary for PLUS/MINUS in make_compound_operation to improve simplification and operand ordering.
The make_compound_operation function in the combine pass has been updated to use simplify_gen_binary for handling PLUS and MINUS operations. This resolves issues where simplifications were discarded and operand ordering was incorrect for nested PLUS expressions. This change ensures that expressions are simplified more effectively and that operands are redistributed correctly in nested operations, improving generated code.
In Details
This commit modifies the make_compound_operation and make_compound_operation_int functions in the combine pass. The PLUS and MINUS cases are now handled using simplify_gen_binary instead of custom simplification logic. This ensures that simplifications are not discarded. It also ensures correct operand redistribution is performed for nested operations. These changes are in combine.c.
For Context
The combine pass in GCC attempts to simplify and combine multiple operations into a single, more efficient operation. This commit focuses on improving how the combine pass handles PLUS and MINUS operations, particularly in complex expressions where these operations are nested. By using simplify_gen_binary, the compiler can now simplify expressions more effectively and ensure that the order of operations is optimal.