libFirm
|
Some machine dependent optimizations. More...
Go to the source code of this file.
Data Structures | |
struct | ir_settings_arch_dep_t |
A parameter structure that drives the machine dependent Firm optimizations. More... |
Typedefs | |
typedef int(* | evaluate_costs_func )(insn_kind kind, const ir_mode *mode, ir_tarval *tv) |
A Callback for evaluating the costs of an instruction. | |
typedef const ir_settings_arch_dep_t *(* | arch_dep_params_factory_t )(void) |
A factory function, that provides architecture parameters for machine dependent optimizations. |
Enumerations | |
enum | insn_kind { LEA, SHIFT, SUB, ADD, ZERO, MUL, ROOT } |
The Multiplication replacement can consist of the following instructions. More... | |
enum | arch_dep_opts_t { arch_dep_none = 0, arch_dep_mul_to_shift = 1, arch_dep_div_by_const = 2, arch_dep_mod_by_const = 4 } |
Optimization flags. More... |
Functions | |
void | arch_dep_set_opts (arch_dep_opts_t opts) |
Sets the optimizations that shall be applied. | |
ir_node * | arch_dep_replace_mul_with_shifts (ir_node *irn) |
Replaces Muls with Lea/Shifts/Add/Subs if these have smaller costs than the original multiplication. | |
ir_node * | arch_dep_replace_div_by_const (ir_node *irn) |
Replaces Divs with Shifts and Add/Subs and Mulh. | |
ir_node * | arch_dep_replace_mod_by_const (ir_node *irn) |
Replaces Mods with Shifts and Add/Subs and Mulh. |
typedef const ir_settings_arch_dep_t*(* arch_dep_params_factory_t)(void) |
enum arch_dep_opts_t |
enum insn_kind |
Replaces Divs with Shifts and Add/Subs and Mulh.
This function is driven by the 3 parameters:
If irn is a Div with a Const, the constant is inspected if it meets the requirements of the variables stated above. If a Shl/Add/Sub/Mulh sequence can be generated that meets these requirements, this expression is returned. In each other case irn is returned unmodified.
irn | The Firm node to inspect. |
Replaces Mods with Shifts and Add/Subs and Mulh.
This function is driven by the 3 parameters:
If irn is a Mod with a Const, the constant is inspected if it meets the requirements of the variables stated above. If a Shl/Add/Sub/Mulh sequence can be generated that meets these requirements, this expression is returned. In each other case irn is returned unmodified.
irn | The Firm node to inspect. |
Replaces Muls with Lea/Shifts/Add/Subs if these have smaller costs than the original multiplication.
irn | The Firm node to inspect. |
void arch_dep_set_opts | ( | arch_dep_opts_t | opts | ) |
Sets the optimizations that shall be applied.
opts | An optimization bit mask. |