Rollup merge of #144665 - scottmcm:restore-sroa-simd-check, r=compiler-errors
Re-block SRoA on SIMD types Fixes rust-lang/rust#144621
This commit is contained in:
@@ -72,8 +72,12 @@ fn escaping_locals<'tcx>(
|
||||
return true;
|
||||
}
|
||||
if let ty::Adt(def, _args) = ty.kind()
|
||||
&& tcx.is_lang_item(def.did(), LangItem::DynMetadata)
|
||||
&& (def.repr().simd() || tcx.is_lang_item(def.did(), LangItem::DynMetadata))
|
||||
{
|
||||
// Exclude #[repr(simd)] types so that they are not de-optimized into an array
|
||||
// (MCP#838 banned projections into SIMD types, but if the value is unused
|
||||
// this pass sees "all the uses are of the fields" and expands it.)
|
||||
|
||||
// codegen wants to see the `DynMetadata<T>`,
|
||||
// not the inner reference-to-opaque-type.
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user