This is an archive of the discontinued LLVM Phabricator instance.

[MLGO] Add LoopPropertiesAnalysis pass
Needs ReviewPublic

Authored by eopXD on Nov 19 2022, 4:38 PM.

Details

Summary

This pass mimics FunctionPropertiesAnalysis.

The analysis will be used to extract features from loop. The follow-up
patches will be extending MLGO onto helping the loop partial unroll
decision, using this pass to extract features of a loop.

Diff Detail

Event Timeline

eopXD created this revision.Nov 19 2022, 4:38 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 19 2022, 4:38 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
eopXD requested review of this revision.Nov 19 2022, 4:38 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 19 2022, 4:38 PM
eopXD added a comment.Nov 19 2022, 4:53 PM
This comment was removed by eopXD.
eopXD retitled this revision from [MLGO] Add LoopPropertiesAnalysis and its printer pass to [MLGO] Add LoopPropertiesAnalysis pass.Nov 19 2022, 4:55 PM
eopXD edited the summary of this revision. (Show Details)
eopXD updated this revision to Diff 485222.Dec 24 2022, 11:42 PM

Rebase upon latest main.

Generally looks good. Two minor comments.

llvm/include/llvm/Analysis/LoopPropertiesAnalysis.h
52

This bool and the one above are not strictly needed, one can just check the size and APInt for their value.

llvm/lib/Analysis/LoopPropertiesAnalysis.cpp
73

It is probably better to do the checks via isa<CastInst> and similar. New stuff is added and this seems hard to maintain.