mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
Add new EliminateAvailableExternally module pass, which is performed in
O2 compiles just before GlobalDCE, unless we are preparing for LTO. This pass eliminates available externally globals (turning them into declarations), regardless of whether they are dead/unreferenced, since we are guaranteed to have a copy available elsewhere at link time. This enables additional opportunities for GlobalDCE. If we are preparing for LTO (e.g. a -flto -c compile), the pass is not included as we want to preserve available externally functions for possible link time inlining. The FE indicates whether we are doing an -flto compile via the new PrepareForLTO flag on the PassManagerBuilder. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239480 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -70,6 +70,12 @@ ModulePass *createGlobalOptimizerPass();
|
||||
///
|
||||
ModulePass *createGlobalDCEPass();
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
/// This transform is designed to eliminate available external globals
|
||||
/// (functions or global variables)
|
||||
///
|
||||
ModulePass *createEliminateAvailableExternallyPass();
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
/// createGVExtractionPass - If deleteFn is true, this pass deletes
|
||||
/// the specified global values. Otherwise, it deletes as much of the module as
|
||||
|
@@ -121,6 +121,7 @@ public:
|
||||
bool VerifyInput;
|
||||
bool VerifyOutput;
|
||||
bool MergeFunctions;
|
||||
bool PrepareForLTO;
|
||||
|
||||
private:
|
||||
/// ExtensionList - This is list of all of the extensions that are registered.
|
||||
|
Reference in New Issue
Block a user