Skip to content

Commit fa658ac

Browse files
authored
[Transforms][NFC] Remove second CodeExtractor constructor
This only has a single use and is equally well served by the existing constructor -- blocks of a loop are already an array. Pull Request: #103399
1 parent dfa488b commit fa658ac

File tree

3 files changed

+1
-24
lines changed

3 files changed

+1
-24
lines changed

llvm/include/llvm/Transforms/Utils/CodeExtractor.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ class CallInst;
3232
class DominatorTree;
3333
class Function;
3434
class Instruction;
35-
class Loop;
3635
class Module;
3736
class Type;
3837
class Value;
@@ -143,16 +142,6 @@ class CodeExtractorAnalysisCache {
143142
BasicBlock *AllocationBlock = nullptr,
144143
std::string Suffix = "", bool ArgsInZeroAddressSpace = false);
145144

146-
/// Create a code extractor for a loop body.
147-
///
148-
/// Behaves just like the generic code sequence constructor, but uses the
149-
/// block sequence of the loop.
150-
CodeExtractor(DominatorTree &DT, Loop &L, bool AggregateArgs = false,
151-
BlockFrequencyInfo *BFI = nullptr,
152-
BranchProbabilityInfo *BPI = nullptr,
153-
AssumptionCache *AC = nullptr,
154-
std::string Suffix = "");
155-
156145
/// Perform the extraction, returning the new function.
157146
///
158147
/// Returns zero when called on a CodeExtractor instance where isEligible

llvm/lib/Transforms/IPO/LoopExtractor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ bool LoopExtractor::extractLoop(Loop *L, LoopInfo &LI, DominatorTree &DT) {
241241
Function &Func = *L->getHeader()->getParent();
242242
AssumptionCache *AC = LookupAssumptionCache(Func);
243243
CodeExtractorAnalysisCache CEAC(Func);
244-
CodeExtractor Extractor(DT, *L, false, nullptr, nullptr, AC);
244+
CodeExtractor Extractor(L->getBlocks(), &DT, false, nullptr, nullptr, AC);
245245
if (Extractor.extractCodeRegion(CEAC)) {
246246
LI.erase(L);
247247
--NumLoops;

llvm/lib/Transforms/Utils/CodeExtractor.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
#include "llvm/Analysis/BlockFrequencyInfo.h"
2424
#include "llvm/Analysis/BlockFrequencyInfoImpl.h"
2525
#include "llvm/Analysis/BranchProbabilityInfo.h"
26-
#include "llvm/Analysis/LoopInfo.h"
2726
#include "llvm/IR/Argument.h"
2827
#include "llvm/IR/Attributes.h"
2928
#include "llvm/IR/BasicBlock.h"
@@ -253,17 +252,6 @@ CodeExtractor::CodeExtractor(ArrayRef<BasicBlock *> BBs, DominatorTree *DT,
253252
Blocks(buildExtractionBlockSet(BBs, DT, AllowVarArgs, AllowAlloca)),
254253
Suffix(Suffix), ArgsInZeroAddressSpace(ArgsInZeroAddressSpace) {}
255254

256-
CodeExtractor::CodeExtractor(DominatorTree &DT, Loop &L, bool AggregateArgs,
257-
BlockFrequencyInfo *BFI,
258-
BranchProbabilityInfo *BPI, AssumptionCache *AC,
259-
std::string Suffix)
260-
: DT(&DT), AggregateArgs(AggregateArgs || AggregateArgsOpt), BFI(BFI),
261-
BPI(BPI), AC(AC), AllocationBlock(nullptr), AllowVarArgs(false),
262-
Blocks(buildExtractionBlockSet(L.getBlocks(), &DT,
263-
/* AllowVarArgs */ false,
264-
/* AllowAlloca */ false)),
265-
Suffix(Suffix) {}
266-
267255
/// definedInRegion - Return true if the specified value is defined in the
268256
/// extracted region.
269257
static bool definedInRegion(const SetVector<BasicBlock *> &Blocks, Value *V) {

0 commit comments

Comments
 (0)