Skip to content
Snippets Groups Projects
Commit be55373c authored by Russel Arbore's avatar Russel Arbore
Browse files

Add more llvm attrs

parent 754c831e
No related branches found
No related tags found
1 merge request!218Add more LLVM attributes
Pipeline #202066 failed
This commit is part of merge request !218. Comments created here will be created in the context of that merge request.
......@@ -76,7 +76,7 @@ impl<'a> CPUContext<'a> {
} else {
write!(
w,
"define dso_local nonnull noundef {} @{}_{}(",
"define dso_local nonnull noundef nounwind nosync willreturn norecurse {} @{}_{}(",
self.get_type(return_type),
self.module_name,
self.function.name,
......@@ -346,7 +346,7 @@ impl<'a> CPUContext<'a> {
let offset = offsets[&id].0;
write!(
body,
" {} = getelementptr i8, ptr %backing, i64 %dc{}\n",
" {} = getelementptr inbounds i8, ptr %backing, i64 %dc{}\n",
self.get_value(id, false),
offset.idx()
)?;
......@@ -473,11 +473,14 @@ impl<'a> CPUContext<'a> {
let opcode = match (op, op_ty) {
(BinaryOperator::Add, OpTy::Float) => "fadd",
(BinaryOperator::Add, _) => "add",
(BinaryOperator::Add, OpTy::Unsigned) => "add nuw",
(BinaryOperator::Add, OpTy::Signed) => "add nsw",
(BinaryOperator::Sub, OpTy::Float) => "fsub",
(BinaryOperator::Sub, _) => "sub",
(BinaryOperator::Sub, OpTy::Unsigned) => "sub nuw",
(BinaryOperator::Sub, OpTy::Signed) => "sub nsw",
(BinaryOperator::Mul, OpTy::Float) => "fmul",
(BinaryOperator::Mul, _) => "mul",
(BinaryOperator::Mul, OpTy::Unsigned) => "mul nuw",
(BinaryOperator::Mul, OpTy::Signed) => "mul nsw",
(BinaryOperator::Div, OpTy::Float) => "fdiv",
(BinaryOperator::Div, OpTy::Unsigned) => "udiv",
(BinaryOperator::Div, OpTy::Signed) => "sdiv",
......@@ -1005,7 +1008,7 @@ impl<'a> CPUContext<'a> {
let name = format!("%gep.{}", Self::gen_filler_id());
write!(
body,
" {} = getelementptr i8, ptr {}, i64 {}\n",
" {} = getelementptr inbounds i8, ptr {}, i64 {}\n",
name, ptr, size
)?;
Ok(name)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment