This is an archive of the discontinued LLVM Phabricator instance.

[X86] Use binary search of the EVEX->VEX static tables instead of populating two DenseMaps for lookups
ClosedPublic

Authored by craig.topper on Jun 18 2018, 9:57 PM.

Details

Summary

After r335018, the static tables are guaranteed sorted by the EVEX opcode to convert. We can use this to do a binary search and remove the need for any secondary data structures.

Right now one table is 736 entries and the other is 482 entries. It might make sense to merge the two tables as a follow up. The effort it takes to select the table is probably similar to the extra binary search step it would require for a larger table.

I haven't done any measurements to see if this has any effect on compile time, but I don't imagine that EVEX->VEX conversion is a place we spend a lot of time.

Diff Detail

Repository
rL LLVM

Event Timeline

craig.topper created this revision.Jun 18 2018, 9:57 PM
RKSimon accepted this revision.Jun 19 2018, 2:40 PM

LGTM with one minor

lib/Target/X86/X86EvexToVex.cpp
263 ↗(On Diff #151849)

Move this to just above the performCustomAdjustments call?

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