forked from OSchip/llvm-project
[NFC] Remove redundant `struct` prefix
Reviewed By: SjoerdMeijer, fhahn Differential Revision: https://reviews.llvm.org/D99251
This commit is contained in:
parent
b6c4b280a0
commit
8fde25b3c3
|
@ -190,8 +190,7 @@ static bool findLoopComponents(
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool checkPHIs(struct FlattenInfo &FI,
|
static bool checkPHIs(FlattenInfo &FI, const TargetTransformInfo *TTI) {
|
||||||
const TargetTransformInfo *TTI) {
|
|
||||||
// All PHIs in the inner and outer headers must either be:
|
// All PHIs in the inner and outer headers must either be:
|
||||||
// - The induction PHI, which we are going to rewrite as one induction in
|
// - The induction PHI, which we are going to rewrite as one induction in
|
||||||
// the new loop. This is already checked by findLoopComponents.
|
// the new loop. This is already checked by findLoopComponents.
|
||||||
|
@ -272,7 +271,7 @@ static bool checkPHIs(struct FlattenInfo &FI,
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
checkOuterLoopInsts(struct FlattenInfo &FI,
|
checkOuterLoopInsts(FlattenInfo &FI,
|
||||||
SmallPtrSetImpl<Instruction *> &IterationInstructions,
|
SmallPtrSetImpl<Instruction *> &IterationInstructions,
|
||||||
const TargetTransformInfo *TTI) {
|
const TargetTransformInfo *TTI) {
|
||||||
// Check for instructions in the outer but not inner loop. If any of these
|
// Check for instructions in the outer but not inner loop. If any of these
|
||||||
|
@ -330,7 +329,7 @@ checkOuterLoopInsts(struct FlattenInfo &FI,
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool checkIVUsers(struct FlattenInfo &FI) {
|
static bool checkIVUsers(FlattenInfo &FI) {
|
||||||
// We require all uses of both induction variables to match this pattern:
|
// We require all uses of both induction variables to match this pattern:
|
||||||
//
|
//
|
||||||
// (OuterPHI * InnerLimit) + InnerPHI
|
// (OuterPHI * InnerLimit) + InnerPHI
|
||||||
|
@ -426,8 +425,8 @@ static bool checkIVUsers(struct FlattenInfo &FI) {
|
||||||
|
|
||||||
// Return an OverflowResult dependant on if overflow of the multiplication of
|
// Return an OverflowResult dependant on if overflow of the multiplication of
|
||||||
// InnerLimit and OuterLimit can be assumed not to happen.
|
// InnerLimit and OuterLimit can be assumed not to happen.
|
||||||
static OverflowResult checkOverflow(struct FlattenInfo &FI,
|
static OverflowResult checkOverflow(FlattenInfo &FI, DominatorTree *DT,
|
||||||
DominatorTree *DT, AssumptionCache *AC) {
|
AssumptionCache *AC) {
|
||||||
Function *F = FI.OuterLoop->getHeader()->getParent();
|
Function *F = FI.OuterLoop->getHeader()->getParent();
|
||||||
const DataLayout &DL = F->getParent()->getDataLayout();
|
const DataLayout &DL = F->getParent()->getDataLayout();
|
||||||
|
|
||||||
|
@ -465,9 +464,9 @@ static OverflowResult checkOverflow(struct FlattenInfo &FI,
|
||||||
return OverflowResult::MayOverflow;
|
return OverflowResult::MayOverflow;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool CanFlattenLoopPair(struct FlattenInfo &FI, DominatorTree *DT,
|
static bool CanFlattenLoopPair(FlattenInfo &FI, DominatorTree *DT, LoopInfo *LI,
|
||||||
LoopInfo *LI, ScalarEvolution *SE,
|
ScalarEvolution *SE, AssumptionCache *AC,
|
||||||
AssumptionCache *AC, const TargetTransformInfo *TTI) {
|
const TargetTransformInfo *TTI) {
|
||||||
SmallPtrSet<Instruction *, 8> IterationInstructions;
|
SmallPtrSet<Instruction *, 8> IterationInstructions;
|
||||||
if (!findLoopComponents(FI.InnerLoop, IterationInstructions, FI.InnerInductionPHI,
|
if (!findLoopComponents(FI.InnerLoop, IterationInstructions, FI.InnerInductionPHI,
|
||||||
FI.InnerLimit, FI.InnerIncrement, FI.InnerBranch, SE))
|
FI.InnerLimit, FI.InnerIncrement, FI.InnerBranch, SE))
|
||||||
|
@ -509,9 +508,8 @@ static bool CanFlattenLoopPair(struct FlattenInfo &FI, DominatorTree *DT,
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool DoFlattenLoopPair(struct FlattenInfo &FI, DominatorTree *DT,
|
static bool DoFlattenLoopPair(FlattenInfo &FI, DominatorTree *DT, LoopInfo *LI,
|
||||||
LoopInfo *LI, ScalarEvolution *SE,
|
ScalarEvolution *SE, AssumptionCache *AC,
|
||||||
AssumptionCache *AC,
|
|
||||||
const TargetTransformInfo *TTI) {
|
const TargetTransformInfo *TTI) {
|
||||||
Function *F = FI.OuterLoop->getHeader()->getParent();
|
Function *F = FI.OuterLoop->getHeader()->getParent();
|
||||||
LLVM_DEBUG(dbgs() << "Checks all passed, doing the transformation\n");
|
LLVM_DEBUG(dbgs() << "Checks all passed, doing the transformation\n");
|
||||||
|
@ -572,9 +570,9 @@ static bool DoFlattenLoopPair(struct FlattenInfo &FI, DominatorTree *DT,
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool CanWidenIV(struct FlattenInfo &FI, DominatorTree *DT,
|
static bool CanWidenIV(FlattenInfo &FI, DominatorTree *DT, LoopInfo *LI,
|
||||||
LoopInfo *LI, ScalarEvolution *SE,
|
ScalarEvolution *SE, AssumptionCache *AC,
|
||||||
AssumptionCache *AC, const TargetTransformInfo *TTI) {
|
const TargetTransformInfo *TTI) {
|
||||||
if (!WidenIV) {
|
if (!WidenIV) {
|
||||||
LLVM_DEBUG(dbgs() << "Widening the IVs is disabled\n");
|
LLVM_DEBUG(dbgs() << "Widening the IVs is disabled\n");
|
||||||
return false;
|
return false;
|
||||||
|
@ -622,9 +620,8 @@ static bool CanWidenIV(struct FlattenInfo &FI, DominatorTree *DT,
|
||||||
return CanFlattenLoopPair(FI, DT, LI, SE, AC, TTI);
|
return CanFlattenLoopPair(FI, DT, LI, SE, AC, TTI);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool FlattenLoopPair(struct FlattenInfo &FI, DominatorTree *DT,
|
static bool FlattenLoopPair(FlattenInfo &FI, DominatorTree *DT, LoopInfo *LI,
|
||||||
LoopInfo *LI, ScalarEvolution *SE,
|
ScalarEvolution *SE, AssumptionCache *AC,
|
||||||
AssumptionCache *AC,
|
|
||||||
const TargetTransformInfo *TTI) {
|
const TargetTransformInfo *TTI) {
|
||||||
LLVM_DEBUG(
|
LLVM_DEBUG(
|
||||||
dbgs() << "Loop flattening running on outer loop "
|
dbgs() << "Loop flattening running on outer loop "
|
||||||
|
@ -664,7 +661,7 @@ bool Flatten(DominatorTree *DT, LoopInfo *LI, ScalarEvolution *SE,
|
||||||
auto *OuterLoop = InnerLoop->getParentLoop();
|
auto *OuterLoop = InnerLoop->getParentLoop();
|
||||||
if (!OuterLoop)
|
if (!OuterLoop)
|
||||||
continue;
|
continue;
|
||||||
struct FlattenInfo FI(OuterLoop, InnerLoop);
|
FlattenInfo FI(OuterLoop, InnerLoop);
|
||||||
Changed |= FlattenLoopPair(FI, DT, LI, SE, AC, TTI);
|
Changed |= FlattenLoopPair(FI, DT, LI, SE, AC, TTI);
|
||||||
}
|
}
|
||||||
return Changed;
|
return Changed;
|
||||||
|
|
Loading…
Reference in New Issue