@@ -1546,6 +1546,9 @@ LogicalResult ParallelOp::verify() {
1546
1546
if (!isWrapper ())
1547
1547
return emitOpError () << " must take a loop wrapper role if nested inside "
1548
1548
" of 'omp.distribute'" ;
1549
+ if (!llvm::cast<ComposableOpInterface>(getOperation ()).isComposite ())
1550
+ return emitError ()
1551
+ << " 'omp.composite' attribute missing from composite wrapper" ;
1549
1552
1550
1553
if (LoopWrapperInterface nested = getNestedWrapper ()) {
1551
1554
// Check for the allowed leaf constructs that may appear in a composite
@@ -1555,6 +1558,9 @@ LogicalResult ParallelOp::verify() {
1555
1558
} else {
1556
1559
return emitOpError () << " must not wrap an 'omp.loop_nest' directly" ;
1557
1560
}
1561
+ } else if (llvm::cast<ComposableOpInterface>(getOperation ()).isComposite ()) {
1562
+ return emitError ()
1563
+ << " 'omp.composite' attribute present in non-composite wrapper" ;
1558
1564
}
1559
1565
1560
1566
if (getAllocateVars ().size () != getAllocatorVars ().size ())
@@ -1749,10 +1755,18 @@ LogicalResult WsloopOp::verify() {
1749
1755
return emitOpError () << " must be a loop wrapper" ;
1750
1756
1751
1757
if (LoopWrapperInterface nested = getNestedWrapper ()) {
1758
+ if (!llvm::cast<ComposableOpInterface>(getOperation ()).isComposite ())
1759
+ return emitError ()
1760
+ << " 'omp.composite' attribute missing from composite wrapper" ;
1761
+
1752
1762
// Check for the allowed leaf constructs that may appear in a composite
1753
1763
// construct directly after DO/FOR.
1754
1764
if (!isa<SimdOp>(nested))
1755
1765
return emitError () << " only supported nested wrapper is 'omp.simd'" ;
1766
+
1767
+ } else if (llvm::cast<ComposableOpInterface>(getOperation ()).isComposite ()) {
1768
+ return emitError ()
1769
+ << " 'omp.composite' attribute present in non-composite wrapper" ;
1756
1770
}
1757
1771
1758
1772
return verifyReductionVarList (*this , getReductionSyms (), getReductionVars (),
@@ -1796,6 +1810,10 @@ LogicalResult SimdOp::verify() {
1796
1810
if (getNestedWrapper ())
1797
1811
return emitOpError () << " must wrap an 'omp.loop_nest' directly" ;
1798
1812
1813
+ if (llvm::cast<ComposableOpInterface>(getOperation ()).isComposite ())
1814
+ return emitError ()
1815
+ << " 'omp.composite' attribute present in non-composite wrapper" ;
1816
+
1799
1817
return success ();
1800
1818
}
1801
1819
@@ -1825,11 +1843,17 @@ LogicalResult DistributeOp::verify() {
1825
1843
return emitOpError () << " must be a loop wrapper" ;
1826
1844
1827
1845
if (LoopWrapperInterface nested = getNestedWrapper ()) {
1846
+ if (!llvm::cast<ComposableOpInterface>(getOperation ()).isComposite ())
1847
+ return emitError ()
1848
+ << " 'omp.composite' attribute missing from composite wrapper" ;
1828
1849
// Check for the allowed leaf constructs that may appear in a composite
1829
1850
// construct directly after DISTRIBUTE.
1830
1851
if (!isa<ParallelOp, SimdOp>(nested))
1831
1852
return emitError () << " only supported nested wrappers are 'omp.parallel' "
1832
1853
" and 'omp.simd'" ;
1854
+ } else if (llvm::cast<ComposableOpInterface>(getOperation ()).isComposite ()) {
1855
+ return emitError ()
1856
+ << " 'omp.composite' attribute present in non-composite wrapper" ;
1833
1857
}
1834
1858
1835
1859
return success ();
@@ -2031,11 +2055,19 @@ LogicalResult TaskloopOp::verify() {
2031
2055
return emitOpError () << " must be a loop wrapper" ;
2032
2056
2033
2057
if (LoopWrapperInterface nested = getNestedWrapper ()) {
2058
+ if (!llvm::cast<ComposableOpInterface>(getOperation ()).isComposite ())
2059
+ return emitError ()
2060
+ << " 'omp.composite' attribute missing from composite wrapper" ;
2061
+
2034
2062
// Check for the allowed leaf constructs that may appear in a composite
2035
2063
// construct directly after TASKLOOP.
2036
2064
if (!isa<SimdOp>(nested))
2037
2065
return emitError () << " only supported nested wrapper is 'omp.simd'" ;
2066
+ } else if (llvm::cast<ComposableOpInterface>(getOperation ()).isComposite ()) {
2067
+ return emitError ()
2068
+ << " 'omp.composite' attribute present in non-composite wrapper" ;
2038
2069
}
2070
+
2039
2071
return success ();
2040
2072
}
2041
2073
0 commit comments