Skip to content

Commit b37c5cd

Browse files
ppogotovigcbot
authored andcommitted
Revert "Extending the application of the multiplication pattern in GEP LSR pass."
This reverts commit 9c27763.
1 parent 7f07369 commit b37c5cd

File tree

2 files changed

+9
-108
lines changed

2 files changed

+9
-108
lines changed

IGC/Compiler/Optimizer/OpenCLPasses/GEPLoopStrengthReduction/GEPLoopStrengthReduction.cpp

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -991,25 +991,13 @@ bool Analyzer::deconstructSCEV(const SCEV *S, Analyzer::DeconstructedSCEV &Resul
991991
return true;
992992
}
993993

994-
// Expect SCEV expression:
995-
// { start, +, step }
996-
// where step is constant
997-
if (auto *Add = dyn_cast<SCEVAddRecExpr>(S)) {
998-
// Consider the following SCEV as a mul pattern:
999-
// {(%val * %multiplier),+,%multiplier}
1000-
auto *Op0 = Add->getOperand(0);
1001-
auto *Op1 = Add->getOperand(1);
1002-
bool Conv = false;
1003-
if (auto *Mul = dyn_cast<SCEVMulExpr>(Op0)) {
1004-
auto *MulOp0 = Mul->getOperand(0);
1005-
auto *MulOp1 = Mul->getOperand(1);
1006-
if (MulOp0 == Op1 || MulOp1 == Op1) {
1007-
Conv = true;
1008-
}
1009-
}
1010-
1011-
if (!Add->isAffine())
1012-
return false;
994+
// Expect SCEV expression:
995+
// { start, +, step }
996+
// where step is constant
997+
if (auto *Add = dyn_cast<SCEVAddRecExpr>(S))
998+
{
999+
if (!Add->isAffine())
1000+
return false;
10131001

10141002
if (Add->getNumOperands() != 2)
10151003
return false;
@@ -1027,9 +1015,8 @@ bool Analyzer::deconstructSCEV(const SCEV *S, Analyzer::DeconstructedSCEV &Resul
10271015
if (!SE.isLoopInvariant(OpStep, &L))
10281016
return false;
10291017

1030-
Result.Start = Add->getStart();
1031-
Result.Step = OpStep;
1032-
Result.ConvertedMulExpr = Conv;
1018+
Result.Start = Add->getStart();
1019+
Result.Step = OpStep;
10331020

10341021
return IGCLLVM::isSafeToExpandAt(Result.Start, &L.getLoopPreheader()->back(), &SE, &E);
10351022
}

IGC/Compiler/tests/GEPLoopStrengthReduction/common-multiplier.ll

Lines changed: 0 additions & 86 deletions
This file was deleted.

0 commit comments

Comments
 (0)