/*
- * Copyright (C) 1995-2007 University of Karlsruhe. All right reserved.
+ * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved.
*
* This file is part of libFirm.
*
/* Consts are typically immediates */
if (!tarval_is_long(get_Const_tarval(node))) {
#ifdef DEBUG_libfirm
- ir_fprintf(stderr, "Optimisation warning tarval of %+F(%+F) is not "
- "a long.\n", node, current_ir_graph);
+ ir_fprintf(stderr,
+ "Optimisation warning tarval of %+F(%+F) is not a long.\n",
+ node, current_ir_graph);
#endif
return 0;
}
return 1;
case iro_Add:
case iro_Sub:
- /* Add's and Sub's are typically supported as long as both operands are immediates */
+ /* Add's and Sub's are typically supported as long as both operands are
+ * immediates */
if(bitset_is_set(non_address_mode_nodes, get_irn_idx(node)))
return 0;
case iro_SymConst:
/* place the entity into the symconst */
if (addr->symconst_ent != NULL) {
- panic("Internal error: more than 1 symconst in address "
- "calculation");
+ panic("Internal error: more than 1 symconst in address calculation");
}
addr->symconst_ent = get_SymConst_entity(node);
#ifndef SUPPORT_NEGATIVE_SYMCONSTS
if(val < 0 || val > 3)
return 0;
if(val == 0) {
- ir_fprintf(stderr, "Optimisation warning: unoptimized Shl(,0) "
- "found\n");
+ ir_fprintf(stderr, "Optimisation warning: unoptimized Shl(,0) found\n");
}
shifted_val = get_Shl_left(node);
left = get_binop_left(node);
right = get_binop_right(node);
- if (!value_last_used_here(node, left) &&
+ /* Fold AM if any of the two operands does not die here. This duplicates
+ * an addition and has the same register pressure for the case that only
+ * one operand dies, but is faster (on Pentium 4).
+ * && instead of || only folds AM if both operands do not die here */
+ if (!value_last_used_here(node, left) ||
!value_last_used_here(node, right)) {
return;
}