@@ -889,23 +889,24 @@ class OMPLoopBasedDirective : public OMPExecutableDirective {
889889
890890 // / Calls the specified callback function for all the loops in \p CurStmt,
891891 // / from the outermost to the innermost.
892- static bool
893- doForAllLoops (Stmt *CurStmt, bool TryImperfectlyNestedLoops,
894- unsigned NumLoops,
895- llvm::function_ref<bool (unsigned , Stmt *)> Callback,
896- llvm::function_ref<void(OMPLoopTransformationDirective *)>
897- OnTransformationCallback);
892+ static bool doForAllLoops (
893+ Stmt *CurStmt, bool TryImperfectlyNestedLoops, unsigned NumLoops,
894+ llvm::function_ref<bool (unsigned , Stmt *)> Callback,
895+ llvm::function_ref<void(OMPCanonicalLoopNestTransformationDirective *)>
896+ OnTransformationCallback);
898897 static bool
899898 doForAllLoops (const Stmt *CurStmt, bool TryImperfectlyNestedLoops,
900899 unsigned NumLoops,
901900 llvm::function_ref<bool (unsigned , const Stmt *)> Callback,
902- llvm::function_ref<void(const OMPLoopTransformationDirective *)>
901+ llvm::function_ref<
902+ void(const OMPCanonicalLoopNestTransformationDirective *)>
903903 OnTransformationCallback) {
904904 auto &&NewCallback = [Callback](unsigned Cnt, Stmt *CurStmt) {
905905 return Callback (Cnt, CurStmt);
906906 };
907907 auto &&NewTransformCb =
908- [OnTransformationCallback](OMPLoopTransformationDirective *A) {
908+ [OnTransformationCallback](
909+ OMPCanonicalLoopNestTransformationDirective *A) {
909910 OnTransformationCallback (A);
910911 };
911912 return doForAllLoops (const_cast <Stmt *>(CurStmt), TryImperfectlyNestedLoops,
@@ -918,7 +919,7 @@ class OMPLoopBasedDirective : public OMPExecutableDirective {
918919 doForAllLoops (Stmt *CurStmt, bool TryImperfectlyNestedLoops,
919920 unsigned NumLoops,
920921 llvm::function_ref<bool (unsigned , Stmt *)> Callback) {
921- auto &&TransformCb = [](OMPLoopTransformationDirective *) {};
922+ auto &&TransformCb = [](OMPCanonicalLoopNestTransformationDirective *) {};
922923 return doForAllLoops (CurStmt, TryImperfectlyNestedLoops, NumLoops, Callback,
923924 TransformCb);
924925 }
@@ -955,19 +956,18 @@ class OMPLoopBasedDirective : public OMPExecutableDirective {
955956 }
956957};
957958
958- // / The base class for all loop transformation directives.
959- class OMPLoopTransformationDirective : public OMPLoopBasedDirective {
959+ // / The base class for all transformation directives of canonical loop nests.
960+ class OMPCanonicalLoopNestTransformationDirective
961+ : public OMPLoopBasedDirective {
960962 friend class ASTStmtReader ;
961963
962964 // / Number of loops generated by this loop transformation.
963965 unsigned NumGeneratedLoops = 0 ;
964966
965967protected:
966- explicit OMPLoopTransformationDirective (StmtClass SC,
967- OpenMPDirectiveKind Kind,
968- SourceLocation StartLoc,
969- SourceLocation EndLoc,
970- unsigned NumAssociatedLoops)
968+ explicit OMPCanonicalLoopNestTransformationDirective (
969+ StmtClass SC, OpenMPDirectiveKind Kind, SourceLocation StartLoc,
970+ SourceLocation EndLoc, unsigned NumAssociatedLoops)
971971 : OMPLoopBasedDirective(SC, Kind, StartLoc, EndLoc, NumAssociatedLoops) {}
972972
973973 // / Set the number of loops generated by this loop transformation.
@@ -5545,7 +5545,8 @@ class OMPTargetTeamsDistributeSimdDirective final : public OMPLoopDirective {
55455545};
55465546
55475547// / This represents the '#pragma omp tile' loop transformation directive.
5548- class OMPTileDirective final : public OMPLoopTransformationDirective {
5548+ class OMPTileDirective final
5549+ : public OMPCanonicalLoopNestTransformationDirective {
55495550 friend class ASTStmtReader ;
55505551 friend class OMPExecutableDirective ;
55515552
@@ -5557,9 +5558,9 @@ class OMPTileDirective final : public OMPLoopTransformationDirective {
55575558
55585559 explicit OMPTileDirective (SourceLocation StartLoc, SourceLocation EndLoc,
55595560 unsigned NumLoops)
5560- : OMPLoopTransformationDirective(OMPTileDirectiveClass,
5561- llvm::omp::OMPD_tile, StartLoc, EndLoc,
5562- NumLoops) {
5561+ : OMPCanonicalLoopNestTransformationDirective(
5562+ OMPTileDirectiveClass, llvm::omp::OMPD_tile, StartLoc, EndLoc,
5563+ NumLoops) {
55635564 setNumGeneratedLoops (2 * NumLoops);
55645565 }
55655566
@@ -5622,7 +5623,8 @@ class OMPTileDirective final : public OMPLoopTransformationDirective {
56225623};
56235624
56245625// / This represents the '#pragma omp stripe' loop transformation directive.
5625- class OMPStripeDirective final : public OMPLoopTransformationDirective {
5626+ class OMPStripeDirective final
5627+ : public OMPCanonicalLoopNestTransformationDirective {
56265628 friend class ASTStmtReader ;
56275629 friend class OMPExecutableDirective ;
56285630
@@ -5634,9 +5636,9 @@ class OMPStripeDirective final : public OMPLoopTransformationDirective {
56345636
56355637 explicit OMPStripeDirective (SourceLocation StartLoc, SourceLocation EndLoc,
56365638 unsigned NumLoops)
5637- : OMPLoopTransformationDirective(OMPStripeDirectiveClass,
5638- llvm::omp::OMPD_stripe, StartLoc, EndLoc,
5639- NumLoops) {
5639+ : OMPCanonicalLoopNestTransformationDirective(
5640+ OMPStripeDirectiveClass, llvm::omp::OMPD_stripe, StartLoc, EndLoc,
5641+ NumLoops) {
56405642 setNumGeneratedLoops (2 * NumLoops);
56415643 }
56425644
@@ -5702,7 +5704,8 @@ class OMPStripeDirective final : public OMPLoopTransformationDirective {
57025704// / #pragma omp unroll
57035705// / for (int i = 0; i < 64; ++i)
57045706// / \endcode
5705- class OMPUnrollDirective final : public OMPLoopTransformationDirective {
5707+ class OMPUnrollDirective final
5708+ : public OMPCanonicalLoopNestTransformationDirective {
57065709 friend class ASTStmtReader ;
57075710 friend class OMPExecutableDirective ;
57085711
@@ -5713,9 +5716,9 @@ class OMPUnrollDirective final : public OMPLoopTransformationDirective {
57135716 };
57145717
57155718 explicit OMPUnrollDirective (SourceLocation StartLoc, SourceLocation EndLoc)
5716- : OMPLoopTransformationDirective (OMPUnrollDirectiveClass,
5717- llvm::omp::OMPD_unroll, StartLoc, EndLoc ,
5718- 1 ) {}
5719+ : OMPCanonicalLoopNestTransformationDirective (OMPUnrollDirectiveClass,
5720+ llvm::omp::OMPD_unroll,
5721+ StartLoc, EndLoc, 1 ) {}
57195722
57205723 // / Set the pre-init statements.
57215724 void setPreInits (Stmt *PreInits) {
@@ -5776,7 +5779,8 @@ class OMPUnrollDirective final : public OMPLoopTransformationDirective {
57765779// / for (int i = 0; i < n; ++i)
57775780// / ...
57785781// / \endcode
5779- class OMPReverseDirective final : public OMPLoopTransformationDirective {
5782+ class OMPReverseDirective final
5783+ : public OMPCanonicalLoopNestTransformationDirective {
57805784 friend class ASTStmtReader ;
57815785 friend class OMPExecutableDirective ;
57825786
@@ -5788,9 +5792,9 @@ class OMPReverseDirective final : public OMPLoopTransformationDirective {
57885792
57895793 explicit OMPReverseDirective (SourceLocation StartLoc, SourceLocation EndLoc,
57905794 unsigned NumLoops)
5791- : OMPLoopTransformationDirective(OMPReverseDirectiveClass,
5792- llvm::omp::OMPD_reverse, StartLoc,
5793- EndLoc, NumLoops) {
5795+ : OMPCanonicalLoopNestTransformationDirective(
5796+ OMPReverseDirectiveClass, llvm::omp::OMPD_reverse, StartLoc, EndLoc ,
5797+ NumLoops) {
57945798 setNumGeneratedLoops (NumLoops);
57955799 }
57965800
@@ -5848,7 +5852,8 @@ class OMPReverseDirective final : public OMPLoopTransformationDirective {
58485852// / for (int j = 0; j < n; ++j)
58495853// / ..
58505854// / \endcode
5851- class OMPInterchangeDirective final : public OMPLoopTransformationDirective {
5855+ class OMPInterchangeDirective final
5856+ : public OMPCanonicalLoopNestTransformationDirective {
58525857 friend class ASTStmtReader ;
58535858 friend class OMPExecutableDirective ;
58545859
@@ -5860,9 +5865,9 @@ class OMPInterchangeDirective final : public OMPLoopTransformationDirective {
58605865
58615866 explicit OMPInterchangeDirective (SourceLocation StartLoc,
58625867 SourceLocation EndLoc, unsigned NumLoops)
5863- : OMPLoopTransformationDirective(OMPInterchangeDirectiveClass,
5864- llvm::omp::OMPD_interchange, StartLoc,
5865- EndLoc, NumLoops) {
5868+ : OMPCanonicalLoopNestTransformationDirective(
5869+ OMPInterchangeDirectiveClass, llvm::omp::OMPD_interchange, StartLoc,
5870+ EndLoc, NumLoops) {
58665871 setNumGeneratedLoops (NumLoops);
58675872 }
58685873
0 commit comments