pan/midgard: Optimize comparisions with similar operations
Closes #2025 (closed)
On comparisions which have the same operation applied to both sides, we can drop those operations and still get the same result.
Only a small set of operations is elegible for this optimization we start with inor, and add more later.
Edited by Alyssa Rosenzweig