[PATCH] D104028: [WIP] Use standard priority queue to order inlining

Chuanqi Xu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 15 02:01:50 PDT 2021


ChuanqiXu added inline comments.


================
Comment at: llvm/lib/Transforms/IPO/Inliner.cpp:912-914
+      auto &P = Calls->front();
       CallBase *CB = P.first;
       const int InlineHistoryID = P.second;
----------------
It may be better to:
```
CallBase *CB = Calls->front().first;
const int InlineHistoryID = Calls->front().second;
```
Since we would call pop() immediately, the reference P would be invalid. It may be possible that programmers may refer P after `Calls->pop()`, which is a disaster. Another option is to replace `auto &P =` with `auto P =`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D104028/new/

https://reviews.llvm.org/D104028



More information about the llvm-commits mailing list