This reverts commit 21653600034084e8335374ddc1eb8d362158d9a8. To fix the crash problem in legacy pass manager