This is an archive of the discontinued LLVM Phabricator instance.

Tidy up getFirstNonBoxedLoopFor [NFC]
ClosedPublic

Authored by sabuasal on Jan 15 2017, 5:17 PM.

Details

Summary

Move the function getFirstNonBoxedLoopFor which is used in ScopBuilder and in ScopInfo to Support/ScopHelpers to make it reusable
in other locations. No functionality change.

Diff Detail

Repository
rL LLVM

Event Timeline

sabuasal updated this revision to Diff 84511.Jan 15 2017, 5:17 PM
sabuasal retitled this revision from to Tidy up getFirstNonBoxedLoopFor [NFC].
sabuasal updated this object.
sabuasal added a reviewer: grosser.
sabuasal set the repository for this revision to rL LLVM.
sabuasal added a project: Restricted Project.

Move the function getFirstNonBoxedLoopFor which is used in
ScopBuilder and in ScopInfo to Support/ScopHelpers to make it reusable
in other locations.

No functionality change.

grosser accepted this revision.Jan 16 2017, 12:19 AM
grosser edited edge metadata.

Dear Sameer,

thank you for the patch. Cleanups are always welcome. Some minore nitpicks, but otherwise this patch is good to go. Feel free to commit!

include/polly/Support/ScopHelper.h
440 ↗(On Diff #84511)

What is this comment about? It seems to be leftover.

443 ↗(On Diff #84511)

Also not needed?

448 ↗(On Diff #84511)

The "Do not call ..." does not seem to make a lot of sense, no? It seems to be an outdated comment. Can you just drop it as part of this cleanup?

lib/Support/ScopHelper.cpp
585 ↗(On Diff #84511)

Nice Cleanup.

A minor nitpick. I would prefer 'Loop *L' over 'auto L*' (even though the original code said 'auto *L). This is more in line with the LLVM coding standards [1], which suggest to only use auto if it makes the code clearly more readable.

[1] http://llvm.org/docs/CodingStandards.html#use-auto-type-deduction-to-make-code-more-readable

This revision is now accepted and ready to land.Jan 16 2017, 12:19 AM
sabuasal updated this revision to Diff 84579.Jan 16 2017, 11:00 AM
sabuasal updated this object.
sabuasal added a reviewer: eli.friedman.
sabuasal removed rL LLVM as the repository for this revision.
sabuasal marked 4 inline comments as done.

Fixed comments by Tobi.

sabuasal added a comment.EditedJan 16 2017, 11:01 AM

@efriedma

Can you commit this on my behalf, I don't have commit rights.

An overhaul of the boxed loop / surrounded loop mechanism could be useful. There's also BlockGenerator::getLoopForStmt with the same functionality. We don't even need to remember the boxed loops if we know the surrounding loop as everything inside will be boxed loops. The surrounding loop is either the top entry of LoopNest, or the loop the whole Scop is enclosed in, if any.

This revision was automatically updated to reflect the committed changes.