CodeGen: extend RHS when splitting ATOMIC_CMP_SWAP_WITH_SUCCESS.
authorTim Northover <tnorthover@apple.com>
Thu, 24 Mar 2016 15:38:38 +0000 (15:38 +0000)
committerTim Northover <tnorthover@apple.com>
Thu, 24 Mar 2016 15:38:38 +0000 (15:38 +0000)
commit4498eff9bbbb79b963c97c8cdcaee46796629428
treedc3468500053b1eab5e30dd290908643a3d99a31
parent9babad25e59551b72701903db3aead24e820dd01
CodeGen: extend RHS when splitting ATOMIC_CMP_SWAP_WITH_SUCCESS.

If the operation's type has been promoted during type legalization, we
need to account for the fact that the high bits of the comparison
operand are likely unspecified.

The LHS is usually zero-extended, but MIPS sign extends it, so we have
to be slightly careful.

Patch by Simon Dardis.

llvm-svn: 264296
llvm/include/llvm/Target/TargetLowering.h
llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
llvm/lib/Target/Mips/MipsISelLowering.h
llvm/test/CodeGen/Mips/atomic.ll