[clang] [llvm] [InstCombine] Try to infer type for `load`/`store` when replacing `memcpy` (PR #169966)
Nikita Popov via cfe-commits
cfe-commits at lists.llvm.org
Sun Nov 30 09:47:28 PST 2025
https://github.com/nikic requested changes to this pull request.
Yes, we should not use alloca types for this purpose.
The correct type to use here is the [byte type](https://blog.llvm.org/posts/2025-08-29-gsoc-byte-type/) -- this is necessary for correctness, otherwise the transform may be incorrect wrt pointer provenance and poison propagation. We currently get away with using integers through a combination of conservative handling elsewhere and poison in memory being de-facto unsupported (in significant part due to exactly this issue).
The byte type does not exist yet (though I expect to see movement here soon), but I think that the change proposed here is a dead end.
(What we *could* do is inspect users of the pointer to check whether it is only used with a single type and use that type. Not sure whether doing that actually makes sense or not.)
https://github.com/llvm/llvm-project/pull/169966
More information about the cfe-commits
mailing list