This is an archive of the discontinued LLVM Phabricator instance.

[Attributor] Add the Attributor to the new PM pipeline
AbandonedPublic

Authored by jdoerfert on Oct 29 2019, 5:16 PM.

Details

Summary

For now, this matches the old pipeline where the Attributor is run early
as module pass (but disabled by default through an internal flag).

We are working on an CG-SCC pass version that we can run later as well.

Event Timeline

jdoerfert created this revision.Oct 29 2019, 5:16 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 29 2019, 5:16 PM

Not really familiar with NewPM..

leonardchan added a subscriber: chandlerc.

Adding @chandlerc for review. I'm not very comfortable reviewing changes to the backend pipeline.

Could you also add an LLVM test showing how this pass should affect the IR?

Adding @chandlerc for review. I'm not very comfortable reviewing changes to the backend pipeline.

Could you also add an LLVM test showing how this pass should affect the IR?

It will not affect the IR without being turned on.

jdoerfert updated this revision to Diff 227359.Oct 31 2019, 2:54 PM

include the test changes this time

Is there a particular reason for choosing this spot in pipeline?
I see that in legacy pipeline Attributor follows IPSCCP/CVP, and here it goes right before.

So, this enables Attributor pass, but in fact has all its functionality disabled unless -attributor-disable is set to false.
Is there any testing that does enable attributor?
If yes, then I would like to see this testing being run with new pass manager as well.

Is there any testing that does enable attributor?

Okey, I did find a fair amount of tests that run individual -attributor *or* -passes=attributor (with -attributor-disable=false).
Are there any near plans to enable attributor (setting -attributor-disable=false by default)?

I dont really see a sense in having AttributorPass in pipeline but all the sematics of it completely disabled, so running Attributor does not really runs the attributor.

If -attributor-disabled=true is the state that you expect it to exist for a prolonged period of time I would better see -attributor-disable option
controlling conditional inclusion of this pass into the pipeline.

This way when somebody sees "Running pass: AttributorPass" there will be no question on whether Attributor ran or not.

fhahn added a subscriber: fhahn.Dec 13 2019, 2:46 AM
fedor.sergeev requested changes to this revision.Jan 27 2020, 6:07 AM

setting request-changes state to make it obvious that there are some questions here I would like to see answered.

This revision now requires changes to proceed.Jan 27 2020, 6:07 AM

Is there any testing that does enable attributor?

Okey, I did find a fair amount of tests that run individual -attributor *or* -passes=attributor (with -attributor-disable=false).
Are there any near plans to enable attributor (setting -attributor-disable=false by default)?

Yes. I did fix the remaining LLVM test suite bugs the other day again. I was hoping to land the SCC version (D70767) before I ask people to set the disabled=false flag in their local test setup and report any breakages/problems.

I dont really see a sense in having AttributorPass in pipeline but all the sematics of it completely disabled, so running Attributor does not really runs the attributor.

It allows folks to test it locally by setting the flag. Without it being in the pipeline that is, as far as I know, really hard to do.

If -attributor-disabled=true is the state that you expect it to exist for a prolonged period of time I would better see -attributor-disable option
controlling conditional inclusion of this pass into the pipeline.

We can do that but (1) I hope disabled will default to false in the next release and (2) I want to make sure we do not invalidate any pass result.

This way when somebody sees "Running pass: AttributorPass" there will be no question on whether Attributor ran or not.

Fair point. Once we enabled it by default I would be happy with not putting it in the pipeline if the flag is set. I can do that now if you think it helps.

setting request-changes state to make it obvious that there are some questions here I would like to see answered.

Sorry, I wrote the SCC pass (D70767) and merged this into it without closing this revision.

jdoerfert abandoned this revision.Feb 4 2020, 10:58 PM