Lines Matching refs:complex
1 // Test regrouping of + and - operations on complex components into complex operations
6 func.func @add(%z: !fir.ref<!fir.complex<8>>, %z1 : !fir.complex<8>, %z2 : !fir.complex<8>) {
9 %real1 = fir.extract_value %z1, [0 : index] : (!fir.complex<8>) -> f64
10 %imag1 = fir.extract_value %z1, [1 : index] : (!fir.complex<8>) -> f64
11 %real2 = fir.extract_value %z2, [0 : index] : (!fir.complex<8>) -> f64
12 %imag2 = fir.extract_value %z2, [1 : index] : (!fir.complex<8>) -> f64
17 %undef = fir.undefined !fir.complex<8>
18 …sert_real = fir.insert_value %undef, %real, [0 : index] : (!fir.complex<8>, f64) -> !fir.complex<8>
19 …mag = fir.insert_value %insert_real, %imag, [1 : index] : (!fir.complex<8>, f64) -> !fir.complex<8>
20 fir.store %insert_imag to %z : !fir.ref<!fir.complex<8>>
25 func.func @sub(%z: !fir.ref<!fir.complex<8>>, %z1 : !fir.complex<8>, %z2 : !fir.complex<8>) {
28 %real1 = fir.extract_value %z1, [0 : index] : (!fir.complex<8>) -> f64
29 %imag1 = fir.extract_value %z1, [1 : index] : (!fir.complex<8>) -> f64
30 %real2 = fir.extract_value %z2, [0 : index] : (!fir.complex<8>) -> f64
31 %imag2 = fir.extract_value %z2, [1 : index] : (!fir.complex<8>) -> f64
36 %undef = fir.undefined !fir.complex<8>
37 …sert_real = fir.insert_value %undef, %real, [0 : index] : (!fir.complex<8>, f64) -> !fir.complex<8>
38 …mag = fir.insert_value %insert_real, %imag, [1 : index] : (!fir.complex<8>, f64) -> !fir.complex<8>
39 fir.store %insert_imag to %z : !fir.ref<!fir.complex<8>>
44 func.func @undefOpHiddenByBranch(%z: !fir.ref<!fir.complex<8>>, %b: i1) {
49 %u1 = fir.undefined !fir.complex<8>
50 %z1l = fir.call @bar1() : () -> !fir.complex<8>
51 %z1r = fir.call @bar1() : () -> !fir.complex<8>
52 cf.br ^bb3(%u1, %z1l, %z1r : !fir.complex<8>, !fir.complex<8>, !fir.complex<8>)
54 %u2 = fir.undefined !fir.complex<8>
55 %z2l = fir.call @bar2() : () -> !fir.complex<8>
56 %z2r = fir.call @bar2() : () -> !fir.complex<8>
57 cf.br ^bb3(%u2, %z2l, %z2r : !fir.complex<8>, !fir.complex<8>, !fir.complex<8>)
59 // CHECK: ^bb3(%[[z1:.*]]: !fir.complex<8>, %[[z2:.*]]: !fir.complex<8>): // 2 preds: ^bb1, ^bb2
60 // CHECK: fir.addc %[[z1]], %[[z2]] : !fir.complex<8>
62 ^bb3(%undef : !fir.complex<8>, %z1 : !fir.complex<8>, %z2 : !fir.complex<8>): // 2 preds: ^bb1, ^b…
63 %real1 = fir.extract_value %z1, [0 : index] : (!fir.complex<8>) -> f64
64 %imag1 = fir.extract_value %z1, [1 : index] : (!fir.complex<8>) -> f64
65 %real2 = fir.extract_value %z2, [0 : index] : (!fir.complex<8>) -> f64
66 %imag2 = fir.extract_value %z2, [1 : index] : (!fir.complex<8>) -> f64
69 …sert_real = fir.insert_value %undef, %real, [0 : index] : (!fir.complex<8>, f64) -> !fir.complex<8>
70 …mag = fir.insert_value %insert_real, %imag, [1 : index] : (!fir.complex<8>, f64) -> !fir.complex<8>
71 fir.store %insert_imag to %z : !fir.ref<!fir.complex<8>>
74 func.func private @bar1() -> !fir.complex<8>
75 func.func private @bar2() -> !fir.complex<8>
78 …nc.func @close_but_bad_pattern(%z: !fir.ref<!fir.complex<8>>, %z1 : !fir.complex<8>, %z2 : !fir.co…
81 %real1 = fir.extract_value %z1, [0 : index] : (!fir.complex<8>) -> f64
83 %imag1 = fir.extract_value %z1, [0 : index] : (!fir.complex<8>) -> f64
84 %real2 = fir.extract_value %z2, [0 : index] : (!fir.complex<8>) -> f64
85 %imag2 = fir.extract_value %z2, [1 : index] : (!fir.complex<8>) -> f64
90 %undef = fir.undefined !fir.complex<8>
93 …sert_real = fir.insert_value %undef, %real, [0 : index] : (!fir.complex<8>, f64) -> !fir.complex<8>
94 …mag = fir.insert_value %insert_real, %imag, [1 : index] : (!fir.complex<8>, f64) -> !fir.complex<8>
96 fir.store %insert_imag to %z : !fir.ref<!fir.complex<8>>