free or reuse unconditionally when value is unique

This commit is contained in:
Folkert 2023-06-27 17:33:53 +02:00
parent e3ab023f62
commit fc3004da58
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C
21 changed files with 381 additions and 69 deletions

View file

@ -1979,6 +1979,19 @@ impl<'a> LowLevelCall<'a> {
);
}
PtrLoad => backend.expr_unbox(self.ret_symbol, self.arguments[0]),
PtrClearTagId => {
let ptr = self.arguments[0];
let ptr_local_id = match backend.storage.get(&ptr) {
StoredValue::Local { local_id, .. } => *local_id,
_ => internal_error!("A pointer will always be an i32"),
};
backend.code_builder.get_local(ptr_local_id);
backend.code_builder.i32_const(-4); // 11111111...1100
backend.code_builder.i32_and();
}
Alloca => {
// Alloca : a -> Ptr a
let arg = self.arguments[0];