This is a followup to D129630, which switches LSR to the member isSafeToExpand() variant, and removes the freestanding function.
This is done by creating the SCEVExpander early (already during the analysis phase). Because the SCEVExpander is now available for the whole lifetime of LSRInstance, I've also made it into a member variable, rather than passing it around in even more places.