[jit] Implement one-element MemoryDAG::mayContainAlias more efficiently (#65178)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/65178
There is no need to copy the MemoryLocations in this case.
ghstack-source-id: 140484161
Test Plan:
CI
static runtime startup for ctr_mobile_feed decreased from 7.0s to 6.3s
Reviewed By: suo
Differential Revision: D30984442
fbshipit-source-id: 61bb678c4480cd030aaab2bbc8a04cbd9b7c7f4d