diff options
author | Vyacheslav Klochkov <vyacheslav.n.klochkov@gmail.com> | 2016-11-11 19:55:29 +0000 |
---|---|---|
committer | Vyacheslav Klochkov <vyacheslav.n.klochkov@gmail.com> | 2016-11-11 19:55:29 +0000 |
commit | f1a12fe0f5de5e07937b8cb99ceda2487713f7c8 (patch) | |
tree | c9728d10cb02c0cabe07ec7c32df4138d6abcc39 /llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp | |
parent | 8ade03463e3cf09b9169cd913384d7385fdeb226 (diff) | |
download | bcm5719-llvm-f1a12fe0f5de5e07937b8cb99ceda2487713f7c8.tar.gz bcm5719-llvm-f1a12fe0f5de5e07937b8cb99ceda2487713f7c8.zip |
Fixed the lost FastMathFlags for FCmp operations in SLPVectorizer.
Reviewer: Michael Zolotukhin.
Differential Revision: https://reviews.llvm.org/D26543
llvm-svn: 286626
Diffstat (limited to 'llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp')
-rw-r--r-- | llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp index 73dca758dd6..6b27ac6406b 100644 --- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp +++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp @@ -211,12 +211,12 @@ static unsigned getSameOpcode(ArrayRef<Value *> VL) { /// of each scalar operation (VL) that will be converted into a vector (I). /// Flag set: NSW, NUW, exact, and all of fast-math. static void propagateIRFlags(Value *I, ArrayRef<Value *> VL) { - if (auto *VecOp = dyn_cast<BinaryOperator>(I)) { - if (auto *Intersection = dyn_cast<BinaryOperator>(VL[0])) { + if (auto *VecOp = dyn_cast<Instruction>(I)) { + if (auto *Intersection = dyn_cast<Instruction>(VL[0])) { // Intersection is initialized to the 0th scalar, // so start counting from index '1'. for (int i = 1, e = VL.size(); i < e; ++i) { - if (auto *Scalar = dyn_cast<BinaryOperator>(VL[i])) + if (auto *Scalar = dyn_cast<Instruction>(VL[i])) Intersection->andIRFlags(Scalar); } VecOp->copyIRFlags(Intersection); @@ -2430,6 +2430,7 @@ Value *BoUpSLP::vectorizeTree(TreeEntry *E) { V = Builder.CreateICmp(P0, L, R); E->VectorizedValue = V; + propagateIRFlags(E->VectorizedValue, E->Scalars); ++NumVectorInstructions; return V; } |