This is an archive of the discontinued LLVM Phabricator instance.

[TableGen] TypeInfer - Cache the legal types as TypeSetByHwMode
ClosedPublic

Authored by RKSimon on Aug 17 2018, 8:15 AM.

Details

Summary

We were just caching the MVT set of legal types, then every call creating a new TypeSetByHwMode with it and passing it back on the stack. There's no need to do this - we can create and cache the whole TypeSetByHwMode once and return a const reference to it each time.

Additionally, TypeInfer::expandOverloads wasn't making use of the fact that the cache just contains a default mode containing all the types.

Saves up to 30secs in debug builds of x86 -gen-dag-isel.

Diff Detail

Repository
rL LLVM

Event Timeline

RKSimon created this revision.Aug 17 2018, 8:15 AM
kparzysz accepted this revision.Aug 17 2018, 8:33 AM
This revision is now accepted and ready to land.Aug 17 2018, 8:33 AM

Thanks for finding all these things!

Thanks for finding all these things!

Cheers, I'm only able to do the easy things that I can see from basic profiling. The big one is the EmitMatcherList iterations inside MatcherTableEmitter::EmitMatcher but I don't have the inner knowledge to try and improve that one - if any llvm-tblgen gurus can work on that one I'd be very grateful!

This revision was automatically updated to reflect the committed changes.