Struct Layout Optimization in Rust 1.18 regressed C ABI #48433
Labels
A-codegen
Area: Code generation
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
In addition to the general question raised by #48426 of whether a pair of floats should use a LLVM vector in the Rust ABI, it seems like the C ABI regressed in Rust 1.18 in this regard too. Before Rust 1.18 it used to actually represent the repr(C) equivalent type as a LLVM vector, but since 1.18 the type gets passed as a double instead and then bitcast to the individual fields inside, completely disabling all the vectorization possible.
Code:
Rust 1.17:
Rust 1.18:
Here's the code on Godbolt compiled with Rust 1.17 and 1.18: https://godbolt.org/g/1iu8n2
The text was updated successfully, but these errors were encountered: