aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/StackProtector.cpp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2023-10-24 09:25:32 -0700
committerGitHub <noreply@github.com>2023-10-24 09:25:32 -0700
commitf65cd04ac1c99dcecede19061dbc78352a1bca47 (patch)
treea05ca65a0f2c3ab91965df9d6c8dfdb23dcbf44a /llvm/lib/CodeGen/StackProtector.cpp
parentd79051f894129428ec36dedc6bbfdfdcc1bd0c17 (diff)
downloadllvm-f65cd04ac1c99dcecede19061dbc78352a1bca47.zip
llvm-f65cd04ac1c99dcecede19061dbc78352a1bca47.tar.gz
llvm-f65cd04ac1c99dcecede19061dbc78352a1bca47.tar.bz2
[ModuleInliner] Remove an extraneous pair of std::push_heap and std::pop_heap (NFC) (#69672)
Immediately after the "while" loop in adjust, Heap.back() is guaranteed to be the highest priority item for the current values of Priorities. std::push_back() at the end of adjust moves the highest priority item to Heap.front(), but std::pop_heap() in pop moves it right back to Heap.back(). This roundtrip is wasteful. This patch removes the extraneous pair of std::push_heap and std::pop_heap. This patch cuts down about 45% of calls to std::push_heap and std::pop_heap in InlineOrder.cpp while building clang with FDO+ThinLTO. Strictly speaking, removing the pair of calls may change the order in which call sites with identical priorities are removed from the priority queue, but we do not need to worry about that. Since the functionality of adjust becomes more like a smart version of pop_heap, this patch renames adjust to pop_heap_adjust.
Diffstat (limited to 'llvm/lib/CodeGen/StackProtector.cpp')
0 files changed, 0 insertions, 0 deletions