Skip to content

Commit

Permalink
Add Cprefetch to selectgen
Browse files Browse the repository at this point in the history
  • Loading branch information
gretay-js committed Jun 9, 2021
1 parent 760ce71 commit 007c2ec
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions backend/selectgen.ml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ let oper_result_type = function
end
| Calloc -> typ_val
| Cstore (_c, _) -> typ_void
| Cprefetch _ -> typ_void
| Caddi | Csubi | Cmuli | Cmulhi | Cdivi | Cmodi |
Cand | Cor | Cxor | Clsl | Clsr | Casr |
Cclz _ | Cctz _ | Cpopcnt |
Expand Down Expand Up @@ -331,6 +332,7 @@ method is_simple_expr = function
(* The following may have side effects *)
| Capply _ | Cextcall _ | Calloc | Cstore _ | Craise _ | Cprobe _
| Cprobe_is_enabled _ -> false
| Cprefetch _ -> false (* avoid reordering *)
(* The remaining operations are simple if their args are *)
| Cload _ | Caddi | Csubi | Cmuli | Cmulhi | Cdivi | Cmodi | Cand | Cor
| Cxor | Clsl | Clsr | Casr | Ccmpi _ | Caddv | Cadda | Ccmpa _ | Cnegf
Expand Down Expand Up @@ -374,6 +376,8 @@ method effects_of exp =
| Capply _ | Cextcall _ | Cprobe _ -> EC.arbitrary
| Calloc -> EC.none
| Cstore _ -> EC.effect_only Effect.Arbitrary
| Cprefetch _ -> EC.join (EC.effect_only Effect.Arbitrary)
(EC.coeffect_only Coeffect.Arbitrary)
| Craise _ | Ccheckbound -> EC.effect_only Effect.Raise
| Cload (_, Asttypes.Immutable) -> EC.none
| Cload (_, Asttypes.Mutable) -> EC.coeffect_only Coeffect.Read_mutable
Expand Down

0 comments on commit 007c2ec

Please sign in to comment.