This is an archive of the discontinued LLVM Phabricator instance.

LoopNest Analysis expansion to return instructions that prevent a Loop Nest from being perfect
ClosedPublic

Authored by madanial on Aug 9 2021, 11:01 AM.

Details

Summary

Expand LoopNestAnalysis to return the full list of instructions that cause a loop nest to be imperfect. This is useful for other passes to know if they should continue for in the inner loops.
Added New function getInterveningInstructions
that returns a small vector with the instructions that prevent a loop for being perfect. Also added a couple of helper functions to reduce code duplication.

Diff Detail

Event Timeline

madanial created this revision.Aug 9 2021, 11:01 AM
madanial requested review of this revision.Aug 9 2021, 11:01 AM
madanial edited the summary of this revision. (Show Details)Aug 9 2021, 11:01 AM
madanial edited the summary of this revision. (Show Details)
Whitney added inline comments.Aug 9 2021, 11:17 AM
llvm/include/llvm/Analysis/LoopNestAnalysis.h
37

Why is this needed?

llvm/lib/Analysis/LoopNestAnalysis.cpp
53

clang-format the lines you changed.

92

no braces needed for single statement block,

107

return (analyzeLoopNestForPerfectNest(OuterLoop,InnerLoop,SE) == PerfectLoopNest);

152

Variable name starts with uppercase.

madanial updated this revision to Diff 365301.Aug 9 2021, 3:36 PM

Addressing review comments and clang-format

madanial marked 5 inline comments as done.Aug 9 2021, 3:52 PM
Whitney added inline comments.Aug 9 2021, 3:59 PM
llvm/include/llvm/Analysis/LoopNestAnalysis.h
55

from being Perfect => from being perfect.

madanial updated this revision to Diff 365308.Aug 9 2021, 4:06 PM
This comment was removed by madanial.
madanial updated this revision to Diff 365309.Aug 9 2021, 4:08 PM

Addressed latest comment

madanial marked an inline comment as done.Aug 9 2021, 4:08 PM
Whitney accepted this revision.Aug 9 2021, 4:09 PM
This revision is now accepted and ready to land.Aug 9 2021, 4:09 PM