3 ms·
The usual example is something like a safe array where the bounds are checked on every access. The bounds check is a common subexpression in code that accesses
by fanf2 6y ago
The usual example is something like a safe array where the bounds are checked on every access. The bounds check is a common subexpression in code that accesses the array more than once. If the abstraction includes a safety check on access that doesn’t depend on the loop variable (eg if empty arrays are NULL) then that can be hoisted.