You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
BNEInstr had a number of different paths to create, but it turns out all of them fall into these categories:
Comparison with true or false
Comparison with nil
Comparison with Undefined
Comparison with fixnum
The true/false cases have been replaced with construction of BTrueInstr and BFalse instr (flipped because this was BNE, nor BEQ). That leaves the other three cases.
For nil, there's BNilInstr for equality but nothing for inequality. Either that remains or we add a new BNotNilInstr or we flip branches using this form.
For Undefined, there's similarly BUndefInstr for equality but nothing for inequality.
The only fixnum cases are two uses of BNEInstr in flip-flop support to check the flip-flop gate status. They could also be implemented a different way.
In short, BNEInstr can be specialized to other forms and eliminated, or simplified to only have reference equality forms (nil and Undefined) moving the value equality uses to other instructions.
The text was updated successfully, but these errors were encountered:
headius
changed the title
BNEInstr logic used by JIT could be smarter about objects that are identical, if we do not need to actually call op_equal. It could also use indy and specialize better. (It turns out BNE is mostly reference equality except for two fixnum forms used by flip-flops. We can do those another way and then compile BNE as simple reference equality.)
Simplify BNEInstr forms to eliminate non-identity comparisons
Apr 3, 2024
This came from #7588.
BNEInstr had a number of different paths to create, but it turns out all of them fall into these categories:
The true/false cases have been replaced with construction of BTrueInstr and BFalse instr (flipped because this was BNE, nor BEQ). That leaves the other three cases.
For nil, there's BNilInstr for equality but nothing for inequality. Either that remains or we add a new BNotNilInstr or we flip branches using this form.
For Undefined, there's similarly BUndefInstr for equality but nothing for inequality.
The only fixnum cases are two uses of BNEInstr in flip-flop support to check the flip-flop gate status. They could also be implemented a different way.
In short, BNEInstr can be specialized to other forms and eliminated, or simplified to only have reference equality forms (nil and Undefined) moving the value equality uses to other instructions.
The text was updated successfully, but these errors were encountered: