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)
commitc77dec905a58b2308e5efe3a7d1635e4965ccff3
treec2ad9414c19dd640e04be7f60e6575713bae5f49
parenta51acc7631fec5bc371d996d7cea45e8a3caee95
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210375 91177308-0d34-0410-b5e6-96231b3b80d8
lib/IR/Instructions.cpp
lib/Transforms/InstCombine/InstCombineCasts.cpp
test/Transforms/InstCombine/addrspacecast.ll
test/Transforms/InstCombine/getelementptr.ll
test/Transforms/InstCombine/memcpy-from-global.ll