LLVM 20.0.0git
Macros | Typedefs | Enumerations | Functions | Variables
Legalizer.cpp File Reference
#include "llvm/CodeGen/GlobalISel/Legalizer.h"
#include "llvm/ADT/PostOrderIterator.h"
#include "llvm/Analysis/OptimizationRemarkEmitter.h"
#include "llvm/CodeGen/GlobalISel/CSEInfo.h"
#include "llvm/CodeGen/GlobalISel/CSEMIRBuilder.h"
#include "llvm/CodeGen/GlobalISel/GISelChangeObserver.h"
#include "llvm/CodeGen/GlobalISel/GISelKnownBits.h"
#include "llvm/CodeGen/GlobalISel/GISelWorkList.h"
#include "llvm/CodeGen/GlobalISel/LegalizationArtifactCombiner.h"
#include "llvm/CodeGen/GlobalISel/LegalizerHelper.h"
#include "llvm/CodeGen/GlobalISel/LostDebugLocObserver.h"
#include "llvm/CodeGen/GlobalISel/Utils.h"
#include "llvm/CodeGen/MachineOptimizationRemarkEmitter.h"
#include "llvm/CodeGen/TargetPassConfig.h"
#include "llvm/CodeGen/TargetSubtargetInfo.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/Error.h"

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "legalizer"
 

Typedefs

using InstListTy = GISelWorkList< 256 >
 
using ArtifactListTy = GISelWorkList< 128 >
 

Enumerations

enum class  DebugLocVerifyLevel { None , Legalizations , LegalizationsAndArtifactCombiners }
 

