[X86] Don't model UD2/UD2B as a terminator
authorDavid Majnemer <david.majnemer@gmail.com>
Tue, 9 Aug 2016 17:55:12 +0000 (17:55 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Tue, 9 Aug 2016 17:55:12 +0000 (17:55 +0000)
commitadc688ce9c2034a0fc5a094d61b76f356123a927
tree3b72c5eb7860eb20c83eed31c555abef98681d59
parent8c5314479ebbf2c70225b94641b464da81ef6f79
[X86] Don't model UD2/UD2B as a terminator

A UD2 might make its way into the program via a call to @llvm.trap.
Obviously, calls are not terminators.  However, we modeled the X86
instruction, UD2, as a terminator.  Later on, this confuses the epilogue
insertion machinery which results in the epilogue getting inserted
before the UD2.  For some platforms, like x64, the result is a
violation of the ABI.

Instead, model UD2/UD2B as a side effecting instruction which may
observe memory.

llvm-svn: 278144
llvm/lib/Target/X86/X86InstrSystem.td
llvm/test/CodeGen/X86/x86-framelowering-trap.ll