Repository navigation
nir/algebraic: test the u2u downcast split - #557
Conversation
The two cases from PR #449 rebased onto the current tip: a narrowing i2i must not appear for u2u8-of-i2i32-of-i2i16 and the sign extension must survive for u2u16-of-i2i32-of-i2i8. Follow-up offered in #449; upstream fold re-landed separately in #513.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2e6f56f6ba
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| run_pass(); | ||
|
|
||
| /* An i2i narrowing would fail validation; the downcast has to stay u2u. */ | ||
| EXPECT_EQ(count_narrowing_i2i(b->shader), 0u); |
There was a problem hiding this comment.
Include the downcast-split fix before enabling this test
When running nir_tests from this revision, this test fails because nir_opt_algebraic.py:3029–3039 still registers u2u8(i2i32(a)) -> i2i8(a), not the downcast split described in the commit message. nir_search.c::construct_value() creates that replacement directly, so the 16-bit input produces a narrowing i2i8: this expectation and EXPECT_TRUE(u2u8_of_16) fail, and the final validation aborts assertion-enabled builds. Include the prerequisite optimizer fix or rebase onto a revision containing it; adding these tests alone breaks the NIR test target.
Useful? React with 👍 / 👎.
Follow-up offered in #449 and confirmed with @RyanTheTide: the two
algebraic_tests.cppcases from #449, rebased onto the currentaurora-wiptip after #513 re-landed the fold.downcast_of_sign_extended_value_is_u2u:u2u8ofi2i32-of-16-bit load must stayu2u(a narrowingi2iwould failnir_validate).downcast_sign_extended_inner_narrow:u2u16ofi2i32-of-8-bit load must keep the sign extension asi2i16.Compiler-only; no hardware run needed. Credits Karmjit Mahil's upstream change 23eedf4 that #513 carries.