1 // RUN: fir-opt --split-input-file --lower-workshare --allow-unregistered-dialect %s | FileCheck %s
4 // Check if we store the correct values
13 // CHECK-NOT: fir.alloca
16 %t1 = "test.test1"() : () -> i32
17 // CHECK: %[[T1:.*]] = "test.test1"
18 // CHECK: fir.store %[[T1]]
19 %t2 = "test.test2"() : () -> i32
20 // CHECK: %[[T2:.*]] = "test.test2"
21 // CHECK: fir.store %[[T2]]
22 %t3 = "test.test3"() : () -> i32
23 // CHECK: %[[T3:.*]] = "test.test3"
24 // CHECK-NOT: fir.store %[[T3]]
25 %t4 = "test.test4"() : () -> i32
26 // CHECK: %[[T4:.*]] = "test.test4"
27 // CHECK: fir.store %[[T4]]
28 %t5 = "test.test5"() : () -> i32
29 // CHECK: %[[T5:.*]] = "test.test5"
30 // CHECK: fir.store %[[T5]]
31 %t6 = "test.test6"() : () -> i32
32 // CHECK: %[[T6:.*]] = "test.test6"
33 // CHECK-NOT: fir.store %[[T6]]
36 "test.test1"(%t1) : (i32) -> ()
37 "test.test1"(%t2) : (i32) -> ()
38 "test.test1"(%t3) : (i32) -> ()
40 %true = arith.constant true
42 "test.test2"(%t3) : (i32) -> ()
45 %c1_i32 = arith.constant 1 : i32
47 %t5_pure_use = arith.addi %t5, %c1_i32 : i32
49 %t6_mem_effect_use = "test.test8"(%t6) : (i32) -> i32
50 // CHECK: %[[T6_USE:.*]] = "test.test8"
51 // CHECK: fir.store %[[T6_USE]]
53 %c42 = arith.constant 42 : index
54 %c1 = arith.constant 1 : index
55 omp.workshare.loop_wrapper {
56 omp.loop_nest (%arg1) : index = (%c1) to (%c42) inclusive step (%c1) {
57 "test.test10"(%t1) : (i32) -> ()
58 "test.test10"(%t5_pure_use) : (i32) -> ()
59 "test.test10"(%t6_mem_effect_use) : (i32) -> ()
64 "test.test10"(%t2) : (i32) -> ()
66 "test.test10"(%t4) : (i32) -> ()