[PATCH] D23299: [PM] Port the always inliner to the new pass manager in a much more minimal and boring form than the old pass manager's version.

Chandler Carruth via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 9 18:37:54 PDT 2016


chandlerc added a comment.

Thanks!


================
Comment at: include/llvm/Transforms/IPO/AlwaysInliner.h:28
@@ +27,3 @@
+///
+/// However, because of the requirement to *remove* these functions, this pass is somewhat
+struct AlwaysInlinerPass : PassInfoMixin<AlwaysInlinerPass> {
----------------
eraman wrote:
> Incomplete comment.
Hah, not only incomplete, very stale. I totally changed my mind about how to do this after writing the comment. I've updated it to match the implementation and the patch description. Thanks!

================
Comment at: lib/Transforms/IPO/AlwaysInliner.cpp:37
@@ +36,3 @@
+PreservedAnalyses AlwaysInlinerPass::run(Module &M, ModuleAnalysisManager &) {
+  InlineFunctionInfo IFI;
+  SmallSetVector<CallSite, 16> Calls;
----------------
eraman wrote:
> InlineFunction makes use of IFI.GetAssumptionCache in AddAlignmentAssumptions. 
Good catch. I thought that AddAlignmentAssumptions was disabled in the face of a null assumption cache, but I see it isn't. =[ I've just added a check to that routine. For -O0 it seems better to not spend time adding assume intrinsics here, and this is really intended to be an -O0 style pass.

(Of course, we can add some of this back very easily if there are good reasons, I was just starting simple.)

Perhaps more importantly, I've added a test case that would have caught this bug. =]


https://reviews.llvm.org/D23299





More information about the llvm-commits mailing list