An algorithm to match associative and commutative patterns
Background For simplicity, just using ADD as an example. In compiler backend, multiple addition is organized by combinations of multiple ADD instructions. For example ADD(1, ADD(1,3)). But since it is associative and commutative, then it doesn’t matter about the order and which 2 add first. Thus it can be seen as equivalent to ADD(1, 1, […]
An algorithm to match associative and commutative patterns
Background For simplicity, just using ADD as an example. In compiler backend, multiple addition is organized by combinations of multiple ADD instructions. For example ADD(1, ADD(1,3)). But since it is associative and commutative, then it doesn’t matter about the order and which 2 add first. Thus it can be seen as equivalent to ADD(1, 1, […]
An algorithm to match associative and commutative patterns
Background For simplicity, just using ADD as an example. In compiler backend, multiple addition is organized by combinations of multiple ADD instructions. For example ADD(1, ADD(1,3)). But since it is associative and commutative, then it doesn’t matter about the order and which 2 add first. Thus it can be seen as equivalent to ADD(1, 1, […]
An algorithm to match associative and commutative patterns
Background For simplicity, just using ADD as an example. In compiler backend, multiple addition is organized by combinations of multiple ADD instructions. For example ADD(1, ADD(1,3)). But since it is associative and commutative, then it doesn’t matter about the order and which 2 add first. Thus it can be seen as equivalent to ADD(1, 1, […]