This is an archive of the discontinued LLVM Phabricator instance.

[BPF][NewPM] Make BPFTargetMachine properly adjust NPM optimizer pipeline
ClosedPublic

Authored by aeubanks on Oct 5 2020, 3:22 PM.

Details

Summary

This involves porting BPFAbstractMemberAccess and BPFPreserveDIType to
NPM, then adding them BPFTargetMachine::registerPassBuilderCallbacks
(the NPM equivalent of adjustPassManager()).

Diff Detail

Event Timeline

aeubanks created this revision.Oct 5 2020, 3:22 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 5 2020, 3:22 PM
aeubanks requested review of this revision.Oct 5 2020, 3:22 PM
asbirlea accepted this revision.Oct 5 2020, 5:30 PM

I am not familiar with this pass, but every bit of the porting and the callbacks looks on-par to me.

This revision is now accepted and ready to land.Oct 5 2020, 5:30 PM
yonghong-song added a comment.EditedOct 5 2020, 7:44 PM

@aeubanks I assume this is related to new pass manager and is not on by default? What is the option I could turn npm on and give a try? Looks like Hexagon is another backend which has implemented npm support. We may plan to implement new (early or module) passes so we need to modify both adjustPassManager and registerPassBuilderCallbacks. Understanding how it really functions will help our future work. The code looks correct, esp. when comparing to what Hexagon has done, but I would like to experiment a little bit before accepting the patch. Thanks!

yonghong-song accepted this revision.Oct 5 2020, 10:56 PM

I think I got how to enable npm in opt. It is -passes option in opt -passes='default<O2>' %s. It looks good. Will stamp it.

I have another patch I plan to land https://reviews.llvm.org/D85570 which inserts a pass for EP_ModuleOptimizerEarly. Does it correspond to NPM registerPipelineStartEPCallback() callback function?

BTW, can you share what is the plan for NPM? Any expected time to turn it on as the default?

I think this thread can give some answers: http://lists.llvm.org/pipermail/llvm-dev/2020-July/143666.html
The target deadline is the end of this year, with a coming checkpoint in a couple of weeks to evaluate the status.

I think I got how to enable npm in opt. It is -passes option in opt -passes='default<O2>' %s. It looks good. Will stamp it.

Yup that's it.

I have another patch I plan to land https://reviews.llvm.org/D85570 which inserts a pass for EP_ModuleOptimizerEarly. Does it correspond to NPM registerPipelineStartEPCallback() callback function?

Yes, just like was done here.

This revision was landed with ongoing or failed builds.Oct 6 2020, 7:45 AM
This revision was automatically updated to reflect the committed changes.