]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - opencl/llvm.git/commit
[InstCombine] Don't fold bitcast into store if it would need addrspacecast
authorRichard Osborne <richard@xmos.com>
Tue, 25 Mar 2014 17:21:41 +0000 (17:21 +0000)
committerRichard Osborne <richard@xmos.com>
Tue, 25 Mar 2014 17:21:41 +0000 (17:21 +0000)
commit67cb554e656de7e74e743deeca03db516463f774
treeb7ceb189059e8b0ebc39d8618042941af4fa085c
parent902c799d96b4d150335d2b3e541c220c200d4e8f
[InstCombine] Don't fold bitcast into store if it would need addrspacecast

Summary:
Previously the code didn't check if the before and after types for the
store were pointers to different address spaces. This resulted in
instcombine using a bitcast to convert between pointers to different
address spaces, causing an assertion due to the invalid cast.

It is not be appropriate to use addrspacecast this case because it is
not guaranteed to be a no-op cast. Instead bail out and do not do the
transformation.

CC: llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D3117

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204733 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
test/Transforms/InstCombine/bitcast-store.ll