torch-mlir/lib/Dialect
Sean Silva 79a3f639bf Give torch.global_slot an initializer region.
This is a much simpler representation than the ad-hoc initializer
function we had before. It is also less general, but given the rationale
in Passes.td it seems like the right tradeoff right now.

We can probably carry this representation for quite a while, and when we
can't, it likely means that TorchScript has fixed their object identity
bug and we probably need to just upgrade to a more general object graph
modeling (more general than GlobalizeObjectGraph).

In particular, we don't want to deal with defining and carrying around
this initializer function concept until we need it. For example, if we
want to constant-fold the global slots into uses, this is a much better
representation, and it plays better with symbol-dce (the initializer
function counts as a "use" of the symbol).

(the alternative would have been to write a pass that converts the
initializer function to this form when possible, but I realized that
lots of information had been lost which made that fairly annoying -- it
was all self-inflicted anyway, so best to just go to the source
(GlobalizeObjectGraph) before the information is lost)

Now symbol-dce works nicely (no more "training" bools)
```
pt_util ~/tmp/classifier.pt --import --exported-name forward \
| npcomp-opt -torch-globalize-object-graph -inline -symbol-dce
```
IR: https://gist.github.com/silvasean/8abe63d70d24e29d6db9170ccc8d512b
2021-02-26 16:24:19 -08:00
..
ATen Bump llvm-project to c68d2895a1f4019b387c69d1e5eec31b0eb5e7b0 2021-02-22 12:23:24 -08:00
Basicpy Bump llvm-project to c68d2895a1f4019b387c69d1e5eec31b0eb5e7b0 2021-02-22 12:23:24 -08:00
Numpy NFC: mark some methods as `override` 2021-01-21 11:48:41 -08:00
Refback [RefBackend] Use std.global_memref instead of homegrown thing 2020-11-13 18:43:50 -08:00
Refbackrt Bump llvm-project to d50d7c37a159802c89454a6c53c0ec2e7949d84a 2020-12-14 14:30:51 -08:00
TCF Bump llvm-project to 16c6e9c58e9ae50a775945e6b407f1891f353d2f 2021-01-05 16:12:11 -08:00
TCP Reformat code 2021-01-28 12:01:35 -08:00
Torch Give torch.global_slot an initializer region. 2021-02-26 16:24:19 -08:00
CMakeLists.txt [RefBackend] Rename RefBackend dialect to Refback 2020-10-08 09:07:00 -07:00