File indexing completed on 2026-05-10 08:43:33
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef LLVM_CODEGEN_REGALLOCFAST_H
0010 #define LLVM_CODEGEN_REGALLOCFAST_H
0011
0012 #include "llvm/CodeGen/MachinePassManager.h"
0013 #include "llvm/CodeGen/RegAllocCommon.h"
0014
0015 namespace llvm {
0016
0017 struct RegAllocFastPassOptions {
0018 RegAllocFilterFunc Filter = nullptr;
0019 StringRef FilterName = "all";
0020 bool ClearVRegs = true;
0021 };
0022
0023 class RegAllocFastPass : public PassInfoMixin<RegAllocFastPass> {
0024 RegAllocFastPassOptions Opts;
0025
0026 public:
0027 RegAllocFastPass(RegAllocFastPassOptions Opts = RegAllocFastPassOptions())
0028 : Opts(Opts) {}
0029
0030 MachineFunctionProperties getRequiredProperties() const {
0031 return MachineFunctionProperties().set(
0032 MachineFunctionProperties::Property::NoPHIs);
0033 }
0034
0035 MachineFunctionProperties getSetProperties() const {
0036 if (Opts.ClearVRegs) {
0037 return MachineFunctionProperties().set(
0038 MachineFunctionProperties::Property::NoVRegs);
0039 }
0040
0041 return MachineFunctionProperties();
0042 }
0043
0044 MachineFunctionProperties getClearedProperties() const {
0045 return MachineFunctionProperties().set(
0046 MachineFunctionProperties::Property::IsSSA);
0047 }
0048
0049 PreservedAnalyses run(MachineFunction &MF, MachineFunctionAnalysisManager &);
0050
0051 void printPipeline(raw_ostream &OS,
0052 function_ref<StringRef(StringRef)> MapClassName2PassName);
0053
0054 static bool isRequired() { return true; }
0055 };
0056
0057 }
0058
0059 #endif