Bug 1708381 Comment 15 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

The branchiness seems key.  Previously, the cost of a trip through the function assuming k iterations was k*m where the m was some average cost of an arm.  After the optimization the cost is s*b+k*(m-s) where b is the number of branches and s is the cost of hoisted code per branch.  Assuming k=10, b=256, m=10 and s=4, we go from 10*10=100 to 4*256+10*(10-4)=1060.  This seems hard to incorporate (indeed, how to compute b?)  and in this case we're looking to avoid disaster more than being optimal.

For wasm in particular, I would almost be inclined to argue that LICM out of any conditional block in a loop is not something we want to do, because the front end would be presumed to have moved what should be moved, and our MIR level is close enough to source to be a proxy for it.
The branchiness seems key.  Previously, the cost of a trip through the function assuming k iterations was k\*m where the m was some average cost of an arm.  After the optimization the cost is s\*b+k\*(m-s) where b is the number of branches and s is the cost of hoisted code per branch.  Assuming k=10, b=256, m=10 and s=4, we go from 10\*10=100 to 4\*256+10\*(10-4)=1060.  This seems hard to incorporate (indeed, how to compute b?)  and in this case we're looking to avoid disaster more than being optimal.

For wasm in particular, I would almost be inclined to argue that LICM out of any conditional block in a loop is not something we want to do, because the front end would be presumed to have moved what should be moved, and our MIR level is close enough to source to be a proxy for it.

Back to Bug 1708381 Comment 15