From 18a48c4f0c62e214dc9d097017b0020418e84d10 Mon Sep 17 00:00:00 2001 From: Tom Harley Date: Sun, 12 Jan 2020 01:21:29 +0000 Subject: Add some LLVM attributes to functions Some of the functions generated by sinc can have attributes added to them that might be difficult for the LLVM toolchain to infer. Attribute generation can be turned off with `-O no-llvm-attributes`. --- sinc.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'sinc.c') diff --git a/sinc.c b/sinc.c index 82dd164..fa9a1ba 100644 --- a/sinc.c +++ b/sinc.c @@ -137,7 +137,8 @@ int main(int argc, char **argv) { optimisation_t llvm_info = { .boxing_rule = ALWAYS_BOX, .default_bit_width = 0, - .tail_recursive_mod_cons = false + .tail_recursive_mod_cons = true, + .llvm_attributes = true }; verbose = 0; @@ -187,7 +188,16 @@ int main(int argc, char **argv) { case 'O': if (!strcmp(optarg, "tail-recursive-mod-cons")) { - llvm_info.tail_recursive_mod_cons = 1; + llvm_info.tail_recursive_mod_cons = true; + + } else if (!strcmp(optarg, "no-tail-recursive-mod-cons")) { + llvm_info.tail_recursive_mod_cons = false; + + } else if (!strcmp(optarg, "llvm-attributes")) { + llvm_info.llvm_attributes = true; + + } else if (!strcmp(optarg, "no-llvm-attributes")) { + llvm_info.llvm_attributes = false; } else { error(INVALID_ARGUMENTS, -- cgit v1.2.1