[llvm] 803ab28 - [SLP][NFC]Add a test with unsafe fp vectorization.

Alexey Bataev via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 1 07:08:02 PDT 2024


Author: Alexey Bataev
Date: 2024-09-01T07:05:36-07:00
New Revision: 803ab280901588bdb92c52f8ea241caaa3926d8f

URL: https://github.com/llvm/llvm-project/commit/803ab280901588bdb92c52f8ea241caaa3926d8f
DIFF: https://github.com/llvm/llvm-project/commit/803ab280901588bdb92c52f8ea241caaa3926d8f.diff

LOG: [SLP][NFC]Add a test with unsafe fp vectorization.

Added: 
    llvm/test/Transforms/SLPVectorizer/ARM/invalid-fp-operations.ll

Modified: 
    

Removed: 
    


################################################################################
diff  --git a/llvm/test/Transforms/SLPVectorizer/ARM/invalid-fp-operations.ll b/llvm/test/Transforms/SLPVectorizer/ARM/invalid-fp-operations.ll
new file mode 100644
index 00000000000000..22100c9ab88c6e
--- /dev/null
+++ b/llvm/test/Transforms/SLPVectorizer/ARM/invalid-fp-operations.ll
@@ -0,0 +1,39 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
+; RUN: opt -S --passes=slp-vectorizer -mtriple=arm-- -mattr=+neon < %s | FileCheck %s
+
+define void @test(ptr %a, ptr %b, ptr %r) {
+; CHECK-LABEL: define void @test(
+; CHECK-SAME: ptr [[A:%.*]], ptr [[B:%.*]], ptr [[R:%.*]]) #[[ATTR0:[0-9]+]] {
+; CHECK-NEXT:    [[TMP1:%.*]] = load <4 x float>, ptr [[A]], align 4
+; CHECK-NEXT:    [[TMP2:%.*]] = load <4 x float>, ptr [[B]], align 4
+; CHECK-NEXT:    [[TMP3:%.*]] = fadd <4 x float> [[TMP1]], [[TMP2]]
+; CHECK-NEXT:    store <4 x float> [[TMP3]], ptr [[R]], align 4
+; CHECK-NEXT:    ret void
+;
+  %v.a.0 = load float, ptr %a
+  %a.1 = getelementptr i8, ptr %a, i64 4
+  %v.a.1 = load float, ptr %a.1
+  %a.2 = getelementptr i8, ptr %a, i64 8
+  %v.a.2 = load float, ptr %a.2
+  %a.3 = getelementptr i8, ptr %a, i64 12
+  %v.a.3 = load float, ptr %a.3
+  %v.b.0 = load float, ptr %b
+  %b.1 = getelementptr i8, ptr %b, i64 4
+  %v.b.1 = load float, ptr %b.1
+  %b.2 = getelementptr i8, ptr %b, i64 8
+  %v.b.2 = load float, ptr %b.2
+  %b.3 = getelementptr i8, ptr %b, i64 12
+  %v.b.3 = load float, ptr %b.3
+  %v.r.0 = fadd float %v.a.0, %v.b.0
+  %v.r.1 = fadd float %v.a.1, %v.b.1
+  %v.r.2 = fadd float %v.a.2, %v.b.2
+  %v.r.3 = fadd float %v.a.3, %v.b.3
+  store float %v.r.0, ptr %r
+  %r.1 = getelementptr i8, ptr %r, i64 4
+  store float %v.r.1, ptr %r.1
+  %r.2 = getelementptr i8, ptr %r, i64 8
+  store float %v.r.2, ptr %r.2
+  %r.3 = getelementptr i8, ptr %r, i64 12
+  store float %v.r.3, ptr %r.3
+  ret void
+}


        


More information about the llvm-commits mailing list