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
I noticed that there may be another optimisation that can be added to IntegerEqualsNode. Specifically, comparing the And and Or of two values is equivalent to comparing the values directly.
oubidar-Abderrahim
changed the title
Potential new optimisation for IntegerEqualsNode
[GR-53019] Potential new optimisation for IntegerEqualsNode
Apr 2, 2024
Overview
Hi,
I noticed that there may be another optimisation that can be added to IntegerEqualsNode. Specifically, comparing the And and Or of two values is equivalent to comparing the values directly.
This optimisation has also been formally verified in an interactive theorem prover (Isabelle/HOL).
Sample Program
I've written a sample program to demonstrate the speed-up of this optimisation:
The optimised version is around 15-20% faster than the unoptimised version, yielding runtimes of approximately 3.7s and 4.5s, respectively.
Unit Test
I've also written a JUnit test to check whether this optimisation is applied:
Running this test produces the following output:
The text was updated successfully, but these errors were encountered: