diff options
author | Sanjoy Das <sanjoy@playingwithpointers.com> | 2019-03-11 22:37:31 +0000 |
---|---|---|
committer | Sanjoy Das <sanjoy@playingwithpointers.com> | 2019-03-11 22:37:31 +0000 |
commit | 2136a5bc49bfd241fcf95d96bd11f9436f001cd4 (patch) | |
tree | afbcd6350b89ebc8952409d6a12d3fc5efb37a2f /llvm/lib/Transforms/Vectorize | |
parent | a958d40e78367642257e6f624769b5fa9e0eab11 (diff) | |
download | bcm5719-llvm-2136a5bc49bfd241fcf95d96bd11f9436f001cd4.tar.gz bcm5719-llvm-2136a5bc49bfd241fcf95d96bd11f9436f001cd4.zip |
Revert "Relax constraints for reduction vectorization"
This reverts commit r355868. Breaks hexagon.
llvm-svn: 355873
Diffstat (limited to 'llvm/lib/Transforms/Vectorize')
-rw-r--r-- | llvm/lib/Transforms/Vectorize/LoopVectorize.cpp | 16 | ||||
-rw-r--r-- | llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp | 3 |
2 files changed, 7 insertions, 12 deletions
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp index b57012291df..b10ce86b682 100644 --- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp +++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp @@ -319,14 +319,11 @@ static unsigned getReciprocalPredBlockProb() { return 2; } /// A helper function that adds a 'fast' flag to floating-point operations. static Value *addFastMathFlag(Value *V) { - if (isa<FPMathOperator>(V)) - cast<Instruction>(V)->setFastMathFlags(FastMathFlags::getFast()); - return V; -} - -static Value *addFastMathFlag(Value *V, FastMathFlags FMF) { - if (isa<FPMathOperator>(V)) - cast<Instruction>(V)->setFastMathFlags(FMF); + if (isa<FPMathOperator>(V)) { + FastMathFlags Flags; + Flags.setFast(); + cast<Instruction>(V)->setFastMathFlags(Flags); + } return V; } @@ -3615,8 +3612,7 @@ void InnerLoopVectorizer::fixReduction(PHINode *Phi) { // Floating point operations had to be 'fast' to enable the reduction. ReducedPartRdx = addFastMathFlag( Builder.CreateBinOp((Instruction::BinaryOps)Op, RdxPart, - ReducedPartRdx, "bin.rdx"), - RdxDesc.getFastMathFlags()); + ReducedPartRdx, "bin.rdx")); else ReducedPartRdx = createMinMaxOp(Builder, MinMaxKind, ReducedPartRdx, RdxPart); diff --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp index 28ed4e6ff1a..0016e10567e 100644 --- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp +++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp @@ -5929,8 +5929,7 @@ private: if (!IsPairwiseReduction) return createSimpleTargetReduction( Builder, TTI, ReductionData.getOpcode(), VectorizedValue, - ReductionData.getFlags(), FastMathFlags::getFast(), - ReductionOps.back()); + ReductionData.getFlags(), ReductionOps.back()); Value *TmpVec = VectorizedValue; for (unsigned i = ReduxWidth / 2; i != 0; i >>= 1) { |