This is an archive of the discontinued LLVM Phabricator instance.

[X86] Initialize FMA3Info directly in its constructor instead of relying on std::call_once
ClosedPublic

Authored by craig.topper on Jun 14 2018, 1:23 PM.

Details

Summary

FMA3Info only exists as a managed static. As far as I know the ManagedStatic construction proccess is thread safe. It doesn't look like we ever access the ManagedStatic object without immediately doing a query on it that would require the map to be populated. So I don't think we're ever deferring the calculation of the tables from the construction of the object.

So I think we should be able to just populate the FMA3Info map directly in the constructor and get rid of all of the initGroupsOnce stuff.

Diff Detail

Repository
rL LLVM

Event Timeline

craig.topper created this revision.Jun 14 2018, 1:23 PM

Rebase after r334925 which changes how the DenseMap is initialized and deleted.

RKSimon accepted this revision.Jun 19 2018, 2:19 AM

LGTM

This revision is now accepted and ready to land.Jun 19 2018, 2:19 AM
This revision was automatically updated to reflect the committed changes.