llvm / llvm/llvm-project

llvm.memset.* with undef bytes gets optimised into no-op

Open
#189,647 0 comments 0 reactions 0 assignees View on GitHub
llvm:optimizations
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

Quote [Discourse](https://discourse.llvm.org/t/forcing-allocation-to-hold-undef-poison-after-non-allocating-operator-new-call/90305/2).

Currently the optimisation removes writes of `undef`, but it would be more semantically correct than writes of `poison` for MSan.

It would be great if we could postpone the optimisation until the codegen, so that instrumentation could pick these writes up for their bookkeeping.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.