This is an archive of the discontinued LLVM Phabricator instance.

[mlir][shape] refine shape.func and shape.with_shape
ClosedPublic

Authored by yaochengji on Aug 16 2022, 9:51 AM.

Details

Summary
  • shape.with_shape supports ExtentTensorType
  • add helper to create shape.func

Diff Detail

Event Timeline

yaochengji created this revision.Aug 16 2022, 9:51 AM
yaochengji requested review of this revision.Aug 16 2022, 9:51 AM
jpienaar accepted this revision.Aug 19 2022, 11:14 AM
jpienaar added inline comments.
mlir/lib/Dialect/Shape/IR/Shape.cpp
1293

getSymNameAttr ? They do match (on purpose) but sym_name is the attribute name ODS defined and what the autogenerated builders use.

1295

Similiarly in the generated code we have

odsState.addAttribute(getFunctionTypeAttrName(odsState.name), function_type);

rather than querying the generic. (the difference is the latter form uses a cached Attribute rather than looking up the stringref and uniqueing it).

This revision is now accepted and ready to land.Aug 19 2022, 11:14 AM
yaochengji updated this revision to Diff 454233.EditedAug 20 2022, 9:48 AM

Thanks for pointing this out, use getSymNameAttrName and getFunctionTypeAttrName instead

yaochengji marked 2 inline comments as done.Aug 20 2022, 9:49 AM
This revision was automatically updated to reflect the committed changes.