@@ -1760,6 +1760,18 @@ static LogicalResult verifyPrivateVarList(OpType &op) {
1760
1760
}
1761
1761
1762
1762
LogicalResult ParallelOp::verify () {
1763
+ if (getAllocateVars ().size () != getAllocatorVars ().size ())
1764
+ return emitError (
1765
+ " expected equal sizes for allocate and allocator variables" );
1766
+
1767
+ if (failed (verifyPrivateVarList (*this )))
1768
+ return failure ();
1769
+
1770
+ return verifyReductionVarList (*this , getReductionSyms (), getReductionVars (),
1771
+ getReductionByref ());
1772
+ }
1773
+
1774
+ LogicalResult ParallelOp::verifyRegions () {
1763
1775
auto distributeChildOps = getOps<DistributeOp>();
1764
1776
if (!distributeChildOps.empty ()) {
1765
1777
if (!isComposite ())
@@ -1780,16 +1792,7 @@ LogicalResult ParallelOp::verify() {
1780
1792
return emitError ()
1781
1793
<< " 'omp.composite' attribute present in non-composite operation" ;
1782
1794
}
1783
-
1784
- if (getAllocateVars ().size () != getAllocatorVars ().size ())
1785
- return emitError (
1786
- " expected equal sizes for allocate and allocator variables" );
1787
-
1788
- if (failed (verifyPrivateVarList (*this )))
1789
- return failure ();
1790
-
1791
- return verifyReductionVarList (*this , getReductionSyms (), getReductionVars (),
1792
- getReductionByref ());
1795
+ return success ();
1793
1796
}
1794
1797
1795
1798
// ===----------------------------------------------------------------------===//
@@ -1979,6 +1982,11 @@ void WsloopOp::build(OpBuilder &builder, OperationState &state,
1979
1982
}
1980
1983
1981
1984
LogicalResult WsloopOp::verify () {
1985
+ return verifyReductionVarList (*this , getReductionSyms (), getReductionVars (),
1986
+ getReductionByref ());
1987
+ }
1988
+
1989
+ LogicalResult WsloopOp::verifyRegions () {
1982
1990
bool isCompositeChildLeaf =
1983
1991
llvm::dyn_cast_if_present<LoopWrapperInterface>((*this )->getParentOp ());
1984
1992
@@ -2000,8 +2008,7 @@ LogicalResult WsloopOp::verify() {
2000
2008
<< " 'omp.composite' attribute missing from composite wrapper" ;
2001
2009
}
2002
2010
2003
- return verifyReductionVarList (*this , getReductionSyms (), getReductionVars (),
2004
- getReductionByref ());
2011
+ return success ();
2005
2012
}
2006
2013
2007
2014
// ===----------------------------------------------------------------------===//
@@ -2037,9 +2044,6 @@ LogicalResult SimdOp::verify() {
2037
2044
if (verifyNontemporalClause (*this , getNontemporalVars ()).failed ())
2038
2045
return failure ();
2039
2046
2040
- if (getNestedWrapper ())
2041
- return emitOpError () << " must wrap an 'omp.loop_nest' directly" ;
2042
-
2043
2047
bool isCompositeChildLeaf =
2044
2048
llvm::dyn_cast_if_present<LoopWrapperInterface>((*this )->getParentOp ());
2045
2049
@@ -2054,6 +2058,13 @@ LogicalResult SimdOp::verify() {
2054
2058
return success ();
2055
2059
}
2056
2060
2061
+ LogicalResult SimdOp::verifyRegions () {
2062
+ if (getNestedWrapper ())
2063
+ return emitOpError () << " must wrap an 'omp.loop_nest' directly" ;
2064
+
2065
+ return success ();
2066
+ }
2067
+
2057
2068
// ===----------------------------------------------------------------------===//
2058
2069
// Distribute construct [2.9.4.1]
2059
2070
// ===----------------------------------------------------------------------===//
@@ -2076,6 +2087,10 @@ LogicalResult DistributeOp::verify() {
2076
2087
return emitError (
2077
2088
" expected equal sizes for allocate and allocator variables" );
2078
2089
2090
+ return success ();
2091
+ }
2092
+
2093
+ LogicalResult DistributeOp::verifyRegions () {
2079
2094
if (LoopWrapperInterface nested = getNestedWrapper ()) {
2080
2095
if (!isComposite ())
2081
2096
return emitError ()
@@ -2281,6 +2296,10 @@ LogicalResult TaskloopOp::verify() {
2281
2296
" may not appear on the same taskloop directive" );
2282
2297
}
2283
2298
2299
+ return success ();
2300
+ }
2301
+
2302
+ LogicalResult TaskloopOp::verifyRegions () {
2284
2303
if (LoopWrapperInterface nested = getNestedWrapper ()) {
2285
2304
if (!isComposite ())
2286
2305
return emitError ()
@@ -2725,7 +2744,7 @@ void PrivateClauseOp::build(OpBuilder &odsBuilder, OperationState &odsState,
2725
2744
DataSharingClauseType::Private));
2726
2745
}
2727
2746
2728
- LogicalResult PrivateClauseOp::verify () {
2747
+ LogicalResult PrivateClauseOp::verifyRegions () {
2729
2748
Type symType = getType ();
2730
2749
2731
2750
auto verifyTerminator = [&](Operation *terminator,
0 commit comments