[llvm] aebf085 - [SLP][NFC]Add a test with comparison for different sized integer types, NFC.
Alexey Bataev via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 6 04:59:18 PDT 2024
Author: Alexey Bataev
Date: 2024-08-06T04:59:05-07:00
New Revision: aebf0855b627ab0b27b6e1d36d370ff70e72fb4e
URL: https://github.com/llvm/llvm-project/commit/aebf0855b627ab0b27b6e1d36d370ff70e72fb4e
DIFF: https://github.com/llvm/llvm-project/commit/aebf0855b627ab0b27b6e1d36d370ff70e72fb4e.diff
LOG: [SLP][NFC]Add a test with comparison for different sized integer types, NFC.
Added:
llvm/test/Transforms/SLPVectorizer/X86/cmp-diff-sized.ll
Modified:
Removed:
################################################################################
diff --git a/llvm/test/Transforms/SLPVectorizer/X86/cmp-
diff -sized.ll b/llvm/test/Transforms/SLPVectorizer/X86/cmp-
diff -sized.ll
new file mode 100644
index 0000000000000..b8b2aa3ad91be
--- /dev/null
+++ b/llvm/test/Transforms/SLPVectorizer/X86/cmp-
diff -sized.ll
@@ -0,0 +1,35 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
+; RUN: opt < %s -passes=slp-vectorizer -S -mtriple=x86_64--- | FileCheck %s
+
+define void @test(ptr noalias %a, ptr %b) {
+; CHECK-LABEL: @test(
+; CHECK-NEXT: [[PA1:%.*]] = getelementptr inbounds i64, ptr [[A:%.*]], i32 64
+; CHECK-NEXT: [[PA2:%.*]] = getelementptr inbounds i32, ptr [[A]], i32 1
+; CHECK-NEXT: [[A0:%.*]] = load i32, ptr [[A]], align 4
+; CHECK-NEXT: [[A1:%.*]] = load i64, ptr [[PA1]], align 8
+; CHECK-NEXT: [[A2:%.*]] = load i32, ptr [[PA2]], align 4
+; CHECK-NEXT: [[PB1:%.*]] = getelementptr inbounds i64, ptr [[B:%.*]], i32 64
+; CHECK-NEXT: [[PB2:%.*]] = getelementptr inbounds i32, ptr [[B]], i32 1
+; CHECK-NEXT: [[B0:%.*]] = load i32, ptr [[B]], align 4
+; CHECK-NEXT: [[B1:%.*]] = load i64, ptr [[PB1]], align 8
+; CHECK-NEXT: [[B2:%.*]] = load i32, ptr [[PB2]], align 4
+; CHECK-NEXT: [[C0:%.*]] = icmp eq i32 [[A0]], [[B0]]
+; CHECK-NEXT: [[C1:%.*]] = icmp eq i64 [[B1]], [[A1]]
+; CHECK-NEXT: [[C2:%.*]] = icmp eq i32 [[B2]], [[A2]]
+; CHECK-NEXT: ret void
+;
+ %pa1 = getelementptr inbounds i64, ptr %a, i32 64
+ %pa2 = getelementptr inbounds i32, ptr %a, i32 1
+ %a0 = load i32, ptr %a, align 4
+ %a1 = load i64, ptr %pa1, align 8
+ %a2 = load i32, ptr %pa2, align 4
+ %pb1 = getelementptr inbounds i64, ptr %b, i32 64
+ %pb2 = getelementptr inbounds i32, ptr %b, i32 1
+ %b0 = load i32, ptr %b, align 4
+ %b1 = load i64, ptr %pb1, align 8
+ %b2 = load i32, ptr %pb2, align 4
+ %c0 = icmp eq i32 %a0, %b0
+ %c1 = icmp eq i64 %b1, %a1
+ %c2 = icmp eq i32 %b2, %a2
+ ret void
+}
More information about the llvm-commits
mailing list