[PATCH] D56714: [SLP] introduce control over arithmetic horizontal reduction
Fedor Sergeev via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 15 03:17:46 PST 2019
fedor.sergeev updated this revision to Diff 181761.
fedor.sergeev added a comment.
clang-formatting
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D56714/new/
https://reviews.llvm.org/D56714
Files:
lib/Transforms/Vectorize/SLPVectorizer.cpp
Index: lib/Transforms/Vectorize/SLPVectorizer.cpp
===================================================================
--- lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ lib/Transforms/Vectorize/SLPVectorizer.cpp
@@ -115,6 +115,11 @@
ShouldVectorizeHor("slp-vectorize-hor", cl::init(true), cl::Hidden,
cl::desc("Attempt to vectorize horizontal reductions"));
+static cl::opt<bool> ShouldVectorizeHorArith(
+ "slp-vectorize-hor-arith", cl::init(false), cl::Hidden,
+ cl::desc("Attempt to vectorize horizontal reductions for arithmetic "
+ "operations other than add/fadd."));
+
static cl::opt<bool> ShouldStartVectorizeHorAtStore(
"slp-vectorize-hor-store", cl::init(false), cl::Hidden,
cl::desc(
@@ -5131,9 +5136,10 @@
// We currently only support add/mul/logical && min/max reductions.
((Kind == RK_Arithmetic &&
(Opcode == Instruction::Add || Opcode == Instruction::FAdd ||
- Opcode == Instruction::Mul || Opcode == Instruction::FMul ||
- Opcode == Instruction::And || Opcode == Instruction::Or ||
- Opcode == Instruction::Xor)) ||
+ (ShouldVectorizeHorArith &&
+ (Opcode == Instruction::Mul || Opcode == Instruction::FMul ||
+ Opcode == Instruction::And || Opcode == Instruction::Or ||
+ Opcode == Instruction::Xor)))) ||
((Opcode == Instruction::ICmp || Opcode == Instruction::FCmp) &&
(Kind == RK_Min || Kind == RK_Max)) ||
(Opcode == Instruction::ICmp &&
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D56714.181761.patch
Type: text/x-patch
Size: 1612 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190115/03fe3487/attachment.bin>
More information about the llvm-commits
mailing list