Skip to content
Unverified Commit 7d950f04 authored by Dhruv Chawla's avatar Dhruv Chawla
Browse files

[NFC][TLI] Replace std::lower_bound call in getLibFunc with DenseMap lookup

While std::lower_bound takes logarithmic time (relative to the length of
the array) to execute, DenseMap gives better performance characteristics
as it traverses few (if any) elements when collisions do occur,
especially when the number of elements are known in advance.

This gives a speedup of 0.24%:
https://llvm-compile-time-tracker.com/compare.php?from=ac00cca3d9c6c3e9118ebbe47aa5b3ba1ee7404f&to=7f3d4c8ce8cee3a236a2328e46b2a8374672b46e&stat=instructions:u

Differential Revision: https://reviews.llvm.org/D157951
parent 39465350
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment