Repository navigation
Conversation
The mid-end rewrites `select(icmp ugt/ult/..., a, b)` into integer min/max. On x86_64 those forms were only lowered for `fits_in_64`, so optimized i128 code hit an unsupported-ISLE trap (bytecodealliance#13790). Lower i128 min/max through the existing i128 `emit_cmp` + `lower_select` path, matching AArch64's scalar-int approach, and extend the i128 min/max runtest to x86_64. Assisted-by: Claude
|
Independent of #14323. x64 didn’t lower i128 umin/umax/smin/smax; mid-end select→minmax can produce them. Patch adds those lowerings via the existing i128 cmp/select path. |
|
@agourakis82 please turn down the frequency to which you post and comment on things. It's been 13 hours since this PR was posted and for most of that we were asleep. This is an open source project and we can't respond to PRs immediately, so we ask for patience on your end while time is found to review things. |
|
Sorry about the noise — I’ll leave it alone and wait for review. |
| ;; `i128`: mid-end select→min/max rewrites can produce these (#13790). Lower via | ||
| ;; the existing i128 compare + select path, matching AArch64's scalar-int | ||
| ;; approach rather than leaving an unsupported ISLE hole. | ||
| ;; Priority above the vector catch-alls so the overlap checker accepts both. |
There was a problem hiding this comment.
| ;; `i128`: mid-end select→min/max rewrites can produce these (#13790). Lower via | |
| ;; the existing i128 compare + select path, matching AArch64's scalar-int | |
| ;; approach rather than leaving an unsupported ISLE hole. | |
| ;; Priority above the vector catch-alls so the overlap checker accepts both. |
This comment is not really useful for code readers. The first part is a historical tidbit that is ultimately incidental, and the second is obvious for ISLE code.
| @@ -0,0 +1,42 @@ | |||
| test compile | |||
There was a problem hiding this comment.
Let's make this test compile precise-output and re-bless. As currently written this is doing nothing other than ensuring that the programs compile successfully. It is not actually checking that the relevant lowerings or rewrites happen and are reflected in the output.
| target x86_64 | ||
|
|
||
| ;; Mid-end select(ugt)->umin must remain lowerable on x64 (#13790). |
There was a problem hiding this comment.
Can you enable all runtest ISAs for this, since the test is not x86-64 specific? And maybe test it for a handful of different inputs (as function parameters) instead of hard-coding constants in the function body.
Also this comment is not really useful. It needs to be lowerable everywhere, not just x64, where there happened to be a bug. Please do a better job of cleaning up LLM comments, here and elsewhere, and now and in the future. Making maintainers do that for you is not a good use of maintainer time.
There was a problem hiding this comment.
Sorry...doing my best!
Drop incidental comments, bless precise-output for the x64 compile test, and broaden the runtest across ISAs with parameterized inputs. Assisted-by: Claude
|
Addressed the review notes: removed the incidental comments, blessed |
Mid-end select→minmax can produce
umin/umax/smin/smaxon i128. x64 only lowered those forfits_in_64, so optimized code hit an unsupported-ISLE trap (#13790).Adds i128 lowerings through the existing
emit_cmp+lower_selectpath.Tests:
isa/x64/iminmax-i128.clifruntests/issue-13790-umin-i128.clifruntests/i128-min-max.clifnow includes x86_64Fixes #13790
Assisted-by: Claude