[X86] Do not use cmpxchgXXb when we need the base pointer (RBX).
authorQuentin Colombet <qcolombet@apple.com>
Fri, 4 Mar 2016 23:29:39 +0000 (23:29 +0000)
committerQuentin Colombet <qcolombet@apple.com>
Fri, 4 Mar 2016 23:29:39 +0000 (23:29 +0000)
commit13b524597db556d364c53a56c248d00b3a320889
treeb1285bb8c9602c75cd2f70f1437c71d37d9cdaba
parent216b275994ed7419d66271d489215e9122b19aef
[X86] Do not use cmpxchgXXb when we need the base pointer (RBX).
cmpxchgXXb uses RBX as one of its implicit argument. I.e., when
we use that instruction we need to clobber RBX. This is generally
fine, expect when RBX is a reserved register because in that case,
the register allocator will not track its value and will not
save and restore it when interferences occur.

rdar://problem/24851412

llvm-svn: 262759
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/test/CodeGen/X86/base-pointer-and-cmpxchg.ll [new file with mode: 0644]