diff options
author | Jingyue Wu <jingyue@google.com> | 2014-06-15 21:40:57 +0000 |
---|---|---|
committer | Jingyue Wu <jingyue@google.com> | 2014-06-15 21:40:57 +0000 |
commit | f6eb7e3175aa0bb69152196bff69beade5fb8f38 (patch) | |
tree | 4f815a74850babac547bcb3b1160935480d88c20 /test/Other | |
parent | f9ef37a9861424efefcca5695c195521ccf31f4a (diff) | |
download | llvm-f6eb7e3175aa0bb69152196bff69beade5fb8f38.tar.gz llvm-f6eb7e3175aa0bb69152196bff69beade5fb8f38.tar.bz2 llvm-f6eb7e3175aa0bb69152196bff69beade5fb8f38.tar.xz |
Canonicalize addrspacecast ConstExpr between different pointer types
As a follow-up to r210375 which canonicalizes addrspacecast
instructions, this patch canonicalizes addrspacecast constant
expressions.
Given clang uses ConstantExpr::getAddrSpaceCast to emit addrspacecast
cosntant expressions, this patch is also a step towards having the
frontend emit canonicalized addrspacecasts.
Piggyback a minor refactor in InstCombineCasts.cpp
Update three affected tests in addrspacecast-alias.ll,
access-non-generic.ll and constant-fold-gep.ll and added one new test in
constant-fold-address-space-pointer.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211004 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Other')
-rw-r--r-- | test/Other/constant-fold-gep.ll | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/test/Other/constant-fold-gep.ll b/test/Other/constant-fold-gep.ll index aed4145c55..dc122fd161 100644 --- a/test/Other/constant-fold-gep.ll +++ b/test/Other/constant-fold-gep.ll @@ -457,7 +457,7 @@ define i8* @different_addrspace() nounwind noinline { %p = getelementptr inbounds i8* addrspacecast ([4 x i8] addrspace(12)* @p12 to i8*), i32 2 ret i8* %p -; OPT: ret i8* getelementptr (i8* addrspacecast ([4 x i8] addrspace(12)* @p12 to i8*), i32 2) +; OPT: ret i8* getelementptr (i8* addrspacecast (i8 addrspace(12)* getelementptr inbounds ([4 x i8] addrspace(12)* @p12, i32 0, i32 0) to i8*), i32 2) } define i8* @same_addrspace() nounwind noinline { |