[PATCH] D77877: [llvm][NFC] Inliner.cpp: ensure InlineHistory ID is always initialized;

Mircea Trofin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 10 10:30:12 PDT 2020


mtrofin added a comment.

In D77877#1974573 <https://reviews.llvm.org/D77877#1974573>, @davidxl wrote:

> This change essentially makes a lazy initialization to become eagerly initialized. It may be better to keep the 'laziness' here, so why not just push the declaration of InlineHistoryID into the if(IsTrivialllyDead) {} block?


I believe the value of the CL is improved readability / maintainability: one doesn't need to trace through the code to understand where the value of InlineHistoryID comes from, and what value it is. In fact, looking at it more, we could even mark it const.

Not sure what the value of lazy initing would be here. If the initialization doesn't end up being optimized equivalently, I doubt there's a meaningful performance impact.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D77877





More information about the llvm-commits mailing list