Hi,
I have been playing around with TVM and it seems that the barrier insertion pass (implemented in src/tir/storage_access.cc and src/tir/thread_storage_sync.cc) does not handle the else case of an IfThenElse node correctly. Specifically, I think the body of the else case, when present, is not being visited in the code here.