-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Block SIMD in transmute_immediate; delete OperandValueKind
#143410
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
base: master
Are you sure you want to change the base?
Conversation
r? @SparrowLii rustbot has assigned @SparrowLii. Use |
Some changes occurred in compiler/rustc_codegen_ssa |
let in_a_ibty = bx.scalar_pair_element_backend_type(operand.layout, 0, false); | ||
let in_b_ibty = bx.scalar_pair_element_backend_type(operand.layout, 1, false); | ||
let out_a_ibty = bx.scalar_pair_element_backend_type(cast, 0, false); | ||
let out_b_ibty = bx.scalar_pair_element_backend_type(cast, 1, false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These just disappear entirely because transmute_immediate
no longer needs them as arguments 🎉
This comment has been minimized.
This comment has been minimized.
At this point I am happy with the codegen changes, but I have a hard time interpreting the test changes. Wouldn't mind someone else to take a look at those :) |
337cb31
to
4e61527
Compare
Vectors have been causing me problems for years in this code, for example #110021 (comment) and #143194
See conversation in https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/Is.20transmuting.20a.20.60T.60.20to.20.60Tx1.60.20.28one-element.20SIMD.20vector.29.20UB.3F/near/526262799.
By blocking SIMD in
transmute_immediate
it can be simplified to just take theScalar
s involved -- the backend types can be gotten from thoseScalar
s, rather than needing to be passed. And there's an assert added to ICE it if it does get hit.Accordingly, this changes
rvalue_creates_operand
to not send SIMD transmutes through the operand path, but to always go through memory instead, like they did back before #108442.And thanks to those changes, I could also remove the
OperandValueKind
type that I added back then which @RalfJung rightly considers pretty sketchy.cc @folkertdev @workingjubilee from the zulip conversation too