This is an archive of the discontinued LLVM Phabricator instance.

[opt] Exposing the parameters of LoopRotate to the -passes interface
ClosedPublic

Authored by Quarub on Jun 21 2023, 8:48 AM.

Details

Summary

There is a gap between running opt -Oz and running opt -passes="OZ_PASSES" where OZ_PASSES is taken from running opt -Oz -print-pipeline-passes.

One of the reasons causing this is that -Oz uses non-default setting for LoopRotate but LoopRotate does not expose its settings when printing the pipeline.

This commit fixes this by exposing LoopRotates parameters.

Diff Detail

Event Timeline

Quarub created this revision.Jun 21 2023, 8:48 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 21 2023, 8:48 AM
Quarub requested review of this revision.Jun 21 2023, 8:48 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 21 2023, 8:48 AM
Quarub edited the summary of this revision. (Show Details)Jun 21 2023, 8:50 AM

lg, but can you add a test to llvm/test/Other/new-pm-print-pipeline.ll?

Quarub updated this revision to Diff 533299.EditedJun 21 2023, 9:34 AM

Adding test.
I could not verify if this is ok locally as I ran into some issues with lit.

aeubanks added inline comments.Jun 21 2023, 10:47 AM
llvm/lib/Passes/PassBuilder.cpp
901

a bunch of tests are failing, probably because this should default to true to match the default constructor

llvm/test/Other/new-pm-print-pipeline.ll
116

typo

Quarub updated this revision to Diff 533527.Jun 22 2023, 3:27 AM

Adjusted the default option and fixed the typo. Also adjusted some other testcases which used loop-rotate.

I only added the loop-rotate options for CHECK and not RUN.
Should I also add them in RUN?

This revision is now accepted and ready to land.Jun 22 2023, 8:47 AM

Thanks @aeubanks !

As this is my first patch, I do not have commit rights.
Could you commit it for me?

--author="Yann Girsberger <yann@ywg.ch>"