We should change MBoundsCheck to redefine the index, so that we can use SSA to track its dependencies.
Atm LICM/GVN guarantee a load/store is never moved before its bounds check so there's no problem, but this will change with bug 722708 (and it will help range analysis).
Created attachment 639005 [details] [diff] [review]
As discussed before, the main difficulty here was factoring out the redundant bounds check elimination from GVN into a new pass. The algorithm is similar to GVN (use a hash map to find dominating bounds checks) but I think it's nice to have it as a separate pass.