Replies: 1 comment 1 reply
-
What exactly do you mean with this point? Do you refer to the basic blocks having addresses instead of numbers? Anything else I do not remember?
The list of nodes in the region is unordered. There is no topological sorting associated with required for the traversing. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Making the output of a compiler deterministic seems common, and provides some benefits:
Some of the reasons Jlm is currently not deterministic include:
One way of removing non-determinism is to make iteration over hash sets and maps use insertion order. Languages like Python do this by default, so I don't think the performance/memory implications are terrible, but I still think it might be even better to never rely on the iteration order of hash sets, and use different approaches when iteration order matters.
The traverser classes can be made independent of addresses by using the ordered list of nodes stored within each region as a deterministic tie-breaker. There are some extra details surrounding the traversers that make them work even while the graph is being modified, so this behavior needs to be maintained in a potential rewrite.
Once the compiler output is deterministic, a part of the CI test suite can check it, e.g. check that jlm compiled with clang and gcc give identical results.
@phate @caleridas any other considerations relevant to this topic?
Beta Was this translation helpful? Give feedback.
All reactions