Bugzilla – Bug 315464
[PATCH] use xor esi, esi to set a regvar to 0
Last modified: 2007-09-15 21:24:46 UTC
---- Reported by bmaurer@users.sf.net 2004-07-12 15:06:20 MST ---- This patch uses the shorter xor esi, esi encoding when we set a regvar to zero. Before, we only did this as a peephole opt. The problem with this method is that the flow of cflags information is not clear from the instructions. My patch does the optimization at the tree level. We know that cflags are not propagated from one tree to another. Thus, if we see stind.x (regvar, iconst [0]), we know we can use the xor encoding. ---- Additional Comments From bmaurer@users.sf.net 2004-07-12 15:06:40 MST ---- Created an attachment (id=166446) mini-xor-esi-esi.patch ---- Additional Comments From miguel@ximian.com 2004-07-17 01:13:18 MST ---- CCing Zoltan to get authorization about this patch. ---- Additional Comments From bmaurer@users.sf.net 2004-07-29 14:41:51 MST ---- Created an attachment (id=166447) Other changes to the burg file have caused conflicts. Same patch, the context has changed. ---- Additional Comments From bmaurer@users.sf.net 2004-07-29 15:14:01 MST ---- Created an attachment (id=166448) newer patch ---- Additional Comments From bmaurer@users.sf.net 2004-07-29 15:15:27 MST ---- The old patch prevented the following rules from being used: stmt: CEE_STIND_I2 (OP_REGVAR, OP_ICONST), stmt: CEE_STIND_I1 (OP_REGVAR, OP_ICONST), stmt: CEE_STIND_REF (OP_REGVAR, OP_ICONST), stmt: CEE_STIND_I (OP_REGVAR, OP_ICONST) because the engine would choose to load the constant into a register (as that also had a cost of two. The newer version of the patch just makes the xor rule a zero cost rule. ---- Additional Comments From vargaz@freemail.hu 2004-08-07 16:15:29 MST ---- This is ok to check in. Imported an attachment (id=166446) Imported an attachment (id=166447) Imported an attachment (id=166448) Unknown operating system unknown. Setting to default OS "Other".