This is an archive of the discontinued LLVM Phabricator instance.

[mlir][sparse] Renaming `CreationPolicy` to `Policy`
ClosedPublic

Authored by wrengr on Jul 17 2023, 6:02 PM.

Details

Summary

This change is mostly for brevity's sake; but it also paves the way for the Policy enum to be reuseable for other situations that require the same three-way semantics.

Diff Detail

Event Timeline

wrengr created this revision.Jul 17 2023, 6:02 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 17 2023, 6:02 PM
wrengr requested review of this revision.Jul 17 2023, 6:02 PM
Peiming added inline comments.Jul 18 2023, 8:17 AM
mlir/lib/Dialect/SparseTensor/IR/Detail/Var.h
393

Since we (at least at the current moment) requires forward declaration (when needed) for the dim/lvl variables. Do we still need the Policy?

Or do you have the plan to completely get rid of forward declaration in the future?

wrengr added inline comments.Jul 18 2023, 12:08 PM
mlir/lib/Dialect/SparseTensor/IR/Detail/Var.h
393

The long-term plan is to get rid of the forward-decls (of level-vars; the symbol-vars will still be there, of course). In D155533 (DimLvlMapParser.cpp:181–207) I add a longer explanation of why the forward-decls cause problems and how we can avoid the need for the forward-decls. The original design of VarEnv, Policy, VarInfo/VarInfo::ID vs Var/Var::Num, etc was set up precisely to solve this issue without the need for forward-decls.

Peiming accepted this revision.Jul 18 2023, 1:06 PM
This revision is now accepted and ready to land.Jul 18 2023, 1:06 PM
This revision was automatically updated to reflect the committed changes.