[llvm] r188919 - Add test for bitcast array ptrs with address spaces
Matt Arsenault
Matthew.Arsenault at amd.com
Wed Aug 21 12:09:29 PDT 2013
Author: arsenm
Date: Wed Aug 21 14:09:28 2013
New Revision: 188919
URL: http://llvm.org/viewvc/llvm-project?rev=188919&view=rev
Log:
Add test for bitcast array ptrs with address spaces
Modified:
llvm/trunk/test/Transforms/InstCombine/getelementptr.ll
Modified: llvm/trunk/test/Transforms/InstCombine/getelementptr.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/getelementptr.ll?rev=188919&r1=188918&r2=188919&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/InstCombine/getelementptr.ll (original)
+++ llvm/trunk/test/Transforms/InstCombine/getelementptr.ll Wed Aug 21 14:09:28 2013
@@ -662,4 +662,26 @@ define i8 @test_gep_bitcast_array_differ
ret i8 %x
}
+define i64 @test_gep_bitcast_array_same_size_element_as1([100 x double] addrspace(1)* %arr, i16 %N) {
+; CHECK-LABEL: @test_gep_bitcast_array_same_size_element_as1(
+; CHECK: getelementptr [100 x double] addrspace(1)* %arr, i16 0, i16 %V
+; CHECK: bitcast
+ %cast = bitcast [100 x double] addrspace(1)* %arr to i64 addrspace(1)*
+ %V = mul i16 %N, 8
+ %t = getelementptr i64 addrspace(1)* %cast, i16 %V
+ %x = load i64 addrspace(1)* %t
+ ret i64 %x
+}
+
+define i8 @test_gep_bitcast_array_different_size_element_as1([100 x double] addrspace(1)* %arr, i16 %N) {
+; CHECK-LABEL: @test_gep_bitcast_array_different_size_element_as1(
+; CHECK: getelementptr [100 x double] addrspace(1)* %arr, i16 0, i16 %N
+; CHECK: bitcast
+ %cast = bitcast [100 x double] addrspace(1)* %arr to i8 addrspace(1)*
+ %V = mul i16 %N, 8
+ %t = getelementptr i8 addrspace(1)* %cast, i16 %V
+ %x = load i8 addrspace(1)* %t
+ ret i8 %x
+}
+
; CHECK: attributes [[NUW]] = { nounwind }
More information about the llvm-commits
mailing list