The hot path through this region of code does lots of batch inserts into sets. By storing them as sorted arrays, we can defer the sorting to the end of the batch, which is dramatically more efficient. This reduces tblgen runtime by 25% on my worst-case target.
Details
Details
Diff Detail
Diff Detail
Event Timeline
Comment Actions
Change looks fine, but I'd really love to see this code cleaned up more if you're going to be here...
- Not using weird typedefs like Vec
- Using range based for loops rather than just auto.
- Use lambdas
Anyways, none of that cleanup should preclude making it go faster.
utils/TableGen/CodeGenRegisters.cpp | ||
---|---|---|
645 | This should be sortRegisterVector... but it doesn't just sort, it uniques as well. I would probably call it 'sortAndUniqueRegisters', but feel free to paint it a different shade. | |
utils/TableGen/CodeGenRegisters.h | ||
418–419 | My clang format spidey sense says this line break isn't necessary. |
My clang format spidey sense says this line break isn't necessary.