[ScopBuilder] Move hoistInvariantLoads to ScopBuilder. NFC.
Refactor Scop and ScopBuilder class:
- Move hoistInvariantLoads function from Scop to ScopBuilder class.
- Private functions (addInvariantLoads, getNonHoistableCtx) are moved to public section of Scop class. hoistInvariantLoads function references these functions. These functions will be moved to ScopBuilder as well in the next steps.
Patch by Dominik Adamski <email@example.com>
Differential Revision: https://reviews.llvm.org/D62925