diff options
author | paperchalice <liujunchang97@outlook.com> | 2024-03-30 20:03:10 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-30 20:03:10 +0800 |
commit | b361b5369ed4bb186f2a11459b1bc1d54d73a33e (patch) | |
tree | 6f9d674aefc5d787ee7a0202c5e488d818f4d754 /llvm/lib/Passes/PassBuilder.cpp | |
parent | 546dc2245ffc4cccd0b05b58b7a5955e355a3b27 (diff) | |
download | llvm-b361b5369ed4bb186f2a11459b1bc1d54d73a33e.zip llvm-b361b5369ed4bb186f2a11459b1bc1d54d73a33e.tar.gz llvm-b361b5369ed4bb186f2a11459b1bc1d54d73a33e.tar.bz2 |
Reland "[PassManager] Support MachineFunctionProperties (#83668)" (#87141)
Unfortunately GCC 9 rejects code in https://godbolt.org/z/zd9r5GM3e GCC
11 accepts this code.
Diffstat (limited to 'llvm/lib/Passes/PassBuilder.cpp')
-rw-r--r-- | llvm/lib/Passes/PassBuilder.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/llvm/lib/Passes/PassBuilder.cpp b/llvm/lib/Passes/PassBuilder.cpp index f60f4eb..57975e3 100644 --- a/llvm/lib/Passes/PassBuilder.cpp +++ b/llvm/lib/Passes/PassBuilder.cpp @@ -365,6 +365,33 @@ public: static StringRef name() { return "TriggerVerifierErrorPass"; } }; +// A pass requires all MachineFunctionProperties. +// DO NOT USE THIS EXCEPT FOR TESTING! +class RequireAllMachineFunctionPropertiesPass + : public MachinePassInfoMixin<RequireAllMachineFunctionPropertiesPass> { +public: + PreservedAnalyses run(MachineFunction &, MachineFunctionAnalysisManager &) { + return PreservedAnalyses::none(); + } + + static MachineFunctionProperties getRequiredProperties() { + MachineFunctionProperties MFProps; + MFProps.set(MachineFunctionProperties::Property::FailedISel); + MFProps.set(MachineFunctionProperties::Property::FailsVerification); + MFProps.set(MachineFunctionProperties::Property::IsSSA); + MFProps.set(MachineFunctionProperties::Property::Legalized); + MFProps.set(MachineFunctionProperties::Property::NoPHIs); + MFProps.set(MachineFunctionProperties::Property::NoVRegs); + MFProps.set(MachineFunctionProperties::Property::RegBankSelected); + MFProps.set(MachineFunctionProperties::Property::Selected); + MFProps.set(MachineFunctionProperties::Property::TiedOpsRewritten); + MFProps.set(MachineFunctionProperties::Property::TracksDebugUserValues); + MFProps.set(MachineFunctionProperties::Property::TracksLiveness); + return MFProps; + } + static StringRef name() { return "RequireAllMachineFunctionPropertiesPass"; } +}; + } // namespace PassBuilder::PassBuilder(TargetMachine *TM, PipelineTuningOptions PTO, |