diff options
author | Martin Storsjo <martin@martin.st> | 2019-10-07 08:21:37 +0000 |
---|---|---|
committer | Martin Storsjo <martin@martin.st> | 2019-10-07 08:21:37 +0000 |
commit | dfc1aee25b68c9819b4a8a868be784110c6e751e (patch) | |
tree | df85a4878f8b383e8c1a3fb355301d7eac4d76b1 /llvm/lib/Transforms | |
parent | 0c56f425a0d2bee766b8627a40af3ad030757e16 (diff) | |
download | bcm5719-llvm-dfc1aee25b68c9819b4a8a868be784110c6e751e.tar.gz bcm5719-llvm-dfc1aee25b68c9819b4a8a868be784110c6e751e.zip |
Revert "[SLP] avoid reduction transform on patterns that the backend can load-combine"
This reverts SVN r373833, as it caused a failed assert "Non-zero loop
cost expected" on building numerous projects, see PR43582 for details
and reproduction samples.
llvm-svn: 373882
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r-- | llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp index ad12646bdee..99428c6c5de 100644 --- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp +++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp @@ -6499,19 +6499,10 @@ private: int ScalarReduxCost = 0; switch (ReductionData.getKind()) { - case RK_Arithmetic: { - // Note: Passing in the reduction operands allows the cost model to match - // load combining patterns for this reduction. - auto *ReduxInst = cast<Instruction>(ReductionRoot); - SmallVector<const Value *, 2> OperandList; - for (Value *Operand : ReduxInst->operands()) - OperandList.push_back(Operand); - ScalarReduxCost = TTI->getArithmeticInstrCost(ReductionData.getOpcode(), - ScalarTy, TargetTransformInfo::OK_AnyValue, - TargetTransformInfo::OK_AnyValue, TargetTransformInfo::OP_None, - TargetTransformInfo::OP_None, OperandList); + case RK_Arithmetic: + ScalarReduxCost = + TTI->getArithmeticInstrCost(ReductionData.getOpcode(), ScalarTy); break; - } case RK_Min: case RK_Max: case RK_UMin: |