all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
blob a6df7d1e8f3d284f6983cf06a22a4164e24863e4 2331 bytes (raw)
name: gnu/packages/patches/llvm-D34078-vectorize-fdiv.patch 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
 
From f94d12b6108b944199b715f31f25a022f75d2feb Mon Sep 17 00:00:00 2001
From: Yichao Yu <yyc1992@gmail.com>
Date: Sat, 10 Jun 2017 08:45:13 -0400
Subject: [PATCH 4/4] Enable support for floating-point division reductions

Similar to fsub, fdiv can also be vectorized using fmul.
---
 lib/Transforms/Utils/LoopUtils.cpp               |  1 +
 test/Transforms/LoopVectorize/float-reduction.ll | 22 ++++++++++++++++++++++
 2 files changed, 23 insertions(+)

diff --git a/lib/Transforms/Utils/LoopUtils.cpp b/lib/Transforms/Utils/LoopUtils.cpp
index 3c522786641..a4aced53a95 100644
--- a/lib/Transforms/Utils/LoopUtils.cpp
+++ b/lib/Transforms/Utils/LoopUtils.cpp
@@ -451,6 +451,7 @@ RecurrenceDescriptor::isRecurrenceInstr(Instruction *I, RecurrenceKind Kind,
     return InstDesc(Kind == RK_IntegerOr, I);
   case Instruction::Xor:
     return InstDesc(Kind == RK_IntegerXor, I);
+  case Instruction::FDiv:
   case Instruction::FMul:
     return InstDesc(Kind == RK_FloatMult, I, UAI);
   case Instruction::FSub:
diff --git a/test/Transforms/LoopVectorize/float-reduction.ll b/test/Transforms/LoopVectorize/float-reduction.ll
index f3b95d0ead7..669c54d55a2 100644
--- a/test/Transforms/LoopVectorize/float-reduction.ll
+++ b/test/Transforms/LoopVectorize/float-reduction.ll
@@ -44,3 +44,25 @@ for.body:                                         ; preds = %for.body, %entry
 for.end:                                          ; preds = %for.body
   ret float %sub
 }
+
+;CHECK-LABEL: @foodiv(
+;CHECK: fdiv fast <4 x float>
+;CHECK: ret
+define float @foodiv(float* nocapture %A, i32* nocapture %n) nounwind uwtable readonly ssp {
+entry:
+  br label %for.body
+
+for.body:                                         ; preds = %for.body, %entry
+  %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]
+  %sum.04 = phi float [ 1.000000e+00, %entry ], [ %sub, %for.body ]
+  %arrayidx = getelementptr inbounds float, float* %A, i64 %indvars.iv
+  %0 = load float, float* %arrayidx, align 4
+  %sub = fdiv fast float %sum.04, %0
+  %indvars.iv.next = add i64 %indvars.iv, 1
+  %lftr.wideiv = trunc i64 %indvars.iv.next to i32
+  %exitcond = icmp eq i32 %lftr.wideiv, 200
+  br i1 %exitcond, label %for.end, label %for.body
+
+for.end:                                          ; preds = %for.body
+  ret float %sub
+}
-- 
2.14.1


debug log:

solving a6df7d1e8f ...
found a6df7d1e8f in https://yhetil.org/guix/20190423094936.27413-1-anothersms@gmail.com/

applying [1/1] https://yhetil.org/guix/20190423094936.27413-1-anothersms@gmail.com/
diff --git a/gnu/packages/patches/llvm-D34078-vectorize-fdiv.patch b/gnu/packages/patches/llvm-D34078-vectorize-fdiv.patch
new file mode 100644
index 0000000000..a6df7d1e8f

1:60: trailing whitespace.
-- 
Checking patch gnu/packages/patches/llvm-D34078-vectorize-fdiv.patch...
1:62: new blank line at EOF.
+
Applied patch gnu/packages/patches/llvm-D34078-vectorize-fdiv.patch cleanly.
warning: 2 lines add whitespace errors.

index at:
100644 a6df7d1e8f3d284f6983cf06a22a4164e24863e4	gnu/packages/patches/llvm-D34078-vectorize-fdiv.patch

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.