/* pre transform some anchors (so they are available in the other transform
* functions) */
- pre_transform_anchor(irg, anchor_bad);
pre_transform_anchor(irg, anchor_no_mem);
pre_transform_anchor(irg, anchor_end_block);
pre_transform_anchor(irg, anchor_end);
edges_deactivate(irg);
edges_activate(irg);
}
-
-int be_mux_is_abs(ir_node *sel, ir_node *mux_true, ir_node *mux_false)
-{
- ir_node *cmp_left;
- ir_node *cmp_right;
- ir_mode *mode;
- ir_relation relation;
-
- if (!is_Cmp(sel))
- return 0;
-
- /**
- * Note further that these optimization work even for floating point
- * with NaN's because -NaN == NaN.
- * However, if +0 and -0 is handled differently, we cannot use the Abs/-Abs
- * transformations.
- */
- mode = get_irn_mode(mux_true);
- if (mode_honor_signed_zeros(mode))
- return 0;
-
- /* must be <, <=, >=, > */
- relation = get_Cmp_relation(sel);
- if ((relation & ir_relation_less_greater) == 0)
- return 0;
-
- if (!ir_is_negated_value(mux_true, mux_false))
- return 0;
-
- /* must be x cmp 0 */
- cmp_right = get_Cmp_right(sel);
- if (!is_Const(cmp_right) || !is_Const_null(cmp_right))
- return 0;
-
- cmp_left = get_Cmp_left(sel);
- if (cmp_left == mux_false) {
- if (relation & ir_relation_less) {
- return 1;
- } else {
- assert(relation & ir_relation_greater);
- return -1;
- }
- } else if (cmp_left == mux_true) {
- if (relation & ir_relation_less) {
- return -1;
- } else {
- assert(relation & ir_relation_greater);
- return 1;
- }
- }
-
- return 0;
-}
-
-ir_node *be_get_abs_op(ir_node *sel)
-{
- ir_node *cmp_left = get_Cmp_left(sel);
- return cmp_left;
-}