|
35 | 35 | #include "llvm/CodeGen/MachineFunctionPass.h" |
36 | 36 | #include "llvm/CodeGen/MachineModuleInfo.h" |
37 | 37 | #include "llvm/CodeGen/Passes.h" |
38 | | -#include "llvm/IR/DiagnosticInfo.h" |
39 | 38 | #include "llvm/IR/Function.h" |
40 | 39 | #include "llvm/InitializePasses.h" |
41 | 40 | #include "llvm/Support/CommandLine.h" |
42 | | -#include "llvm/TargetParser/Triple.h" |
43 | 41 | #include <optional> |
44 | 42 |
|
45 | 43 | using namespace llvm; |
@@ -84,13 +82,6 @@ class MachineFunctionSplitter : public MachineFunctionPass { |
84 | 82 | void getAnalysisUsage(AnalysisUsage &AU) const override; |
85 | 83 |
|
86 | 84 | bool runOnMachineFunction(MachineFunction &F) override; |
87 | | - |
88 | | - bool doInitialization(Module &) override; |
89 | | - |
90 | | - static bool isSupportedTriple(const Triple &T) { return T.isX86(); } |
91 | | - |
92 | | -private: |
93 | | - bool UnsupportedTriple = false; |
94 | 85 | }; |
95 | 86 | } // end anonymous namespace |
96 | 87 |
|
@@ -136,20 +127,7 @@ static bool isColdBlock(const MachineBasicBlock &MBB, |
136 | 127 | return (*Count < ColdCountThreshold); |
137 | 128 | } |
138 | 129 |
|
139 | | -bool MachineFunctionSplitter::doInitialization(Module &M) { |
140 | | - StringRef T = M.getTargetTriple(); |
141 | | - if (!isSupportedTriple(Triple(T))) { |
142 | | - UnsupportedTriple = true; |
143 | | - M.getContext().diagnose( |
144 | | - DiagnosticInfoMachineFunctionSplit(T, DS_Warning)); |
145 | | - return false; |
146 | | - } |
147 | | - return MachineFunctionPass::doInitialization(M); |
148 | | -} |
149 | | - |
150 | 130 | bool MachineFunctionSplitter::runOnMachineFunction(MachineFunction &MF) { |
151 | | - if (UnsupportedTriple) |
152 | | - return false; |
153 | 131 | // We target functions with profile data. Static information in the form |
154 | 132 | // of exception handling code may be split to cold if user passes the |
155 | 133 | // mfs-split-ehcode flag. |
|
0 commit comments