Skip to content

[ARITH] Use IntImm in canonical scalar hot paths#19885

Merged
tlopex merged 1 commit into
apache:mainfrom
tqchen:tvm-improve-canonical-simplify-makeconst-hot-paths
Jun 25, 2026
Merged

[ARITH] Use IntImm in canonical scalar hot paths#19885
tlopex merged 1 commit into
apache:mainfrom
tqchen:tvm-improve-canonical-simplify-makeconst-hot-paths

Conversation

@tqchen

@tqchen tqchen commented Jun 25, 2026

Copy link
Copy Markdown
Member

Summary

Canonical simplify operates on scalar index expressions in these paths, so direct IntImm construction avoids the generic MakeConst scalar/vector dispatch. This keeps MakeConst for generic helper sites while streamlining the focused split normal-form constants.

Main changes:

  • Use IntImm for scalar constants in canonical split/sum normalization and related division/mod paths
  • Apply the same cleanup to the scalar-index Mod and FloorMod constant-fold zero cases

Canonical simplify operates on scalar index expressions in these paths, so direct IntImm construction avoids the generic MakeConst scalar/vector dispatch. This keeps MakeConst for generic helper sites while streamlining the focused split normal-form constants.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request replaces multiple instances of MakeConst with IntImm in src/arith/canonical_simplify.cc and src/arith/const_fold.h to instantiate integer constants directly. There are no review comments, and I have no feedback to provide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@tlopex tlopex merged commit 6ea9599 into apache:main Jun 25, 2026
10 checks passed
@tqchen tqchen deleted the tvm-improve-canonical-simplify-makeconst-hot-paths branch June 25, 2026 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants