Skip to content

Enable to handle some promoted constants#12

Merged
coord-e merged 1 commit into
mainfrom
promoted-constants
Dec 14, 2025
Merged

Enable to handle some promoted constants#12
coord-e merged 1 commit into
mainfrom
promoted-constants

Conversation

@coord-e
Copy link
Copy Markdown
Owner

@coord-e coord-e commented Dec 14, 2025

for #10

Copy link
Copy Markdown

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 refactors constant handling to support promoted constants by moving the logic from Env::operand_type() to the Analyzer struct in basic_block.rs. The implementation is decomposed into three helper methods for better maintainability and adds support for handling unevaluated constants.

  • Moves constant handling from env.rs to basic_block.rs for better access to type context
  • Adds support for promoted constants via const_eval_resolve
  • Introduces PlaceType::immut() method for creating immutable pointer types

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
src/refine/env.rs Removes operand_type method, unused imports, and adds new immut() helper method
src/analyze/basic_block.rs Implements three new methods (const_bytes_ty, const_value_ty, const_ty) for handling constants and refactors operand_type to use them

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/analyze/basic_block.rs Outdated
Comment thread src/analyze/basic_block.rs Outdated
Comment thread src/analyze/basic_block.rs
Copy link
Copy Markdown

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

Copilot reviewed 2 out of 2 changed files in this pull request and generated 7 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/analyze/basic_block.rs
Comment thread src/analyze/basic_block.rs
Comment thread src/analyze/basic_block.rs
Comment thread src/refine/env.rs
Comment thread src/analyze/basic_block.rs
Comment thread src/analyze/basic_block.rs
Comment thread src/analyze/basic_block.rs Outdated
@coord-e coord-e merged commit 37b4fed into main Dec 14, 2025
3 checks passed
@coord-e coord-e deleted the promoted-constants branch December 14, 2025 09:10
coeff-aij pushed a commit to coeff-aij/thrust that referenced this pull request Jan 12, 2026
Enable to handle some promoted constants
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