Optimize OptTable::findNearest implementation and usage
authorserge-sans-paille <sguelton@mozilla.com>
Wed, 18 Jan 2023 15:43:56 +0000 (16:43 +0100)
committerserge-sans-paille <sguelton@mozilla.com>
Thu, 19 Jan 2023 13:16:29 +0000 (14:16 +0100)
commit6ad1b4095172373590134afff19a7fbad9d7889d
tree2124fea57de822487a6d404b79e96bae756143fe
parent94750af83640cd702d80c53ab99d5bb303e55796
Optimize OptTable::findNearest implementation and usage

When used to find an exact match, some extra context can be used to
totally cut some computations.

This saves 1% of the instruction count when pre processing sqlite3.c
through

valgrind --tool=callgrind ./bin/clang -E sqlite3.c -o/dev/null

Differential Revision: https://reviews.llvm.org/D142026
clang/lib/Driver/Driver.cpp
llvm/include/llvm/Option/OptTable.h
llvm/lib/Option/OptTable.cpp