LLVM: include/llvm/Transforms/Utils/CodeExtractor.h Source File (original) (raw)

48

50

51

53

54

55

57

58 void findSideEffectInfoForBlock(BasicBlock &BB);

59

60public:

62

63

64

65

67

68

69

72};

89

90

92 const bool AggregateArgs;

96

97

98

99

101

102

103 bool AllowVarArgs;

104

105

107

108

109

110

111

112

113

114

115

116

117

118

119

120

121

122

123

124

126

127

128

129

130 std::string Suffix;

131

132

133

134 bool ArgsInZeroAddressSpace;

135

136 public:

137

138

139

140

141

142

143

144

145

146

147

148

149

150

151

152

157 AssumptionCache *AC = nullptr, bool AllowVarArgs = false,

158 bool AllowAlloca = false,

159 BasicBlock *AllocationBlock = nullptr,

160 std::string Suffix = "", bool ArgsInZeroAddressSpace = false);

161

162

163

164

165

168

169

170

171

172

173

174

175

176

177

178

179

181 ValueSet &Inputs, ValueSet &Outputs);

182

183

184

185

189

190

191

192

193

194

195

196

198

199

200

201

202

203

204

205

206

208 const ValueSet &Allocas,

209 bool CollectGlobalInputs = false) const;

210

211

212

213

214

218

219

220

221

222

223

224

225

226

228 ValueSet &SinkCands, ValueSet &HoistCands,

230

231

232

233

234

235

236

237

238

241

242

243

245

246 private:

247 struct LifetimeMarkerInfo {

248 bool SinkLifeStart = false;

249 bool HoistLifeEnd = false;

252 };

253

254 ValueSet ExcludeArgsFromAggregate;

255

256 LifetimeMarkerInfo

259

260

261

262 void computeExtractedFuncRetVals();

263

264

265

266 Type *getSwitchType();

267

268 void severSplitPHINodesOfEntry(BasicBlock *&Header);

269 void severSplitPHINodesOfExits();

270 void splitReturnBlocks();

271

272 void moveCodeToFunction(Function *newFunction);

273

274 void calculateNewCallTerminatorWeights(

278

279

280

281 void normalizeCFGForExtraction(BasicBlock *&header);

282

283

284

285 Function *constructFunctionDeclaration(const ValueSet &inputs,

286 const ValueSet &outputs,

288 const Twine &Name,

289 ValueSet &StructValues,

291

292

293

294

295 void emitFunctionBody(const ValueSet &inputs, const ValueSet &outputs,

296 const ValueSet &StructValues, Function *newFunction,

298 const ValueSet &SinkingCands,

300

301

302 CallInst *emitReplacerCall(const ValueSet &inputs, const ValueSet &outputs,

303 const ValueSet &StructValues,

308 std::vector<Value *> &Reloads);

309

310

311

312 void insertReplacerCall(

316 };