This is an archive of the discontinued LLVM Phabricator instance.

[TypePromotion] Make TypeSize a class member
ClosedPublic

Authored by samparker on Dec 23 2019, 1:51 AM.

Details

Summary

Having TypeSize as a static class variable was causing problems with multi-threading. Several static functions have now been converted into methods of TypePromotion and a few other members of TypePromotion and IRPromoter have been added or removed.

Thanks for debugging this @rnk

Diff Detail

Event Timeline

samparker created this revision.Dec 23 2019, 1:51 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 23 2019, 1:51 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
samparker marked an inline comment as done.Dec 23 2019, 1:53 AM
samparker added inline comments.
llvm/lib/CodeGen/TypePromotion.cpp
917

This change was a part of the original commit to fix some tests when the pass is enabled by default. Figured it would be best to get this committed again before re-enabling.

rnk accepted this revision.Dec 23 2019, 9:54 AM

Looks good as far as removing the global goes.

llvm/lib/CodeGen/TypePromotion.cpp
965–966

Unrelated nit: Why not for (auto &I : BB)? The instruction list is a bit of an implementation detail.

This revision is now accepted and ready to land.Dec 23 2019, 9:54 AM
samparker marked an inline comment as done.Dec 23 2019, 11:09 PM
samparker added inline comments.
llvm/lib/CodeGen/TypePromotion.cpp
965–966

I think this was because I was concerned about modifying the block while iterating through it, but now I can't see why it can't be removed.

This revision was automatically updated to reflect the committed changes.