Instead of only detecting things at the LLVM level, we should consider also doing so at the Julia level where much more information is still available. JuliaLang/julia#57530 could probably serve as inspiration.
That said, we probably don't want to completely get rid of the LLVM IR verifier, or we'd have to accurately model how codegen behaves.