Skip to content
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

fix(ssa): Resolve value before fetching from DFG in a couple cases #7169

Merged
merged 1 commit into from
Jan 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1344,8 +1344,8 @@ impl<'block, Registers: RegisterAllocator> BrilligBlock<'block, Registers> {
result_variable: SingleAddrVariable,
) {
let binary_type = type_of_binary_operation(
dfg[binary.lhs].get_type().as_ref(),
dfg[binary.rhs].get_type().as_ref(),
dfg[dfg.resolve(binary.lhs)].get_type().as_ref(),
dfg[dfg.resolve(binary.rhs)].get_type().as_ref(),
binary.operator,
);

Expand Down
2 changes: 1 addition & 1 deletion compiler/noirc_evaluator/src/ssa/ir/dfg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ impl DataFlowGraph {
/// Should `value` be a numeric constant then this function will return the exact number of bits required,
/// otherwise it will return the minimum number of bits based on type information.
pub(crate) fn get_value_max_num_bits(&self, value: ValueId) -> u32 {
match self[value] {
match self[self.resolve(value)] {
Value::Instruction { instruction, .. } => {
let value_bit_size = self.type_of_value(value).bit_size();
if let Instruction::Cast(original_value, _) = self[instruction] {
Expand Down
Loading