This is an archive of the discontinued LLVM Phabricator instance.

IR: Optimize StructType::get to perform one hash lookup instead of two, NFCI
ClosedPublic

Authored by krasimir on Oct 25 2018, 12:53 AM.

Details

Summary

This function was performing two hash lookups when a new struct type was requested: first checking if it exists and second to insert it. This patch updates the function to perform a single hash lookup in this case by updating the value in the hash table in-place in case the struct type was not there before.

Similar to r345151.

Diff Detail

Repository
rL LLVM

Event Timeline

krasimir created this revision.Oct 25 2018, 12:53 AM
This revision is now accepted and ready to land.Oct 25 2018, 5:26 AM
This revision was automatically updated to reflect the committed changes.