[llvm] 3dbfd13 - [SLP][NFC]Add a test with the incorrect xor to and transformation

Alexey Bataev via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 31 07:21:51 PST 2025


Author: Alexey Bataev
Date: 2025-12-31T07:21:38-08:00
New Revision: 3dbfd13acd113c14d0cde5ccb9c77d9e2fec33fc

URL: https://github.com/llvm/llvm-project/commit/3dbfd13acd113c14d0cde5ccb9c77d9e2fec33fc
DIFF: https://github.com/llvm/llvm-project/commit/3dbfd13acd113c14d0cde5ccb9c77d9e2fec33fc.diff

LOG: [SLP][NFC]Add a test with the incorrect xor to and transformation

Added: 
    llvm/test/Transforms/SLPVectorizer/X86/xor-with-zero-and-incompat.ll

Modified: 
    

Removed: 
    


################################################################################
diff  --git a/llvm/test/Transforms/SLPVectorizer/X86/xor-with-zero-and-incompat.ll b/llvm/test/Transforms/SLPVectorizer/X86/xor-with-zero-and-incompat.ll
new file mode 100644
index 0000000000000..545470ebed9f1
--- /dev/null
+++ b/llvm/test/Transforms/SLPVectorizer/X86/xor-with-zero-and-incompat.ll
@@ -0,0 +1,19 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 6
+; RUN: opt -S --passes=slp-vectorizer -mtriple=x86_64-unknown-linux-gnu < %s -slp-threshold=-100 | FileCheck %s
+
+define void @src_test_xor_and_identity_mismatch(i32 %a, i32 %b, ptr %dst) {
+; CHECK-LABEL: define void @src_test_xor_and_identity_mismatch(
+; CHECK-SAME: i32 [[A:%.*]], i32 [[B:%.*]], ptr [[DST:%.*]]) {
+; CHECK-NEXT:    [[TMP1:%.*]] = insertelement <2 x i32> poison, i32 [[A]], i32 0
+; CHECK-NEXT:    [[TMP2:%.*]] = insertelement <2 x i32> [[TMP1]], i32 [[B]], i32 1
+; CHECK-NEXT:    [[TMP3:%.*]] = and <2 x i32> [[TMP2]], <i32 0, i32 -1>
+; CHECK-NEXT:    store <2 x i32> [[TMP3]], ptr [[DST]], align 4
+; CHECK-NEXT:    ret void
+;
+  %op1 = xor i32 %a, 0
+  %op2 = and i32 %b, -1
+  store i32 %op1, ptr %dst
+  %gep = getelementptr i32, ptr %dst, i64 1
+  store i32 %op2, ptr %gep
+  ret void
+}


        


More information about the llvm-commits mailing list