This is an archive of the discontinued LLVM Phabricator instance.

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

Authored by krasimir on Oct 20 2018, 12:46 AM.

Details

Summary

This function was performing two hash lookups when a new function 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 function type was not there before.

Diff Detail

Event Timeline

krasimir created this revision.Oct 20 2018, 12:46 AM
krasimir updated this revision to Diff 170892.Oct 24 2018, 7:50 AM
  • Added comments
krasimir edited the summary of this revision. (Show Details)Oct 24 2018, 7:52 AM
krasimir added a reviewer: bkramer.
krasimir retitled this revision from IR: make function getter compute hash once to IR: Update FunctionType::get to perform one hash lookup instead of two.
krasimir retitled this revision from IR: Update FunctionType::get to perform one hash lookup instead of two to IR: Optimize FunctionType::get to perform one hash lookup instead of two, NFCI.
This revision is now accepted and ready to land.Oct 24 2018, 7:58 AM
This revision was automatically updated to reflect the committed changes.