[Mono-bugs] [Bug 71577][Wis] Changed - The JIT shouldn't generate code for initlocals if not needed

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Fri, 21 Jan 2005 11:28:01 -0500 (EST)

Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by bmaurer@users.sf.net.


--- shadow/71577	2005-01-21 10:45:52.000000000 -0500
+++ shadow/71577.tmp.30715	2005-01-21 11:28:01.000000000 -0500
@@ -1,14 +1,14 @@
 Bug#: 71577
 Product: Mono: Runtime
 Version: unspecified
+OS: unknown
 OS Details: 
 Status: NEW   
+Severity: Unknown
 Priority: Wishlist
 Component: JIT
 AssignedTo: mono-bugs@ximian.com                            
 ReportedBy: vargaz@gmail.com               
 QAContact: mono-bugs@ximian.com
 TargetMilestone: ---
@@ -18,6 +18,40 @@
 Currently, the JIT basically initializes every variable twice, one for the
 initialization caused by initlocals to be set, and the other because of the
 initialization required by the C# spec. For trusted assemblies, like the
 system assemblies and mcs, we could ignore initlocals in the JIT. Trying
 this sped up a corlib compilation by about 2%.
+------- Additional Comments From bmaurer@users.sf.net  2005-01-21 11:28 -------
+Liveness gives us all the information we really need for this.
+Lets say you have this IR:
+   loc1 <-- 0
+   loc2 <-- 0
+   loc1 <-- call Foo
+   cmp loc1, 4
+   beq bb3
+   loc2 <-- 5
+   br BB4
+   loc2 <-- 2
+Liveness will see that loc1 and loc2 are not liveout or livein from
+BB0. However, in liveness, we mark the live range of loc1 as being
+from [BB0, BB1] and loc2 as [BB0, BB3]. This is because a use of a
+variable in a block (even if it is a dead store) will extend the live
+We need to use the liveness to do some deadce. I tried to do this over
+the summer, but I always ended up making mcs bootstrap slower.
+FYI, the reason this slows things down seems not to be the stores
+themselves, but because it prevents enregistration. Every variable is
+alive from [BB0, LAST USE]. So, you can only get 3 variables into