File indexing completed on 2026-05-10 08:43:30
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #ifndef LLVM_CODEGEN_MACHINECYCLEANALYSIS_H
0015 #define LLVM_CODEGEN_MACHINECYCLEANALYSIS_H
0016
0017 #include "llvm/ADT/GenericCycleInfo.h"
0018 #include "llvm/CodeGen/MachineFunctionPass.h"
0019 #include "llvm/CodeGen/MachineSSAContext.h"
0020
0021 namespace llvm {
0022
0023 using MachineCycleInfo = GenericCycleInfo<MachineSSAContext>;
0024 using MachineCycle = MachineCycleInfo::CycleT;
0025
0026
0027 class MachineCycleInfoWrapperPass : public MachineFunctionPass {
0028 MachineFunction *F = nullptr;
0029 MachineCycleInfo CI;
0030
0031 public:
0032 static char ID;
0033
0034 MachineCycleInfoWrapperPass();
0035
0036 MachineCycleInfo &getCycleInfo() { return CI; }
0037 const MachineCycleInfo &getCycleInfo() const { return CI; }
0038
0039 bool runOnMachineFunction(MachineFunction &F) override;
0040 void getAnalysisUsage(AnalysisUsage &AU) const override;
0041 void releaseMemory() override;
0042 void print(raw_ostream &OS, const Module *M = nullptr) const override;
0043 };
0044
0045
0046
0047 bool isCycleInvariant(const MachineCycle *Cycle, MachineInstr &I);
0048
0049 }
0050
0051 #endif