This reverts commit 1515caf7a59dc20cb932b724b2ef5c1d1a593427 (https://github.com/llvm/llvm-project/pull/122833) i.e., relands 7d8b4eb0ead277f41ff69525ed807f9f6e227f37 (https://github.com/llvm/llvm-project/pull/122765), with LowerAllowCheckPass::Options moved inside the callback to fix a stack use-after-scope error. --------- Co-authored-by: Vitaly Buka <vitalybuka@gmail.com>