Skip to content

Commit

Permalink
Allow sub instructions to be simplified to mov
Browse files Browse the repository at this point in the history
  • Loading branch information
voltrevo committed Jul 1, 2023
1 parent 74ed734 commit 571c576
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions valuescript_compiler/src/optimization/kal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,8 @@ impl FnState {
| OpRightShift(_, _, dst)
| OpRightShiftUnsigned(_, _, dst)
| InstanceOf(_, _, dst)
| In(_, _, dst) => match self.get(dst.name.clone()).try_to_value() {
| In(_, _, dst)
| Sub(_, _, dst) => match self.get(dst.name.clone()).try_to_value() {
Some(value) => *instr = Instruction::Mov(value, dst.clone()),
None => {}
},
Expand All @@ -506,7 +507,6 @@ impl FnState {
| Call(_, _, _)
| Apply(_, _, _, _)
| Bind(_, _, _)
| Sub(_, _, _)
| SubMov(_, _, _)
| SubCall(_, _, _, _)
| Jmp(_)
Expand Down

0 comments on commit 571c576

Please sign in to comment.