• bmeurer's avatar
    Revert of binary-operator-reducer: reduce mul+div(shift) (patchset #11... · 5d18e93b
    bmeurer authored
    Revert of binary-operator-reducer: reduce mul+div(shift) (patchset #11 id:200001 of https://codereview.chromium.org/1350223006/ )
    
    Reason for revert:
    This is also unsound for the reasons outlined in
    https://codereview.chromium.org/1473073004/
    Will help Fedor to implement a solution based on simplified operators.
    
    Original issue's description:
    > binary-operator-reducer: reduce mul+div(shift)
    >
    > Reduction Input:
    >
    >     ChangeInt32ToFloat64=>          TruncateFloat64ToInt32
    >                          Float64Mul=>
    >     ChangeInt32ToFloat64=>          Float64Div=>TruncateFloat64ToInt32
    >
    > Output:
    >
    >          =>  TruncateInt64ToInt32
    > Int64Mul
    >          =>  Int64Shr => TruncateInt64ToInt32
    >
    > Test code:
    >
    >     function mul(a, b) {
    >       var l = a & 0x3ffffff;
    >       var h = b & 0x3ffffff;
    >       var m = l * h;
    >
    >       var rl = m & 0x3ffffff;
    >       var rh = (m / 0x4000000) | 0;
    >
    >       return rl | rh;
    >     }
    >
    >     mul(1, 2);
    >     var a0 = mul(0x3ffffff, 0x3ffffff);
    >     mul(0x0, 0x0);
    >     %OptimizeFunctionOnNextCall(mul);
    >     var a1 = mul(0x3ffffff, 0x3ffffff);
    >
    >     print(a0 + ' == ' + a1);
    >
    > BUG=
    > R=mstarzinger@chromium.org
    >
    > Committed: https://crrev.com/461e5b49d022335a7fc4e9d172397a4bd48b93d4
    > Cr-Commit-Position: refs/heads/master@{#31899}
    
    TBR=mstarzinger@chromium.org,danno@chromium.org,titzer@chromium.org,fedor@indutny.com
    NOPRESUBMIT=true
    NOTREECHECKS=true
    NOTRY=true
    BUG=
    
    Review URL: https://codereview.chromium.org/1478923002
    
    Cr-Commit-Position: refs/heads/master@{#32313}
    5d18e93b
machine-operator-reducer.cc 40.3 KB