[mono/mono] 18299f08: [llvm] Fix the handling of moves in the LICM optimization.

"Zoltan Varga ([email protected])" <[email protected]> Tue, 19 Nov 2013 12:18:06 +0000
Newsgroups gmane.comp.gnome.mono.patches
Message-ID <00000142704bd307-31056551-14d5-4e67-b667-b7db647ac251-000000@email.amazonses.com>
   Branch: refs/heads/master
     Home: https://github.com/mono/mono
  Compare: https://github.com/mono/mono/compare/e4bf54392ad9...18299f080fff

   Commit: 18299f080fff76504549f9996ba9002e872bbbbe
   Author: Zoltan Varga <[email protected]> (vargaz)
     Date: 2013-11-19 12:16:10 GMT
      URL: https://github.com/mono/mono/commit/18299f080fff76504549f9996ba9002e872bbbbe

[llvm] Fix the handling of moves in the LICM optimization.

Changed paths:
  M mono/mini/ssa.c

Modified: mono/mini/ssa.c
===================================================================
@@ -1425,18 +1425,21 @@
 					sreg = -1;
 				if (sreg != -1) {
 					skip = FALSE;
-					MONO_BB_FOR_EACH_INS (bb, tins) {
+					MonoInst *tins;
+
+					for (tins = ins->prev; tins; tins = tins->prev) {
 						const char *spec = INS_INFO (tins->opcode);
 
 						if (tins->opcode == OP_MOVE && tins->dreg == sreg) {
 							sreg = tins->sreg1;
-						} else if (spec [MONO_INST_DEST] != ' ' && tins->dreg == ins->sreg1) {
+						} if (spec [MONO_INST_DEST] != ' ' && tins->dreg == sreg) {
 							skip = TRUE;
 							break;
 						}
 					}
 					if (skip)
 						continue;
+					ins->sreg1 = sreg;
 				}
 
 				if (cfg->verbose_level > 1) {


_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches