Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Deleted: | ||||||||
< < | ||||||||
Competition RulesIn gimple tree, there are some opportunities to decrease the executed statements by combining several into one. The following rules are for preventing these feasible but illegal optimizations. | ||||||||
Line: 13 to 12 | ||||||||
| ||||||||
Changed: | ||||||||
< < | NOTICE: Actually, you do NOT need to do any work to make the gimple tree to follow the above rules because gcc has already simplified it. | |||||||
> > | NOTE: you do NOT need to do any work to make the gimple tree to follow the above rules because gcc has already simplified it. | |||||||
After the program transformation, new temporary variables could be introduced. An example program segment | ||||||||
Line: 46 to 45 | ||||||||
L1: | ||||||||
Changed: | ||||||||
< < | You should take scanf and printf as special instructions that need not conform to above specifications. You should not make any temporary variable to take value of the pointer passed to scanf. Remember that our language does not have pointers, so we do not deal with them. For printf, you still need to make all the arguments in variable or constant form except for the format string. | |||||||
> > | For scanf , you do not need to make any temporary variable to take value of the pointer passed to the call. Remember that our language otherwise does not have pointers, so you do not deal with pointer induced aliasing. For printf , you still need to make all the arguments in variable or constant form except for the format string. | |||||||
-- XiaomingGu - 08 Apr 2008 |
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Added: | ||||||||
> > |
Competition RulesIn gimple tree, there are some opportunities to decrease the executed statements by combining several into one. The following rules are for preventing these feasible but illegal optimizations.
a = b + c[e] + d; if (a+d<b) goto L1; foo (m[a+d]); m[e+f] = m[a] + m[d]; L1:needs to be converted to something like the following: t1 = c[e]; t2 = t1 + b; a = t2 + d; t3 = a + d; if (t3 < b) goto L1; t4 = a + d; t5 = m[t4]; foo (t5); t6 = e + f; t7 = m[a]; t8 = m[d]; t9 = t7 + t8; m[t6] = t9; L1:You should take scanf and printf as special instructions that need not conform to above specifications. You should not make any temporary variable to take value of the pointer passed to scanf. Remember that our language does not have pointers, so we do not deal with them. For printf, you still need to make all the arguments in variable or constant form except for the format string. -- XiaomingGu - 08 Apr 2008 |