Also switches it to use a worklist so that it doesn't recurse too
deeply.
I wrote this because I was hunting for any place where we failed to look
through poniter casts feeding loads or stores, and saw this. I have no
idea if this really matters at all, if it helps, etc. I'm not really
looking at LTO stuff at the moment and don't have time to dig into the
details, figure out if this is a worthwhile change, or write test cases.
Mailing it to the list in case someone else wants to play with it.