Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove our special-casing of zero-length memcpy/memset for WebAssembly with LLVM 20 #22108

Closed
alexrp opened this issue Nov 30, 2024 · 2 comments
Labels
arch-wasm 32-bit and 64-bit WebAssembly backend-llvm The LLVM backend outputs an LLVM IR Module. optimization upstream An issue with a third party project that Zig uses.
Milestone

Comments

@alexrp
Copy link
Member

alexrp commented Nov 30, 2024

zig/src/codegen/llvm.zig

Lines 10065 to 10071 in aa7d138

// Any WebAssembly runtime will trap when the destination pointer is out-of-bounds, regardless
// of the length. This means we need to emit a check where we skip the memset when the length
// is 0 as we allow for undefined pointers in 0-sized slices.
// This logic can be removed once https://github.com/ziglang/zig/issues/16360 is done.
const intrinsic_len0_traps = o.target.isWasm() and
ptr_ty.isSlice(zcu) and
std.Target.wasm.featureSetHas(o.target.cpu.features, .bulk_memory);

llvm/llvm-project#112617

@alexrp alexrp added optimization upstream An issue with a third party project that Zig uses. backend-llvm The LLVM backend outputs an LLVM IR Module. labels Nov 30, 2024
@alexrp alexrp added this to the 0.15.0 milestone Nov 30, 2024
@alexrp alexrp self-assigned this Nov 30, 2024
@alexrp alexrp added the arch-wasm 32-bit and 64-bit WebAssembly label Nov 30, 2024
@Luukdegram
Copy link
Member

Luukdegram commented Nov 30, 2024

#16360 can be closed as well as it was the original tracking issue.

@alexrp
Copy link
Member Author

alexrp commented Nov 30, 2024

Ah, I hadn't seen that one. Let's just use that then.

@alexrp alexrp closed this as not planned Won't fix, can't repro, duplicate, stale Nov 30, 2024
@alexrp alexrp removed their assignment Dec 3, 2024
@alexrp alexrp modified the milestones: 0.15.0, 0.14.0 Dec 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arch-wasm 32-bit and 64-bit WebAssembly backend-llvm The LLVM backend outputs an LLVM IR Module. optimization upstream An issue with a third party project that Zig uses.
Projects
None yet
Development

No branches or pull requests

2 participants