Run canonical graph optimizations in optimize_for_mobile. (#38840)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/38840
JIT graph executor runs some canonical optimizations such as cse, dead code
elimination etc before constructing code that interpreter executes.
Since we do not have full JIT in lite interpreter any such graph optimizations
must happen AOT.
This diff applies such canonical optimizations on graph.
Test Plan: CI's test_mobile_optimizer.
Reviewed By: dreiss
Differential Revision: D21675855
fbshipit-source-id: 5dd898088ef8250103ccbbb6aa2bbce156a8d61d