@@ -1580,10 +1580,11 @@ func.func @omp_cancellationpoint2() {
1580
1580
func.func @taskloop (%lb: i32 , %ub: i32 , %step: i32 ) {
1581
1581
%testmemref = " test.memref" () : () -> (memref <i32 >)
1582
1582
// expected-error @below {{expected equal sizes for allocate and allocator variables}}
1583
- " omp.taskloop" (%lb , %ub , %ub , %lb , %step , %step , %testmemref ) ({
1584
- ^bb0 (%arg3: i32 , %arg4: i32 ):
1585
- " omp.terminator" () : () -> ()
1586
- }) {operandSegmentSizes = array<i32 : 2 , 2 , 2 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 >} : (i32 , i32 , i32 , i32 , i32 , i32 , memref <i32 >) -> ()
1583
+ " omp.taskloop" (%testmemref ) ({
1584
+ omp.loop_nest (%i , %j ) : i32 = (%lb , %ub ) to (%ub , %lb ) step (%step , %step ) {
1585
+ omp.yield
1586
+ }
1587
+ }) {operandSegmentSizes = array<i32 : 0 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 >} : (memref <i32 >) -> ()
1587
1588
return
1588
1589
}
1589
1590
@@ -1593,23 +1594,24 @@ func.func @taskloop(%lb: i32, %ub: i32, %step: i32) {
1593
1594
%testf32 = " test.f32" () : () -> (!llvm.ptr )
1594
1595
%testf32_2 = " test.f32" () : () -> (!llvm.ptr )
1595
1596
// expected-error @below {{expected as many reduction symbol references as reduction variables}}
1596
- " omp.taskloop" (%lb , %ub , %ub , %lb , %step , %step , %testf32 , %testf32_2 ) ({
1597
- ^bb0 (%arg3: i32 , %arg4: i32 ):
1598
- " omp.terminator" () : () -> ()
1599
- }) {operandSegmentSizes = array<i32 : 2 , 2 , 2 , 0 , 0 , 0 , 2 , 0 , 0 , 0 , 0 , 0 >, reductions = [@add_f32 ]} : (i32 , i32 , i32 , i32 , i32 , i32 , !llvm.ptr , !llvm.ptr ) -> ()
1597
+ " omp.taskloop" (%testf32 , %testf32_2 ) ({
1598
+ omp.loop_nest (%i , %j ) : i32 = (%lb , %ub ) to (%ub , %lb ) step (%step , %step ) {
1599
+ omp.yield
1600
+ }
1601
+ }) {operandSegmentSizes = array<i32 : 0 , 0 , 0 , 2 , 0 , 0 , 0 , 0 , 0 >, reductions = [@add_f32 ]} : (!llvm.ptr , !llvm.ptr ) -> ()
1600
1602
return
1601
1603
}
1602
1604
1603
1605
// -----
1604
1606
1605
1607
func.func @taskloop (%lb: i32 , %ub: i32 , %step: i32 ) {
1606
1608
%testf32 = " test.f32" () : () -> (!llvm.ptr )
1607
- %testf32_2 = " test.f32" () : () -> (!llvm.ptr )
1608
1609
// expected-error @below {{expected as many reduction symbol references as reduction variables}}
1609
- " omp.taskloop" (%lb , %ub , %ub , %lb , %step , %step , %testf32 ) ({
1610
- ^bb0 (%arg3: i32 , %arg4: i32 ):
1611
- " omp.terminator" () : () -> ()
1612
- }) {operandSegmentSizes = array<i32 : 2 , 2 , 2 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 0 >, reductions = [@add_f32 , @add_f32 ]} : (i32 , i32 , i32 , i32 , i32 , i32 , !llvm.ptr ) -> ()
1610
+ " omp.taskloop" (%testf32 ) ({
1611
+ omp.loop_nest (%i , %j ) : i32 = (%lb , %ub ) to (%ub , %lb ) step (%step , %step ) {
1612
+ omp.yield
1613
+ }
1614
+ }) {operandSegmentSizes = array<i32 : 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 0 >, reductions = [@add_f32 , @add_f32 ]} : (!llvm.ptr ) -> ()
1613
1615
return
1614
1616
}
1615
1617
@@ -1619,23 +1621,24 @@ func.func @taskloop(%lb: i32, %ub: i32, %step: i32) {
1619
1621
%testf32 = " test.f32" () : () -> (!llvm.ptr )
1620
1622
%testf32_2 = " test.f32" () : () -> (!llvm.ptr )
1621
1623
// expected-error @below {{expected as many reduction symbol references as reduction variables}}
1622
- " omp.taskloop" (%lb , %ub , %ub , %lb , %step , %step , %testf32 , %testf32_2 ) ({
1623
- ^bb0 (%arg3: i32 , %arg4: i32 ):
1624
- " omp.terminator" () : () -> ()
1625
- }) {in_reductions = [@add_f32 ], operandSegmentSizes = array<i32 : 2 , 2 , 2 , 0 , 0 , 2 , 0 , 0 , 0 , 0 , 0 , 0 >} : (i32 , i32 , i32 , i32 , i32 , i32 , !llvm.ptr , !llvm.ptr ) -> ()
1624
+ " omp.taskloop" (%testf32 , %testf32_2 ) ({
1625
+ omp.loop_nest (%i , %j ) : i32 = (%lb , %ub ) to (%ub , %lb ) step (%step , %step ) {
1626
+ omp.yield
1627
+ }
1628
+ }) {in_reductions = [@add_f32 ], operandSegmentSizes = array<i32 : 0 , 0 , 2 , 0 , 0 , 0 , 0 , 0 , 0 >} : (!llvm.ptr , !llvm.ptr ) -> ()
1626
1629
return
1627
1630
}
1628
1631
1629
1632
// -----
1630
1633
1631
1634
func.func @taskloop (%lb: i32 , %ub: i32 , %step: i32 ) {
1632
1635
%testf32 = " test.f32" () : () -> (!llvm.ptr )
1633
- %testf32_2 = " test.f32" () : () -> (!llvm.ptr )
1634
1636
// expected-error @below {{expected as many reduction symbol references as reduction variables}}
1635
- " omp.taskloop" (%lb , %ub , %ub , %lb , %step , %step , %testf32_2 ) ({
1636
- ^bb0 (%arg3: i32 , %arg4: i32 ):
1637
- " omp.terminator" () : () -> ()
1638
- }) {in_reductions = [@add_f32 , @add_f32 ], operandSegmentSizes = array<i32 : 2 , 2 , 2 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 >} : (i32 , i32 , i32 , i32 , i32 , i32 , !llvm.ptr ) -> ()
1637
+ " omp.taskloop" (%testf32 ) ({
1638
+ omp.loop_nest (%i , %j ) : i32 = (%lb , %ub ) to (%ub , %lb ) step (%step , %step ) {
1639
+ omp.yield
1640
+ }
1641
+ }) {in_reductions = [@add_f32 , @add_f32 ], operandSegmentSizes = array<i32 : 0 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 >} : (!llvm.ptr ) -> ()
1639
1642
return
1640
1643
}
1641
1644
@@ -1657,9 +1660,10 @@ func.func @taskloop(%lb: i32, %ub: i32, %step: i32) {
1657
1660
%testf32 = " test.f32" () : () -> (!llvm.ptr )
1658
1661
%testf32_2 = " test.f32" () : () -> (!llvm.ptr )
1659
1662
// expected-error @below {{if a reduction clause is present on the taskloop directive, the nogroup clause must not be specified}}
1660
- omp.taskloop reduction (@add_f32 -> %testf32 : !llvm.ptr , @add_f32 -> %testf32_2 : !llvm.ptr ) nogroup
1661
- for (%i , %j ) : i32 = (%lb , %ub ) to (%ub , %lb ) step (%step , %step ) {
1662
- omp.terminator
1663
+ omp.taskloop reduction (@add_f32 -> %testf32 : !llvm.ptr , @add_f32 -> %testf32_2 : !llvm.ptr ) nogroup {
1664
+ omp.loop_nest (%i , %j ) : i32 = (%lb , %ub ) to (%ub , %lb ) step (%step , %step ) {
1665
+ omp.yield
1666
+ }
1663
1667
}
1664
1668
return
1665
1669
}
@@ -1681,9 +1685,10 @@ combiner {
1681
1685
func.func @taskloop (%lb: i32 , %ub: i32 , %step: i32 ) {
1682
1686
%testf32 = " test.f32" () : () -> (!llvm.ptr )
1683
1687
// expected-error @below {{the same list item cannot appear in both a reduction and an in_reduction clause}}
1684
- omp.taskloop reduction (@add_f32 -> %testf32 : !llvm.ptr ) in_reduction (@add_f32 -> %testf32 : !llvm.ptr )
1685
- for (%i , %j ) : i32 = (%lb , %ub ) to (%ub , %lb ) step (%step , %step ) {
1686
- omp.terminator
1688
+ omp.taskloop reduction (@add_f32 -> %testf32 : !llvm.ptr ) in_reduction (@add_f32 -> %testf32 : !llvm.ptr ) {
1689
+ omp.loop_nest (%i , %j ) : i32 = (%lb , %ub ) to (%ub , %lb ) step (%step , %step ) {
1690
+ omp.yield
1691
+ }
1687
1692
}
1688
1693
return
1689
1694
}
@@ -1693,15 +1698,42 @@ func.func @taskloop(%lb: i32, %ub: i32, %step: i32) {
1693
1698
func.func @taskloop (%lb: i32 , %ub: i32 , %step: i32 ) {
1694
1699
%testi64 = " test.i64" () : () -> (i64 )
1695
1700
// expected-error @below {{the grainsize clause and num_tasks clause are mutually exclusive and may not appear on the same taskloop directive}}
1696
- omp.taskloop grain_size (%testi64: i64 ) num_tasks (%testi64: i64 )
1697
- for (%i , %j ) : i32 = (%lb , %ub ) to (%ub , %lb ) step (%step , %step ) {
1701
+ omp.taskloop grain_size (%testi64: i64 ) num_tasks (%testi64: i64 ) {
1702
+ omp.loop_nest (%i , %j ) : i32 = (%lb , %ub ) to (%ub , %lb ) step (%step , %step ) {
1703
+ omp.yield
1704
+ }
1705
+ }
1706
+ return
1707
+ }
1708
+
1709
+ // -----
1710
+
1711
+ func.func @taskloop (%lb: i32 , %ub: i32 , %step: i32 ) {
1712
+ // expected-error @below {{op must be a loop wrapper}}
1713
+ omp.taskloop {
1714
+ %0 = arith.constant 0 : i32
1698
1715
omp.terminator
1699
1716
}
1700
1717
return
1701
1718
}
1702
1719
1703
1720
// -----
1704
1721
1722
+ func.func @taskloop (%lb: i32 , %ub: i32 , %step: i32 ) {
1723
+ // expected-error @below {{only supported nested wrapper is 'omp.simdloop'}}
1724
+ omp.taskloop {
1725
+ omp.distribute {
1726
+ omp.loop_nest (%iv ) : i32 = (%lb ) to (%ub ) step (%step ) {
1727
+ omp.yield
1728
+ }
1729
+ omp.terminator
1730
+ }
1731
+ }
1732
+ return
1733
+ }
1734
+
1735
+ // -----
1736
+
1705
1737
func.func @omp_threadprivate () {
1706
1738
%1 = llvm.mlir.addressof @_QFsubEx : !llvm.ptr
1707
1739
// expected-error @below {{op failed to verify that all of {sym_addr, tls_addr} have same type}}
0 commit comments