[Mono-bugs] [Bug 354495] New: Optimization - GMCS should use cpobj more

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Thu Jan 17 12:49:19 EST 2008


           Summary: Optimization - GMCS should use cpobj more
           Product: Mono: Compilers
           Version: unspecified
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Enhancement
          Priority: P5 - None
         Component: C#
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: rkumpera at novell.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---

GMCS should emit an optimized IL for code like this:

class Test<T> {
        public static void NoInline() {}

        public void Copy(ref T a, ref T b) {
                a = b;

Right now the copy is implemented like this:
ldobj !T
stobj !T

This code is translated by the JIT into a memcpy to the stack and then a memcpy
to the destination address.

The compiler could use instead the following sequence:
cpobj !T

The generated code have just one memcpy and run twice as fast.

GMCS should use cpobj every time the source is a managed pointer.

Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.

More information about the mono-bugs mailing list