[X86] Don't fold away the memory operand of an xchg.
authorBenjamin Kramer <benny.kra@googlemail.com>
Mon, 29 May 2017 16:25:20 +0000 (16:25 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Mon, 29 May 2017 16:25:20 +0000 (16:25 +0000)
commitfd1952761ed3691ef118f6ef4c6cc51b4d37de75
treee01c8b0290fce6d9c06d0cbe3d027c09d92fc51d
parenteed7a3102c51d863ff9035d31a33313e77364692
[X86] Don't fold away the memory operand of an xchg.

xchg with a mem operand has different locking semantics. If we unfold it
into a xchg r,r we will loose the implicit lock. Likewise we never want
to fold a register xchg into a memory one as it would be a lot slower.

This triggers during LLVM selfhost.

llvm-svn: 304163
llvm/test/CodeGen/X86/xchg-nofold.ll [new file with mode: 0644]
llvm/utils/TableGen/X86FoldTablesEmitter.cpp