[PATCH] D14721: patch for missed constantFold optimization in InstCombine

David Majnemer via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 18 13:49:27 PST 2015


majnemer added a comment.

Please include additional context in the diff.


================
Comment at: test/Transforms/InstCombine/instCombineOptimizeAddrspaceCast.ll:8-26
@@ +7,20 @@
+; Function Attrs: nounwind
+define void @testKernel(i32 addrspace(1)* %results) nounwind {
+  %1 = alloca i32 addrspace(1)*, align 8
+  %ptr = alloca i32 addrspace(4)*, align 8
+  %lptr = alloca i32 addrspace(3)*, align 8
+  store i32 addrspace(1)* %results, i32 addrspace(1)** %1, align 8
+  store i32 7, i32 addrspace(3)* @testKernel.some_value, align 4
+  store i32 addrspace(4)* null, i32 addrspace(4)** %ptr, align 8
+  store i32 addrspace(3)* @testKernel.some_value, i32 addrspace(3)** %lptr, align 8
+  %2 = load i32 addrspace(4)** %ptr, align 8
+  %3 = load i32 addrspace(3)** %lptr, align 8
+  %4 = addrspacecast i32 addrspace(3)* %3 to i32 addrspace(4)*
+  %5 = icmp ne i32 addrspace(4)* %2, %4
+  %6 = zext i1 %5 to i32
+  %7 = load i32 addrspace(1)** %1, align 8
+  %8 = getelementptr inbounds i32 addrspace(1)* %7, i64 0
+  store i32 %6, i32 addrspace(1)* %8, align 4
+; CHECK: store i32 1, i32 addrspace(1)* %results
+  ret void
+}
----------------
Can you try to make this test a little more targeted?


http://reviews.llvm.org/D14721





More information about the llvm-commits mailing list