Functions

 INITIALIZE_PASS_BEGIN (Legalizer, DEBUG_TYPE, "Legalize the Machine IR a function's Machine IR", false, false) INITIALIZE_PASS_END(Legalizer
 
static bool isArtifact (const MachineInstr &MI)
 

Variables

static cl::opt< boolEnableCSEInLegalizer ("enable-cse-in-legalizer", cl::desc("Should enable CSE in Legalizer"), cl::Optional, cl::init(false))
 
static cl::opt< boolAllowGInsertAsArtifact ("allow-ginsert-as-artifact", cl::desc("Allow G_INSERT to be considered an artifact. Hack around AMDGPU " "test infinite loops."), cl::Optional, cl::init(true))
 
static cl::opt< DebugLocVerifyLevelVerifyDebugLocs ("verify-legalizer-debug-locs", cl::desc("Verify that debug locations are handled"), cl::values(clEnumValN(DebugLocVerifyLevel::None, "none", "No verification"), clEnumValN(DebugLocVerifyLevel::Legalizations, "legalizations", "Verify legalizations"), clEnumValN(DebugLocVerifyLevel::LegalizationsAndArtifactCombiners, "legalizations+artifactcombiners", "Verify legalizations and artifact combines")), cl::init(DebugLocVerifyLevel::Legalizations))
 
 DEBUG_TYPE
 
Legalize the Machine IR a function s Machine IR
 
Legalize the Machine IR a function s Machine false
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "legalizer"

Definition at line 33 of file Legalizer.cpp.

Typedef Documentation

◆ ArtifactListTy

Definition at line 117 of file Legalizer.cpp.

◆ InstListTy

using InstListTy = GISelWorkList<256>

Definition at line 116 of file Legalizer.cpp.

Enumeration Type Documentation

◆ DebugLocVerifyLevel

enum class DebugLocVerifyLevel
strong
Enumerator
None 
Legalizations 
LegalizationsAndArtifactCombiners 

Definition at line 49 of file Legalizer.cpp.

Function Documentation

◆ INITIALIZE_PASS_BEGIN()

INITIALIZE_PASS_BEGIN ( Legalizer  ,
DEBUG_TYPE  ,
"Legalize the Machine IR a function's Machine IR"  ,
false  ,
false   
)

◆ isArtifact()

static bool isArtifact ( const MachineInstr MI)
static

Definition at line 98 of file Legalizer.cpp.

References AllowGInsertAsArtifact, and MI.

Referenced by llvm::Legalizer::legalizeMachineFunction().

Variable Documentation

◆ AllowGInsertAsArtifact

cl::opt< bool > AllowGInsertAsArtifact("allow-ginsert-as-artifact", cl::desc("Allow G_INSERT to be considered an artifact. Hack around AMDGPU " "test infinite loops."), cl::Optional, cl::init(true)) ( "allow-ginsert-as-artifact"  ,
cl::desc("Allow G_INSERT to be considered an artifact. Hack around AMDGPU " "test infinite loops.")  ,
cl::Optional  ,
cl::init(true  
)
static

Referenced by isArtifact().

◆ DEBUG_TYPE

DEBUG_TYPE

Definition at line 79 of file Legalizer.cpp.

◆ EnableCSEInLegalizer

cl::opt< bool > EnableCSEInLegalizer("enable-cse-in-legalizer", cl::desc("Should enable CSE in Legalizer"), cl::Optional, cl::init(false)) ( "enable-cse-in-legalizer"  ,
cl::desc("Should enable CSE in Legalizer")  ,
cl::Optional  ,
cl::init(false)   
)
static

◆ false

Definition at line 80 of file Legalizer.cpp.

◆ IR

Definition at line 80 of file Legalizer.cpp.

Referenced by llvm::mca::Scheduler::analyzeDataDependencies(), llvm::IRComparer< T >::analyzeIR(), llvm::OuterAnalysisManagerProxy< AnalysisManagerT, IRUnitT, ExtraArgTs >::Result::cachedResultExists(), llvm::mca::AMDGPUCustomBehaviour::checkCustomHazard(), llvm::mca::Stage::checkNextStage(), llvm::mca::checkRegisterHazard(), llvm::AnalysisManager< IRUnitT, ExtraArgTs >::clear(), llvm::mca::Scheduler::cycleEvent(), llvm::mca::ExecuteStage::cycleStart(), llvm::mca::InOrderIssueStage::cycleStart(), llvm::mca::LSUnit::dispatch(), llvm::mca::RetireControlUnit::dispatch(), llvm::mca::Scheduler::dispatch(), llvm::mca::DispatchStage::execute(), llvm::mca::ExecuteStage::execute(), llvm::mca::InOrderIssueStage::execute(), llvm::mca::InstructionTables::execute(), llvm::mca::MicroOpQueueStage::execute(), llvm::mca::RetireStage::execute(), llvm::mca::findFirstWriteBackCycle(), llvm::DotCfgChangeReporter::generateIRRepresentation(), llvm::InLineChangePrinter::generateIRRepresentation(), llvm::IRChangedPrinter::generateIRRepresentation(), llvm::detail::getAnalysisResult(), llvm::detail::getAnalysisResultUnpackTuple(), llvm::AnalysisManager< IRUnitT, ExtraArgTs >::getCachedResult(), llvm::OuterAnalysisManagerProxy< AnalysisManagerT, IRUnitT, ExtraArgTs >::Result::getCachedResult(), GetFunctions(), getIRFileDisplayName(), llvm::AnalysisManager< IRUnitT, ExtraArgTs >::getResult(), llvm::DotCfgChangeReporter::handleAfter(), llvm::InLineChangePrinter::handleAfter(), llvm::TextChangeReporter< IRUnitT >::handleInitialIR(), llvm::IRChangedTester::handleInitialIR(), llvm::DotCfgChangeReporter::handleInitialIR(), llvm::ChangeReporter< IRUnitT >::handleIRAfterPass(), llvm::mca::LSUnit::hasDependentUsers(), llvm::mca::hasResourceHazard(), llvm::mca::Scheduler::instructionCheck(), llvm::AnalysisManager< IRUnitT, ExtraArgTs >::Invalidator::invalidate(), llvm::AnalysisManager< IRUnitT, ExtraArgTs >::invalidate(), llvm::detail::AnalysisResultModel< IRUnitT, PassT, ResultT, InvalidatorT, true >::invalidate(), llvm::mca::InOrderIssueStage::isAvailable(), llvm::mca::Scheduler::isAvailable(), llvm::mca::LSUnit::isAvailable(), llvm::mca::DispatchStage::isAvailable(), llvm::mca::ExecuteStage::isAvailable(), llvm::mca::MicroOpQueueStage::isAvailable(), llvm::mca::LSUnit::isPending(), llvm::mca::LSUnit::isReady(), llvm::mca::Scheduler::issueInstruction(), llvm::mca::LSUnit::isWaiting(), llvm::mca::Stage::moveToTheNextStage(), llvm::mca::Scheduler::mustIssueImmediately(), llvm::mca::ExecuteStage::notifyInstructionExecuted(), llvm::mca::ExecuteStage::notifyInstructionIssued(), llvm::mca::ExecuteStage::notifyInstructionPending(), llvm::mca::ExecuteStage::notifyInstructionReady(), llvm::mca::RetireStage::notifyInstructionRetired(), llvm::mca::ExecuteStage::notifyReservedOrReleasedBuffers(), llvm::mca::LSUnit::MemoryGroup::onGroupIssued(), llvm::mca::LSUnit::MemoryGroup::onInstructionExecuted(), llvm::mca::LSUnit::onInstructionExecuted(), llvm::mca::RetireControlUnit::onInstructionExecuted(), llvm::mca::LSUnit::MemoryGroup::onInstructionIssued(), llvm::mca::LSUnit::onInstructionIssued(), llvm::mca::LSUnit::onInstructionRetired(), llvm::operator<<(), llvm::mca::operator<<(), planContainsAdditionalSimplifications(), processCall(), llvm::DroppedVariableStatsIR::registerCallbacks(), llvm::PrintIRInstrumentation::registerCallbacks(), llvm::OptNoneInstrumentation::registerCallbacks(), llvm::OptPassGateInstrumentation::registerCallbacks(), llvm::PrintPassInstrumentation::registerCallbacks(), llvm::TimeProfilingPassesHandler::registerCallbacks(), llvm::PrintCrashIRInstrumentation::registerCallbacks(), llvm::PseudoProbeVerifier::registerCallbacks(), llvm::PreservedCFGCheckerInstrumentation::registerCallbacks(), llvm::DebugifyEachInstrumentation::registerCallbacks(), llvm::VerifyInstrumentation::registerCallbacks(), llvm::ChangeReporter< IRUnitT >::registerRequiredCallbacks(), llvm::FunctionToLoopPassAdaptor::run(), llvm::PassManager< Function >::run(), llvm::detail::AnalysisPassModel< IRUnitT, PassT, InvalidatorT, ExtraArgTs >::run(), llvm::PassManager< IRUnitT, AnalysisManagerT, ExtraArgTs >::run(), llvm::detail::PassModel< IRUnitT, PassT, AnalysisManagerT, ExtraArgTs >::run(), llvm::PassInstrumentation::runAfterAnalysis(), llvm::PassInstrumentation::runAfterPass(), llvm::DroppedVariableStatsIR::runAfterPass(), llvm::PseudoProbeVerifier::runAfterPass(), llvm::PassInstrumentation::runAnalysisInvalidated(), llvm::PassInstrumentation::runBeforeAnalysis(), llvm::DroppedVariableStatsIR::runBeforePass(), llvm::PassInstrumentation::runBeforePass(), llvm::PassManager< Loop, LoopAnalysisManager, LoopStandardAnalysisResults &, LPMUpdater & >::runSinglePass(), llvm::ChangeReporter< IRUnitT >::saveIRBeforePass(), llvm::mca::Scheduler::select(), llvm::OptPassGateInstrumentation::shouldRun(), unwrapIR(), llvm::mca::verifyInstructionEliminated(), and llvm::AnalysisManager< IRUnitT, ExtraArgTs >::verifyNotInvalidated().

◆ VerifyDebugLocs

cl::opt< DebugLocVerifyLevel > VerifyDebugLocs("verify-legalizer-debug-locs", cl::desc("Verify that debug locations are handled"), cl::values( clEnumValN(DebugLocVerifyLevel::None, "none", "No verification"), clEnumValN(DebugLocVerifyLevel::Legalizations, "legalizations", "Verify legalizations"), clEnumValN(DebugLocVerifyLevel::LegalizationsAndArtifactCombiners, "legalizations+artifactcombiners", "Verify legalizations and artifact combines")), cl::init(DebugLocVerifyLevel::Legalizations)) ( "verify-legalizer-debug-locs"  ,
cl::desc("Verify that debug locations are handled")  ,
cl::values( clEnumValN(DebugLocVerifyLevel::None, "none", "No verification"), clEnumValN(DebugLocVerifyLevel::Legalizations, "legalizations", "Verify legalizations"), clEnumValN(DebugLocVerifyLevel::LegalizationsAndArtifactCombiners, "legalizations+artifactcombiners", "Verify legalizations and artifact combines"))  ,
cl::init(DebugLocVerifyLevel::Legalizations  
)
static