Issue |
145121
|
Summary |
Small arrays of MaybeUninit::<u8>::uninit() are deoptimized to all zeroes
|
Labels |
new issue
|
Assignees |
|
Reporter |
saethlin
|
I started by looking at https://github.com/rust-lang/rust/issues/139355 but it looks like the root cause can be produce with much less Rust code: https://godbolt.org/z/4Kv5Gbdse
As far as I can tell, things go wrong twice. SROA tries to splat the undef i8, but it generates a generic sequence of instructions in the process instead of just an undef of the target type. Then EarlyCSE sees the splat and replaces it with a 0.
I have a candidate fix for this, though I'm a bit of a novice at working on LLVM.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs