Cache PrimExpr instead of raw pointers in bound analyzer (#5533)
authorKrzysztof Parzyszek <kparzysz@quicinc.com>
Thu, 7 May 2020 18:18:26 +0000 (13:18 -0500)
committerGitHub <noreply@github.com>
Thu, 7 May 2020 18:18:26 +0000 (11:18 -0700)
commitf05b9119e0612df59172301bdfbe4fabcd8605e9
tree6aca3f0f52e2018a3642162dd91d6cf153a66ac8
parente40b8bc9e1229d8ee9d0228d5dbdc2338fd8677d
Cache PrimExpr instead of raw pointers in bound analyzer (#5533)

The objects that the raw pointers point to can be deallocated and new
objects can be allocated at the same address, all while these pointers
are still in the cache. This can lead to unexpected behavior, for
example to calculated bound conflicts with previously cached values.

Caching PrimExpr will prevent the objects from being deallocated while
the cache is active.
include/tvm/arith/analyzer.h
src/arith/const_int_bound.cc
src/tir/transforms/narrow_datatype.cc