[llvm] d2ab97b - [SLP][NFC]Add a test with incorrect reduction of poisoned logical bool.
Alexey Bataev via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 14 17:14:54 PDT 2023
Author: Alexey Bataev
Date: 2023-09-14T17:11:44-07:00
New Revision: d2ab97b00ce702006f7b1098e3530094759c8841
URL: https://github.com/llvm/llvm-project/commit/d2ab97b00ce702006f7b1098e3530094759c8841
DIFF: https://github.com/llvm/llvm-project/commit/d2ab97b00ce702006f7b1098e3530094759c8841.diff
LOG: [SLP][NFC]Add a test with incorrect reduction of poisoned logical bool.
Added:
llvm/test/Transforms/SLPVectorizer/const-bool-logical-or-reduction.ll
Modified:
Removed:
################################################################################
diff --git a/llvm/test/Transforms/SLPVectorizer/const-bool-logical-or-reduction.ll b/llvm/test/Transforms/SLPVectorizer/const-bool-logical-or-reduction.ll
new file mode 100644
index 000000000000000..9d86785ab44336a
--- /dev/null
+++ b/llvm/test/Transforms/SLPVectorizer/const-bool-logical-or-reduction.ll
@@ -0,0 +1,16 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 3
+; RUN: opt -passes=slp-vectorizer -S < %s | FileCheck %s
+
+define i1 @test(i32 %inc) {
+; CHECK-LABEL: define i1 @test(
+; CHECK-SAME: i32 [[INC:%.*]]) {
+; CHECK-NEXT: [[CMP:%.*]] = icmp ult i32 [[INC]], 3
+; CHECK-NEXT: [[OP_RDX:%.*]] = select i1 poison, i1 true, i1 [[CMP]]
+; CHECK-NEXT: ret i1 [[OP_RDX]]
+;
+ %cmp = icmp ult i32 %inc, 3
+ %sel1 = select i1 %cmp, i1 true, i1 poison
+ %sel2 = select i1 %sel1, i1 true, i1 poison
+ %sel3 = select i1 %sel2, i1 true, i1 poison
+ ret i1 %sel3
+}
More information about the llvm-commits
mailing list