Skip to content

Commit e6e0838

Browse files
authored
[SYCL-MLIR]: Improve Polygeist LICM to handle invariant operations in scf::ForOp and AffineForOp (#8377)
This PR improves the `ParallelLICM` pass in polygeist as follows: - adds support for non-parallel loop constructs scf::ForOp and improves handleing of AffineForOp - fixes a problem, in sequential loops function calls are conservatively considered to modify memory - add more tests for both reduction loops and loops that do not yield a value - renames `ParallelLICM` pass to simply `LICM` --------- Signed-off-by: Tiotto, Ettore <[email protected]>
1 parent 425cc7f commit e6e0838

File tree

8 files changed

+464
-319
lines changed

8 files changed

+464
-319
lines changed

polygeist/include/polygeist/Passes/Passes.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class PatternRewriter;
99
class DominanceInfo;
1010
class LLVMTypeConverter;
1111
namespace polygeist {
12-
std::unique_ptr<Pass> createParallelLICMPass();
12+
std::unique_ptr<Pass> createLICMPass();
1313
std::unique_ptr<Pass> createMem2RegPass();
1414
std::unique_ptr<Pass> createLoopRestructurePass();
1515
std::unique_ptr<Pass> createInnerSerializationPass();

polygeist/include/polygeist/Passes/Passes.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ def SCFCanonicalizeFor : Pass<"canonicalize-scf-for"> {
6565
let constructor = "mlir::polygeist::createCanonicalizeForPass()";
6666
}
6767

68-
def ParallelLICM : Pass<"parallel-licm"> {
68+
def LICM : Pass<"licm"> {
6969
let summary = "Perform LICM on known parallel (and serial) loops";
70-
let constructor = "mlir::polygeist::createParallelLICMPass()";
70+
let constructor = "mlir::polygeist::createLICMPass()";
7171

7272
let statistics = [
7373
Statistic<"numOpHoisted", "num-operations-hoisted", "Number of operations hoisted">

polygeist/lib/polygeist/Passes/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ add_mlir_dialect_library(MLIRPolygeistTransforms
66
ConvertPolygeistToLLVM.cpp
77
InnerSerialization.cpp
88
LegalizeForSPIRV.cpp
9+
LICM.cpp
910
LoopRestructure.cpp
1011
Mem2Reg.cpp
1112
OpenMPOpt.cpp
12-
ParallelLICM.cpp
1313
ParallelLoopDistribute.cpp
1414
ParallelLower.cpp
1515
RaiseToAffine.cpp

0 commit comments

Comments
 (0)