You are viewing a plain text version of this content. The canonical link for it is here.
Posted to discuss-archive@tvm.apache.org by "akaashrp (via GitHub)" <gi...@apache.org> on 2026/08/13 04:37:56 UTC
[PR] [Fix][TIRx] Preserve index semantics when narrowing to int32 [tvm]
akaashrp opened a new pull request, #20129:
URL: https://github.com/apache/tvm/pull/20129
This PR fixes two cases where `ForceNarrowIndexToInt32` could produce invalid or semantically different index expressions. When rewriting `if_then_else` and `Select`, one branch may remain `int64` while the other is narrowed to `int32`. The pass now derives the result type from the rewritten branches and casts the narrower branch to the common type. The pass also adjusts signed right shifts when their input is narrowed. Under the pass invariant that index values fit in `int32`, a shift at or beyond the new width is remapped to the `int32` sign-bit position, preserving sign extraction.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org
For additional commands, e-mail: discuss-archive-help@tvm.apache.org
Re: [PR] [Fix][TIRx] Preserve index semantics when narrowing to int32 [tvm]
Posted by "tlopex (via GitHub)" <gi...@apache.org>.
tlopex commented on PR #20129:
URL: https://github.com/apache/tvm/pull/20129#issuecomment-5449144398
now `DataTypeLegalizer` is also used by `SubstituteWithDataTypeLegalization`, which does not have this representability invariant. e.g., substituting an `int64 x` with `int32 y` in `x << int64(40)` now changes the result from `cast(int64, y) << 40` to `cast(int64, y) << 31`. Could we scope this clamp to `ForceNarrowIndexToInt32`?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org
For additional commands, e-mail: discuss-archive-help@tvm.apache.org
Re: [PR] [Fix][TIRx] Preserve index semantics when narrowing to int32 [tvm]
Posted by "yongwww (via GitHub)" <gi...@apache.org>.
yongwww closed pull request #20129: [Fix][TIRx] Preserve index semantics when narrowing to int32
URL: https://github.com/apache/tvm/pull/20129
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org
For additional commands, e-mail: discuss-archive-help@tvm.apache.org
Re: [PR] [Fix][TIRx] Preserve index semantics when narrowing to int32 [tvm]
Posted by "tlopex (via GitHub)" <gi...@apache.org>.
tlopex merged PR #20129:
URL: https://github.com/apache/tvm/pull/20129
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org
For additional commands, e-mail: discuss-archive-help@tvm.apache.org