[mlir][IR] Hash nesting structure in OperationFingerPrint
The following ops currently have the same finger print, even though they are different: ``` func.func @test() { "test.foo"() ({ "test.bar"() : () -> () }) : () -> () } ``` And: ``` func.func @test() { "test.bar"() : () -> () "test.foo"() ({ }) : () -> () } ``` The SHA1 hash used in OperationFingerPrint is order-sensitive, but the ops are hashed in the same order (post-order traversal), so the hash is the same. Switching to pre-order traversal does not solve the issue; a similar example, where IR differs just in its nesting structure, can be constructed. The problem is solved by hashing the parent op pointer. (Alternatively, a traversal over the IR that hashes scope markers (`{}`) could be used.) Differential Revision: https://reviews.llvm.org/D151306
Loading
Please sign in to comment