summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorMartin Storsjo <martin@martin.st>2019-10-07 08:21:37 +0000
committerMartin Storsjo <martin@martin.st>2019-10-07 08:21:37 +0000
commitdfc1aee25b68c9819b4a8a868be784110c6e751e (patch)
treedf85a4878f8b383e8c1a3fb355301d7eac4d76b1 /llvm/lib/Transforms
parent0c56f425a0d2bee766b8627a40af3ad030757e16 (diff)
downloadbcm5719-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.cpp15
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:
OpenPOWER on IntegriCloud