This is an archive of the discontinued LLVM Phabricator instance.

[LoopNest] Add new utilites
ClosedPublic

Authored by Whitney on Dec 11 2021, 6:13 PM.

Details

Reviewers
Meinersbur
Group Reviewers
Restricted Project
Commits
rGcb6b9d3ae2cb: [LoopNest] Add new utilites
Summary

getLoopIndex() is added to get the loop index of a given loop.
getLoopsAtDepth() is added to get the loops in the nest at a given depth.

Diff Detail

Unit TestsFailed

Event Timeline

Whitney requested review of this revision.Dec 11 2021, 6:13 PM
Whitney created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptDec 11 2021, 6:13 PM
Whitney updated this revision to Diff 394590.Dec 15 2021, 9:44 AM
Meinersbur added inline comments.
llvm/include/llvm/Analysis/LoopNestAnalysis.h
120

Isn't it sufficient to return Loops[Depth - getOutermostLoop().getLoopDepth()]?

Whitney marked an inline comment as done.Dec 20 2021, 7:18 AM
Whitney added inline comments.
llvm/include/llvm/Analysis/LoopNestAnalysis.h
120

When the loop nest is not perfect, there can be multiple loops at the same depth.

Whitney marked an inline comment as done.Jan 10 2022, 6:35 AM

ping

Meinersbur accepted this revision as: Meinersbur.Jan 13 2022, 7:01 AM

LGTM

llvm/include/llvm/Analysis/LoopNestAnalysis.h
128

[suggestion]

This revision is now accepted and ready to land.Jan 13 2022, 7:01 AM
Whitney updated this revision to Diff 399748.Jan 13 2022, 12:04 PM
Whitney marked an inline comment as done.

address review comment

This revision was automatically updated to reflect the committed changes.