[opaque pointer type] Encode the pointee type in the bitcode for 'cmpxchg'
authorDavid Blaikie <dblaikie@gmail.com>
Tue, 28 Apr 2015 04:30:29 +0000 (04:30 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Tue, 28 Apr 2015 04:30:29 +0000 (04:30 +0000)
commit974d5d32c8af742058dec16aa6f2cb7cc51222e1
tree0456369770bcb81492b54fbead330cd506557aae
parente1f835ab596a984f5d055ca98db375b72ddd7f14
[opaque pointer type] Encode the pointee type in the bitcode for 'cmpxchg'

As a space optimization, this instruction would just encode the pointer
type of the first operand and use the knowledge that the second and
third operands would be of the pointee type of the first. When typed
pointers go away, this assumption will no longer be available - so
encode the type of the second operand explicitly and rely on that for
the third.

Test case added to demonstrate the backwards compatibility concern,
which only comes up when the definition of the second operand comes
after the use (hence the weird basic block sequence) - at which point
the type needs to be explicitly encoded in the bitcode and the record
length changes to accommodate this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235966 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Bitcode/LLVMBitCodes.h
lib/Bitcode/Reader/BitcodeReader.cpp
lib/Bitcode/Writer/BitcodeWriter.cpp
test/Bitcode/cmpxchg.3.6.ll [new file with mode: 0644]
test/Bitcode/cmpxchg.3.6.ll.bc [new file with mode: 0644]