mirror of
https://github.com/Ed94/Odin.git
synced 2026-07-01 17:51:48 -07:00
Update alignment rules for matrix types as a compromise to keep zero padding
This commit is contained in:
@@ -512,8 +512,7 @@ void lb_emit_slice_bounds_check(lbProcedure *p, Token token, lbValue low, lbValu
|
||||
}
|
||||
}
|
||||
|
||||
bool lb_try_update_alignment(lbValue ptr, unsigned alignment) {
|
||||
LLVMValueRef addr_ptr = ptr.value;
|
||||
bool lb_try_update_alignment(LLVMValueRef addr_ptr, unsigned alignment) {
|
||||
if (LLVMIsAGlobalValue(addr_ptr) || LLVMIsAAllocaInst(addr_ptr) || LLVMIsALoadInst(addr_ptr)) {
|
||||
if (LLVMGetAlignment(addr_ptr) < alignment) {
|
||||
if (LLVMIsAAllocaInst(addr_ptr) || LLVMIsAGlobalValue(addr_ptr)) {
|
||||
@@ -525,6 +524,11 @@ bool lb_try_update_alignment(lbValue ptr, unsigned alignment) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool lb_try_update_alignment(lbValue ptr, unsigned alignment) {
|
||||
return lb_try_update_alignment(ptr.value, alignment);
|
||||
}
|
||||
|
||||
|
||||
bool lb_try_vector_cast(lbModule *m, lbValue ptr, LLVMTypeRef *vector_type_) {
|
||||
Type *array_type = base_type(type_deref(ptr.type));
|
||||
GB_ASSERT(is_type_array_like(array_type));
|
||||
|
||||
Reference in New Issue
Block a user