[Windows] Replace TrapUnreachable with an int3 insertion pass
authorReid Kleckner <rnk@google.com>
Mon, 9 Sep 2019 23:04:25 +0000 (23:04 +0000)
committerReid Kleckner <rnk@google.com>
Mon, 9 Sep 2019 23:04:25 +0000 (23:04 +0000)
commitbf02399a852e1ff06e074c353908147d9a22b1dc
tree7f7d091fca56b10b42f88b84726876359c06a640
parent5112b71126a133b744b11b50d60fcb89d005513d
[Windows] Replace TrapUnreachable with an int3 insertion pass

This is an alternative to D66980, which was reverted. Instead of
inserting a pseudo instruction that optionally expands to nothing, add a
pass that inserts int3 when appropriate after basic block layout.

Reviewers: hans

Differential Revision: https://reviews.llvm.org/D67201

llvm-svn: 371466
20 files changed:
llvm/lib/Target/X86/CMakeLists.txt
llvm/lib/Target/X86/X86.h
llvm/lib/Target/X86/X86AvoidTrailingCall.cpp [new file with mode: 0644]
llvm/lib/Target/X86/X86TargetMachine.cpp
llvm/test/CodeGen/WinEH/wineh-noret-cleanup.ll
llvm/test/CodeGen/X86/br-fold.ll
llvm/test/CodeGen/X86/catchpad-lifetime.ll
llvm/test/CodeGen/X86/catchpad-regmask.ll
llvm/test/CodeGen/X86/catchret-regmask.ll
llvm/test/CodeGen/X86/empty-function.ll
llvm/test/CodeGen/X86/funclet-layout.ll
llvm/test/CodeGen/X86/noreturn-call-win64.ll [new file with mode: 0644]
llvm/test/CodeGen/X86/pr24374.ll
llvm/test/CodeGen/X86/trap.ll
llvm/test/CodeGen/X86/unreachable-trap.ll
llvm/test/CodeGen/X86/win64-eh-empty-block.ll [new file with mode: 0644]
llvm/test/CodeGen/X86/win64_call_epi.ll
llvm/test/CodeGen/X86/win64_eh.ll
llvm/test/CodeGen/X86/wineh-coreclr.ll
llvm/test/DebugInfo/COFF/local-variable-gap.ll