The one thing that keeps the SystemZ backend from enabling expensive checks, is the issue with the trap instruction. See https://bugs.llvm.org/show_bug.cgi?id=33047.
Current discussion is:
- It looks like targets are split over whether they consider their "trap" a terminator; x86, AArch64, and NVPTX don't, but ARM, MIPS, PPC, and SystemZ do. We should probably try to be consistent here.
- If the isTerminator is flag is used, how should isel handle instructions after it? Note that this is only an issue at -O0.
I did a quick experiment to see what would happen if I just added isTerminator on all targets trap instructions, and then handled TRAP during selection DAG building. This however caused a lot of regression test failures, so this is not a working patch right now.