It would be nice if there were a canonicalization pass that attempted to improve the likelihood of deterministic output across runs. For example:

The idea of a canonicalizing pass in this instance would be to determine if the conditions tested in an short-circuiting and/or can be evaluated in any order, and if so, impose a specific order. The specific order imposed could be based on sorting the hashes of the sub-nodes, where the hashes are implemented with a clang::StmtProfilerWithoutPointers, which is accessible via
void Stmt::ProcessODRHash(llvm::FoldingSetNodeID &ID, class ODRHash &Hash) const {
StmtProfilerWithoutPointers Profiler(ID, Hash);
Profiler.Visit(this);
}
It would be nice if there were a canonicalization pass that attempted to improve the likelihood of deterministic output across runs. For example:
The idea of a canonicalizing pass in this instance would be to determine if the conditions tested in an short-circuiting and/or can be evaluated in any order, and if so, impose a specific order. The specific order imposed could be based on sorting the hashes of the sub-nodes, where the hashes are implemented with a
clang::StmtProfilerWithoutPointers, which is accessible via