[llvm] 600b463 - [X86] Add test to check that an extracted bool element comparison is correctly extended when the bool vector is bitcast instead

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Sat Sep 2 09:35:41 PDT 2023


Author: Simon Pilgrim
Date: 2023-09-02T17:34:12+01:00
New Revision: 600b4634acd7284025ee8cbf9b1ef97abbec4b07

URL: https://github.com/llvm/llvm-project/commit/600b4634acd7284025ee8cbf9b1ef97abbec4b07
DIFF: https://github.com/llvm/llvm-project/commit/600b4634acd7284025ee8cbf9b1ef97abbec4b07.diff

LOG: [X86] Add test to check that an extracted bool element comparison is correctly extended when the bool vector is bitcast instead

Thanks to @zequanwu for the reduced test case where 239ab16ec121 failed to correctly cast a compare-with-zero to the correct integer type

Added: 
    

Modified: 
    llvm/test/CodeGen/X86/avx512-insert-extract.ll

Removed: 
    


################################################################################
diff  --git a/llvm/test/CodeGen/X86/avx512-insert-extract.ll b/llvm/test/CodeGen/X86/avx512-insert-extract.ll
index 89b245b4ca8ef6..5728c14df14dd9 100644
--- a/llvm/test/CodeGen/X86/avx512-insert-extract.ll
+++ b/llvm/test/CodeGen/X86/avx512-insert-extract.ll
@@ -2263,3 +2263,26 @@ define void @test_concat_v2i1(ptr %arg, ptr %arg1, ptr %arg2) nounwind {
   store <2 x half> %tmp7, ptr %arg2, align 8
   ret void
 }
+
+; Check that an extracted bool element comparison is correctly extended when
+; the bool vector is bitcasted instead.
+define void @test_extractelement_v64i1_cmp0(<64 x i1> %0) nounwind {
+; KNL-LABEL: test_extractelement_v64i1_cmp0:
+; KNL:       ## %bb.0: ## %entry
+; KNL-NEXT:    retq
+;
+; SKX-LABEL: test_extractelement_v64i1_cmp0:
+; SKX:       ## %bb.0: ## %entry
+; SKX-NEXT:    vzeroupper
+; SKX-NEXT:    retq
+entry:
+  %1 = extractelement <64 x i1> %0, i64 0
+  br i1 %1, label %common.ret, label %2
+
+common.ret:                                       ; preds = %2, %entry
+  ret void
+
+2:                                                ; preds = %entry
+  %3 = extractelement <64 x i1> zeroinitializer, i64 0
+  br label %common.ret
+}


        


More information about the llvm-commits mailing list