Skip to content

MLIR: fix constant tablegen #2337

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 4, 2025
Merged

MLIR: fix constant tablegen #2337

merged 3 commits into from
Jun 4, 2025

Conversation

wsmoses
Copy link
Member

@wsmoses wsmoses commented Jun 4, 2025

No description provided.

@wsmoses wsmoses requested review from Copilot and vimarsh6739 June 4, 2025 18:47
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates the constant tablegen logic by suppressing an unused-variable warning and loosening a restriction on vector constants.

  • Adds a void cast for the vectorized flag in generated code to prevent compiler warnings.
  • Removes the assert(!isVec); check to allow vector constants.
  • (Implicitly) broadens constant handling to include vectorized cases.
Comments suppressed due to low confidence (2)

enzyme/tools/enzyme-tblgen/enzyme-tblgen.cpp:624

  • With the assert(!isVec) removed, vector constants are now allowed but no handling is provided; add explicit logic or an error path for isVec == true to avoid silent incorrect behavior.
assert(!isVec);

enzyme/tools/enzyme-tblgen/enzyme-tblgen.cpp:622

  • Consider adding unit tests for cases where isVec is true to verify that vector constant handling works correctly now that the restriction has been lifted.
auto [ord1, isVec, ext, isva] = nameToOrdinal.lookup(name, pattern, resultTree);

@wsmoses wsmoses merged commit 96cb47e into main Jun 4, 2025
20 of 24 checks passed
@wsmoses wsmoses deleted the szvec branch June 4, 2025 19:24
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