Vous avez reçu un message "Your GitLab account has been locked ..." ? Pas d'inquiétude : lisez cet article https://docs.gricad-pages.univ-grenoble-alpes.fr/help/unlock/

Commit 3b448f59 authored by Xavier Leroy's avatar Xavier Leroy Committed by Xavier Leroy
Browse files

Support __builtin_expect

Not yet used for optimizations.

Actually, __builtin_expect is removed during C2C conversion, otherwise
the conversion to type "long" produces inefficient code on 64-bit platforms.
parent 320c5559
......@@ -271,6 +271,8 @@ let builtins_generic = {
(* Optimization hints *)
"__builtin_unreachable",
(TVoid [], [], false);
"__builtin_expect",
(TInt(ILong, []), [TInt(ILong, []); TInt(ILong, [])], false);
(* Helper functions for int64 arithmetic *)
"__compcert_i64_dtos",
(TInt(ILongLong, []),
......@@ -992,6 +994,9 @@ let rec convertExpr env e =
ewrap (Ctyping.eselection (convertExpr env arg1)
(convertExpr env arg2) (convertExpr env arg3))
| C.ECall({edesc = C.EVar {name = "__builtin_expect"}}, [arg1; arg2]) ->
convertExpr env arg1
| C.ECall({edesc = C.EVar {name = "printf"}}, args)
when !Clflags.option_interp ->
let targs = convertTypArgs env [] args
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment