This is an archive of the discontinued LLVM Phabricator instance.

[mlir][Analysis] CFGLoopInfo instantiation in C++
ClosedPublic

Authored by Dinistro on Apr 13 2023, 5:37 AM.

Details

Summary

This commit moves the CFGLoopInfo instantiation into the C++ file to
ensure that it is only compiled once. Instantiating the template
explicitly revealed two missing functions that this commit also adds.

Diff Detail

Event Timeline

Dinistro created this revision.Apr 13 2023, 5:37 AM
Herald added a project: Restricted Project. · View Herald Transcript
Dinistro requested review of this revision.Apr 13 2023, 5:37 AM
gysit added a comment.Apr 13 2023, 5:59 AM

LGTM but let's give others a chance to have a look at this.

mlir/lib/Analysis/CFGLoopInfo.cpp
12

nit: maybe "Instantiate the LoopBase and LoopInfoBase classes defined in LoopInfoImpl.h for CFGLoops" ?

Dinistro updated this revision to Diff 513237.Apr 13 2023, 7:53 AM

address review comments

Dinistro marked an inline comment as done.Apr 13 2023, 7:57 AM
ftynse accepted this revision.Apr 14 2023, 3:46 AM
ftynse added inline comments.
mlir/include/mlir/IR/Block.h
354–357

Not for this commit, but if we are already touching to LoopInfo proper, thi can be refactored to be provided through the trait class, defaulting to return false

This revision is now accepted and ready to land.Apr 14 2023, 3:46 AM
Dinistro added inline comments.Apr 14 2023, 4:09 AM
mlir/include/mlir/IR/Block.h
354–357

Thanks for the comment. I'll check if it makes sense to add this to the GraphTrait or if we should use an SFINAE based mechanism to do this.

This revision was automatically updated to reflect the committed changes.