LLVM  14.0.0git
Macros | Typedefs | Enumerations | Functions | Variables
Legalizer.cpp File Reference
#include "llvm/CodeGen/GlobalISel/Legalizer.h"
#include "llvm/ADT/PostOrderIterator.h"
#include "llvm/ADT/SetVector.h"
#include "llvm/CodeGen/GlobalISel/CSEInfo.h"
#include "llvm/CodeGen/GlobalISel/CSEMIRBuilder.h"
#include "llvm/CodeGen/GlobalISel/GISelChangeObserver.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/MachineRegisterInfo.h"
#include "llvm/CodeGen/TargetPassConfig.h"
#include "llvm/CodeGen/TargetSubtargetInfo.h"
#include "llvm/InitializePasses.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/Error.h"
#include "llvm/Target/TargetMachine.h"
#include <iterator>
Include dependency graph for Legalizer.cpp:

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "legalizer"
 

Typedefs

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

Enumerations

enum  DebugLocVerifyLevel { DebugLocVerifyLevel::None, DebugLocVerifyLevel::Legalizations, DebugLocVerifyLevel::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< bool > EnableCSEInLegalizer ("enable-cse-in-legalizer", cl::desc("Should enable CSE in Legalizer"), cl::Optional, cl::init(false))
 
static 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))
 
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 37 of file Legalizer.cpp.

Typedef Documentation

◆ ArtifactListTy

Definition at line 118 of file Legalizer.cpp.

◆ InstListTy

using InstListTy = GISelWorkList<256>

Definition at line 117 of file Legalizer.cpp.

Enumeration Type Documentation

◆ DebugLocVerifyLevel

enum DebugLocVerifyLevel
strong
Enumerator
None 
Legalizations 
LegalizationsAndArtifactCombiners 

Definition at line 53 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 99 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))
static

Referenced by isArtifact().

◆ DEBUG_TYPE

DEBUG_TYPE

Definition at line 82 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))
static

◆ false

Legalize the Machine IR a function s Machine false

Definition at line 83 of file Legalizer.cpp.

◆ IR

Legalize the Machine IR a function s Machine IR

Definition at line 83 of file Legalizer.cpp.

◆ 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))
static