Page MenuHomePhabricator

[OpenMP][NFC] Reduce instantiation time with different data structure

Authored by jdoerfert on Mar 13 2020, 5:41 PM.

Diff Detail

Event Timeline

jdoerfert created this revision.Mar 13 2020, 5:41 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 13 2020, 5:41 PM

Tests pass fine, @rnk, let me know if this solves the issue you saw.

rnk added a comment.Mar 14 2020, 8:54 AM

Thanks, yes, this is what I had in mind.


LLVM doesn't use the all uppercase naming style for enums, I'd use something like Count, Num, or Max.

One technique you could use to avoid the sentinel enum is to make an alias for the last enum, as is done for builtin types here:
Then you won't have to handle NUM_PROPERTIES below, and you would use TraitProperty::Max + 1 for the BitVector.


This is the same instantiation, so we don't get any savings unless the same technique is applied here. I started by trying to change this type, but it was challenging, so I raised the issue to see if you'd be OK with it.


Worth fixing this formatting nit

Addressed comments

rnk accepted this revision.Mar 16 2020, 8:54 AM

lgtm, as long as you are OK with the casts as the code author.


I expected BitVector to expose an API to do this without iterating the bits individually, but I can't find one. test seems close, but not quite right. Oh well.

This revision is now accepted and ready to land.Mar 16 2020, 8:54 AM
This revision was automatically updated to reflect the committed changes.