[llvm] 6703d2e - [VectorCombine] add test with addrspacecast; NFC

Sanjay Patel via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 8 05:29:53 PST 2022


Author: Sanjay Patel
Date: 2022-11-08T08:28:56-05:00
New Revision: 6703d2ecf9da24f0f4611bff0a467e2aa7d16c18

URL: https://github.com/llvm/llvm-project/commit/6703d2ecf9da24f0f4611bff0a467e2aa7d16c18
DIFF: https://github.com/llvm/llvm-project/commit/6703d2ecf9da24f0f4611bff0a467e2aa7d16c18.diff

LOG: [VectorCombine] add test with addrspacecast; NFC

D137341

Added: 
    

Modified: 
    llvm/test/Transforms/VectorCombine/X86/load-widening.ll

Removed: 
    


################################################################################
diff  --git a/llvm/test/Transforms/VectorCombine/X86/load-widening.ll b/llvm/test/Transforms/VectorCombine/X86/load-widening.ll
index 40f610d3343c..3df694b14e58 100644
--- a/llvm/test/Transforms/VectorCombine/X86/load-widening.ll
+++ b/llvm/test/Transforms/VectorCombine/X86/load-widening.ll
@@ -350,3 +350,16 @@ define <4 x i32> @load_v2i32_v4i32_non_canonical_mask_commute(ptr dereferenceabl
   %s = shufflevector <2 x i32> poison, <2 x i32> %l, <4 x i32> <i32 2, i32 3, i32 undef, i32 undef>
   ret <4 x i32> %s
 }
+
+define <4 x i32> @load_v2i32_v4i32_addrspacecast(ptr addrspace(5) align 16 dereferenceable(16) %p) {
+; CHECK-LABEL: @load_v2i32_v4i32_addrspacecast(
+; CHECK-NEXT:    [[ASC:%.*]] = addrspacecast ptr addrspace(5) [[P:%.*]] to ptr addrspace(42)
+; CHECK-NEXT:    [[L:%.*]] = load <2 x i32>, ptr addrspace(42) [[ASC]], align 4
+; CHECK-NEXT:    [[S:%.*]] = shufflevector <2 x i32> [[L]], <2 x i32> poison, <4 x i32> <i32 0, i32 1, i32 undef, i32 undef>
+; CHECK-NEXT:    ret <4 x i32> [[S]]
+;
+  %asc = addrspacecast ptr addrspace(5) %p to ptr addrspace(42)
+  %l = load <2 x i32>, ptr addrspace(42) %asc, align 4
+  %s = shufflevector <2 x i32> %l, <2 x i32> poison, <4 x i32> <i32 0, i32 1, i32 undef, i32 undef>
+  ret <4 x i32> %s
+}


        


More information about the llvm-commits mailing list