This is an archive of the discontinued LLVM Phabricator instance.

[PM] Make LowerAtomic a FunctionPass
ClosedPublic

Authored by davide on May 6 2016, 10:32 AM.

Details

Summary

LowerAtomic happens to be a BasicBlockPass but the scope on which it operates is actually a function.
In general, I don't think BasicBlockPasses should exist at all and can be replaced by FunctionPass(es) which iterate over the set of BasicBlocks. If this looks fine, I'll port the pass to the new PM.

Diff Detail

Event Timeline

davide updated this revision to Diff 56432.May 6 2016, 10:32 AM
davide retitled this revision from to [PM] Make LowerAtomic a FunctionPass.
davide updated this object.
davide added reviewers: bogner, chandlerc.
davide added a subscriber: llvm-commits.
reames accepted this revision.May 11 2016, 5:32 PM
reames added a reviewer: reames.
reames added a subscriber: reames.

LGTM

This revision is now accepted and ready to land.May 11 2016, 5:32 PM
chandlerc accepted this revision.May 11 2016, 7:42 PM
chandlerc edited edge metadata.

I'm fine with this, but I don't actually think you should really aggressively port basic block passes. I'm fine if it accomplishes something specifically, but in many cases I'd just leave the old basic block pass in place and add a clean function pass for the new pass manager having them both call out to a helper function.

lib/Transforms/Scalar/LowerAtomic.cpp
124–126

Please use clang-format and skip the braces here.

This revision was automatically updated to reflect the committed changes.