Tvm_storage_sync

Hi, I have some questions about the pass thread_storage_sync, it’s used to insert the barrier when global or shared memory is defined. I note that some topi operators like proposal, users need to insert tvm_storage_sync by using tvm.tir.Call(None, "tir.tvm_storage_sync", tvm.runtime.convert(["shared"])) . Why is not thead index in condition included in this pass? Is there any case that we can not determine to insert barrier or not when thead index in if condition ?

Appreciate for any explanation of this or any suggestions about this queation. Thanks in advance!