Skip to content
Snippets Groups Projects

Emit align in LLVM

Merged rarbore2 requested to merge emit-align into main
Files
4
+ 4
3
@@ -103,8 +103,9 @@ impl<'a> CPUContext<'a> {
@@ -103,8 +103,9 @@ impl<'a> CPUContext<'a> {
} else {
} else {
write!(
write!(
w,
w,
"{} noalias nofree nonnull noundef %p{}",
"{} noalias nofree nonnull noundef align({}) %p{}",
self.get_type(*ty),
self.get_type(*ty),
 
get_type_alignment(&self.types, *ty),
idx
idx
)?;
)?;
}
}
@@ -509,7 +510,7 @@ impl<'a> CPUContext<'a> {
@@ -509,7 +510,7 @@ impl<'a> CPUContext<'a> {
" {} = load {}, ptr {}\n",
" {} = load {}, ptr {}\n",
self.get_value(id, false),
self.get_value(id, false),
self.get_type(self_ty),
self.get_type(self_ty),
index_ptr_name
index_ptr_name,
)?;
)?;
} else {
} else {
// If this read doesn't reach a primitive type, just return
// If this read doesn't reach a primitive type, just return
@@ -540,7 +541,7 @@ impl<'a> CPUContext<'a> {
@@ -540,7 +541,7 @@ impl<'a> CPUContext<'a> {
body,
body,
" store {}, ptr {}\n",
" store {}, ptr {}\n",
self.get_value(data, true),
self.get_value(data, true),
index_ptr_name
index_ptr_name,
)?;
)?;
} else {
} else {
// If the data item being written is not a primitive type,
// If the data item being written is not a primitive type,
Loading