Commit 8aa878f
authored
[jit] fix tuple alias analysis (pytorch#41992)
Previously when analyzing a TupleConstruct, we ignored the aliasing
information of the inputs and simply marked all elements of the returned
tuple as wildcards. But since we can fully reason about the contents of
a tuple statically, we should be able to assign them aliasing
information.
This analysis was not only incomplete but produced incorrect results,
since if `a` is not a wildcard, `a noalias wilcard`. So if we looked at
`tuple(a)` and reported the aliasing info as `tuple(wildcard)`, then
`tuple[0] noalias a`, which is...wrong.1 parent 7c7c9c3 commit 8aa878f
File tree
3 files changed
+19
-11
lines changed- test/jit
- torch/csrc/jit/ir
3 files changed
+19
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
794 | 794 | | |
795 | 795 | | |
796 | 796 | | |
797 | | - | |
798 | | - | |
799 | | - | |
800 | 797 | | |
801 | 798 | | |
802 | 799 | | |
| |||
815 | 812 | | |
816 | 813 | | |
817 | 814 | | |
818 | | - | |
819 | 815 | | |
820 | 816 | | |
821 | 817 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
498 | 498 | | |
499 | 499 | | |
500 | 500 | | |
| 501 | + | |
501 | 502 | | |
502 | 503 | | |
503 | 504 | | |
| |||
864 | 865 | | |
865 | 866 | | |
866 | 867 | | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
867 | 884 | | |
868 | 885 | | |
869 | 886 | | |
870 | 887 | | |
871 | 888 | | |
872 | 889 | | |
873 | 890 | | |
874 | | - | |
875 | | - | |
876 | | - | |
877 | | - | |
878 | | - | |
879 | | - | |
880 | | - | |
| 891 | + | |
881 | 892 | | |
882 | 893 | | |
883 | 894 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
194 | 194 | | |
195 | 195 | | |
196 | 196 | | |
| 197 | + | |
197 | 198 | | |
198 | 199 | | |
199 | 200 | | |
| |||
0 commit comments