You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
mir-importer: intrinsic sites that type the call result from the bare destination local fail as a verifier type-mismatch on a projected destination #773
PR #769 taught store_result_to_place to write an intrinsic result through a projected call destination ((*p), x.0, x[i], x[0]) and switched the bitops/saturating/bigint/exact_div sites to type the call result from Place::ty via types::translate_destination_type. Six sites still type it from body.locals()[destination.local].ty, i.e. the bare local:
crates/mir-importer/src/translator/terminator/intrinsics/memory.rs:861 and :954 (DynamicSharedArray::get/offset pointee extraction from the destination type)
crates/mir-importer/src/translator/terminator/intrinsics/generated.rs:22382 (elect_sync tuple destination; the template that emits it is crates/cuda-intrinsics-gen/src/render.rs:10976)
With a projected destination (custom MIR only, e.g. RET.1 = powf(...)), the call op is created with the whole aggregate's type (or the pointer's type for (*p)), and store_result_to_place then stores that mistyped value through the correctly typed projected address. The pipeline dies as a MirStoreOp verifier type-mismatch ("Compilation error: invalid input program.") instead of either a correct store or the clean "unsupported construct" diagnostic the four fixed sites now guarantee.
Fix: switch each site to types::translate_destination_type(ctx, body, destination, &loc); for generated.rs update the render.rs template and regenerate. The two memory.rs sites match on the destination's RawPtr kind to extract a pointee, so they want the projected Place::ty before that match rather than the local's type. Add custom-MIR coverage alongside the mir_projected_call_destination example or as importer unit tests.
Severity: low (reachable only from #[custom_mir]), but the failure mode is a confusing verifier error rather than a diagnostic.
Activity
fix(mir-importer): type six intrinsic results from the projected dest…
fix(mir-importer): type six intrinsic results from the projected dest…
fix(mir-importer): type six intrinsic results from the projected dest…