diff options
author | Matt Arsenault <Matthew.Arsenault@amd.com> | 2013-10-03 18:15:57 +0000 |
---|---|---|
committer | Matt Arsenault <Matthew.Arsenault@amd.com> | 2013-10-03 18:15:57 +0000 |
commit | 1df59ef1aa271a4e33cf8973e14bcaf55c585231 (patch) | |
tree | 64b86c57b32aa8d267f5eff9b1cb54305d562132 /test/Transforms | |
parent | d6370ad87d21402c0e2b1fef12d4a77fd1ead306 (diff) | |
download | external_llvm-1df59ef1aa271a4e33cf8973e14bcaf55c585231.zip external_llvm-1df59ef1aa271a4e33cf8973e14bcaf55c585231.tar.gz external_llvm-1df59ef1aa271a4e33cf8973e14bcaf55c585231.tar.bz2 |
Make gep i8* X, -(ptrtoint Y) transform work with address spaces
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191920 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms')
-rw-r--r-- | test/Transforms/InstCombine/getelementptr.ll | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/getelementptr.ll b/test/Transforms/InstCombine/getelementptr.ll index 191a151..c29a7dc 100644 --- a/test/Transforms/InstCombine/getelementptr.ll +++ b/test/Transforms/InstCombine/getelementptr.ll @@ -776,4 +776,17 @@ define i64 @test40() { ; CHECK-NEXT: ret i64 8 } +define i16 @test41([3 x i32] addrspace(1)* %array) { + %gep = getelementptr inbounds [3 x i32] addrspace(1)* %array, i16 0, i16 2 + %gepi8 = bitcast i32 addrspace(1)* %gep to i8 addrspace(1)* + %p = ptrtoint [3 x i32] addrspace(1)* %array to i16 + %np = sub i16 0, %p + %gep2 = getelementptr i8 addrspace(1)* %gepi8, i16 %np + %ret = ptrtoint i8 addrspace(1)* %gep2 to i16 + ret i16 %ret + +; CHECK-LABEL: @test41( +; CHECK-NEXT: ret i16 8 +} + ; CHECK: attributes [[NUW]] = { nounwind } |