The current implementation is wrong as it crosses basic blocks boundaries. Doing basic block decomposition of regex is probably a tad too complex for this single optimization. Fixes #2711