Repository navigation
Report invalid SIMD splat/extract/insert/shuffle instantiations as unsupported - #4972
feliperodri merged 4 commits into
Conversation
|
@CYJ904 @Tianshu-Huang @wodex1nhaoIeng @acearyanarun for review. Same shape as #4922: Kani checks SIMD intrinsic calls itself, since rustc's backend does not run, and four of those checks still stopped the whole crate when a generic helper was instantiated with the wrong types (a |
Tianshu-Huang
left a comment
There was a problem hiding this comment.
Ran the 19 expected/intrinsics/simd-* tests on this branch, all pass. The five sites return the unsupported statement before any codegen and abort_if_errors is gone from all four functions. LGTM.
b3fbf27 to
e816660
Compare
…supported Kani's SIMD codegen stands in for rustc's E0511 checks, and an invalid `simd_splat`, `simd_extract`, `simd_insert` or `simd_shuffle` instantiation was a compile error that stopped codegen of the whole crate. These checks now report an unsupported construct, as model-checking#4951 did for the comparisons, so only the harnesses that reach the instantiation fail. The five tests that pinned the compile errors now pin the unsupported checks, and a new test runs invalid and valid instantiations of each intrinsic in one crate.
The comment saying why an invalid instantiation is reported as unsupported, rather than as an error that aborts the crate, appeared at five sites; it stays at the simd_splat arm.
e816660 to
5625087
Compare
feliperodri
left a comment
There was a problem hiding this comment.
The change matches the approach in #4951, and the new harnesses show that only the invalid calls fail.
Before approving:
- This aborted the whole crate, so please add
[C] Bugand[F] Crash. BuildBundle-MacOs-aarch64fails. Please confirm it's the macOS runner issue seen elsewhere, or fix it.
|
@feliperodri we cannot set labels on this repository; could you add |
feliperodri
left a comment
There was a problem hiding this comment.
Thanks. The SIMD instantiation checks now report as unsupported constructs, matching #4951, and the new harnesses show only the invalid calls fail. Labels are set. The two CI failures on this head are not from this change: BuildBundle-MacOs-aarch64 fails in setup because the Z3 download is not a zip, and compile-timer-short fails in the analyzer step with normal timings. Approving.
5df43cc
Kani's SIMD codegen stands in for rustc's E0511 checks, because rustc's own backend never runs under Kani. #4951 turned the comparison checks into unsupported-construct reports. Four checks still reported a compile error and called
abort_if_errors(), so one invalid instantiation ofsimd_splat,simd_extract,simd_insertorsimd_shufflestopped codegen of the whole crate.These five sites (the two shuffle checks included) now report the call as an unsupported construct, so only the harnesses that reach it fail.
simd_shuffle_lengthreturnsNonefor an index vector that is notu32lanes instead of erroring, andcodegen_intrinsic_simd_insertloses aspanparameter it no longer uses. The messages link the new-issue page rather than this issue, which the PR closes.The new
expectedtestsimd-invalid-instantiationhas a valid and an invalid harness for each of the four intrinsics in one crate; without this change the crate aborts at the first invalid one, with it four harnesses verify and four fail with their own message. The five existing tests that pinned the compile errors (simd-splat-wrong-type,simd-extract-wrong-type,simd-insert-wrong-type, the twosimd-shuffle-result-type-*tests) now pin the unsupported checks, as #4951 did for its two.Not included: rejecting these candidates in autoharness before codegen, which the issue also suggests.
Resolves #4952
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.