This is an archive of the discontinued LLVM Phabricator instance.

[WIP][Attributor] Run Attributor in stages.
Needs ReviewPublic

Authored by kuter on Aug 15 2021, 7:51 PM.

Details

Summary

This patch makes it possible for Attributor deductions to run in stages.
You can seed AbstractAttributes in stages and run fixpoint iteration separately.
This reduces wasted updates for Attributes.

It also makes the Attributor pass run AAIsDead Attribute to run in a seperate
stage.


WIP Note: This patch reduces the iteartion count for almost all tests :-)
I disabled the max iteration check for now.
I will provide performance measurements.

We should also try seeding functions in phases too.

Diff Detail

Event Timeline

kuter created this revision.Aug 15 2021, 7:51 PM
kuter requested review of this revision.Aug 15 2021, 7:51 PM
Herald added a reviewer: sstefan1. · View Herald Transcript
Herald added a reviewer: baziotis. · View Herald Transcript
Herald added a project: Restricted Project. · View Herald Transcript
kuter updated this revision to Diff 366547.Aug 15 2021, 9:28 PM

Small Change.

kuter added a comment.Aug 15 2021, 9:36 PM

With the patch:

$ time opt -attributor test-suite/CTMark/sqlite3/sqlite3.mem2reg.ll 

real	0m25.499s
user	0m25.392s
sys	0m0.107s

With out the patch:

$ time opt -attributor test-suite/CTMark/sqlite3/sqlite3.mem2reg.ll 
real	0m22.850s
user	0m22.739s
sys	0m0.111s

I did this test multiple times. This patch makes the result 2-3 seconds slower.
It might be because of having to go over all functions again in the second seeding stage.

Did you try again and make sure we don't run into a timeout on the iterations?

llvm/lib/Transforms/IPO/Attributor.cpp
2441

Should we interleave this one and the default one, add an argument to pick which handling the user want? Seems there is some obvious duplication but it might not be as much as I feared.

ormris removed a subscriber: ormris.Jan 24 2022, 11:47 AM