[llvm] r322033 - AlwaysInliner: Alow setting InsertLifetime in the new-style pass

Justin Bogner via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 8 14:07:42 PST 2018


Author: bogner
Date: Mon Jan  8 14:07:42 2018
New Revision: 322033

URL: http://llvm.org/viewvc/llvm-project?rev=322033&view=rev
Log:
AlwaysInliner: Alow setting InsertLifetime in the new-style pass

Modified:
    llvm/trunk/include/llvm/Transforms/IPO/AlwaysInliner.h
    llvm/trunk/lib/Transforms/IPO/AlwaysInliner.cpp

Modified: llvm/trunk/include/llvm/Transforms/IPO/AlwaysInliner.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/IPO/AlwaysInliner.h?rev=322033&r1=322032&r2=322033&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Transforms/IPO/AlwaysInliner.h (original)
+++ llvm/trunk/include/llvm/Transforms/IPO/AlwaysInliner.h Mon Jan  8 14:07:42 2018
@@ -27,7 +27,13 @@ namespace llvm {
 /// be the simplest possible pass to remove always_inline function definitions'
 /// uses by inlining them. The \c GlobalDCE pass can be used to remove these
 /// functions once all users are gone.
-struct AlwaysInlinerPass : PassInfoMixin<AlwaysInlinerPass> {
+class AlwaysInlinerPass : public PassInfoMixin<AlwaysInlinerPass> {
+  bool InsertLifetime;
+
+public:
+  AlwaysInlinerPass(bool InsertLifetime = true)
+      : InsertLifetime(InsertLifetime) {}
+
   PreservedAnalyses run(Module &M, ModuleAnalysisManager &);
 };
 

Modified: llvm/trunk/lib/Transforms/IPO/AlwaysInliner.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/AlwaysInliner.cpp?rev=322033&r1=322032&r2=322033&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/AlwaysInliner.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/AlwaysInliner.cpp Mon Jan  8 14:07:42 2018
@@ -50,7 +50,8 @@ PreservedAnalyses AlwaysInlinerPass::run
       for (CallSite CS : Calls)
         // FIXME: We really shouldn't be able to fail to inline at this point!
         // We should do something to log or check the inline failures here.
-        Changed |= InlineFunction(CS, IFI);
+        Changed |=
+            InlineFunction(CS, IFI, /*CalleeAAR=*/nullptr, InsertLifetime);
 
       // Remember to try and delete this function afterward. This both avoids
       // re-walking the rest of the module and avoids dealing with any iterator




More information about the llvm-commits mailing list