InstCombine: Canonicalize addrspacecast between different element types
authorJingyue Wu <jingyue@google.com>
Fri, 6 Jun 2014 21:52:55 +0000 (21:52 +0000)
committerJingyue Wu <jingyue@google.com>
Fri, 6 Jun 2014 21:52:55 +0000 (21:52 +0000)
commit77145d9410d05049059d96762873483df571c304
treeb6237086b55edf2f54cf504469876d1977613240
parente76013c2adcc094f7118ded8485db19fb2939efc
InstCombine: Canonicalize addrspacecast between different element types

addrspacecast X addrspace(M)* to Y addrspace(N)*

-->

bitcast X addrspace(M)* to Y addrspace(M)*
addrspacecast Y addrspace(M)* to Y addrspace(N)*

Updat all affected tests and add several new tests in addrspacecast.ll.

This patch is based on http://reviews.llvm.org/D2186 (authored by Matt
Arsenault) with fixes and more tests.

llvm-svn: 210375
llvm/lib/IR/Instructions.cpp
llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp
llvm/test/Transforms/InstCombine/addrspacecast.ll
llvm/test/Transforms/InstCombine/getelementptr.ll
llvm/test/Transforms/InstCombine/memcpy-from-global.ll