From 3fa17a73bc4942a196c65d35be75bdfd7bf2618a Mon Sep 17 00:00:00 2001 From: LeiWang1999 Date: Tue, 3 Feb 2026 19:11:41 +0800 Subject: [PATCH] Fix thread storage synchronization logic in `thread_storage_sync.cc` to correctly identify conflicts between read and write operations based on loop carry conditions. --- src/transform/thread_storage_sync.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/transform/thread_storage_sync.cc b/src/transform/thread_storage_sync.cc index 1fd0f10a7..2e5e01702 100644 --- a/src/transform/thread_storage_sync.cc +++ b/src/transform/thread_storage_sync.cc @@ -1417,8 +1417,8 @@ struct TileLangThreadSyncPlanner : public ConstrVisitor { // If this is a read into a double buffer that was previously // swapped out, then it doesn't conflict. - if (prev.double_buffer_write && curr.type == kRead && !loop_carry) { - return false; + if (curr.type == kWrite && prev.type == kRead && loop_carry) { + return true; } // If nothing else allows sharing the same buffer, then they are