This is an archive of the discontinued LLVM Phabricator instance.

[mlir][scf] Enhance sizes computation in tileUsingSCFForOp.
ClosedPublic

Authored by hanchung on Oct 27 2022, 1:50 PM.

Details

Summary

The boundary is always 1 if the tile size is 1.

Diff Detail

Event Timeline

hanchung created this revision.Oct 27 2022, 1:50 PM
hanchung requested review of this revision.Oct 27 2022, 1:50 PM
mravishankar requested changes to this revision.Oct 27 2022, 1:54 PM

Just a minor readability comment.

mlir/lib/Dialect/SCF/Transforms/TileUsingInterface.cpp
171

The if-then-else-if logic is a bit hard to follow. Maybe move that into a helper method like

OpFoldResult getBoundedTileSize(OpBuilder &b, Value tileSize) {
  Optional<int64_t> ts = getConstantIntValue(tileSize)
  if (ts && ts.value() == 1)
    return getAsOpFoldResult(tileSize);
  if (tileDividesIterationDomain(...))
    return tileSize;
  return b.create<AffineMinOp>(...);
}
This revision now requires changes to proceed.Oct 27 2022, 1:54 PM
hanchung updated this revision to Diff 471597.Oct 28 2022, 10:58 AM

create a helper function

hanchung marked an inline comment as done.Oct 28 2022, 11:08 AM
mravishankar accepted this revision.Oct 28 2022, 11:34 AM
This revision is now accepted and ready to land.Oct 28 2022, 11:34 AM
hanchung updated this revision to Diff 471629.Oct 28 2022, 1:01 PM

clang-format

This revision was landed with ongoing or failed builds.Oct 28 2022, 1:03 PM
This revision was automatically updated to reflect the committed changes.