[Issue 2915] New: [Patch]: Optimize -a*-b into a*b

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Apr 30 00:07:54 PDT 2009


http://d.puremagic.com/issues/show_bug.cgi?id=2915

           Summary: [Patch]: Optimize -a*-b into a*b
           Product: D
           Version: 1.043
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Keywords: patch, performance
          Severity: enhancement
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: clugdbug at yahoo.com.au


This is a simple patch for a simple optimisation.

TEST CASE:
---
int main(string[] args) {
    real x = args.length == 2 ? 6.0 : 4.0; // just to defeat the optimiser
    real y = -x*-x;
    return cast(int)y;  
}
--


More information about the Digitalmars-d-bugs mailing list