Fix the original block for block params in egraphs (#5960)
This fixes an issue where block params were always listed as being members of the current block in egraphs, even when the block param was actually defined in a separate block. This then enables instructions which depend on these parameters to get hoisted up out of inner loops at least to the block that defined the argument. Closes #5957
This commit is contained in:
@@ -330,14 +330,14 @@ impl<'a> Elaborator<'a> {
|
||||
);
|
||||
(inst, result_idx)
|
||||
}
|
||||
ValueDef::Param(_, _) => {
|
||||
ValueDef::Param(in_block, _) => {
|
||||
// We don't need to do anything to compute
|
||||
// this value; just push its result on the
|
||||
// result stack (blockparams are already
|
||||
// available).
|
||||
trace!(" -> value {} is a blockparam", best_value);
|
||||
self.elab_result_stack.push(ElaboratedValue {
|
||||
in_block: self.cur_block,
|
||||
in_block,
|
||||
value: best_value,
|
||||
});
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user