@@ -5941,7 +5941,7 @@ impl Function {
59415941 }
59425942
59435943 fn block_terminator(fun: &Function, block_id: BlockId) -> InsnId {
5944- *fun.blocks[block_id.0 ].insns().last().unwrap()
5944+ *fun.blocks[block_id.to_usize() as usize ].insns().last().unwrap()
59455945 }
59465946
59475947 macro_rules! edges_of {
@@ -5956,12 +5956,12 @@ impl Function {
59565956
59575957 fn outgoing_edges(fun: &Function, block_id: BlockId) -> impl Iterator<Item = &BranchEdge> {
59585958 let insn_id = block_terminator(fun, block_id);
5959- edges_of!(&fun.insns[insn_id.0 ])
5959+ edges_of!(&fun.insns[insn_id.to_usize() ])
59605960 }
59615961
59625962 fn outgoing_edges_mut(fun: &mut Function, block_id: BlockId) -> impl Iterator<Item = &mut BranchEdge> {
59635963 let insn_id = block_terminator(fun, block_id);
5964- edges_of!(&mut fun.insns[insn_id.0 ])
5964+ edges_of!(&mut fun.insns[insn_id.to_usize() ])
59655965 }
59665966
59675967 // Instantiate the domain for abstract interpretation.
@@ -5979,7 +5979,7 @@ impl Function {
59795979 // We only need to update blocks that have params. (Blocks without params cannot be improved)
59805980 let blocks_receiving_params: Vec<BlockId> = blocks.into_iter()
59815981 .filter(|&block_id|
5982- self.blocks[block_id.0 ].params().len() != 0)
5982+ self.blocks[block_id.to_usize() ].params().len() != 0)
59835983 .collect();
59845984
59855985 // NOTE: It is possible that once some block_params are removed, there will be no params.
@@ -6005,10 +6005,10 @@ impl Function {
60056005 for (i, param) in params.iter().enumerate() {
60066006 let param = self.find_id(*param);
60076007 // If the param is the same as passed into the block, it is a self loop and provides no new predecessor information.
6008- if param == self.find_id(self.blocks[block_id.0 ].params[i]) {
6008+ if param == self.find_id(self.blocks[block_id.to_usize() ].params[i]) {
60096009 continue
60106010 }
6011- param_values[block_id.0 ][i].update(param);
6011+ param_values[block_id.to_usize() ][i].update(param);
60126012 }
60136013 }
60146014 }
@@ -6019,7 +6019,7 @@ impl Function {
60196019 // 2. Remove trivial params from the basic block definition
60206020 // 3. Remove trivial params from each CondBranch and Jump that targets the basic block that was just updated
60216021 for block_id in &blocks_receiving_params {
6022- let block_preds = ¶m_values[block_id.0 ];
6022+ let block_preds = ¶m_values[block_id.to_usize() ];
60236023 let trivial_indices: Vec<usize> = block_preds.iter().enumerate()
60246024 .filter_map(|(idx, state)|
60256025 matches!(state, ParamValue::One(_)).then_some(idx)
@@ -6028,13 +6028,13 @@ impl Function {
60286028 // Replace uses of the trivial params with the concretized value
60296029 for param_index in &trivial_indices {
60306030 if let ParamValue::One(insn_id) = block_preds[*param_index] {
6031- self.make_equal_to(self.blocks[block_id.0 ].params[*param_index], insn_id);
6031+ self.make_equal_to(self.blocks[block_id.to_usize() ].params[*param_index], insn_id);
60326032 changed = true;
60336033 }
60346034 }
60356035
60366036 // Update the block
6037- prune_vec_by_indices(&mut self.blocks[block_id.0 ].params, &trivial_indices);
6037+ prune_vec_by_indices(&mut self.blocks[block_id.to_usize() ].params, &trivial_indices);
60386038
60396039 // Update the terminators (basic blocks can only branch at the terminator. This is where block params are passed)
60406040 for jump_block_id in &blocks_sending_params {
0 commit comments