File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -1818,7 +1818,8 @@ bool PhaseIterGVN::verify_Ideal_for(Node* n, bool can_reshape) {
1818
1818
1819
1819
// The number of nodes shoud not increase.
1820
1820
uint old_unique = C->unique ();
1821
-
1821
+ // The hash of a node should not change, this would indicate different inputs
1822
+ uint old_hash = n->hash ();
1822
1823
Node* i = n->Ideal (this , can_reshape);
1823
1824
// If there was no new Idealization, we are probably happy.
1824
1825
if (i == nullptr ) {
@@ -1832,6 +1833,16 @@ bool PhaseIterGVN::verify_Ideal_for(Node* n, bool can_reshape) {
1832
1833
return true ;
1833
1834
}
1834
1835
1836
+ if (old_hash != n->hash ()) {
1837
+ stringStream ss; // Print as a block without tty lock.
1838
+ ss.cr ();
1839
+ ss.print_cr (" Ideal optimization did not make progress but node hash changed." );
1840
+ ss.print_cr (" old_hash = %d, hash = %d" , old_hash, n->hash ());
1841
+ n->dump_bfs (1 , nullptr , " " , &ss);
1842
+ tty->print_cr (" %s" , ss.as_string ());
1843
+ return true ;
1844
+ }
1845
+
1835
1846
verify_empty_worklist (n);
1836
1847
1837
1848
// Everything is good.
You can’t perform that action at this time.
0 commit comments