If you have a long chain of select instructions created from something like int* p = &g; if (foo()) p += 4; if (foo2()) p += 4; etc., a naive recursive visitor will recursively visit each select twice, which is O(2^N) in the number of select instructions. Use the visited set to cut off recursion in this case.
(No testcase because this doesn't actually change the behavior, just the time.)