[llvm] 71bf052 - [SLP][NFC]Add a test for bool logic ops reduction, NFC.
Alexey Bataev via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 30 13:39:08 PDT 2023
Author: Alexey Bataev
Date: 2023-10-30T13:38:57-07:00
New Revision: 71bf052ec90e77cb4aa66505d47cbc4b6016ac1d
URL: https://github.com/llvm/llvm-project/commit/71bf052ec90e77cb4aa66505d47cbc4b6016ac1d
DIFF: https://github.com/llvm/llvm-project/commit/71bf052ec90e77cb4aa66505d47cbc4b6016ac1d.diff
LOG: [SLP][NFC]Add a test for bool logic ops reduction, NFC.
Added:
llvm/test/Transforms/SLPVectorizer/X86/reduction-bool-logic-op-inside.ll
Modified:
Removed:
################################################################################
diff --git a/llvm/test/Transforms/SLPVectorizer/X86/reduction-bool-logic-op-inside.ll b/llvm/test/Transforms/SLPVectorizer/X86/reduction-bool-logic-op-inside.ll
new file mode 100644
index 000000000000000..2b5f62bdf98943e
--- /dev/null
+++ b/llvm/test/Transforms/SLPVectorizer/X86/reduction-bool-logic-op-inside.ll
@@ -0,0 +1,19 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 3
+; RUN: opt -S < %s --passes=slp-vectorizer | FileCheck %s
+
+define i1 @test(i32 %x) {
+; CHECK-LABEL: define i1 @test(
+; CHECK-SAME: i32 [[X:%.*]]) {
+; CHECK-NEXT: [[CMP:%.*]] = icmp sgt i32 [[X]], 1
+; CHECK-NEXT: [[OP_RDX:%.*]] = or i1 poison, [[CMP]]
+; CHECK-NEXT: ret i1 [[OP_RDX]]
+;
+ %cmp = icmp sgt i32 %x, 1
+ %sel1 = select i1 %cmp, i1 true, i1 poison
+ %sel2 = select i1 %sel1, i1 true, i1 poison
+ %sel3 = select i1 %sel2, i1 true, i1 poison
+ %sel4 = select i1 %cmp, i1 true, i1 poison
+ %ret = or i1 %sel3, %sel4
+ ret i1 %ret
+}
+
More information about the llvm-commits
mailing list