Bug 539876 - nanojit: optimize away 'y = mul x, 1'. r=rreitmai.
authorNicholas Nethercote <nnethercote@mozilla.com>
Mon, 18 Jan 2010 09:36:32 +1100
changeset 37706 b831915b57aff7b77e12651228f9d32951b82d64
parent 37705 80ff3ca19b1cfdec8fd86551cc615595465593fc
child 37707 63ff91e1cdbf0236792d2b810931b90409f00915
push id11426
push userrsayre@mozilla.com
push dateSun, 31 Jan 2010 16:36:36 +0000
treeherdermozilla-central@3048d03980e7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrreitmai
bugs539876
milestone1.9.3a1pre
Bug 539876 - nanojit: optimize away 'y = mul x, 1'. r=rreitmai.
js/src/nanojit/LIR.cpp
--- a/js/src/nanojit/LIR.cpp
+++ b/js/src/nanojit/LIR.cpp
@@ -727,16 +727,18 @@ namespace nanojit
                     // x | -1 = -1, cmp | 1 = 1
                     return oprnd2;
                 case LIR_and:
                     // x & -1 = x, cmp & 1 = cmp
                     return oprnd1;
                 default:
                     ;
                 }
+            } else if (c == 1 && v == LIR_mul) {
+                return oprnd1;
             }
         }
 
         LInsp i;
         if (v == LIR_qjoin && oprnd1->isop(LIR_qlo) && oprnd2->isop(LIR_qhi) &&
             (i = oprnd1->oprnd1()) == oprnd2->oprnd1()) {
             // qjoin(qlo(x),qhi(x)) == x
             return i;