@@ -37,12 +37,37 @@ struct VPlanTransforms {
37
37
GetIntOrFpInductionDescriptor,
38
38
ScalarEvolution &SE, const TargetLibraryInfo &TLI);
39
39
40
+ // / Sink users of fixed-order recurrences after the recipe defining their
41
+ // / previous value. Then introduce FirstOrderRecurrenceSplice VPInstructions
42
+ // / to combine the value from the recurrence phis and previous values. The
43
+ // / current implementation assumes all users can be sunk after the previous
44
+ // / value, which is enforced by earlier legality checks.
45
+ // / \returns true if all users of fixed-order recurrences could be re-arranged
46
+ // / as needed or false if it is not possible. In the latter case, \p Plan is
47
+ // / not valid.
48
+ static bool adjustFixedOrderRecurrences (VPlan &Plan, VPBuilder &Builder);
49
+
50
+ // / Clear NSW/NUW flags from reduction instructions if necessary.
51
+ static void clearReductionWrapFlags (VPlan &Plan);
52
+
53
+ // / Optimize \p Plan based on \p BestVF and \p BestUF. This may restrict the
54
+ // / resulting plan to \p BestVF and \p BestUF.
55
+ static void optimizeForVFAndUF (VPlan &Plan, ElementCount BestVF,
56
+ unsigned BestUF,
57
+ PredicatedScalarEvolution &PSE);
58
+
59
+ // / Apply VPlan-to-VPlan optimizations to \p Plan, including induction recipe
60
+ // / optimizations, dead recipe removal, replicate region optimizations and
61
+ // / block merging.
62
+ static void optimize (VPlan &Plan, ScalarEvolution &SE);
63
+
40
64
// / Wrap predicated VPReplicateRecipes with a mask operand in an if-then
41
65
// / region block and remove the mask operand. Optimize the created regions by
42
66
// / iteratively sinking scalar operands into the region, followed by merging
43
67
// / regions until no improvements are remaining.
44
68
static void createAndOptimizeReplicateRegions (VPlan &Plan);
45
69
70
+ private:
46
71
// / Remove redundant VPBasicBlocks by merging them into their predecessor if
47
72
// / the predecessor has a single successor.
48
73
static bool mergeBlocksIntoPredecessors (VPlan &Plan);
@@ -71,24 +96,6 @@ struct VPlanTransforms {
71
96
// / them with already existing recipes expanding the same SCEV expression.
72
97
static void removeRedundantExpandSCEVRecipes (VPlan &Plan);
73
98
74
- // / Sink users of fixed-order recurrences after the recipe defining their
75
- // / previous value. Then introduce FirstOrderRecurrenceSplice VPInstructions
76
- // / to combine the value from the recurrence phis and previous values. The
77
- // / current implementation assumes all users can be sunk after the previous
78
- // / value, which is enforced by earlier legality checks.
79
- // / \returns true if all users of fixed-order recurrences could be re-arranged
80
- // / as needed or false if it is not possible. In the latter case, \p Plan is
81
- // / not valid.
82
- static bool adjustFixedOrderRecurrences (VPlan &Plan, VPBuilder &Builder);
83
-
84
- // / Clear NSW/NUW flags from reduction instructions if necessary.
85
- static void clearReductionWrapFlags (VPlan &Plan);
86
-
87
- // / Optimize \p Plan based on \p BestVF and \p BestUF. This may restrict the
88
- // / resulting plan to \p BestVF and \p BestUF.
89
- static void optimizeForVFAndUF (VPlan &Plan, ElementCount BestVF,
90
- unsigned BestUF,
91
- PredicatedScalarEvolution &PSE);
92
99
};
93
100
94
101
} // namespace llvm
0 commit comments