Cache object refs in loop partitioner instead of object pointers (#6004)
Cache object refs in loop partitioner instead of object pointers (#6004)

* Cache object refs in loop partitioner instead of object pointers

Loop partitioner modifies the IR, which can cause TIR objects to
become dead and be destroyed. To avoid working on junk data cache
object references instead of object pointers.

* Fix format/lint errors
sxjscience/tvm,tqchen/tvm,Laurawly/tvm-1,tqchen/tvm,dmlc/tvm,Laurawly/tvm-1,dmlc/tvm,Laurawly/tvm-1,dmlc/tvm,Laurawly/tvm-1,dmlc/tvm,Laurawly/tvm-1,tqchen/tvm,Laurawly/tvm-1,tqchen/tvm,sxjscience/tvm,tqchen/tvm,sxjscience/tvm,Laurawly/tvm-1,sxjscience/tvm,dmlc/tvm,Laurawly/tvm-1,sxjscience/tvm,tqchen/tvm,Laurawly/tvm-1,sxjscience/tvm,dmlc/tvm,sxjscience/tvm,dmlc/tvm,tqchen/tvm,dmlc/tvm,dmlc/tvm,tqchen/tvm,Laurawly/tvm-1,tqchen/tvm,sxjscience/tvm,sxjscience/tvm,tqchen/tvm