This is an archive of the discontinued LLVM Phabricator instance.

[mlir][linalg] Add constant padding helper to PadTensorOp
ClosedPublic

Authored by springerm on Jun 9 2021, 6:46 PM.

Details

Summary
  • Add a helper function that returns the constant padding value (if applicable).
  • Remove existing getConstantYieldValueFromBlock function, which does almost the same.
  • Adapted from D103243.

Diff Detail

Event Timeline

springerm created this revision.Jun 9 2021, 6:46 PM
springerm requested review of this revision.Jun 9 2021, 6:46 PM
ThomasRaoux accepted this revision.Jun 10 2021, 9:16 AM
ThomasRaoux added inline comments.
mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
1143–1148

Can you just replace that with something like this:

if(padValue.getParentRegion() == getRegion().front())
  return {};
This revision is now accepted and ready to land.Jun 10 2021, 9:16 AM
springerm updated this revision to Diff 351754.Jun 13 2021, 5:43 PM
springerm marked an inline comment as done.

address comments

This revision was landed with ongoing or failed builds.Jun 13 2021, 5:49 PM
This revision was automatically updated to reflect the committed changes.