aboutsummaryrefslogtreecommitdiff
path: root/src/llvm_backend_utility.cpp
diff options
context:
space:
mode:
authorgingerBill <gingerBill@users.noreply.github.com>2025-10-05 20:27:23 +0100
committerGitHub <noreply@github.com>2025-10-05 20:27:23 +0100
commit3f7fc1e9bf7050c526949b284aef15597d67f1b0 (patch)
treef924187cc34d0c8e8c3926cffe19eeefc50951cf /src/llvm_backend_utility.cpp
parent810ca89253a9f7b4e2b6eb1e527a66e2e168708b (diff)
parent588513a510f5906d214633bfcdce6b4441e900bb (diff)
Merge pull request #5738 from jakubtomsu/fix-simd-ptr-transmute
[LLVM backend] SIMD vector transmute only uses bitcast when the elements aren't pointers
Diffstat (limited to 'src/llvm_backend_utility.cpp')
-rw-r--r--src/llvm_backend_utility.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/llvm_backend_utility.cpp b/src/llvm_backend_utility.cpp
index aef35370e..ca7bf34e3 100644
--- a/src/llvm_backend_utility.cpp
+++ b/src/llvm_backend_utility.cpp
@@ -286,7 +286,14 @@ gb_internal lbValue lb_emit_transmute(lbProcedure *p, lbValue value, Type *t) {
}
}
+ bool is_simd_vector_bitcastable = false;
if (is_type_simd_vector(src) && is_type_simd_vector(dst)) {
+ if (!is_type_internally_pointer_like(src->SimdVector.elem) && !is_type_internally_pointer_like(dst->SimdVector.elem)) {
+ is_simd_vector_bitcastable = true;
+ }
+ }
+
+ if (is_simd_vector_bitcastable) {
res.value = LLVMBuildBitCast(p->builder, value.value, lb_type(p->module, t), "");
return res;
} else if (is_type_array_like(src) && (is_type_simd_vector(dst) || is_type_integer_128bit(dst))) {