* the opcode, debug-info and mode of a newly created one
* @param op1 the first operand
* @param op2 the second operand
- * @param env the environment
+ * @param env the environment
*
* @return the newly created node
*/
iv = right; rc = left;
}
- if (iv)
+ if (iv) {
+ if (env->flags & osr_flag_ignore_x86_shift) {
+ if (is_Const(rc)) {
+ tarval *tv = get_Const_tarval(rc);
+
+ if (tarval_is_long(tv)) {
+ long value = get_tarval_long(tv);
+
+ if (value == 2 || value == 4 || value == 8) {
+ /* do not reduce multiplications by 2, 4, 8 */
+ break;
+ }
+ }
+ }
+ }
+
return replace(irn, iv, rc, env);
+ }
break;
default:
break;
osr_flag_none = 0, /**< no additional flags */
osr_flag_lftr_with_ov_check = 1, /**< do linear function test replacement
only if no overflow can occur. */
+ osr_flag_ignore_x86_shift = 2 /**< ignore Multiplications by 2, 4, 8 */
} osr_flags;
/* FirmJNI cannot handle identical enum values... */