Lines Matching refs:fir

2 // RUN: fir-opt --canonicalize %s | FileCheck %s
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
14 // CHECK-LABEL: fir.addc
17 %undef = fir.undefined !fir.complex<8>
18 …%insert_real = fir.insert_value %undef, %real, [0 : index] : (!fir.complex<8>, f64) -> !fir.comple…
19 …%insert_imag = fir.insert_value %insert_real, %imag, [1 : index] : (!fir.complex<8>, f64) -> !fir.…
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
33 // CHECK-LABEL: fir.subc
36 %undef = fir.undefined !fir.complex<8>
37 …%insert_real = fir.insert_value %undef, %real, [0 : index] : (!fir.complex<8>, f64) -> !fir.comple…
38 …%insert_imag = fir.insert_value %insert_real, %imag, [1 : index] : (!fir.complex<8>, f64) -> !fir.…
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 …%insert_real = fir.insert_value %undef, %real, [0 : index] : (!fir.complex<8>, f64) -> !fir.comple…
70 …%insert_imag = fir.insert_value %insert_real, %imag, [1 : index] : (!fir.complex<8>, f64) -> !fir.…
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 func.func @close_but_bad_pattern(%z: !fir.ref<!fir.complex<8>>, %z1 : !fir.complex<8>, %z2 : !fir.c…
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>
91 // CHECK: %[[insert1:.*]] = fir.insert_value %{{.*}}, %{{.*}}, [0
92 // CHECK: %[[insert2:.*]] = fir.insert_value %[[insert1]], %{{.*}}, [1
93 …%insert_real = fir.insert_value %undef, %real, [0 : index] : (!fir.complex<8>, f64) -> !fir.comple…
94 …%insert_imag = fir.insert_value %insert_real, %imag, [1 : index] : (!fir.complex<8>, f64) -> !fir.…
95 // CHECK: fir.store %[[insert2]] to {{.*}}
96 fir.store %insert_imag to %z : !fir.ref<!fir.complex<8>>