|
LLVM 24.0.0git
|
#include "llvm/CodeGen/TargetPassConfig.h"#include "CodeGenOptions.h"#include "llvm/ADT/DenseMap.h"#include "llvm/ADT/SmallVector.h"#include "llvm/ADT/StringRef.h"#include "llvm/Analysis/BasicAliasAnalysis.h"#include "llvm/Analysis/CallGraphSCCPass.h"#include "llvm/Analysis/ScopedNoAliasAA.h"#include "llvm/Analysis/TargetTransformInfo.h"#include "llvm/Analysis/TypeBasedAliasAnalysis.h"#include "llvm/CodeGen/BasicBlockSectionsProfileReader.h"#include "llvm/CodeGen/CSEConfigBase.h"#include "llvm/CodeGen/CodeGenTargetMachineImpl.h"#include "llvm/CodeGen/MachineBlockHashInfo.h"#include "llvm/CodeGen/MachineFunctionPass.h"#include "llvm/CodeGen/MachinePassRegistry.h"#include "llvm/CodeGen/Passes.h"#include "llvm/CodeGen/RegAllocRegistry.h"#include "llvm/IR/IRPrintingPasses.h"#include "llvm/IR/LegacyPassManager.h"#include "llvm/IR/PassInstrumentation.h"#include "llvm/IR/Verifier.h"#include "llvm/InitializePasses.h"#include "llvm/MC/MCAsmInfo.h"#include "llvm/MC/MCTargetOptions.h"#include "llvm/Pass.h"#include "llvm/Support/CodeGen.h"#include "llvm/Support/CommandLine.h"#include "llvm/Support/Compiler.h"#include "llvm/Support/Debug.h"#include "llvm/Support/Discriminator.h"#include "llvm/Support/ErrorHandling.h"#include "llvm/Support/SaveAndRestore.h"#include "llvm/Support/Threading.h"#include "llvm/Support/VirtualFileSystem.h"#include "llvm/Support/WithColor.h"#include "llvm/Target/CGPassBuilderOption.h"#include "llvm/Target/TargetMachine.h"#include "llvm/Transforms/ObjCARC.h"#include "llvm/Transforms/Scalar.h"#include "llvm/Transforms/Utils.h"#include <cassert>#include <optional>#include <string>Go to the source code of this file.
Classes | |
| struct | INITIALIZE_PASS::InsertedPass |
| class | llvm::PassConfigImpl |
Namespaces | |
| namespace | INITIALIZE_PASS |
| TargetPassConfig. | |
| namespace | llvm |
| This is an optimization pass for GlobalISel generic memory operations. | |
Macros | |
| #define | DISABLE_PASS(Option, Name) |
Functions | |
| static IdentifyingPassPtr | applyDisable (IdentifyingPassPtr PassID, bool Override) |
| Allow standard passes to be disabled by command line options. | |
| static IdentifyingPassPtr | overridePass (AnalysisID StandardID, IdentifyingPassPtr TargetID) |
| Allow standard passes to be disabled by the command line, regardless of who is adding the pass. | |
| static std::string | getFSProfileFile (const TargetMachine *TM) |
| static std::string | getFSRemappingFile (const TargetMachine *TM) |
| static const PassInfo * | getPassInfo (StringRef PassName) |
| static AnalysisID | getPassIDFromName (StringRef PassName) |
| static std::pair< StringRef, unsigned > | getPassNameAndInstanceNum (StringRef PassName) |
| static cl::boolOrDefault | toBoolOrDefault (BoolOrDefault B) |
| static MachineVerifierMode | computeMachineVerifierMode (const CodeGenOptions &Opts, bool VerifyEach) |
| static FunctionPass * | useDefaultRegisterAllocator () |
| -regalloc=... command line option. | |
| static void | initializeDefaultRegisterAllocatorOnce () |
Variables | |
| static cl::opt< RunOutliner > | EnableMachineOutliner ("enable-machine-outliner", cl::desc("Enable the machine outliner"), cl::Hidden, cl::ValueOptional, cl::init(RunOutliner::TargetDefault), cl::values(clEnumValN(RunOutliner::AlwaysOutline, "always", "Run on all functions guaranteed to be beneficial"), clEnumValN(RunOutliner::OptimisticPGO, "optimistic-pgo", "Outline cold code only. If a code block does not have " "profile data, optimistically assume it is cold."), clEnumValN(RunOutliner::ConservativePGO, "conservative-pgo", "Outline cold code only. If a code block does not have " "profile, data, conservatively assume it is hot."), clEnumValN(RunOutliner::NeverOutline, "never", "Disable all outlining"), clEnumValN(RunOutliner::AlwaysOutline, "", ""))) |
| static const char | StartAfterOptName [] = "start-after" |
| Option names for limiting the codegen pipeline. | |
| static const char | StartBeforeOptName [] = "start-before" |
| static const char | StopAfterOptName [] = "stop-after" |
| static const char | StopBeforeOptName [] = "stop-before" |
| static cl::opt< RegisterRegAlloc::FunctionPassCtor, false, RegisterPassParser< RegisterRegAlloc > > | RegAlloc ("regalloc", cl::Hidden, cl::init(&useDefaultRegisterAllocator), cl::desc("Register allocator to use")) |
| static llvm::once_flag | InitializeDefaultRegisterAllocatorFlag |
| Register Allocation Pass Configuration. | |
| static RegisterRegAlloc | defaultRegAlloc ("default", "pick register allocator based on -O option", useDefaultRegisterAllocator) |
| #define DISABLE_PASS | ( | Option, | |
| Name ) |
Referenced by llvm::registerCodeGenCallback().
|
static |
Allow standard passes to be disabled by command line options.
This supports simple binary flags that either suppress the pass or do nothing. i.e. -disable-mypass=false has no effect. These should be converted to boolOrDefault in order to use applyOverride.
Definition at line 105 of file TargetPassConfig.cpp.
Referenced by overridePass().
|
static |
Definition at line 318 of file TargetPassConfig.cpp.
References llvm::Each, llvm::End, llvm::None, and VerifyEach.
Referenced by llvm::getCGPassBuilderOption(), and llvm::TargetPassConfig::TargetPassConfig().
|
static |
Definition at line 174 of file TargetPassConfig.cpp.
References llvm::TargetMachine::getPGOOption(), and llvm::PGOOptions::SampleUse.
Referenced by llvm::TargetPassConfig::addBlockPlacement(), and llvm::TargetPassConfig::addMachinePasses().
|
static |
Definition at line 186 of file TargetPassConfig.cpp.
References llvm::TargetMachine::getPGOOption(), and llvm::PGOOptions::SampleUse.
Referenced by llvm::TargetPassConfig::addBlockPlacement(), and llvm::TargetPassConfig::addMachinePasses().
|
static |
Definition at line 262 of file TargetPassConfig.cpp.
References getPassInfo(), llvm::PassInfo::getTypeInfo(), and PassName.
Definition at line 250 of file TargetPassConfig.cpp.
References llvm::PassRegistry::getPassInfo(), llvm::PassRegistry::getPassRegistry(), PassName, and llvm::reportFatalUsageError().
Referenced by llvm::PMTopLevelManager::findAnalysisPassInfo(), and getPassIDFromName().
Definition at line 268 of file TargetPassConfig.cpp.
References llvm::StringRef::empty(), llvm::StringRef::getAsInteger(), PassName, and llvm::reportFatalUsageError().
Referenced by llvm::TargetPassConfig::getStartStopInfo().
|
static |
Definition at line 1220 of file TargetPassConfig.cpp.
References llvm::RegisterRegAllocBase< RegisterRegAlloc >::getDefault(), RegAlloc, and llvm::RegisterRegAllocBase< RegisterRegAlloc >::setDefault().
Referenced by llvm::TargetPassConfig::getOptimizeRegAlloc().
|
static |
Allow standard passes to be disabled by the command line, regardless of who is adding the pass.
StandardID is the pass identified in the standard pass pipeline and provided to addPass(). It may be a target-specific ID in the case that the target directly adds its own pass, but in that case we harmlessly fall through.
TargetID is the pass that the target has configured to override StandardID.
StandardID may be a pseudo ID. In that case TargetID is the name of the real pass to run. This allows multiple options to control a single pass depending on where in the pipeline that pass is added.
Definition at line 124 of file TargetPassConfig.cpp.
References applyDisable(), llvm::BranchFolderPassID, llvm::DeadMachineInstructionElimID, llvm::EarlyIfConverterLegacyID, llvm::EarlyMachineLICMID, llvm::EarlyTailDuplicateLegacyID, llvm::MachineBlockPlacementID, llvm::MachineCopyPropagationID, llvm::MachineCSELegacyID, llvm::MachineLICMID, llvm::MachineSinkingLegacyID, llvm::PostRAMachineSinkingID, llvm::PostRASchedulerID, llvm::StackSlotColoringID, and llvm::TailDuplicateLegacyID.
Referenced by llvm::TargetPassConfig::addPass(), and llvm::TargetPassConfig::isPassSubstitutedOrOverridden().
|
static |
Definition at line 310 of file TargetPassConfig.cpp.
References B(), llvm::cl::BOU_FALSE, llvm::cl::BOU_TRUE, llvm::cl::BOU_UNSET, llvm::Default, and llvm::True.
Referenced by llvm::getCGPassBuilderOption().
|
static |
-regalloc=... command line option.
Definition at line 952 of file TargetPassConfig.cpp.
Referenced by llvm::TargetPassConfig::addRegAssignAndRewriteFast(), llvm::TargetPassConfig::createRegAllocPass(), llvm::TargetPassConfig::getOptimizeRegAlloc(), and llvm::TargetPassConfig::isCustomizedRegAlloc().
|
static |
|
static |
Referenced by llvm::TargetPassConfig::addMachinePasses(), and llvm::getCGPassBuilderOption().
|
static |
Register Allocation Pass Configuration.
A dummy default pass factory indicates whether the register allocator is overridden on the command line.
Definition at line 1213 of file TargetPassConfig.cpp.
Referenced by llvm::TargetPassConfig::getOptimizeRegAlloc().
|
static |
Option names for limiting the codegen pipeline.
Those are used in error reporting and we didn't want to duplicate their names all over the place.
Definition at line 96 of file TargetPassConfig.cpp.
Referenced by llvm::TargetPassConfig::getLimitedCodeGenPipelineReason(), and llvm::TargetPassConfig::getStartStopInfo().
Definition at line 97 of file TargetPassConfig.cpp.
Referenced by llvm::TargetPassConfig::getLimitedCodeGenPipelineReason(), and llvm::TargetPassConfig::getStartStopInfo().
Definition at line 98 of file TargetPassConfig.cpp.
Referenced by llvm::TargetPassConfig::getLimitedCodeGenPipelineReason(), and llvm::TargetPassConfig::getStartStopInfo().
Definition at line 99 of file TargetPassConfig.cpp.
Referenced by llvm::TargetPassConfig::getLimitedCodeGenPipelineReason(), and llvm::TargetPassConfig::getStartStopInfo().