Commit 1a7bc837 authored by Christoph Mallon's avatar Christoph Mallon
Browse files

ia32: Add peephole optimization 'lea c(, %i, 2), %d' -> 'lea c(%i, %i), %d'.

With base the displacement may be a single byte.
parent 700d2d80
......@@ -16,6 +16,7 @@ libFirm 1.22.1 (2016-01-07)
* Add peephole optimization 'mov $0, %r' -> 'xorl %r, %r' (amd64)
* Add peephole optimization 'lea c(%r), %r' -> 'add $c, %r' (amd64)
* Add peephole optimization 'lea (%r1, %r2), %r1' -> 'add %r2, %r1' and the commutated case (amd64)
* Add peephole optimization 'lea c(, %i, 2), %d' -> 'lea c(%i, %i), %d' (ia32)
* Bugfixes
libFirm 1.22.0 (2015-12-31)
......
......@@ -948,9 +948,15 @@ exchange:
arch_set_irn_register(res, oreg);
SET_IA32_ORIG_NODE(res, node);
replace(node, res);
return;
}
}
}
if (!breg && scale == 1) {
/* lea c(, %i, 2), %d -> lea c(%i, %i), %d */
set_irn_n(node, n_ia32_Lea_base, idx);
set_ia32_am_scale(node, 0);
}
}
/**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment