Remove many LLVM optimization passes which were causes UB due to them assuming C-like behaviour incompatible with Odin

This commit is contained in:
gingerBill
2021-11-06 17:23:33 +00:00
parent 5df15b5724
commit 3d3785a7f1
6 changed files with 83 additions and 41 deletions
+1 -1
View File
@@ -1084,7 +1084,7 @@ lbValue lb_addr_load(lbProcedure *p, lbAddr const &addr) {
scalars[i] = LLVMConstInt(lb_type(p->module, t_u32), addr.swizzle.indices[i], false);
}
LLVMValueRef mask = LLVMConstVector(scalars, addr.swizzle.count);
LLVMValueRef sv = LLVMBuildShuffleVector(p->builder, v, LLVMGetUndef(vector_type), mask, "");
LLVMValueRef sv = llvm_basic_shuffle(p, v, mask);
LLVMValueRef dst = LLVMBuildPointerCast(p->builder, ptr.value, LLVMPointerType(LLVMTypeOf(sv), 0), "");
LLVMBuildStore(p->builder, sv, dst);