[JIT] Freeze unrolls constant loops (#63614)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/63614
There are a number of optimizations (`RemoveListMutation` in particular) that are tied to loop unrolling in `runOptimizations`. However, these were not invoked from `freeze_module` since the freezing pass should be idempotent.
This diff makes `runOptimizations` run `UnrollConstantLoops` instead of `UnrollLoops`. `freeze_module` is then able to run these optimizations.
Test Plan: Observed that `freeze_module` applies `RemoveListMutation`
Reviewed By: eellison
Differential Revision: D30437356
fbshipit-source-id: cba04bd958a48ad51b151aa3264f3d5bbb1fc2a4