XChy wrote: Could you please check whether this patch fixed https://github.com/llvm/llvm-project/commit/b22917e6e2a0aec05474f58e64b7e87d1ea0a054#commitcomment-131198746 ? I assumed it's because loop optimzations share some invalid analysis cache. https://github.com/llvm/llvm-project/pull/69909