fix corner case for optional aliasing (#18093)
authorMichael Suo <suo@fb.com>
Sun, 17 Mar 2019 21:53:41 +0000 (14:53 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Sun, 17 Mar 2019 21:56:40 +0000 (14:56 -0700)
commitf9ad125e397b1cf96fb03de29a2920cc0dc5c312
tree609714fec88fd447033f32e42beefa9ba6e69187
parent96fe2b4ecbbd02143d95f467655a2d697282ac32
fix corner case for optional aliasing (#18093)

Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/18093
ghimport-source-id: 021adc52aa7bfe5fff74531c76a8cd28cab30b2a

Stack:
* **#18093 [jit] fix corner case for optional aliasing**

Occasionally the compiler can insert constant Nones to make types line
up. In that case, don't try to make a pointer from the optional type to
None, since we know statically that None won't be mutated or whatever.

Reviewed By: shannonzhu

Differential Revision: D14493004

fbshipit-source-id: 6564065f39d99ee5af664f3a0fe235892973d9be
torch/csrc/jit/passes/alias_analysis.cpp