While investigating the issue fixed in #95864 I came across some surprising behaviour. In trying to figure out whether rustc was generating invalid IR or it was some subsequent LLVM pass, I realized that -Z verify-llvm-ir was essentially ignored with -C no-prepopulate-passes in the new LLVM Pass Manager. This lead me to (incorrectly) assume that the IR rustc generated was valid when it got to LLVM.
It looks like a subtle change in behaviour due to the way the new Pass Manager is constructed in LLVMRustOptimizeWithNewPassManager.