Skip to content

Commit 06ca52e

Browse files
authored
[InlineOrder] Fix InlineOrder erase_if implementation (#78684)
The InlineOrder Heap stores a CallBase ptr and InlineHistoryID pair. When running the `erase_if` method, InlineHistoryID is always returned with 0. Instead, we should be retrieving it from the `InlineHistoryMap` (similar to what is done in the `pop` implementation). This change is completely harmless because no one is using InlineHistoryID right now as part of the `erase_if` implementation which is currently only used in the ModuleInliner.
1 parent 49212d1 commit 06ca52e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/Analysis/InlineOrder.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ class PriorityInlineOrder : public InlineOrder<std::pair<CallBase *, int>> {
262262

263263
void erase_if(function_ref<bool(T)> Pred) override {
264264
auto PredWrapper = [=](CallBase *CB) -> bool {
265-
return Pred(std::make_pair(CB, 0));
265+
return Pred(std::make_pair(CB, InlineHistoryMap[CB]));
266266
};
267267
llvm::erase_if(Heap, PredWrapper);
268268
std::make_heap(Heap.begin(), Heap.end(), isLess);

0 commit comments

Comments
 (0)