104#include "llvm/IR/IntrinsicsAMDGPU.h"
153 using Base = CodeGenPassBuilder;
155 const AMDGPUOptions &CLOpts;
157 GCNTargetMachine &
getTM()
const {
158 return static_cast<GCNTargetMachine &
>(TM);
162 AMDGPUCodeGenPassBuilder(GCNTargetMachine &TM,
163 const CGPassBuilderOption &Opts,
164 PassInstrumentationCallbacks *
PIC);
167 void addIRPasses(PassManagerWrapper &PMW)
override;
168 void addCodeGenPrepare(PassManagerWrapper &PMW)
override;
169 void addPreISel(PassManagerWrapper &PMW)
override;
170 void addILPOpts(PassManagerWrapper &PMW)
override;
171 void addAsmPrinterBegin(PassManagerWrapper &PMW)
override;
172 void addAsmPrinter(PassManagerWrapper &PMW)
override;
173 void addAsmPrinterEnd(PassManagerWrapper &PMW)
override;
174 Error addInstSelector(PassManagerWrapper &PMW)
override;
175 Error addIRTranslator(PassManagerWrapper &PMW)
override;
176 void addPreLegalizeMachineIR(PassManagerWrapper &PMW)
override;
177 Error addLegalizeMachineIR(PassManagerWrapper &PMW)
override;
178 void addPreRegBankSelect(PassManagerWrapper &PMW)
override;
179 Error addRegBankSelect(PassManagerWrapper &PMW)
override;
180 void addPreGlobalInstructionSelect(PassManagerWrapper &PMW)
override;
181 Error addGlobalInstructionSelect(PassManagerWrapper &PMW)
override;
182 void addPreRewrite(PassManagerWrapper &PMW)
override;
183 void addMachineSSAOptimization(PassManagerWrapper &PMW)
override;
184 void addPostRegAlloc(PassManagerWrapper &PMW)
override;
185 void addPreEmitPass(PassManagerWrapper &PMW)
override;
186 Error addRegAssignAndRewriteFast(PassManagerWrapper &PMW)
override;
187 Error addRegAssignAndRewriteOptimized(PassManagerWrapper &PMW)
override;
188 void addPreRegAlloc(PassManagerWrapper &PMW)
override;
189 Error addFastRegAlloc(PassManagerWrapper &PMW)
override;
190 Error addOptimizedRegAlloc(PassManagerWrapper &PMW)
override;
191 void addPreSched2(PassManagerWrapper &PMW)
override;
192 void addPostBBSections(PassManagerWrapper &PMW)
override;
195 Error validateRegAllocOptions()
const;
203 void addEarlyCSEOrGVNPass(PassManagerWrapper &PMW);
204 void addStraightLineScalarOptimizationPasses(PassManagerWrapper &PMW);
209 SGPRRegisterRegAlloc(
const char *
N,
const char *
D, FunctionPassCtor
C)
210 : RegisterRegAllocBase(
N,
D,
C) {}
215 VGPRRegisterRegAlloc(
const char *
N,
const char *
D, FunctionPassCtor
C)
216 : RegisterRegAllocBase(
N,
D,
C) {}
221 WWMRegisterRegAlloc(
const char *
N,
const char *
D, FunctionPassCtor
C)
222 : RegisterRegAllocBase(
N,
D,
C) {}
260static SGPRRegisterRegAlloc
262 "pick SGPR register allocator based on -O option",
265static cl::opt<SGPRRegisterRegAlloc::FunctionPassCtor,
false,
268 cl::desc(
"Register allocator to use for SGPRs"));
270static cl::opt<VGPRRegisterRegAlloc::FunctionPassCtor,
false,
273 cl::desc(
"Register allocator to use for VGPRs"));
275static cl::opt<WWMRegisterRegAlloc::FunctionPassCtor,
false,
279 cl::desc(
"Register allocator to use for WWM registers"));
284 cl::desc(
"Register allocator for SGPRs (new pass manager)"));
288 cl::desc(
"Register allocator for VGPRs (new pass manager)"));
292 cl::desc(
"Register allocator for WWM registers (new pass manager)"));
299 Twine(
"unsupported register allocator '") +
307Error AMDGPUCodeGenPassBuilder::validateRegAllocOptions()
const {
309 if (Opt.RegAlloc != RegAllocType::Unset) {
311 "-regalloc-npm not supported for amdgcn. Use -sgpr-regalloc-npm, "
312 "-vgpr-regalloc-npm, and -wwm-regalloc-npm",
321 "-sgpr-regalloc, -vgpr-regalloc, and -wwm-regalloc are legacy PM "
322 "options. Use -sgpr-regalloc-npm, -vgpr-regalloc-npm, and "
323 "-wwm-regalloc-npm with the new pass manager",
418 "basic register allocator",
420static WWMRegisterRegAlloc
432 "amdgpu-enable-object-linking",
433 cl::desc(
"Enable object linking for cross-TU LDS and ABI support"),
438 "amdgpu-enable-lower-module-lds",
cl::desc(
"Enable lower module lds pass"),
447 Attribute SchedStrategyAttr =
F.getFnAttribute(
"amdgpu-sched-strategy");
448 if (SchedStrategyAttr.
isValid())
451 return CLOpts.sched_strategy;
457 if (ST.hasGFX1250Insts() || ST.hasGFX950Insts())
462 "'amdgpu-sched-strategy'='coexec' is only supported for gfx1250/gfx950",
469 F.getFnAttribute(
"amdgpu-post-sched-strategy");
470 if (PostSchedStrategyAttr.
isValid())
572 return std::make_unique<AMDGPUTargetObjectFile>();
579static ScheduleDAGInstrs *
585 if (ST.shouldClusterStores())
595static ScheduleDAGInstrs *
603static ScheduleDAGInstrs *
607 C, std::make_unique<GCNMaxMemoryClauseSchedStrategy>(
C));
609 if (ST.shouldClusterStores())
617static ScheduleDAGInstrs *
623 if (ST.shouldClusterStores())
636static ScheduleDAGInstrs *
641 if (ST.shouldClusterStores())
648static MachineSchedRegistry
654 "Run GCN scheduler to maximize occupancy",
662 "gcn-max-memory-clause",
"Run GCN scheduler to maximize memory clause",
666 "gcn-iterative-max-occupancy-experimental",
667 "Run GCN scheduler to maximize occupancy (experimental)",
671 "gcn-iterative-minreg",
672 "Run GCN iterative scheduler for minimal register usage (experimental)",
677 "Run GCN iterative scheduler for ILP scheduling (experimental)",
705 std::optional<Reloc::Model>
RM,
706 std::optional<CodeModel::Model> CM,
712 CLOpts(
cl::LibraryOptionsContext::
get<AMDGPUOptions>(
713 Options.MCOptions.LibraryOptions)),
720 bool IsUnknownSubArch =
722 if (IsUnknownSubArch)
754 if (ST.shouldClusterStores())
762 return F->isDeclaration() ||
F->getName().starts_with(
"__asan_") ||
763 F->getName().starts_with(
"__sanitizer_") ||
793 while (!Params.
empty()) {
795 std::tie(ParamName, Params) = Params.
split(
';');
796 if (ParamName ==
"closed-world") {
797 Result.IsClosedWorld =
true;
800 formatv(
"invalid AMDGPUAttributor pass parameter '{0}' ", ParamName)
810#define GET_PASS_REGISTRY "AMDGPUPassRegistry.def"
813 PB.registerPipelineParsingCallback(
816 if (Name ==
"amdgpu-attributor-cgscc" &&
getTargetTriple().isAMDGCN()) {
824 PB.registerScalarOptimizerLateEPCallback(
832 PB.registerVectorizerEndEPCallback(
840 PB.registerPipelineEarlySimplificationEPCallback(
847 if (
CLOpts.enable_hipstdpar) {
868 PB.registerPeepholeEPCallback(
874 if (
CLOpts.simplify_libcall)
877 if (
CLOpts.enable_uniform_intrinsic_combine)
881 PB.registerCGSCCOptimizerLateEPCallback(
892 CLOpts.enable_promote_kernel_arguments)
925 PB.registerFullLinkTimeOptimizationLastEPCallback(
938 if (
CLOpts.enable_hipstdpar) {
945 if (
CLOpts.enable_lower_exec_sync)
947 if (
CLOpts.enable_sw_lower_lds)
959 if (
CLOpts.internalize_symbols) {
965 if (
CLOpts.link_time_closed_world)
978 PB.registerRegClassFilterParsingCallback(
980 if (FilterName ==
"sgpr")
982 if (FilterName ==
"vgpr")
984 if (FilterName ==
"wwm")
992 unsigned DestAS)
const {
1001 !Arg->hasByRefAttr())
1011 const auto *Ptr = LD->getPointerOperand();
1021std::pair<const Value *, unsigned>
1024 switch (
II->getIntrinsicID()) {
1025 case Intrinsic::amdgcn_is_shared:
1027 case Intrinsic::amdgcn_is_private:
1032 return std::pair(
nullptr, -1);
1039 const_cast<Value *
>(V),
1045 return std::pair(
nullptr, -1);
1066 function_ref<
void(std::unique_ptr<Module> MPart)> ModuleCallback) {
1077 PB.registerModuleAnalyses(
MAM);
1078 PB.registerFunctionAnalyses(
FAM);
1094 std::optional<Reloc::Model>
RM,
1095 std::optional<CodeModel::Model> CM,
1116 return static_cast<OOBFlagValue>(Flag->getZExtValue());
1129 : TargetIDSetting::Off;
1132 : TargetIDSetting::Off;
1137 return TargetIDSetting::Any;
1138 return Flag->getZExtValue() == 0 ? TargetIDSetting::Off : TargetIDSetting::On;
1144 const Module *M =
F.getParent();
1145 if (
const GCNSubtarget *ST = LastSubtarget.lookup(FnAttrs, M))
1148 SubtargetAttrs Attrs;
1158 if (
const GCNSubtarget *ST = LastSubtarget.lookup(FnAttrs, M, Attrs))
1162 Attrs.GPU.isValid() ? Attrs.GPU.getValueAsString() :
getTargetCPU();
1163 StringRef FS = Attrs.FS.isValid() ? Attrs.FS.getValueAsString()
1169 if (Attrs.BufRelaxed)
1170 SubtargetKey.
append(
",buf-oob=1");
1171 if (Attrs.TBufRelaxed)
1172 SubtargetKey.
append(
",tbuf-oob=1");
1173 if (Attrs.Xnack != TargetIDSetting::Any) {
1174 SubtargetKey.
append(
",xnack=");
1175 SubtargetKey.
push_back(Attrs.Xnack == TargetIDSetting::On ?
'1' :
'0');
1177 if (Attrs.SramEcc != TargetIDSetting::Any) {
1178 SubtargetKey.
append(
",sramecc=");
1179 SubtargetKey.
push_back(Attrs.SramEcc == TargetIDSetting::On ?
'1' :
'0');
1182 auto &
I = SubtargetMap[SubtargetKey];
1189 const Triple &TT = M->getTargetTriple();
1196 if (!IsLegacyEmptySubArch &&
1198 F.getContext().emitError(
"invalid subtarget '" +
Twine(GPU) +
1199 "' for subarch " + TT.getArchName());
1203 I = std::make_unique<GCNSubtarget>(
TargetTriple, GPU, FS, *
this,
1204 Attrs.BufRelaxed, Attrs.TBufRelaxed,
1205 Attrs.Xnack, Attrs.SramEcc);
1208 LastSubtarget.set(FnAttrs, M, Attrs,
I.get());
1222 AMDGPUCodeGenPassBuilder CGPB(*
this, Opts,
PIC);
1223 return CGPB.buildPipeline(MPM,
MAM, Out, DwoOut, FileType, Ctx);
1229 if (ST.enableSIScheduler())
1235 if (SchedStrategy ==
"max-ilp")
1238 if (SchedStrategy ==
"max-memory-clause")
1241 if (SchedStrategy ==
"iterative-ilp")
1244 if (SchedStrategy ==
"iterative-minreg")
1247 if (SchedStrategy ==
"iterative-maxocc")
1250 if (SchedStrategy ==
"coexec") {
1268 if (ST.shouldClusterStores())
1295 bool addPreISel()
override;
1296 void addMachineSSAOptimization()
override;
1297 bool addILPOpts()
override;
1298 bool addInstSelector()
override;
1299 bool addIRTranslator()
override;
1300 void addPreLegalizeMachineIR()
override;
1301 bool addLegalizeMachineIR()
override;
1302 void addPreRegBankSelect()
override;
1303 bool addRegBankSelect()
override;
1304 void addPreGlobalInstructionSelect()
override;
1305 bool addGlobalInstructionSelect()
override;
1306 void addPreRegAlloc()
override;
1307 void addFastRegAlloc()
override;
1308 void addOptimizedRegAlloc()
override;
1313 FunctionPass *createRegAllocPass(
bool Optimized)
override;
1315 void addRegAssignAndRewriteFast()
override;
1316 void addRegAssignAndRewriteOptimized()
override;
1318 bool addPreRewrite()
override;
1319 void addPostRegAlloc()
override;
1320 void addPreSched2()
override;
1321 void addPreEmitPass()
override;
1322 void addPostBBSections()
override;
1337 if (
CLOpts.use_ssa_machine_scheduler) {
1352 if (
CLOpts.loop_prefetch)
1371 if (
CLOpts.enable_remove_incompatible_functions &&
1372 TM.getTargetTriple().isAMDGCN())
1380 if (
TM.getTargetTriple().isAMDGCN())
1383 if (
CLOpts.lower_global_ctor_dtor)
1386 if (
TM.getTargetTriple().isAMDGCN() &&
1390 if (
CLOpts.enable_uniform_intrinsic_combine)
1409 if (
CLOpts.enable_lower_exec_sync)
1413 if (
CLOpts.enable_sw_lower_lds)
1422 if ((
TM.getTargetTriple().isAMDGCN()) &&
1445 if (
TM.getTargetTriple().isAMDGCN()) {
1476 if (
TM->getTargetTriple().isAMDGCN() &&
1480 if (
TM->getTargetTriple().isAMDGCN() &&
CLOpts.ir_lower_kernel_arguments)
1488 if (
TM->getTargetTriple().isAMDGCN()) {
1527bool GCNPassConfig::addPreISel() {
1553 !isGlobalISelAbortEnabled())
1562void GCNPassConfig::addMachineSSAOptimization() {
1573 if (CLOpts.dpp_combine)
1576 if (isPassEnabled(CLOpts.sdwa_peephole)) {
1586bool GCNPassConfig::addILPOpts() {
1587 if (CLOpts.early_ifcvt)
1594bool GCNPassConfig::addInstSelector() {
1601bool GCNPassConfig::addIRTranslator() {
1606void GCNPassConfig::addPreLegalizeMachineIR() {
1612bool GCNPassConfig::addLegalizeMachineIR() {
1617void GCNPassConfig::addPreRegBankSelect() {
1623bool GCNPassConfig::addRegBankSelect() {
1629void GCNPassConfig::addPreGlobalInstructionSelect() {
1634bool GCNPassConfig::addGlobalInstructionSelect() {
1639void GCNPassConfig::addFastRegAlloc() {
1653void GCNPassConfig::addPreRegAlloc() {
1658void GCNPassConfig::addOptimizedRegAlloc() {
1659 if (CLOpts.dce_in_ra)
1662 if (CLOpts.opt_vgpr_liverange)
1670 if (CLOpts.enable_rewrite_partial_reg_uses)
1674 AnalysisID EndOfPreRA = CLOpts.use_ssa_machine_scheduler
1678 if (isPassEnabled(CLOpts.enable_pre_ra_optimizations))
1685 if (CLOpts.opt_exec_mask_pre_ra)
1696bool GCNPassConfig::addPreRewrite() {
1697 if (CLOpts.reassign_regs)
1704FunctionPass *GCNPassConfig::createSGPRAllocPass(
bool Optimized) {
1719FunctionPass *GCNPassConfig::createVGPRAllocPass(
bool Optimized) {
1734FunctionPass *GCNPassConfig::createWWMRegAllocPass(
bool Optimized) {
1749FunctionPass *GCNPassConfig::createRegAllocPass(
bool Optimized) {
1754 "-regalloc not supported with amdgcn. Use -sgpr-regalloc, -wwm-regalloc, "
1755 "and -vgpr-regalloc";
1757void GCNPassConfig::addRegAssignAndRewriteFast() {
1758 if (!usingDefaultRegAlloc())
1763 addPass(createSGPRAllocPass(
false));
1772 addPass(createWWMRegAllocPass(
false));
1778 addPass(createVGPRAllocPass(
false));
1781void GCNPassConfig::addRegAssignAndRewriteOptimized() {
1782 if (!usingDefaultRegAlloc())
1787 addPass(createSGPRAllocPass(
true));
1807 addPass(createWWMRegAllocPass(
true));
1813 addPass(createVGPRAllocPass(
true));
1823void GCNPassConfig::addPostRegAlloc() {
1830void GCNPassConfig::addPreSched2() {
1843void GCNPassConfig::addPreEmitPass() {
1859 if (CLOpts.set_wave_priority)
1883void GCNPassConfig::addPostBBSections() {
1890 return new GCNPassConfig(*
this, PM);
1929 if (MFI->Occupancy == 0) {
1931 MFI->Occupancy = ST.getOccupancyWithWorkGroupSizes(MF).second;
1937 SourceRange =
RegName.SourceRange;
1950 if (parseOptionalRegister(YamlMFI.
VGPRForAGPRCopy, MFI->VGPRForAGPRCopy))
1953 if (parseOptionalRegister(YamlMFI.
SGPRForEXECCopy, MFI->SGPRForEXECCopy))
1957 MFI->LongBranchReservedReg))
1967 "incorrect register class for field",
RegName.Value, {}, {});
1968 SourceRange =
RegName.SourceRange;
1972 if (parseRegister(YamlMFI.
ScratchRSrcReg, MFI->ScratchRSrcReg) ||
1977 if (MFI->ScratchRSrcReg != AMDGPU::PRIVATE_RSRC_REG &&
1978 !AMDGPU::SGPR_128RegClass.contains(MFI->ScratchRSrcReg)) {
1982 if (MFI->FrameOffsetReg != AMDGPU::FP_REG &&
1983 !AMDGPU::SGPR_32RegClass.contains(MFI->FrameOffsetReg)) {
1987 if (MFI->StackPtrOffsetReg != AMDGPU::SP_REG &&
1988 !AMDGPU::SGPR_32RegClass.contains(MFI->StackPtrOffsetReg)) {
1994 if (parseRegister(YamlReg, ParsedReg))
2001 MFI->
setFlag(Info->VReg, Info->Flags);
2003 for (
const auto &[
_, Info] : PFS.
VRegInfos) {
2004 MFI->
setFlag(Info->VReg, Info->Flags);
2009 if (parseRegister(YamlRegStr, ParsedReg))
2011 MFI->SpillPhysVGPRs.push_back(ParsedReg);
2014 auto parseAndCheckArgument = [&](
const std::optional<yaml::SIArgument> &
A,
2017 unsigned SystemSGPRs) {
2022 if (
A->IsRegister) {
2025 SourceRange =
A->RegisterName.SourceRange;
2028 if (!RC.contains(Reg))
2029 return diagnoseRegisterClass(
A->RegisterName);
2037 MFI->NumUserSGPRs += UserSGPRs;
2038 MFI->NumSystemSGPRs += SystemSGPRs;
2043 (parseAndCheckArgument(YamlMFI.
ArgInfo->PrivateSegmentBuffer,
2044 AMDGPU::SGPR_128RegClass,
2046 parseAndCheckArgument(YamlMFI.
ArgInfo->DispatchPtr,
2047 AMDGPU::SReg_64RegClass, MFI->ArgInfo.
DispatchPtr,
2049 parseAndCheckArgument(YamlMFI.
ArgInfo->QueuePtr, AMDGPU::SReg_64RegClass,
2051 parseAndCheckArgument(YamlMFI.
ArgInfo->KernargSegmentPtr,
2052 AMDGPU::SReg_64RegClass,
2054 parseAndCheckArgument(YamlMFI.
ArgInfo->DispatchID,
2055 AMDGPU::SReg_64RegClass, MFI->ArgInfo.
DispatchID,
2057 parseAndCheckArgument(YamlMFI.
ArgInfo->FlatScratchInit,
2058 AMDGPU::SReg_64RegClass,
2060 parseAndCheckArgument(YamlMFI.
ArgInfo->PrivateSegmentSize,
2061 AMDGPU::SGPR_32RegClass,
2063 parseAndCheckArgument(YamlMFI.
ArgInfo->LDSKernelId,
2064 AMDGPU::SGPR_32RegClass, MFI->ArgInfo.
LDSKernelId,
2066 parseAndCheckArgument(YamlMFI.
ArgInfo->WorkGroupIDX,
2069 parseAndCheckArgument(YamlMFI.
ArgInfo->WorkGroupIDY,
2072 parseAndCheckArgument(YamlMFI.
ArgInfo->WorkGroupIDZ,
2075 parseAndCheckArgument(YamlMFI.
ArgInfo->WorkGroupInfo,
2076 AMDGPU::SGPR_32RegClass,
2078 parseAndCheckArgument(YamlMFI.
ArgInfo->PrivateSegmentWaveByteOffset,
2079 AMDGPU::SGPR_32RegClass,
2081 parseAndCheckArgument(YamlMFI.
ArgInfo->ImplicitArgPtr,
2082 AMDGPU::SReg_64RegClass,
2084 parseAndCheckArgument(YamlMFI.
ArgInfo->ImplicitBufferPtr,
2085 AMDGPU::SReg_64RegClass,
2087 parseAndCheckArgument(YamlMFI.
ArgInfo->WorkItemIDX,
2088 AMDGPU::VGPR_32RegClass, MFI->ArgInfo.
WorkItemIDX,
2090 parseAndCheckArgument(YamlMFI.
ArgInfo->WorkItemIDY,
2091 AMDGPU::VGPR_32RegClass, MFI->ArgInfo.
WorkItemIDY,
2093 parseAndCheckArgument(YamlMFI.
ArgInfo->WorkItemIDZ,
2094 AMDGPU::VGPR_32RegClass, MFI->ArgInfo.
WorkItemIDZ,
2100 if (YamlMFI.
ArgInfo && YamlMFI.
ArgInfo->FirstKernArgPreloadReg) {
2103 if (!
A.IsRegister) {
2114 "firstKernArgPreloadReg must be a register, not a stack location",
"",
2117 SourceRange =
Range;
2123 SourceRange =
A.RegisterName.SourceRange;
2127 if (!AMDGPU::SGPR_32RegClass.
contains(Reg))
2128 return diagnoseRegisterClass(
A.RegisterName);
2134 if (ST.hasFeature(AMDGPU::FeatureDX10ClampAndIEEEMode)) {
2164AMDGPUCodeGenPassBuilder::AMDGPUCodeGenPassBuilder(
2168 Opt.MISchedPostRA =
true;
2169 Opt.RequiresCodeGenSCCOrder =
true;
2170 Opt.EnableSSAMachineScheduler =
CLOpts.use_ssa_machine_scheduler;
2179 if (Opt.EnableSSAMachineScheduler)
2180 disablePass<MachineSchedulerPass>();
2184 if (CLOpts.enable_remove_incompatible_functions &&
2186 flushFPMsToMPM(PMW);
2190 flushFPMsToMPM(PMW);
2195 if (CLOpts.lower_global_ctor_dtor)
2198 if (isPassEnabled(CLOpts.enable_image_intrinsic_optimizer))
2201 if (CLOpts.enable_uniform_intrinsic_combine)
2205 flushFPMsToMPM(PMW);
2213 if (CLOpts.enable_lower_exec_sync)
2216 if (CLOpts.enable_sw_lower_lds)
2233 if (isPassEnabled(CLOpts.scalar_ir_passes))
2234 addStraightLineScalarOptimizationPasses(PMW);
2250 Base::addIRPasses(PMW);
2264 if (isPassEnabled(CLOpts.scalar_ir_passes))
2265 addEarlyCSEOrGVNPass(PMW);
2270 flushFPMsToMPM(PMW);
2274 if (CLOpts.ir_lower_kernel_arguments)
2277 Base::addCodeGenPrepare(PMW);
2279 if (isPassEnabled(CLOpts.load_store_vectorizer))
2289 flushFPMsToMPM(PMW);
2291 flushFPMsToMPM(PMW);
2292 requireCGSCCOrder(PMW);
2330 !isGlobalISelAbortEnabled())
2334 flushFPMsToMPM(PMW);
2340 if (CLOpts.early_ifcvt)
2343 Base::addILPOpts(PMW);
2371void AMDGPUCodeGenPassBuilder::addPreLegalizeMachineIR(
2393void AMDGPUCodeGenPassBuilder::addPreGlobalInstructionSelect(
2399Error AMDGPUCodeGenPassBuilder::addGlobalInstructionSelect(
2406 if (CLOpts.reassign_regs) {
2413void AMDGPUCodeGenPassBuilder::addMachineSSAOptimization(
2415 Base::addMachineSSAOptimization(PMW);
2418 if (CLOpts.dpp_combine) {
2422 if (isPassEnabled(CLOpts.sdwa_peephole)) {
2437 return Base::addFastRegAlloc(PMW);
2440Error AMDGPUCodeGenPassBuilder::addRegAssignAndRewriteFast(
2442 if (
auto Err = validateRegAllocOptions())
2464 addMachineFunctionPass(
2480 if (CLOpts.dce_in_ra)
2483 if (CLOpts.opt_vgpr_liverange)
2484 insertPass<RequireAnalysisPass<MachineLoopAnalysis, MachineFunction>>(
2492 if (CLOpts.enable_rewrite_partial_reg_uses)
2497 auto insertAtEndOfPreRA = [
this](
auto &&
Pass) {
2498 if (Opt.EnableSSAMachineScheduler)
2499 insertPass<RenameIndependentSubregsPass>(std::move(
Pass));
2501 insertPass<MachineSchedulerPass>(std::move(
Pass));
2504 if (isPassEnabled(CLOpts.enable_pre_ra_optimizations))
2511 if (CLOpts.opt_exec_mask_pre_ra)
2519 return Base::addOptimizedRegAlloc(PMW);
2527Error AMDGPUCodeGenPassBuilder::addRegAssignAndRewriteOptimized(
2529 if (
auto Err = validateRegAllocOptions())
2560 addMachineFunctionPass(
2585 Base::addPostRegAlloc(PMW);
2619 if (CLOpts.set_wave_priority)
2644bool AMDGPUCodeGenPassBuilder::isPassEnabled(
BoolOrDefault Opt,
2651 addFunctionPass(
GVNPass(), PMW);
2656void AMDGPUCodeGenPassBuilder::addStraightLineScalarOptimizationPasses(
2658 if (CLOpts.loop_prefetch)
2669 addEarlyCSEOrGVNPass(PMW);
aarch64 falkor hwpf fix Falkor HW Prefetch Fix Late Phase
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static std::unique_ptr< TargetLoweringObjectFile > createTLOF(const Triple &TT)
This is the AMGPU address space based alias analysis pass.
AMDGPU Assembly printer class.
Coexecution-focused scheduling strategy for AMDGPU.
Defines an instruction selector for the AMDGPU target.
Analyzes if a function potentially memory bound and if a kernel kernel may benefit from limiting numb...
Analyzes how many registers and other resources are used by functions.
static cl::opt< RegAllocType, false, RegAllocTypeParser > SGPRRegAllocNPM("sgpr-regalloc-npm", cl::Hidden, cl::init(RegAllocType::Default), cl::desc("Register allocator for SGPRs (new pass manager)"))
static cl::opt< bool, true > EnableLowerModuleLDS("amdgpu-enable-lower-module-lds", cl::desc("Enable lower module lds pass"), cl::location(AMDGPUTargetMachine::EnableLowerModuleLDS), cl::init(true), cl::Hidden)
static VGPRRegisterRegAlloc greedyRegAllocVGPR("greedy", "greedy register allocator", createGreedyVGPRRegisterAllocator)
static MachineSchedRegistry GCNMaxMemoryClauseSchedRegistry("gcn-max-memory-clause", "Run GCN scheduler to maximize memory clause", createGCNMaxMemoryClauseMachineScheduler)
static Reloc::Model getEffectiveRelocModel()
static llvm::once_flag InitializeDefaultVGPRRegisterAllocatorFlag
static Error checkRegAllocSupported(RegAllocType RAType, StringRef RegName)
Check if the given RegAllocType is supported for AMDGPU NPM register allocation.
static MachineSchedRegistry SISchedRegistry("si", "Run SI's custom scheduler", createSIMachineScheduler)
static ScheduleDAGInstrs * createIterativeILPMachineScheduler(MachineSchedContext *C)
static bool useNoopPostScheduler(const AMDGPUOptions &CLOpts, const Function &F)
static SGPRRegisterRegAlloc defaultSGPRRegAlloc("default", "pick SGPR register allocator based on -O option", useDefaultRegisterAllocator)
static OOBFlagValue getOOBFlagValue(const Module &M, StringRef FlagName)
Returns the OOB mode encoded by a module flag.
static FunctionPass * useDefaultRegisterAllocator()
-{sgpr|wwm|vgpr}-regalloc=... command line option.
static cl::opt< bool, true > EnableObjectLinking("amdgpu-enable-object-linking", cl::desc("Enable object linking for cross-TU LDS and ABI support"), cl::location(AMDGPUTargetMachine::EnableObjectLinking), cl::init(false), cl::Hidden)
static ScheduleDAGInstrs * createGCNMaxILPMachineScheduler(MachineSchedContext *C)
static llvm::once_flag InitializeDefaultSGPRRegisterAllocatorFlag
A dummy default pass factory indicates whether the register allocator is overridden on the command li...
static FunctionPass * createFastVGPRRegisterAllocator()
static FunctionPass * createGreedyWWMRegisterAllocator()
static SGPRRegisterRegAlloc fastRegAllocSGPR("fast", "fast register allocator", createFastSGPRRegisterAllocator)
static MachineSchedRegistry GCNMinRegSchedRegistry("gcn-iterative-minreg", "Run GCN iterative scheduler for minimal register usage (experimental)", createMinRegScheduler)
static SGPRRegisterRegAlloc greedyRegAllocSGPR("greedy", "greedy register allocator", createGreedySGPRRegisterAllocator)
static void diagnoseUnsupportedCoExecSchedulerSelection(const Function &F, const GCNSubtarget &ST)
static ScheduleDAGInstrs * createGCNMaxMemoryClauseMachineScheduler(MachineSchedContext *C)
static bool onlyAllocateSGPRs(const TargetRegisterInfo &TRI, const MachineRegisterInfo &MRI, const Register Reg)
static WWMRegisterRegAlloc greedyRegAllocWWMReg("greedy", "greedy register allocator", createGreedyWWMRegisterAllocator)
static FunctionPass * createFastSGPRRegisterAllocator()
static Expected< AMDGPU::ScanOptions > parseAMDGPUAtomicOptimizerStrategy(StringRef Params)
static FunctionPass * createGreedyVGPRRegisterAllocator()
static WWMRegisterRegAlloc basicRegAllocWWMReg("basic", "basic register allocator", createBasicWWMRegisterAllocator)
static cl::opt< RegAllocType, false, RegAllocTypeParser > WWMRegAllocNPM("wwm-regalloc-npm", cl::Hidden, cl::init(RegAllocType::Default), cl::desc("Register allocator for WWM registers (new pass manager)"))
static MachineSchedRegistry IterativeGCNMaxOccupancySchedRegistry("gcn-iterative-max-occupancy-experimental", "Run GCN scheduler to maximize occupancy (experimental)", createIterativeGCNMaxOccupancyMachineScheduler)
static void initializeDefaultWWMRegisterAllocatorOnce()
static bool onlyAllocateWWMRegs(const TargetRegisterInfo &TRI, const MachineRegisterInfo &MRI, const Register Reg)
static cl::opt< WWMRegisterRegAlloc::FunctionPassCtor, false, RegisterPassParser< WWMRegisterRegAlloc > > WWMRegAlloc("wwm-regalloc", cl::Hidden, cl::init(&useDefaultRegisterAllocator), cl::desc("Register allocator to use for WWM registers"))
static cl::opt< RegAllocType, false, RegAllocTypeParser > VGPRRegAllocNPM("vgpr-regalloc-npm", cl::Hidden, cl::init(RegAllocType::Default), cl::desc("Register allocator for VGPRs (new pass manager)"))
static cl::opt< VGPRRegisterRegAlloc::FunctionPassCtor, false, RegisterPassParser< VGPRRegisterRegAlloc > > VGPRRegAlloc("vgpr-regalloc", cl::Hidden, cl::init(&useDefaultRegisterAllocator), cl::desc("Register allocator to use for VGPRs"))
LLVM_ABI LLVM_EXTERNAL_VISIBILITY void LLVMInitializeAMDGPUTarget()
static MachineSchedRegistry GCNMaxILPSchedRegistry("gcn-max-ilp", "Run GCN scheduler to maximize ilp", createGCNMaxILPMachineScheduler)
static FunctionPass * createGreedySGPRRegisterAllocator()
static LLVM_READNONE StringRef getGPUOrDefault(const Triple &TT, StringRef GPU)
Expected< AMDGPUAttributorOptions > parseAMDGPUAttributorPassOptions(StringRef Params)
static ScheduleDAGInstrs * createMinRegScheduler(MachineSchedContext *C)
static void initializeDefaultVGPRRegisterAllocatorOnce()
static ScheduleDAGInstrs * createIterativeGCNMaxOccupancyMachineScheduler(MachineSchedContext *C)
static FunctionPass * createFastWWMRegisterAllocator()
static bool mustPreserveGV(const GlobalValue &GV)
Predicate for Internalize pass.
static FunctionPass * createBasicVGPRRegisterAllocator()
static VGPRRegisterRegAlloc basicRegAllocVGPR("basic", "basic register allocator", createBasicVGPRRegisterAllocator)
static WWMRegisterRegAlloc fastRegAllocWWMReg("fast", "fast register allocator", createFastWWMRegisterAllocator)
static VGPRRegisterRegAlloc fastRegAllocVGPR("fast", "fast register allocator", createFastVGPRRegisterAllocator)
static SGPRRegisterRegAlloc basicRegAllocSGPR("basic", "basic register allocator", createBasicSGPRRegisterAllocator)
static llvm::once_flag InitializeDefaultWWMRegisterAllocatorFlag
static cl::opt< SGPRRegisterRegAlloc::FunctionPassCtor, false, RegisterPassParser< SGPRRegisterRegAlloc > > SGPRRegAlloc("sgpr-regalloc", cl::Hidden, cl::init(&useDefaultRegisterAllocator), cl::desc("Register allocator to use for SGPRs"))
static bool onlyAllocateVGPRs(const TargetRegisterInfo &TRI, const MachineRegisterInfo &MRI, const Register Reg)
static ScheduleDAGInstrs * createSIMachineScheduler(MachineSchedContext *C)
static void initializeDefaultSGPRRegisterAllocatorOnce()
static ScheduleDAGInstrs * createGCNMaxOccupancyMachineScheduler(MachineSchedContext *C)
static MachineSchedRegistry GCNILPSchedRegistry("gcn-iterative-ilp", "Run GCN iterative scheduler for ILP scheduling (experimental)", createIterativeILPMachineScheduler)
static FunctionPass * createBasicWWMRegisterAllocator()
static bool mayNeedAsyncBarrierArriveWorkaround(const Triple &TT)
static const char RegAllocOptNotSupportedMessage[]
static FunctionPass * createBasicSGPRRegisterAllocator()
static MachineSchedRegistry GCNMaxOccupancySchedRegistry("gcn-max-occupancy", "Run GCN scheduler to maximize occupancy", createGCNMaxOccupancyMachineScheduler)
The AMDGPU TargetMachine interface definition for hw codegen targets.
This file declares the AMDGPU-specific subclass of TargetLoweringObjectFile.
Provides passes to inlining "always_inline" functions.
static GCRegistry::Add< ShadowStackGC > C("shadow-stack", "Very portable GC for uncooperative code generators")
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
This header provides classes for managing passes over SCCs of the call graph.
Provides analysis for continuously CSEing during GISel passes.
Interfaces for producing common pass manager configurations.
#define LLVM_EXTERNAL_VISIBILITY
Analysis that tracks defined/used subregister lanes across COPY instructions and instructions that ge...
This file provides the interface for a simple, fast CSE pass.
This file defines the class GCNIterativeScheduler, which uses an iterative approach to find a best sc...
This file provides the interface for LLVM's Global Value Numbering pass which eliminates fully redund...
AcceleratorCodeSelection - Identify all functions reachable from a kernel, removing those that are un...
This file declares the IRTranslator pass.
Module.h This file contains the declarations for the Module class.
This header defines various interfaces for pass management in LLVM.
This file provides the interface for LLVM's Loop Data Prefetching Pass.
This header provides classes for managing a pipeline of passes over loops in LLVM IR.
Register const TargetRegisterInfo * TRI
ConstantRange Range(APInt(BitWidth, Low), APInt(BitWidth, High))
uint64_t IntrinsicInst * II
CGSCCAnalysisManager CGAM
FunctionAnalysisManager FAM
ModuleAnalysisManager MAM
PassBuilder PB(Mod->getContext(), Machine, PassOpts->PTO, std::nullopt, &PIC)
PassInstrumentationCallbacks PIC
static bool isLTOPreLink(ThinOrFullLTOPhase Phase)
The AMDGPU TargetMachine interface definition for hw codegen targets.
MachineRegisterInfo & MRI
const GCNTargetMachine & getTM(const GCNSubtarget *STI)
SI Machine Scheduler interface.
static bool contains(SmallPtrSetImpl< ConstantExpr * > &Cache, ConstantExpr *Expr, Constant *C)
static TableGen::Emitter::Opt Y("gen-skeleton-entry", EmitSkeleton, "Generate example skeleton entry")
static FunctionPass * useDefaultRegisterAllocator()
-regalloc=... command line option.
Target-Independent Code Generator Pass Configuration Options pass.
static std::unique_ptr< TargetLoweringObjectFile > createTLOF()
A manager for alias analyses.
void registerFunctionAnalysis()
Register a specific AA result.
void addAAResult(AAResultT &AAResult)
Register a specific AA result.
Legacy wrapper pass to provide the AMDGPUAAResult object.
Analysis pass providing a never-invalidated alias analysis result.
Lower llvm.global_ctors and llvm.global_dtors to special kernels.
AMDGPUTargetMachine & getAMDGPUTargetMachine() const
std::unique_ptr< CSEConfigBase > getCSEConfig() const override
Returns the CSEConfig object to use for the current optimization level.
const AMDGPUOptions & CLOpts
bool addPreISel() override
Methods with trivial inline returns are convenient points in the common codegen pass pipeline where t...
bool addInstSelector() override
addInstSelector - This method should install an instruction selector pass, which converts from LLVM c...
bool addGCPasses() override
addGCPasses - Add late codegen passes that analyze code for garbage collection.
void addStraightLineScalarOptimizationPasses()
AMDGPUPassConfig(TargetMachine &TM, PassManagerBase &PM)
bool isPassEnabled(BoolOrDefault Opt, CodeGenOptLevel Level=CodeGenOptLevel::Default) const
Check if a pass is enabled given Opt option.
void addIRPasses() override
Add common target configurable passes that perform LLVM IR to IR transforms following machine indepen...
void addEarlyCSEOrGVNPass()
void addCodeGenPrepare() override
Add pass to prepare the LLVM IR for code generation.
Splits the module M into N linkable partitions.
std::unique_ptr< TargetLoweringObjectFile > TLOF
unsigned getAddressSpaceForPseudoSourceKind(unsigned Kind) const override
getAddressSpaceForPseudoSourceKind - Given the kind of memory (e.g.
bool isNoopAddrSpaceCast(const DataLayout &DL, unsigned SrcAS, unsigned DestAS) const override
Returns true if a cast between SrcAS and DestAS is a noop.
void registerDefaultAliasAnalyses(AAManager &) override
Allow the target to register alias analyses with the AAManager for use with the new pass manager.
~AMDGPUTargetMachine() override
std::pair< const Value *, unsigned > getPredicatedAddrSpace(const Value *V) const override
If the specified predicate checks whether a generic pointer falls within a specified address space,...
ScheduleDAGInstrs * createMachineScheduler(MachineSchedContext *C) const override
Create an instance of ScheduleDAGInstrs to be run within the standard MachineScheduler pass for this ...
const AMDGPUOptions & CLOpts
static bool EnableFunctionCalls
AMDGPUTargetMachine(const Target &T, const Triple &TT, StringRef CPU, StringRef FS, const TargetOptions &Options, std::optional< Reloc::Model > RM, std::optional< CodeModel::Model > CM, CodeGenOptLevel OL)
void registerPassBuilderCallbacks(PassBuilder &PB) override
Allow the target to modify the pass pipeline.
static bool EnableLowerModuleLDS
unsigned getAssumedAddrSpace(const Value *V) const override
If the specified generic pointer could be assumed as a pointer to a specific address space,...
bool splitModule(Module &M, unsigned NumParts, function_ref< void(std::unique_ptr< Module > MPart)> ModuleCallback) override
Entry point for module splitting.
static bool EnableObjectLinking
Inlines functions marked as "always_inline".
Represent a constant reference to an array (0 or more elements consecutively in memory),...
This class holds the attributes for a particular argument, parameter, function, or return value.
LLVM_ABI Attribute getAttribute(Attribute::AttrKind Kind) const
Return the attribute object.
Functions, function parameters, and return types can have attributes to indicate how they should be t...
LLVM_ABI StringRef getValueAsString() const
Return the attribute's value as a string.
bool isValid() const
Return true if the attribute is any kind of attribute.
This class provides access to building LLVM's passes.
CodeGenTargetMachineImpl(const Target &T, const Triple &TT, StringRef CPU, StringRef FS, const TargetOptions &Options, Reloc::Model RM, CodeModel::Model CM, CodeGenOptLevel OL)
LLVM_ABI void removeDeadConstantUsers() const
If there are any dead constant users dangling off of this constant, remove them.
A parsed version of the target data layout string in and methods for querying it.
Diagnostic information for unsupported feature in backend.
Lightweight error class with error context and mandatory checking.
static ErrorSuccess success()
Create a success value.
Tagged union holding either a T or a Error.
FunctionPass class - This class is used to implement most global optimizations.
LowerIntrinsics - This pass rewrites calls to the llvm.gcread or llvm.gcwrite intrinsics,...
@ SCHEDULE_LEGACYMAXOCCUPANCY
const SIRegisterInfo * getRegisterInfo() const override
TargetTransformInfo getTargetTransformInfo(const Function &F) const override
Get a TargetTransformInfo implementation for the target.
const TargetSubtargetInfo * getSubtargetImpl(const Function &) const override
Virtual method implemented by subclasses that returns a reference to that target's TargetSubtargetInf...
ScheduleDAGInstrs * createPostMachineScheduler(MachineSchedContext *C) const override
Similar to createMachineScheduler but used when postRA machine scheduling is enabled.
ScheduleDAGInstrs * createMachineScheduler(MachineSchedContext *C) const override
Create an instance of ScheduleDAGInstrs to be run within the standard MachineScheduler pass for this ...
void registerMachineRegisterInfoCallback(MachineFunction &MF) const override
bool parseMachineFunctionInfo(const yaml::MachineFunctionInfo &, PerFunctionMIParsingState &PFS, SMDiagnostic &Error, SMRange &SourceRange) const override
Parse out the target's MachineFunctionInfo from the YAML reprsentation.
yaml::MachineFunctionInfo * convertFuncInfoToYAML(const MachineFunction &MF) const override
Allocate and initialize an instance of the YAML representation of the MachineFunctionInfo.
yaml::MachineFunctionInfo * createDefaultFuncInfoYAML() const override
Allocate and return a default initialized instance of the YAML representation for the MachineFunction...
Error buildCodeGenPipeline(ModulePassManager &MPM, ModuleAnalysisManager &MAM, raw_pwrite_stream &Out, raw_pwrite_stream *DwoOut, CodeGenFileType FileType, const CGPassBuilderOption &Opts, MCContext &Ctx, PassInstrumentationCallbacks *PIC) override
TargetPassConfig * createPassConfig(PassManagerBase &PM) override
Create a pass configuration object to be used by addPassToEmitX methods for generating a pipeline of ...
GCNTargetMachine(const Target &T, const Triple &TT, StringRef CPU, StringRef FS, const TargetOptions &Options, std::optional< Reloc::Model > RM, std::optional< CodeModel::Model > CM, CodeGenOptLevel OL, bool JIT)
AMDGPU::TargetIDSetting getTargetIDSettingFromModuleFlag(const Module &M, StringRef FlagName) const
Get xnack/sramecc setting from module flag or command line option (for testing).
MachineFunctionInfo * createMachineFunctionInfo(BumpPtrAllocator &Allocator, const Function &F, const TargetSubtargetInfo *STI) const override
Create the target's instance of MachineFunctionInfo.
Pass to remove unused function declarations.
This pass is responsible for selecting generic machine instructions to target-specific instructions.
A pass that internalizes all functions and variables other than those that must be preserved accordin...
Converts loops into loop-closed SSA form.
Performs Loop Invariant Code Motion Pass.
static void setUseExtended(bool Enable)
This pass implements the localization mechanism described at the top of this file.
An optimization pass inserting data prefetches in loops.
Context object for machine code objects.
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
MachineRegisterInfo & getRegInfo()
getRegInfo - Return information about the registers currently in use.
Ty * getInfo()
getInfo - Keep track of various per-function pieces of information for backends that would like to do...
MachineRegisterInfo - Keep track of information for virtual and physical registers,...
void addDelegate(Delegate *delegate)
MachineSchedRegistry provides a selection of available machine instruction schedulers.
This interface provides simple read-only access to a block of memory, and provides simple methods for...
virtual StringRef getBufferIdentifier() const
Return an identifier for this buffer, typically the filename it was read from.
const char * getBufferStart() const
A Module instance is used to store all the information related to an LLVM module.
This class provides access to building LLVM's passes.
This class manages callbacks registration, as well as provides a way for PassInstrumentation to pass ...
LLVM_ATTRIBUTE_MINSIZE std::enable_if_t<!std::is_same_v< PassT, PassManager > > addPass(PassT &&Pass)
PreservedAnalyses run(IRUnitT &IR, AnalysisManagerT &AM, ExtraArgTs... ExtraArgs)
Run all of the passes in this manager over the given unit of IR.
PassRegistry - This class manages the registration and intitialization of the pass subsystem as appli...
static LLVM_ABI PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
Pass interface - Implemented by all 'passes'.
@ ExternalSymbolCallEntry
RegisterPassParser class - Handle the addition of new machine passes.
RegisterRegAllocBase class - Track the registration of register allocators.
FunctionPass *(*)() FunctionPassCtor
Wrapper class representing virtual and physical registers.
This class keeps track of the SPI_SP_INPUT_ADDR config register, which tells the hardware which inter...
bool initializeBaseYamlFields(const yaml::SIMachineFunctionInfo &YamlMFI, const MachineFunction &MF, PerFunctionMIParsingState &PFS, SMDiagnostic &Error, SMRange &SourceRange)
void setFlag(Register Reg, uint8_t Flag)
bool checkFlag(Register Reg, uint8_t Flag) const
void reserveWWMRegister(Register Reg)
Instances of this class encapsulate one diagnostic report, allowing printing to a raw_ostream as a ca...
Represents a location in source code.
static SMLoc getFromPointer(const char *Ptr)
Represents a range in source code.
A ScheduleDAG for scheduling lists of MachineInstr.
ScheduleDAGMILive is an implementation of ScheduleDAGInstrs that schedules machine instructions while...
ScheduleDAGMI is an implementation of ScheduleDAGInstrs that simply schedules machine instructions ac...
void addMutation(std::unique_ptr< ScheduleDAGMutation > Mutation)
Add a postprocessing step to the DAG builder.
const TargetInstrInfo * TII
Target instruction information.
Move instructions into successor blocks when possible.
SmallString - A SmallString is just a SmallVector with methods and accessors that make it work better...
void append(StringRef RHS)
Append from a StringRef.
void push_back(const T &Elt)
unsigned getMainFileID() const
const MemoryBuffer * getMemoryBuffer(unsigned i) const
Represent a constant reference to a string, i.e.
std::pair< StringRef, StringRef > split(char Separator) const
Split into two substrings around the first occurrence of a separator character.
constexpr bool empty() const
Check if the string is empty.
bool consume_front(char Prefix)
Returns true if this StringRef has the given prefix and removes that prefix.
A switch()-like statement whose cases are string literals.
StringSwitch & Cases(std::initializer_list< StringLiteral > CaseStrings, T Value)
Primary interface to the complete machine description for the target machine.
CodeGenOptLevel getOptLevel() const
Returns the optimization level: None, Less, Default, or Aggressive.
Triple TargetTriple
Triple string, CPU name, and target feature strings the TargetMachine instance is created with.
const Triple & getTargetTriple() const
const MCSubtargetInfo & getMCSubtargetInfo() const
StringRef getTargetFeatureString() const
const DataLayout DL
DataLayout for the target: keep ABI type size and alignment.
StringRef getTargetCPU() const
std::unique_ptr< const MCSubtargetInfo > STI
void setEnableTiedFastRegAlloc(bool Value)
std::unique_ptr< const MCRegisterInfo > MRI
void setEnableDefaultMachineVerifier(bool Enable)
Target-Independent Code Generator Pass Configuration Options.
virtual void addCodeGenPrepare()
Add pass to prepare the LLVM IR for code generation.
virtual bool addILPOpts()
Add passes that optimize instruction level parallelism for out-of-order targets.
virtual void addPostRegAlloc()
This method may be implemented by targets that want to run passes after register allocation pass pipe...
CodeGenOptLevel getOptLevel() const
virtual void addOptimizedRegAlloc()
addOptimizedRegAlloc - Add passes related to register allocation.
virtual void addIRPasses()
Add common target configurable passes that perform LLVM IR to IR transforms following machine indepen...
virtual void addFastRegAlloc()
addFastRegAlloc - Add the minimum set of target-independent passes that are required for fast registe...
virtual void addMachineSSAOptimization()
addMachineSSAOptimization - Add standard passes that optimize machine instructions in SSA form.
void disablePass(AnalysisID PassID)
Allow the target to disable a specific standard pass by default.
AnalysisID addPass(AnalysisID PassID)
Utilities for targets to add passes to the pass manager.
TargetPassConfig(TargetMachine &TM, PassManagerBase &PM)
void setEnableSSAMachineScheduler(bool Enable)
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
TargetSubtargetInfo - Generic base class for all target subtargets.
Target - Wrapper for Target specific information.
Triple - Helper class for working with autoconf configuration names.
bool isAMDGCN() const
Tests whether the target is AMDGCN.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
LLVM Value Representation.
An efficient, type-erasing, non-owning reference to a callable.
PassManagerBase - An abstract interface to allow code to add passes to a pass manager without having ...
Registers T with cl::parseCommandLineOptions.
An abstract base class for streams implementations that also support a pwrite operation.
Interfaces for registering analysis passes, producing common pass manager configurations,...
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
@ LOCAL_ADDRESS
Address space for local memory.
@ CONSTANT_ADDRESS
Address space for constant memory (VTX2).
@ FLAT_ADDRESS
Address space for flat memory.
@ GLOBAL_ADDRESS
Address space for global memory (RAT0, VTX0).
@ PRIVATE_ADDRESS
Address space for private memory.
constexpr StringLiteral BufferFlag("amdgpu.buffer.oob.mode")
constexpr StringLiteral TBufferFlag("amdgpu.tbuffer.oob.mode")
bool isFlatGlobalAddrSpace(unsigned AS)
LLVM_READNONE constexpr bool isModuleEntryFunctionCC(CallingConv::ID CC)
StringRef getSchedStrategy(const AMDGPUOptions &CLOpts, const Function &F)
GPUKind
GPU kinds supported by the AMDGPU target.
LLVM_READNONE constexpr bool isEntryFunctionCC(CallingConv::ID CC)
LLVM_ABI Triple::SubArchType getSubArch(GPUKind AK)
LLVM_ABI StringRef getArchNameFromSubArch(Triple::SubArchType SubArch)
Returns the canonical GPU name for an AMDGPU subarch, e.g.
LLVM_ABI GPUKind parseArchAMDGCN(StringRef CPU)
LLVM_ABI Triple::SubArchType getMajorSubArch(Triple::SubArchType SubArch)
BinaryOp_match< SrcTy, SpecificConstantMatch, TargetOpcode::G_XOR, true > m_Not(const SrcTy &&Src)
Matches a register not-ed by a G_XOR.
BinaryOp_match< LHS, RHS, Instruction::And, true > m_c_And(const LHS &L, const RHS &R)
Matches an And with LHS and RHS in either order.
bool match(Val *V, const Pattern &P)
match_deferred< Value > m_Deferred(Value *const &V)
Like m_Specific(), but works if the specific value to match is determined as part of the same match()...
auto m_Value()
Match an arbitrary value and ignore it.
auto m_Intrinsic(const Ts &...Ops)
Match intrinsic calls like this: m_Intrinsic<Intrinsic::fabs>(m_Value(X))
This namespace contains all of the command line option processing machinery.
initializer< Ty > init(const Ty &Val)
LocationClass< Ty > location(Ty &L)
std::enable_if_t< detail::IsValidPointer< X, Y >::value, X * > dyn_extract_or_null(Y &&MD)
Extract a Value from Metadata, if any, allowing null.
This is an optimization pass for GlobalISel generic memory operations.
ScheduleDAGMILive * createSchedLive(MachineSchedContext *C)
Create the standard converging machine scheduler.
LLVM_ABI FunctionPass * createFlattenCFGPass()
ModulePass * createAMDGPUSwLowerLDSLegacyPass()
std::unique_ptr< ScheduleDAGMutation > createAMDGPUBarrierLatencyDAGMutation(MachineFunction *MF)
LLVM_ABI FunctionPass * createFastRegisterAllocator()
FastRegisterAllocation Pass - This pass register allocates as fast as possible.
LLVM_ABI char & EarlyMachineLICMID
This pass performs loop invariant code motion on machine instructions.
ImmutablePass * createAMDGPUAAWrapperPass()
LLVM_ABI char & PostRAHazardRecognizerID
PostRAHazardRecognizer - This pass runs the post-ra hazard recognizer.
std::function< bool(const TargetRegisterInfo &TRI, const MachineRegisterInfo &MRI, const Register Reg)> RegAllocFilterFunc
Filter function for register classes during regalloc.
FunctionPass * createAMDGPUSetWavePriorityPass()
LLVM_ABI Pass * createLCSSAPass()
void initializeAMDGPUMarkLastScratchLoadLegacyPass(PassRegistry &)
void initializeAMDGPUInsertDelayAluLegacyPass(PassRegistry &)
void initializeSIOptimizeExecMaskingPreRALegacyPass(PassRegistry &)
char & GCNPreRAOptimizationsID
LLVM_ABI char & GCLoweringID
GCLowering Pass - Used by gc.root to perform its default lowering operations.
void initializeSIInsertHardClausesLegacyPass(PassRegistry &)
FunctionPass * createSIAnnotateControlFlowLegacyPass()
Create the annotation pass.
FunctionPass * createSIModeRegisterPass()
void initializeGCNPreRAOptimizationsLegacyPass(PassRegistry &)
void initializeSILowerWWMCopiesLegacyPass(PassRegistry &)
LLVM_ABI FunctionPass * createGreedyRegisterAllocator()
Greedy register allocation pass - This pass implements a global register allocator for optimized buil...
void initializeAMDGPUAAWrapperPassPass(PassRegistry &)
void initializeSIShrinkInstructionsLegacyPass(PassRegistry &)
ModulePass * createAMDGPULowerBufferFatPointersPass()
void initializeR600ClauseMergePassPass(PassRegistry &)
ModulePass * createAMDGPUCtorDtorLoweringLegacyPass()
decltype(auto) dyn_cast(const From &Val)
dyn_cast<X> - Return the argument parameter cast to the specified type.
ModuleToFunctionPassAdaptor createModuleToFunctionPassAdaptor(FunctionPassT &&Pass, bool EagerlyInvalidate=false)
A function to deduce a function pass type and wrap it in the templated adaptor.
void initializeGCNRewritePartialRegUsesLegacyPass(llvm::PassRegistry &)
void initializeAMDGPURewriteUndefForPHILegacyPass(PassRegistry &)
char & GCNRewritePartialRegUsesID
void initializeAMDGPUSwLowerLDSLegacyPass(PassRegistry &)
LLVM_ABI std::error_code inconvertibleErrorCode()
The value returned by this function can be returned from convertToErrorCode for Error values where no...
void initializeAMDGPULowerVGPREncodingLegacyPass(PassRegistry &)
LLVM_ABI std::unique_ptr< ScheduleDAGMutation > createLoadClusterDAGMutation(const TargetInstrInfo *TII, bool ReorderWhileClustering=false)
If ReorderWhileClustering is set to true, no attempt will be made to reduce reordering due to store c...
char & AMDGPUWaitSGPRHazardsLegacyID
void initializeSILowerSGPRSpillsLegacyPass(PassRegistry &)
char & SILowerControlFlowLegacyID
void initializeAMDGPURegBankCombinerLegacyPass(PassRegistry &)
LLVM_ABI Pass * createLoadStoreVectorizerPass()
Create a legacy pass manager instance of the LoadStoreVectorizer pass.
FunctionPass * createAMDGPURegBankCombinerLegacy(bool IsOptLevelNone)
void initializeAMDGPUPostLegalizerCombinerLegacyPass(PassRegistry &)
std::unique_ptr< ScheduleDAGMutation > createIGroupLPDAGMutation(AMDGPU::SchedulingPhase Phase)
Phase specifes whether or not this is a reentry into the IGroupLPDAGMutation.
void initializeAMDGPUDAGToDAGISelLegacyPass(PassRegistry &)
char & AMDGPUReserveWWMRegsLegacyID
LLVM_ABI FunctionPass * createNaryReassociatePass()
void initializeAMDGPUWaitSGPRHazardsLegacyPass(PassRegistry &)
LLVM_ABI char & PatchableFunctionID
This pass implements the "patchable-function" attribute.
char & SIOptimizeExecMaskingLegacyID
LLVM_ABI char & PostRASchedulerID
PostRAScheduler - This pass performs post register allocation scheduling.
FunctionPass * createAMDGPUPostLegalizeCombinerLegacy(bool IsOptNone)
void initializeAMDGPUNextUseAnalysisLegacyPassPass(PassRegistry &)
void initializeR600ExpandSpecialInstrsPassPass(PassRegistry &)
void initializeR600PacketizerPass(PassRegistry &)
void initializeAMDGPURegBankSelectLegacyPass(PassRegistry &)
@ O1
Optimize quickly without destroying debuggability.
@ O0
Disable as many optimizations as possible.
std::unique_ptr< ScheduleDAGMutation > createVOPDPairingMutation()
ModulePass * createAMDGPUExportKernelRuntimeHandlesLegacyPass()
ModulePass * createAMDGPUAlwaysInlinePass(bool GlobalOpt=true)
void initializeAMDGPUAsmPrinterPass(PassRegistry &)
void initializeSIFoldOperandsLegacyPass(PassRegistry &)
void initializeAMDGPURegBankLegalizeLegacyPass(PassRegistry &)
char & SILoadStoreOptimizerLegacyID
void initializeAMDGPUPreLegalizerCombinerLegacyPass(PassRegistry &)
PassManager< LazyCallGraph::SCC, CGSCCAnalysisManager, LazyCallGraph &, CGSCCUpdateResult & > CGSCCPassManager
The CGSCC pass manager.
LLVM_ABI std::unique_ptr< CSEConfigBase > getStandardCSEConfigForOpt(CodeGenOptLevel Level)
Target & getTheR600Target()
The target for R600 GPUs.
LLVM_ABI char & MachineSchedulerID
MachineScheduler - This pass schedules machine instructions.
LLVM_ABI Pass * createStructurizeCFGPass(bool SkipUniformRegions=false)
When SkipUniformRegions is true the structizer will not structurize regions that only contain uniform...
LLVM_ABI char & PostMachineSchedulerID
PostMachineScheduler - This pass schedules machine instructions postRA.
LLVM_ABI std::unique_ptr< ScheduleDAGMutation > createStoreClusterDAGMutation(const TargetInstrInfo *TII, bool ReorderWhileClustering=false)
If ReorderWhileClustering is set to true, no attempt will be made to reduce reordering due to store c...
LLVM_ABI Pass * createLICMPass()
char & SIFormMemoryClausesID
void initializeSILoadStoreOptimizerLegacyPass(PassRegistry &)
void initializeAMDGPULowerModuleLDSLegacyPass(PassRegistry &)
void initializeSIInsertAsyncBarrierArriveWorkaroundLegacyPass(PassRegistry &)
AnalysisManager< LazyCallGraph::SCC, LazyCallGraph & > CGSCCAnalysisManager
The CGSCC analysis manager.
void initializeAMDGPUCtorDtorLoweringLegacyPass(PassRegistry &)
LLVM_ABI char & EarlyIfConverterLegacyID
EarlyIfConverter - This pass performs if-conversion on SSA form by inserting cmov instructions.
AnalysisManager< Loop, LoopStandardAnalysisResults & > LoopAnalysisManager
The loop analysis manager.
FunctionPass * createAMDGPUUniformIntrinsicCombineLegacyPass()
ThinOrFullLTOPhase
This enumerates the LLVM full LTO or ThinLTO optimization phases.
@ FullLTOPreLink
Full LTO prelink phase.
@ FullLTOPostLink
Full LTO postlink (backend compile) phase.
@ ThinLTOPreLink
ThinLTO prelink (summary) phase.
char & AMDGPUUnifyDivergentExitNodesID
void initializeAMDGPUPrepareAGPRAllocLegacyPass(PassRegistry &)
FunctionPass * createAMDGPUPreloadKernArgPrologLegacyPass()
LLVM_ABI char & MachineLoopInfoID
MachineLoopInfo - This pass is a loop analysis pass.
char & SIOptimizeVGPRLiveRangeLegacyID
LLVM_ABI char & ShadowStackGCLoweringID
ShadowStackGCLowering - Implements the custom lowering mechanism used by the shadow stack GC.
void initializeAMDGPURewriteOutArgumentsPass(PassRegistry &)
static Reloc::Model getEffectiveRelocModel(std::optional< Reloc::Model > RM)
void initializeAMDGPUExternalAAWrapperPass(PassRegistry &)
char & SIFoldOperandsLegacyID
auto formatv(bool Validate, const char *Fmt, Ts &&...Vals)
void initializeAMDGPULowerKernelArgumentsPass(PassRegistry &)
void initializeSIModeRegisterLegacyPass(PassRegistry &)
CodeModel::Model getEffectiveCodeModel(std::optional< CodeModel::Model > CM, CodeModel::Model Default)
Helper method for getting the code model, returning Default if CM does not have a value.
void initializeAMDGPUPreloadKernelArgumentsLegacyPass(PassRegistry &)
LLVM_ABI ModulePass * createExpandVariadicsPass(ExpandVariadicsMode)
char & SILateBranchLoweringPassID
FunctionToLoopPassAdaptor createFunctionToLoopPassAdaptor(LoopPassT &&Pass, bool UseMemorySSA=false)
A function to deduce a loop pass type and wrap it in the templated adaptor.
char & SIPostRA16BitMovFoldingLegacyID
LLVM_ABI char & BranchRelaxationPassID
BranchRelaxation - This pass replaces branches that need to jump further than is supported by a branc...
LLVM_ABI FunctionPass * createSinkingPass()
CGSCCToFunctionPassAdaptor createCGSCCToFunctionPassAdaptor(FunctionPassT &&Pass, bool EagerlyInvalidate=false, bool NoRerun=false)
A function to deduce a function pass type and wrap it in the templated adaptor.
void initializeSIMemoryLegalizerLegacyPass(PassRegistry &)
ModulePass * createAMDGPULowerIntrinsicsLegacyPass()
decltype(auto) get(const PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info > &Pair)
void initializeR600MachineCFGStructurizerPass(PassRegistry &)
CodeGenFileType
These enums are meant to be passed into addPassesToEmitFile to indicate what type of file to emit,...
char & GCNDPPCombineLegacyID
FunctionPass * createSIInsertAsyncBarrierArriveWorkaroundPass()
PassManager< Module > ModulePassManager
Convenience typedef for a pass manager over modules.
LLVM_ABI FunctionPass * createLoopDataPrefetchPass()
FunctionPass * createAMDGPULowerKernelArgumentsPass()
char & AMDGPUInsertDelayAluID
std::unique_ptr< ScheduleDAGMutation > createAMDGPUMacroFusionDAGMutation()
Note that you have to add: DAG.addMutation(createAMDGPUMacroFusionDAGMutation()); to AMDGPUTargetMach...
LLVM_ABI char & StackMapLivenessID
StackMapLiveness - This pass analyses the register live-out set of stackmap/patchpoint intrinsics and...
void initializeGCNPreRALongBranchRegLegacyPass(PassRegistry &)
char & SILowerWWMCopiesLegacyID
LLVM_ABI FunctionPass * createUnifyLoopExitsPass()
char & SIOptimizeExecMaskingPreRAID
LLVM_ABI FunctionPass * createFixIrreduciblePass()
void initializeR600EmitClauseMarkersPass(PassRegistry &)
LLVM_ABI char & FuncletLayoutID
This pass lays out funclets contiguously.
LLVM_ABI char & DetectDeadLanesID
This pass adds dead/undef flags after analyzing subregister lanes.
void initializeAMDGPULowerExecSyncLegacyPass(PassRegistry &)
ScheduleDAGInstrs * createGCNNoopPostMachineScheduler(MachineSchedContext *C)
void initializeAMDGPUExportKernelRuntimeHandlesLegacyPass(PassRegistry &)
LLVM_ABI FunctionPass * createRegAllocScoringPass()
When learning an eviction policy, extract score(reward) information, otherwise this does nothing.
CodeGenOptLevel
Code generation optimization level.
void initializeSIInsertWaitcntsLegacyPass(PassRegistry &)
LLVM_ABI CGPassBuilderOption getCGPassBuilderOption(const TargetMachine &TM)
ModulePass * createAMDGPUPreloadKernelArgumentsLegacyPass(const TargetMachine *)
ModulePass * createAMDGPUPrintfRuntimeBinding()
LLVM_ABI char & StackSlotColoringID
StackSlotColoring - This pass performs stack slot coloring.
LLVM_ABI Pass * createAlwaysInlinerLegacyPass(bool InsertLifetime=true)
Create a legacy pass manager instance of a pass to inline and remove functions marked as "always_inli...
void initializeR600ControlFlowFinalizerPass(PassRegistry &)
void initializeAMDGPUImageIntrinsicOptimizerPass(PassRegistry &)
void initializeSILateBranchLoweringLegacyPass(PassRegistry &)
void initializeSILowerControlFlowLegacyPass(PassRegistry &)
void initializeSIFormMemoryClausesLegacyPass(PassRegistry &)
char & SIPreAllocateWWMRegsLegacyID
Error make_error(ArgTs &&... Args)
Make a Error instance representing failure using the given error info type.
ModulePass * createAMDGPULowerModuleLDSLegacyPass(const AMDGPUTargetMachine *TM=nullptr)
FunctionPass * createAMDGPUPromoteAlloca()
LLVM_ABI FunctionPass * createSeparateConstOffsetFromGEPPass(bool LowerGEP=false)
void initializeAMDGPUReserveWWMRegsLegacyPass(PassRegistry &)
char & SIPreEmitPeepholeID
char & SIPostRABundlerLegacyID
ModulePass * createAMDGPURemoveIncompatibleFunctionsPass(const TargetMachine *)
void initializeGCNRegPressurePrinterPass(PassRegistry &)
void initializeSILowerI1CopiesLegacyPass(PassRegistry &)
LLVM_ABI ImmutablePass * createExternalAAWrapperPass(std::function< void(Pass &, Function &, AAResults &)> Callback, bool RunEarly=false)
A wrapper pass around a callback which can be used to populate the AAResults in the AAResultsWrapperP...
char & SILowerSGPRSpillsLegacyID
LLVM_ABI FunctionPass * createBasicRegisterAllocator()
BasicRegisterAllocation Pass - This pass implements a degenerate global register allocator using the ...
LLVM_ABI void initializeGlobalISel(PassRegistry &)
Initialize all passes linked into the GlobalISel library.
ModulePass * createR600OpenCLImageTypeLoweringPass()
void initializeSIAnnotateControlFlowLegacyPass(PassRegistry &)
FunctionPass * createAMDGPUISelDag(TargetMachine &TM, CodeGenOptLevel OptLevel)
This pass converts a legalized DAG into a AMDGPU-specific.
void initializeGCNCreateVOPDLegacyPass(PassRegistry &)
void initializeAMDGPUUniformIntrinsicCombineLegacyPass(PassRegistry &)
ScheduleDAGInstrs * createGCNCoExecMachineScheduler(MachineSchedContext *C)
void initializeSIPreAllocateWWMRegsLegacyPass(PassRegistry &)
void initializeSIFixVGPRCopiesLegacyPass(PassRegistry &)
Target & getTheGCNTarget()
The target for GCN GPUs.
void initializeSIFixSGPRCopiesLegacyPass(PassRegistry &)
void initializeAMDGPUAtomicOptimizerPass(PassRegistry &)
void initializeAMDGPULowerIntrinsicsLegacyPass(PassRegistry &)
LLVM_ABI FunctionPass * createGVNPass()
void initializeAMDGPURewriteAGPRCopyMFMALegacyPass(PassRegistry &)
void initializeAMDGPUNextUseAnalysisPrinterLegacyPassPass(PassRegistry &)
void initializeSIPostRABundlerLegacyPass(PassRegistry &)
LLVM_ABI char & MachineCSELegacyID
MachineCSE - This pass performs global CSE on machine instructions.
PassManager< Function > FunctionPassManager
Convenience typedef for a pass manager over functions.
void initializeAMDGPUCodeGenPreparePass(PassRegistry &)
FunctionPass * createAMDGPURewriteUndefForPHILegacyPass()
void initializeSIOptimizeExecMaskingLegacyPass(PassRegistry &)
void call_once(once_flag &flag, Function &&F, Args &&... ArgList)
Execute the function specified as a parameter once.
FunctionPass * createSILowerI1CopiesLegacyPass()
FunctionPass * createAMDGPURegBankSelectLegacyPass()
void initializeAMDGPULowerKernelAttributesPass(PassRegistry &)
char & SIInsertHardClausesID
char & SIFixSGPRCopiesLegacyID
void initializeGCNDPPCombineLegacyPass(PassRegistry &)
char & SIPeepholeSDWALegacyID
LLVM_ABI char & VirtRegRewriterID
VirtRegRewriter pass.
void initializeGCNNSAReassignLegacyPass(PassRegistry &)
LLVM_ABI FunctionPass * createLowerSwitchPass()
void initializeAMDGPUPreloadKernArgPrologLegacyPass(PassRegistry &)
Target & getTheGCNLegacyTarget()
The target for GCN GPUs, registered under the legacy "amdgcn" architecture name for use with -march.
LLVM_ABI FunctionPass * createVirtRegRewriter(bool ClearVirtRegs=true)
void initializeR600VectorRegMergerPass(PassRegistry &)
char & AMDGPURewriteAGPRCopyMFMALegacyID
ModulePass * createAMDGPULowerExecSyncLegacyPass()
constexpr bool valueOr(BoolOrDefault X, bool Default)
char & AMDGPULowerVGPREncodingLegacyID
FunctionPass * createAMDGPUGlobalISelDivergenceLoweringPass()
FunctionPass * createAMDGPUPreLegalizeCombinerLegacyPass(bool IsOptLevelNone)
FunctionPass * createSIMemoryLegalizerPass()
void initializeAMDGPULateCodeGenPrepareLegacyPass(PassRegistry &)
void initializeSIOptimizeVGPRLiveRangeLegacyPass(PassRegistry &)
void initializeSIPeepholeSDWALegacyPass(PassRegistry &)
LLVM_ABI char & TwoAddressInstructionPassID
TwoAddressInstruction - This pass reduces two-address instructions to use two operands.
AnalysisManager< Function > FunctionAnalysisManager
Convenience typedef for the Function analysis manager.
FunctionPass * createAMDGPULateCodeGenPrepareLegacyPass()
LLVM_ABI FunctionPass * createAtomicExpandLegacyPass()
AtomicExpandPass - At IR level this pass replace atomic instructions with __atomic_* library calls,...
void initializeAMDGPUGlobalISelDivergenceLoweringLegacyPass(PassRegistry &)
MCRegisterInfo * createGCNMCRegisterInfo(AMDGPUDwarfFlavour DwarfFlavour)
LLVM_ABI FunctionPass * createStraightLineStrengthReducePass()
BumpPtrAllocatorImpl<> BumpPtrAllocator
The standard BumpPtrAllocator which just uses the default template parameters.
FunctionPass * createAMDGPUImageIntrinsicOptimizerPass(const TargetMachine *)
void initializeAMDGPULowerBufferFatPointersPass(PassRegistry &)
void initializeAMDGPUUnifyDivergentExitNodesLegacyPass(PassRegistry &)
FunctionPass * createSIInsertWaitcntsPass()
FunctionPass * createAMDGPUAnnotateUniformValuesLegacy()
LLVM_ABI FunctionPass * createEarlyCSEPass(bool UseMemorySSA=false)
void initializeSIWholeQuadModeLegacyPass(PassRegistry &)
LLVM_ABI char & PHIEliminationID
PHIElimination - This pass eliminates machine instruction PHI nodes by inserting copy instructions.
LLVM_ABI llvm::cl::opt< bool > NoKernelInfoEndLTO
LLVM_ABI bool parseNamedRegisterReference(PerFunctionMIParsingState &PFS, Register &Reg, StringRef Src, SMDiagnostic &Error)
FunctionPass * createAMDGPUAtomicOptimizerPass(AMDGPU::ScanOptions ScanStrategy)
void initializeAMDGPUResourceUsageAnalysisWrapperPassPass(PassRegistry &)
FunctionPass * createSIShrinkInstructionsLegacyPass()
char & AMDGPUPrepareAGPRAllocLegacyID
char & AMDGPUMarkLastScratchLoadID
LLVM_ABI char & RenameIndependentSubregsID
This pass detects subregister lanes in a virtual register that are used independently of other lanes ...
void initializeAMDGPUAnnotateUniformValuesLegacyPass(PassRegistry &)
std::unique_ptr< ScheduleDAGMutation > createAMDGPUExportClusteringDAGMutation()
void initializeAMDGPUPrintfRuntimeBindingPass(PassRegistry &)
void initializeAMDGPUPromoteAllocaPass(PassRegistry &)
void initializeAMDGPURemoveIncompatibleFunctionsLegacyPass(PassRegistry &)
std::unique_ptr< ScheduleDAGMutation > createAMDGPUHazardLatencyDAGMutation(MachineFunction *MF)
void initializeAMDGPUAlwaysInlinePass(PassRegistry &)
LLVM_ABI char & DeadMachineInstructionElimID
DeadMachineInstructionElim - This pass removes dead machine instructions.
void initializeSIPreEmitPeepholeLegacyPass(PassRegistry &)
AnalysisManager< Module > ModuleAnalysisManager
Convenience typedef for the Module analysis manager.
char & AMDGPUPerfHintAnalysisLegacyID
char & GCNPreRALongBranchRegID
FunctionPass * createAMDGPUCodeGenPreparePass(bool ExpandDiv64InIR)
void initializeSIPostRA16BitMovFoldingLegacyPass(PassRegistry &)
FunctionPass * createAMDGPURegBankLegalizeLegacyPass()
MCRegisterClass TargetRegisterClass
LLVM_ABI void reportFatalUsageError(Error Err)
Report a fatal error that does not indicate a bug in LLVM.
void initializeAMDGPUPromoteKernelArgumentsPass(PassRegistry &)
ArgDescriptor PrivateSegmentBuffer
ArgDescriptor WorkGroupIDY
ArgDescriptor WorkGroupIDZ
ArgDescriptor PrivateSegmentSize
ArgDescriptor ImplicitArgPtr
ArgDescriptor PrivateSegmentWaveByteOffset
ArgDescriptor WorkGroupInfo
ArgDescriptor WorkItemIDZ
ArgDescriptor WorkItemIDY
ArgDescriptor LDSKernelId
ArgDescriptor KernargSegmentPtr
ArgDescriptor WorkItemIDX
ArgDescriptor FlatScratchInit
ArgDescriptor DispatchPtr
ArgDescriptor ImplicitBufferPtr
Register FirstKernArgPreloadReg
ArgDescriptor WorkGroupIDX
static ArgDescriptor createStack(unsigned Offset, unsigned Mask=~0u)
static ArgDescriptor createArg(const ArgDescriptor &Arg, unsigned Mask)
static ArgDescriptor createRegister(Register Reg, unsigned Mask=~0u)
cl::boolOrDefault EnableGlobalISelOption
DenormalModeKind Input
Denormal treatment kind for floating point instruction inputs in the default floating-point environme...
@ PreserveSign
The sign of a flushed-to-zero number is preserved in the sign of 0.
@ IEEE
IEEE-754 denormal numbers preserved.
DenormalModeKind Output
Denormal flushing mode for floating point instruction results in the default floating point environme...
A simple and fast domtree-based CSE pass.
MachineFunctionInfo - This class can be derived from and used by targets to hold private target-speci...
static FuncInfoTy * create(BumpPtrAllocator &Allocator, const Function &F, const SubtargetTy *STI)
Factory function: default behavior is to call new using the supplied allocator.
MachineSchedContext provides enough context from the MachineScheduler pass for the target to instanti...
StringMap< VRegInfo * > VRegInfosNamed
DenseMap< Register, VRegInfo * > VRegInfos
RegisterTargetMachine - Helper template for registering a target machine implementation,...
bool DX10Clamp
Used by the vector ALU to force DX10-style treatment of NaNs: when set, clamp NaN to zero; otherwise,...
DenormalMode FP64FP16Denormals
If this is set, neither input or output denormals are flushed for both f64 and f16/v2f16 instructions...
bool IEEE
Floating point opcodes that support exception flag gathering quiet and propagate signaling NaN inputs...
DenormalMode FP32Denormals
If this is set, neither input or output denormals are flushed for most f32 instructions.
The llvm::once_flag structure.
Targets should override this in a way that mirrors the implementation of llvm::MachineFunctionInfo.
StringValue SGPRForEXECCopy
SmallVector< StringValue > WWMReservedRegs
StringValue FrameOffsetReg
StringValue LongBranchReservedReg
unsigned NumKernargPreloadSGPRs
StringValue VGPRForAGPRCopy
std::optional< SIArgumentInfo > ArgInfo
SmallVector< StringValue, 2 > SpillPhysVGPRS
StringValue ScratchRSrcReg
StringValue StackPtrOffsetReg
bool FP64FP16OutputDenormals
bool FP64FP16InputDenormals
A wrapper around std::string which contains a source range that's being set during parsing.