This is an archive of the discontinued LLVM Phabricator instance.

[mlir][NFC] Clean up builder usage around constants/non-foldable ops
ClosedPublic

Authored by springerm on Jun 30 2023, 3:00 AM.

Details

Summary
  • Use create instead of createOrFold for constant ops. Constants cannot be folded any further.
  • Use create instead of createOrFold for ops that do not have a folder.
  • Use C++ op builders that take an int instead of creating a ConstantIndexOp.
  • Create tensor::DimOp instead of linalg::createOrFoldDimOp when it is certain that the operand is a tensor.

Diff Detail

Event Timeline

springerm created this revision.Jun 30 2023, 3:00 AM
springerm requested review of this revision.Jun 30 2023, 3:00 AM
nicolasvasilache accepted this revision.Jun 30 2023, 4:34 AM
This revision is now accepted and ready to land.Jun 30 2023, 4:34 AM