Commit dfdc50b
authored
[mlir][acc] Remove declare attribute verification (#137676)
The part that verifies the declare attributes are preserved in the
verifier can fail easily during the FIR lowering pipeline. For example,
during FIR lowering to FIRCG, fir.declare can be removed. Thus, any
fir.declare that has acc.declare attributes will cause a verifier
failure. Since the declare attribute only existed to simplify the effort
of locating acc declare enter and exit points, which can be easily
replaced by a def-use chain traversal, we are considering removing the
verification of declare attributes in this MR.
Example:
```
%1 = fir.alloca !fir.array<10xf32> {bindc_name = "arr", uniq_name = "_QMmmFsubEarr"}
%2 = fir.shape %c10 : (index) -> !fir.shape<1>
%3 = fir.declare %1(%2) {acc.declare = #acc.declare<dataClause = acc_create>, uniq_name = "_QMmmFsubEarr"} : (!fir.ref<!fir.array<10xf32>>, !fir.shape<1>) -> !fir.ref<!fir.array<10xf32>>
%4 = acc.create varPtr(%3 : !fir.ref<!fir.array<10xf32>>) -> !fir.ref<!fir.array<10xf32>> {name = "arr"}
%5 = acc.declare_enter dataOperands(%4 : !fir.ref<!fir.array<10xf32>>)
```
the acc.declare_enter itself is enough to identify when the data region
starts.1 parent 86b7ce9 commit dfdc50b
1 file changed
+0
-26
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2910 | 2910 | | |
2911 | 2911 | | |
2912 | 2912 | | |
2913 | | - | |
2914 | | - | |
2915 | | - | |
2916 | | - | |
2917 | | - | |
2918 | | - | |
2919 | | - | |
2920 | | - | |
2921 | | - | |
2922 | | - | |
2923 | | - | |
2924 | | - | |
2925 | | - | |
2926 | | - | |
2927 | | - | |
2928 | | - | |
2929 | | - | |
2930 | | - | |
2931 | | - | |
2932 | | - | |
2933 | | - | |
2934 | | - | |
2935 | | - | |
2936 | | - | |
2937 | | - | |
2938 | | - | |
2939 | 2913 | | |
2940 | 2914 | | |
2941 | 2915 | | |
| |||
0 commit comments