[Polly] Add support for -polly-position=early with the NPM.

This required support for the canonicalization passes, inlcuding
porting RewriteByReferenceParams to the NPM.

For some reason, the legacy pass pipeline with -polly-position=early did
not run the CodePreparation pass. This was fixed as well.

GitOrigin-RevId: 5aafcb2b440fb71a026e9c74101f272caecf08b0
7 files changed