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/Analysis/IVDescriptors.cpp | |
parent | a958d40e78367642257e6f624769b5fa9e0eab11 (diff) | |
download | llvm-2136a5bc49bfd241fcf95d96bd11f9436f001cd4.zip llvm-2136a5bc49bfd241fcf95d96bd11f9436f001cd4.tar.gz llvm-2136a5bc49bfd241fcf95d96bd11f9436f001cd4.tar.bz2 |
Revert "Relax constraints for reduction vectorization"
This reverts commit r355868. Breaks hexagon.
llvm-svn: 355873
Diffstat (limited to 'llvm/lib/Analysis/IVDescriptors.cpp')
-rw-r--r-- | llvm/lib/Analysis/IVDescriptors.cpp | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/llvm/lib/Analysis/IVDescriptors.cpp b/llvm/lib/Analysis/IVDescriptors.cpp index 19f1a77..555e3c9 100644 --- a/llvm/lib/Analysis/IVDescriptors.cpp +++ b/llvm/lib/Analysis/IVDescriptors.cpp @@ -251,10 +251,6 @@ bool RecurrenceDescriptor::AddReductionVar(PHINode *Phi, RecurrenceKind Kind, Worklist.push_back(Start); VisitedInsts.insert(Start); - // Start with all flags set because we will intersect this with the reduction - // flags from all the reduction operations. - FastMathFlags FMF = FastMathFlags::getFast(); - // A value in the reduction can be used: // - By the reduction: // - Reduction operation: @@ -300,8 +296,6 @@ bool RecurrenceDescriptor::AddReductionVar(PHINode *Phi, RecurrenceKind Kind, ReduxDesc = isRecurrenceInstr(Cur, Kind, ReduxDesc, HasFunNoNaNAttr); if (!ReduxDesc.isRecurrence()) return false; - if (isa<FPMathOperator>(ReduxDesc.getPatternInst())) - FMF &= ReduxDesc.getPatternInst()->getFastMathFlags(); } bool IsASelect = isa<SelectInst>(Cur); @@ -447,7 +441,7 @@ bool RecurrenceDescriptor::AddReductionVar(PHINode *Phi, RecurrenceKind Kind, // Save the description of this reduction variable. RecurrenceDescriptor RD( - RdxStart, ExitInstruction, Kind, FMF, ReduxDesc.getMinMaxKind(), + RdxStart, ExitInstruction, Kind, ReduxDesc.getMinMaxKind(), ReduxDesc.getUnsafeAlgebraInst(), RecurrenceType, IsSigned, CastInsts); RedDes = RD; @@ -556,7 +550,7 @@ RecurrenceDescriptor::InstDesc RecurrenceDescriptor::isRecurrenceInstr(Instruction *I, RecurrenceKind Kind, InstDesc &Prev, bool HasFunNoNaNAttr) { Instruction *UAI = Prev.getUnsafeAlgebraInst(); - if (!UAI && isa<FPMathOperator>(I) && !I->hasAllowReassoc()) + if (!UAI && isa<FPMathOperator>(I) && !I->isFast()) UAI = I; // Found an unsafe (unvectorizable) algebra instruction. switch (I->getOpcode()) { |